summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /x11-drivers
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/afb-ucode/Manifest1
-rw-r--r--x11-drivers/afb-ucode/afb-ucode-1.3.11.ebuild25
-rw-r--r--x11-drivers/afb-ucode/metadata.xml5
-rw-r--r--x11-drivers/ati-drivers/Manifest7
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-14.12-r2.ebuild602
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild607
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-14.4_p1.ebuild609
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild609
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-14.9-r2.ebuild601
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-15.1.ebuild614
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-15.7.ebuild615
-rw-r--r--x11-drivers/ati-drivers/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch27
-rw-r--r--x11-drivers/ati-drivers/files/ati-drivers-13.12-acpi.patch16
-rw-r--r--x11-drivers/ati-drivers/files/ati-drivers-13.8-beta-include-seq_file.patch13
-rw-r--r--x11-drivers/ati-drivers/files/ati-drivers-x32_something_something.patch13
-rw-r--r--x11-drivers/ati-drivers/files/ati-powermode-opt-path-3.patch40
-rw-r--r--x11-drivers/ati-drivers/files/atieventsd.init20
-rw-r--r--x11-drivers/ati-drivers/files/const-notifier-block.patch25
-rw-r--r--x11-drivers/ati-drivers/files/fgl_glxgears-do-not-include-glATI.patch11
-rw-r--r--x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch18
-rw-r--r--x11-drivers/ati-drivers/files/switchlibGL61
-rw-r--r--x11-drivers/ati-drivers/files/typesafe-kuid.diff34
-rw-r--r--x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch12
-rw-r--r--x11-drivers/ati-drivers/metadata.xml22
-rw-r--r--x11-drivers/metadata.xml25
-rw-r--r--x11-drivers/nvidia-drivers/Manifest38
-rw-r--r--x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist1
-rw-r--r--x11-drivers/nvidia-drivers/files/95-nvidia-settings2
-rw-r--r--x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch11
-rw-r--r--x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch13
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-169.0714
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch52
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch25
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch25
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch47
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch17
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch54
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop7
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf8
-rwxr-xr-xx11-drivers/nvidia-drivers/files/nvidia-persistenced.init25
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-smi.init25
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-udev.sh17
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-uvm.conf3
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia.udev-rule6
-rw-r--r--x11-drivers/nvidia-drivers/metadata.xml15
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-173.14.39.ebuild546
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-304.125.ebuild457
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild474
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-340.76.ebuild479
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-343.36.ebuild479
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-346.87.ebuild489
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-349.16.ebuild489
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-352.30.ebuild489
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-355.06.ebuild498
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23.ebuild519
-rw-r--r--x11-drivers/radeon-ucode/Manifest3
-rw-r--r--x11-drivers/radeon-ucode/metadata.xml5
-rw-r--r--x11-drivers/radeon-ucode/radeon-ucode-20140204.ebuild41
-rw-r--r--x11-drivers/radeon-ucode/radeon-ucode-20140430.ebuild41
-rw-r--r--x11-drivers/radeon-ucode/radeon-ucode-20140823.ebuild41
-rw-r--r--x11-drivers/xf86-input-acecad/Manifest1
-rw-r--r--x11-drivers/xf86-input-acecad/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-acecad/xf86-input-acecad-1.5.0.ebuild15
-rw-r--r--x11-drivers/xf86-input-aiptek/Manifest1
-rw-r--r--x11-drivers/xf86-input-aiptek/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-aiptek/xf86-input-aiptek-1.4.1.ebuild14
-rw-r--r--x11-drivers/xf86-input-elographics/Manifest1
-rw-r--r--x11-drivers/xf86-input-elographics/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.1.ebuild15
-rw-r--r--x11-drivers/xf86-input-evdev/Manifest7
-rw-r--r--x11-drivers/xf86-input-evdev/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.7.3.ebuild16
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.1.ebuild16
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.2.ebuild23
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.4.ebuild23
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.0.ebuild24
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.1.ebuild24
-rw-r--r--x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.2.ebuild24
-rw-r--r--x11-drivers/xf86-input-fpit/Manifest1
-rw-r--r--x11-drivers/xf86-input-fpit/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-fpit/xf86-input-fpit-1.4.0.ebuild14
-rw-r--r--x11-drivers/xf86-input-hyperpen/Manifest1
-rw-r--r--x11-drivers/xf86-input-hyperpen/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-hyperpen/xf86-input-hyperpen-1.4.1.ebuild14
-rw-r--r--x11-drivers/xf86-input-joystick/Manifest2
-rw-r--r--x11-drivers/xf86-input-joystick/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.1.ebuild16
-rw-r--r--x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.2.ebuild22
-rw-r--r--x11-drivers/xf86-input-keyboard/Manifest2
-rw-r--r--x11-drivers/xf86-input-keyboard/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.0.ebuild14
-rw-r--r--x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.1.ebuild14
-rw-r--r--x11-drivers/xf86-input-libinput/Manifest4
-rw-r--r--x11-drivers/xf86-input-libinput/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-libinput/xf86-input-libinput-0.11.0.ebuild17
-rw-r--r--x11-drivers/xf86-input-libinput/xf86-input-libinput-0.12.0.ebuild17
-rw-r--r--x11-drivers/xf86-input-libinput/xf86-input-libinput-0.6.0.ebuild17
-rw-r--r--x11-drivers/xf86-input-libinput/xf86-input-libinput-0.8.0.ebuild17
-rw-r--r--x11-drivers/xf86-input-mouse/Manifest3
-rw-r--r--x11-drivers/xf86-input-mouse/files/xf86-input-mouse-1.8.1-gcc46-workaround.patch16
-rw-r--r--x11-drivers/xf86-input-mouse/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-mouse/xf86-input-mouse-1.8.1.ebuild19
-rw-r--r--x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.0.ebuild14
-rw-r--r--x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.1.ebuild14
-rw-r--r--x11-drivers/xf86-input-mtrack/Manifest2
-rw-r--r--x11-drivers/xf86-input-mtrack/files/xf86-input-mtrack-0.2.0-drop-mtrack-test.patch13
-rw-r--r--x11-drivers/xf86-input-mtrack/metadata.xml11
-rw-r--r--x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.0.ebuild51
-rw-r--r--x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.1.ebuild51
-rw-r--r--x11-drivers/xf86-input-mutouch/Manifest1
-rw-r--r--x11-drivers/xf86-input-mutouch/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-mutouch/xf86-input-mutouch-1.3.0.ebuild14
-rw-r--r--x11-drivers/xf86-input-penmount/Manifest1
-rw-r--r--x11-drivers/xf86-input-penmount/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-penmount/xf86-input-penmount-1.5.0.ebuild14
-rw-r--r--x11-drivers/xf86-input-synaptics/Manifest4
-rw-r--r--x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.7-glibc-2.20.patch61
-rw-r--r--x11-drivers/xf86-input-synaptics/metadata.xml15
-rw-r--r--x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.4.ebuild42
-rw-r--r--x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.8.ebuild42
-rw-r--r--x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.1.ebuild38
-rw-r--r--x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.2.ebuild38
-rw-r--r--x11-drivers/xf86-input-tslib/Manifest1
-rw-r--r--x11-drivers/xf86-input-tslib/files/fix-overlapped-variable.patch20
-rw-r--r--x11-drivers/xf86-input-tslib/files/xf86-input-tslib-0.0.6-xf86XInputSetScreen.patch23
-rw-r--r--x11-drivers/xf86-input-tslib/files/xf86-input-tslib-port-ABI-12-r48.patch191
-rw-r--r--x11-drivers/xf86-input-tslib/metadata.xml6
-rw-r--r--x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r2.ebuild31
-rw-r--r--x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r3.ebuild32
-rw-r--r--x11-drivers/xf86-input-vmmouse/Manifest2
-rw-r--r--x11-drivers/xf86-input-vmmouse/files/xf86-input-vmmouse-13.0.0-add-missing-include.patch44
-rw-r--r--x11-drivers/xf86-input-vmmouse/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.0.0-r1.ebuild34
-rw-r--r--x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.1.0.ebuild30
-rw-r--r--x11-drivers/xf86-input-void/Manifest2
-rw-r--r--x11-drivers/xf86-input-void/metadata.xml5
-rw-r--r--x11-drivers/xf86-input-void/xf86-input-void-1.4.0.ebuild14
-rw-r--r--x11-drivers/xf86-input-void/xf86-input-void-1.4.1.ebuild14
-rw-r--r--x11-drivers/xf86-input-wacom/Manifest3
-rw-r--r--x11-drivers/xf86-input-wacom/metadata.xml9
-rw-r--r--x11-drivers/xf86-input-wacom/xf86-input-wacom-0.24.0.ebuild60
-rw-r--r--x11-drivers/xf86-input-wacom/xf86-input-wacom-0.29.0.ebuild60
-rw-r--r--x11-drivers/xf86-input-wacom/xf86-input-wacom-0.30.0.ebuild60
-rw-r--r--x11-drivers/xf86-video-apm/Manifest2
-rw-r--r--x11-drivers/xf86-video-apm/files/xf86-video-apm-1.2.5-remove-mibstore_h.patch23
-rw-r--r--x11-drivers/xf86-video-apm/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-apm/xf86-video-apm-1.2.4.ebuild15
-rw-r--r--x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5-r1.ebuild19
-rw-r--r--x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5.ebuild15
-rw-r--r--x11-drivers/xf86-video-ark/Manifest1
-rw-r--r--x11-drivers/xf86-video-ark/files/xf86-video-ark-0.7.5-remove-mibstore_h.patch35
-rw-r--r--x11-drivers/xf86-video-ark/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-ark/xf86-video-ark-0.7.5.ebuild19
-rw-r--r--x11-drivers/xf86-video-ast/Manifest2
-rw-r--r--x11-drivers/xf86-video-ast/files/xf86-video-ast-0.97.0-remove-mibstore_h.patch101
-rw-r--r--x11-drivers/xf86-video-ast/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-ast/xf86-video-ast-0.97.0-r1.ebuild16
-rw-r--r--x11-drivers/xf86-video-ast/xf86-video-ast-1.0.1.ebuild12
-rw-r--r--x11-drivers/xf86-video-ati/Manifest4
-rw-r--r--x11-drivers/xf86-video-ati/metadata.xml8
-rw-r--r--x11-drivers/xf86-video-ati/xf86-video-ati-6.14.6-r1.ebuild32
-rw-r--r--x11-drivers/xf86-video-ati/xf86-video-ati-7.3.0.ebuild37
-rw-r--r--x11-drivers/xf86-video-ati/xf86-video-ati-7.4.0.ebuild40
-rw-r--r--x11-drivers/xf86-video-ati/xf86-video-ati-7.5.0.ebuild49
-rw-r--r--x11-drivers/xf86-video-chips/Manifest2
-rw-r--r--x11-drivers/xf86-video-chips/files/xf86-video-chips-1.2.5-remove-mibstore_h.patch39
-rw-r--r--x11-drivers/xf86-video-chips/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-chips/xf86-video-chips-1.2.4.ebuild12
-rw-r--r--x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5-r1.ebuild16
-rw-r--r--x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5.ebuild12
-rw-r--r--x11-drivers/xf86-video-cirrus/Manifest3
-rw-r--r--x11-drivers/xf86-video-cirrus/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.1.ebuild13
-rw-r--r--x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.2.ebuild13
-rw-r--r--x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.3.ebuild13
-rw-r--r--x11-drivers/xf86-video-dummy/Manifest2
-rw-r--r--x11-drivers/xf86-video-dummy/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.6.ebuild24
-rw-r--r--x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.7.ebuild24
-rw-r--r--x11-drivers/xf86-video-fbdev/Manifest1
-rw-r--r--x11-drivers/xf86-video-fbdev/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.4.4.ebuild19
-rw-r--r--x11-drivers/xf86-video-freedreno/Manifest3
-rw-r--r--x11-drivers/xf86-video-freedreno/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.0.0.ebuild21
-rw-r--r--x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.1.0.ebuild17
-rw-r--r--x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.3.0.ebuild17
-rw-r--r--x11-drivers/xf86-video-geode/Manifest1
-rw-r--r--x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include.patch23
-rw-r--r--x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include2.patch22
-rw-r--r--x11-drivers/xf86-video-geode/metadata.xml14
-rw-r--r--x11-drivers/xf86-video-geode/xf86-video-geode-2.11.17.ebuild24
-rw-r--r--x11-drivers/xf86-video-glint/Manifest2
-rw-r--r--x11-drivers/xf86-video-glint/files/xf86-video-glint-1.2.8-remove-mibstore_h.patch30
-rw-r--r--x11-drivers/xf86-video-glint/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-glint/xf86-video-glint-1.2.7.ebuild19
-rw-r--r--x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8-r1.ebuild23
-rw-r--r--x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8.ebuild19
-rw-r--r--x11-drivers/xf86-video-i128/Manifest2
-rw-r--r--x11-drivers/xf86-video-i128/files/xf86-video-i128-1.3.6-remove-mibstore_h.patch30
-rw-r--r--x11-drivers/xf86-video-i128/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-i128/xf86-video-i128-1.3.5.ebuild15
-rw-r--r--x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6-r1.ebuild19
-rw-r--r--x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6.ebuild15
-rw-r--r--x11-drivers/xf86-video-i740/Manifest1
-rw-r--r--x11-drivers/xf86-video-i740/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-i740/xf86-video-i740-1.3.5.ebuild14
-rw-r--r--x11-drivers/xf86-video-intel/Manifest13
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.21.15-handle-updates-to-DamageUnregister-API.patch24
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.905-fix-randr.patch56
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.906-server-crash.patch37
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.907-invalidation.patch46
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.911-sna-pixmap-migration.patch102
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.912-disable-dri3.patch22
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch65
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-sna-udev-fstat.patch57
-rw-r--r--x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-uxa-udev-fstat.patch27
-rw-r--r--x11-drivers/xf86-video-intel/metadata.xml11
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.19.0.ebuild56
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.20.13.ebuild65
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.21.15.ebuild74
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.9.1.ebuild31
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.903.ebuild65
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.905-r1.ebuild72
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.906.ebuild72
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.907-r1.ebuild72
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.909.ebuild69
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.910.ebuild69
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.914.ebuild73
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.916.ebuild73
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r1.ebuild72
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r2.ebuild73
-rw-r--r--x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917.ebuild67
-rw-r--r--x11-drivers/xf86-video-ivtv/Manifest3
-rw-r--r--x11-drivers/xf86-video-ivtv/metadata.xml12
-rw-r--r--x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r1.ebuild26
-rw-r--r--x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r2.ebuild23
-rw-r--r--x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2.ebuild17
-rw-r--r--x11-drivers/xf86-video-mach64/Manifest1
-rw-r--r--x11-drivers/xf86-video-mach64/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-mach64/xf86-video-mach64-6.9.5.ebuild25
-rw-r--r--x11-drivers/xf86-video-mga/Manifest3
-rw-r--r--x11-drivers/xf86-video-mga/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-mga/xf86-video-mga-1.6.2.ebuild17
-rw-r--r--x11-drivers/xf86-video-mga/xf86-video-mga-1.6.3.ebuild17
-rw-r--r--x11-drivers/xf86-video-mga/xf86-video-mga-1.6.4.ebuild17
-rw-r--r--x11-drivers/xf86-video-modesetting/Manifest2
-rw-r--r--x11-drivers/xf86-video-modesetting/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.8.1.ebuild12
-rw-r--r--x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.9.0.ebuild15
-rw-r--r--x11-drivers/xf86-video-neomagic/Manifest1
-rw-r--r--x11-drivers/xf86-video-neomagic/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.9.ebuild10
-rw-r--r--x11-drivers/xf86-video-newport/Manifest2
-rw-r--r--x11-drivers/xf86-video-newport/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-newport/xf86-video-newport-0.2.3.ebuild14
-rw-r--r--x11-drivers/xf86-video-newport/xf86-video-newport-0.2.4.ebuild14
-rw-r--r--x11-drivers/xf86-video-nouveau/Manifest2
-rw-r--r--x11-drivers/xf86-video-nouveau/files/xf86-video-nouveau-1.0.11-glamor-automagic.patch42
-rw-r--r--x11-drivers/xf86-video-nouveau/metadata.xml8
-rw-r--r--x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10-r1.ebuild32
-rw-r--r--x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10.ebuild21
-rw-r--r--x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.11.ebuild32
-rw-r--r--x11-drivers/xf86-video-nv/Manifest1
-rw-r--r--x11-drivers/xf86-video-nv/files/xf86-video-nv-2.1.20-remove-mibstore_h.patch81
-rw-r--r--x11-drivers/xf86-video-nv/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-nv/xf86-video-nv-2.1.20-r1.ebuild19
-rw-r--r--x11-drivers/xf86-video-omap/Manifest2
-rw-r--r--x11-drivers/xf86-video-omap/metadata.xml6
-rw-r--r--x11-drivers/xf86-video-omap/xf86-video-omap-0.4.2.ebuild15
-rw-r--r--x11-drivers/xf86-video-omap/xf86-video-omap-0.4.3.ebuild15
-rw-r--r--x11-drivers/xf86-video-omapfb/Manifest2
-rw-r--r--x11-drivers/xf86-video-omapfb/files/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch41
-rw-r--r--x11-drivers/xf86-video-omapfb/files/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch32
-rw-r--r--x11-drivers/xf86-video-omapfb/files/0003-force-plain-mode.patch31
-rw-r--r--x11-drivers/xf86-video-omapfb/files/0004-blacklist-tv-out.patch33
-rw-r--r--x11-drivers/xf86-video-omapfb/files/0005-Attempt-to-fix-VRFB.patch325
-rw-r--r--x11-drivers/xf86-video-omapfb/files/0006-omapfb-port-to-new-xserver-video-API.patch272
-rw-r--r--x11-drivers/xf86-video-omapfb/files/xf86-video-omapfb-0.1.1-closescreen.patch11
-rw-r--r--x11-drivers/xf86-video-omapfb/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-omapfb/xf86-video-omapfb-0.1.1.1_p1.ebuild34
-rw-r--r--x11-drivers/xf86-video-openchrome/Manifest1
-rw-r--r--x11-drivers/xf86-video-openchrome/files/xf86-video-openchrome-0.3.3-glibc-2.20.patch42
-rw-r--r--x11-drivers/xf86-video-openchrome/metadata.xml8
-rw-r--r--x11-drivers/xf86-video-openchrome/xf86-video-openchrome-0.3.3.ebuild52
-rw-r--r--x11-drivers/xf86-video-opentegra/Manifest1
-rw-r--r--x11-drivers/xf86-video-opentegra/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-opentegra/xf86-video-opentegra-0.7.0.ebuild17
-rw-r--r--x11-drivers/xf86-video-qxl/Manifest2
-rw-r--r--x11-drivers/xf86-video-qxl/metadata.xml8
-rw-r--r--x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.3.ebuild25
-rw-r--r--x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.4.ebuild25
-rw-r--r--x11-drivers/xf86-video-r128/Manifest3
-rw-r--r--x11-drivers/xf86-video-r128/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-r128/xf86-video-r128-6.10.0.ebuild21
-rw-r--r--x11-drivers/xf86-video-r128/xf86-video-r128-6.9.1.ebuild21
-rw-r--r--x11-drivers/xf86-video-r128/xf86-video-r128-6.9.2.ebuild21
-rw-r--r--x11-drivers/xf86-video-rendition/Manifest1
-rw-r--r--x11-drivers/xf86-video-rendition/files/xf86-video-rendition-4.2.5-remove-mibstore_h.patch35
-rw-r--r--x11-drivers/xf86-video-rendition/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-rendition/xf86-video-rendition-4.2.5-r1.ebuild17
-rw-r--r--x11-drivers/xf86-video-s3/Manifest1
-rw-r--r--x11-drivers/xf86-video-s3/files/xf86-video-s3-0.6.5-mibstore_h.patch32
-rw-r--r--x11-drivers/xf86-video-s3/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5-r1.ebuild18
-rw-r--r--x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5.ebuild14
-rw-r--r--x11-drivers/xf86-video-s3virge/Manifest1
-rw-r--r--x11-drivers/xf86-video-s3virge/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-s3virge/xf86-video-s3virge-1.10.6.ebuild14
-rw-r--r--x11-drivers/xf86-video-savage/Manifest1
-rw-r--r--x11-drivers/xf86-video-savage/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-savage/xf86-video-savage-2.3.8.ebuild30
-rw-r--r--x11-drivers/xf86-video-siliconmotion/Manifest1
-rw-r--r--x11-drivers/xf86-video-siliconmotion/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.8.ebuild14
-rw-r--r--x11-drivers/xf86-video-sis/Manifest1
-rw-r--r--x11-drivers/xf86-video-sis/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-sis/xf86-video-sis-0.10.7.ebuild19
-rw-r--r--x11-drivers/xf86-video-sisusb/Manifest2
-rw-r--r--x11-drivers/xf86-video-sisusb/files/xf86-video-sisusb-0.9.6-remove-mibstore_h.patch29
-rw-r--r--x11-drivers/xf86-video-sisusb/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.5.ebuild14
-rw-r--r--x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6-r1.ebuild18
-rw-r--r--x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6.ebuild14
-rw-r--r--x11-drivers/xf86-video-suncg14/Manifest2
-rw-r--r--x11-drivers/xf86-video-suncg14/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.1.ebuild18
-rw-r--r--x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.2.ebuild18
-rw-r--r--x11-drivers/xf86-video-suncg3/Manifest2
-rw-r--r--x11-drivers/xf86-video-suncg3/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.1.ebuild18
-rw-r--r--x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.2.ebuild18
-rw-r--r--x11-drivers/xf86-video-suncg6/Manifest2
-rw-r--r--x11-drivers/xf86-video-suncg6/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.1.ebuild18
-rw-r--r--x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.2.ebuild18
-rw-r--r--x11-drivers/xf86-video-sunffb/Manifest2
-rw-r--r--x11-drivers/xf86-video-sunffb/files/xf86-video-sunffb-1.2.2-unbreak-when-xaa-is-not-present.patch32
-rw-r--r--x11-drivers/xf86-video-sunffb/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.1.ebuild18
-rw-r--r--x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.2-r1.ebuild19
-rw-r--r--x11-drivers/xf86-video-sunleo/Manifest2
-rw-r--r--x11-drivers/xf86-video-sunleo/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.0.ebuild17
-rw-r--r--x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.1.ebuild17
-rw-r--r--x11-drivers/xf86-video-suntcx/Manifest2
-rw-r--r--x11-drivers/xf86-video-suntcx/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.1.ebuild18
-rw-r--r--x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.2.ebuild18
-rw-r--r--x11-drivers/xf86-video-tdfx/Manifest1
-rw-r--r--x11-drivers/xf86-video-tdfx/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-tdfx/xf86-video-tdfx-1.4.6.ebuild21
-rw-r--r--x11-drivers/xf86-video-tga/Manifest1
-rw-r--r--x11-drivers/xf86-video-tga/files/xf86-video-tga-1.2.2-remove-mibstore_h.patch42
-rw-r--r--x11-drivers/xf86-video-tga/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2-r1.ebuild18
-rw-r--r--x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2.ebuild14
-rw-r--r--x11-drivers/xf86-video-trident/Manifest1
-rw-r--r--x11-drivers/xf86-video-trident/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-trident/xf86-video-trident-1.3.7.ebuild13
-rw-r--r--x11-drivers/xf86-video-tseng/Manifest1
-rw-r--r--x11-drivers/xf86-video-tseng/files/xf86-video-tseng-1.2.5-remove-mibstore_h.patch31
-rw-r--r--x11-drivers/xf86-video-tseng/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-tseng/xf86-video-tseng-1.2.5-r1.ebuild17
-rw-r--r--x11-drivers/xf86-video-v4l/Manifest1
-rw-r--r--x11-drivers/xf86-video-v4l/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-v4l/xf86-video-v4l-0.2.0.ebuild17
-rw-r--r--x11-drivers/xf86-video-vesa/Manifest2
-rw-r--r--x11-drivers/xf86-video-vesa/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.3.ebuild14
-rw-r--r--x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.4.ebuild14
-rw-r--r--x11-drivers/xf86-video-virtualbox/Manifest3
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-2.2.0-enable-opengl.patch13
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-localconfig30
-rwxr-xr-xx11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-vboxvideo_drm.makefile240
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3.2.8-mesa-check.patch36
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-makeself-check.patch10
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-mkisofs-check.patch10
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.6-link-lazy.patch17
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.8-vboxvideo_compilefixes.patch31
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5-localconfig30
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.0_beta3-configure_checks.patch52
-rw-r--r--x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-link-lazy.patch16
-rw-r--r--x11-drivers/xf86-video-virtualbox/metadata.xml8
-rw-r--r--x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.28.ebuild173
-rw-r--r--x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.30.ebuild173
-rw-r--r--x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.0.ebuild171
-rw-r--r--x11-drivers/xf86-video-vmware/Manifest3
-rw-r--r--x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-damageunregister.patch38
-rw-r--r--x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xa-compat-2.patch26
-rw-r--r--x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xatracker-2.patch179
-rw-r--r--x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.2-fix-includes.patch41
-rw-r--r--x11-drivers/xf86-video-vmware/metadata.xml9
-rw-r--r--x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.1-r1.ebuild23
-rw-r--r--x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.2.ebuild18
-rw-r--r--x11-drivers/xf86-video-vmware/xf86-video-vmware-13.1.0.ebuild16
-rw-r--r--x11-drivers/xf86-video-voodoo/Manifest1
-rw-r--r--x11-drivers/xf86-video-voodoo/metadata.xml5
-rw-r--r--x11-drivers/xf86-video-voodoo/xf86-video-voodoo-1.2.5.ebuild14
399 files changed, 17917 insertions, 0 deletions
diff --git a/x11-drivers/afb-ucode/Manifest b/x11-drivers/afb-ucode/Manifest
new file mode 100644
index 000000000000..81afcdc7802f
--- /dev/null
+++ b/x11-drivers/afb-ucode/Manifest
@@ -0,0 +1 @@
+DIST afb-ucode.tar.bz2 36421 SHA256 6ef1da6c6ff7a6ba07d7cf8c5b3677e353d59b8baea40af05ae0ee56d2befc84
diff --git a/x11-drivers/afb-ucode/afb-ucode-1.3.11.ebuild b/x11-drivers/afb-ucode/afb-ucode-1.3.11.ebuild
new file mode 100644
index 000000000000..b89c5a5f2115
--- /dev/null
+++ b/x11-drivers/afb-ucode/afb-ucode-1.3.11.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit multilib
+
+DESCRIPTION="Binary blob microcode for Elite3D framebuffers to use X, required by xf86-video-sunffb"
+HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
+SRC_URI="http://dlc.sun.com/osol/sparc-gfx/downloads/${PN}.tar.bz2
+ mirror://gentoo/${PN}.tar.bz2"
+IUSE=""
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="-* sparc"
+
+RDEPEND="${DEPEND}
+ x11-misc/afbinit"
+
+S="${WORKDIR}/${PN}"
+
+src_install() {
+ insinto /usr/$(get_libdir)
+ doins afb.ucode
+}
diff --git a/x11-drivers/afb-ucode/metadata.xml b/x11-drivers/afb-ucode/metadata.xml
new file mode 100644
index 000000000000..bec30fdf4884
--- /dev/null
+++ b/x11-drivers/afb-ucode/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sparc</herd>
+</pkgmetadata>
diff --git a/x11-drivers/ati-drivers/Manifest b/x11-drivers/ati-drivers/Manifest
new file mode 100644
index 000000000000..d8a48e01f765
--- /dev/null
+++ b/x11-drivers/ati-drivers/Manifest
@@ -0,0 +1,7 @@
+DIST amd-catalyst-14-4-rev2-linux-x86-x86-64-may6.zip 122875129 SHA256 93e213e5b182a0863aa926d1e3ab4498adc0e0007aac4fc14a3abae84bb170f5 SHA512 478419e5051423d490d98149dbb529104d6d36b84e84fa90ae028f0b266c6f2f034c1584f016781c689b558e83724571e5b0af640d9374dcfaedb1c025fa8dfc WHIRLPOOL fdfc6c3177d9e5076a2a2deb79955df069706485dab845d7a651e14597441621b326d0376d979405eca7017330cb3bcdd50fe35f6394d41a527d01c6819fbb71
+DIST amd-catalyst-14-9-linux-x86-x86-64.zip 142129117 SHA256 f28af1970df92a423ce0fafda89e508b37af68dccefffacff4a712ebe619c07a SHA512 022c4b6660c586e6055c2a4f708ca8f37677dc99a32b00fb8fe0ef51981c872a3cae0014994f2b9d137df0b8e98b6ab9904af778d77a815b62a5d72404022bb9 WHIRLPOOL 455e03a580d52aec915dcb899eca019bc3ff265ef250dab65fb08549f77078b8014a93961adeae663f85538a6bc188b8f6b68f16cd7b32418ddbd5bdcf93ae12
+DIST amd-catalyst-omega-14.12-linux-run-installers.zip 155616187 SHA256 68669836f20ad4351e08b13c5766c6b2ffc6b8cd2a37e9baf55779da32d3a249 SHA512 f87be6a56c03ca4aae3782668af8700d83c85872387753cf002ba4a0e0816fae9af29841a4390db972bfe2f7fb853571b32f8434c2008983461b80699347ac21 WHIRLPOOL 2675a387abd372b34c51f4e8ebfd6547300a8c3ffcc0562633838bc0cdaec3675ca3f4cfa2ab7481c8fa1238a46059f5f848611780638ef6d2301a527d900326
+DIST amd-driver-installer-15.20.1046-x86.x86_64.zip 180105224 SHA256 ffde64203f49d9288eaa25f4d744187b6f4f14a87a444bab6a001d822b327a9d SHA512 8a04a524f64af5620eb39bc22cd869551f1b1ea7f6e3349258f70305c84ba45d36355c16348e2e286f8f74f3657cae283f0bb911b3f819995f1933999fd6ef0f WHIRLPOOL f7a7e705cd56cf2ef9557416a4fba6b98704e971e0d18daf27b5f73052df7f61240693522b8e02b53f3cba714a5b99c3bf65cc1aba6d0802858adc896852cc08
+DIST fglrx-installer_15.200.orig.tar.gz 202964824 SHA256 a4ad20d53f790d5105351a5627fadbf02fe4945582abf2b93a337b1bbaa0b033 SHA512 499fd955a170d8157a974acdee981ce0a444262465624bacea38a23421f9d80ce3481b20a0d0daa4469eba85a69ec9278026c127a2a1995f52573adc5b1808c7 WHIRLPOOL 00ccd79433499133367b669740b494de33ec9de17c2a45f3d1222ee8d8cb9c40d4ad8d7043a2593bb3e1fbc66a4f65a7fd756c61a40fdbc9cf9b6cb1d693e25f
+DIST linux-amd-catalyst-14.6-beta-v1.0-jul11.zip 127042528 SHA256 9786b8d695069ebe132d4c6ad8bd011688c28af3fa1a11c08589f38f1854a962 SHA512 029df9ff5ba1a90bb54518726852b20ba3766e3b72d1071d99dcee076dcc505e5d81433308f1213413257f4afe450fd3ca3fd29dc611fcc1126a8c148c928f73 WHIRLPOOL 26bd3eb371ac3dbefe539a4ebb31718db7153c2382b9e5f650de094be309964e65f1e55136313e4d5430ae18e661faa547bb6211efb1d6b3ca50487d99756195
+DIST xvba-sdk-0.74-404001.tar.gz 583847 SHA256 731a2c489f2fb5d7318c1976061b26c1057a696f46d09dcf55fbada97fed17eb SHA512 aa1dd52b59eeeabd026d8b76e3b75eaf02587ef286438ba28884afeef5a5efaf50283b5ee4f5b81b12cf79cb4ec77c9a235a886b29fb7cdf850c9779f4b07b35 WHIRLPOOL 69917b746d353a884512e97b9d9a9b89e6f51add3119e69ddd119d51c0c3f2820b93a449fe42bd76d671dc505f92bf25b7f2c5868b33768fc68a19596e460951
diff --git a/x11-drivers/ati-drivers/ati-drivers-14.12-r2.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.12-r2.ebuild
new file mode 100644
index 000000000000..c9402797e3b0
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-14.12-r2.ebuild
@@ -0,0 +1,602 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit eutils multilib-build linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+RUN="${WORKDIR}/fglrx-14.501.1003/amd-driver-installer-14.501.1003-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://gentoo/amd-catalyst-omega-14.12-linux-run-installers.zip"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules qt4 static-libs pax_kernel"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+
+RESTRICT="bindist test"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.16.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ virtual/glu
+ abi_x86_32? (
+ virtual/glu[abi_x86_32]
+ x11-libs/libX11[abi_x86_32]
+ x11-libs/libXext[abi_x86_32]
+ x11-libs/libXinerama[abi_x86_32]
+ x11-libs/libXrandr[abi_x86_32]
+ x11-libs/libXrender[abi_x86_32]
+ )
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Fix #524658
+ epatch "${FILESDIR}/fix-the-linux-3.17-no_hotplug-error.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ # Compile fix, #526602
+ epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+ multilib_foreach_abi src_install-libs
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ if multilib_is_native_abi; then
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+ fi
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdhsasc*.so
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild
new file mode 100644
index 000000000000..52efa86d540c
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild
@@ -0,0 +1,607 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit eutils multilib-build linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+RUN="${WORKDIR}/fglrx-14.501.1003/amd-driver-installer-14.501.1003-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://gentoo/amd-catalyst-omega-14.12-linux-run-installers.zip"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules qt4 static-libs pax_kernel"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* amd64 x86"
+
+RESTRICT="bindist test"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.16.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ virtual/glu
+ !x11-libs/xvba-video
+ abi_x86_32? (
+ virtual/glu[abi_x86_32]
+ x11-libs/libX11[abi_x86_32]
+ x11-libs/libXext[abi_x86_32]
+ x11-libs/libXinerama[abi_x86_32]
+ x11-libs/libXrandr[abi_x86_32]
+ x11-libs/libXrender[abi_x86_32]
+ )
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/libamdhsasc\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_OUT_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Fix #524658
+ epatch "${FILESDIR}/fix-the-linux-3.17-no_hotplug-error.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ # Compile fix, #526602
+ epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+ multilib_foreach_abi src_install-libs
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ if multilib_is_native_abi; then
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+ fi
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdhsasc*.so
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ # VA-API internal wrapper
+ dosym /usr/$(get_libdir)/libXvBAW.so.1.0 /usr/$(get_libdir)/va/drivers/fglrx_drv_video.so
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/ati-drivers-14.4_p1.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.4_p1.ebuild
new file mode 100644
index 000000000000..d6d509a1a1ed
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-14.4_p1.ebuild
@@ -0,0 +1,609 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+RUN="${WORKDIR}/fglrx-14.10.1006.1001/amd-driver-installer-14.10.1006.1001-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://gentoo/amd-catalyst-14-4-rev2-linux-x86-x86-64-may6.zip"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules multilib qt4 static-libs pax_kernel"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* amd64 x86"
+
+RESTRICT="bindist test"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.15.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ virtual/glu
+ multilib? (
+ >=virtual/glu-9.0-r1[abi_x86_32]
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ >=x11-libs/libXinerama-1.1.3[abi_x86_32]
+ >=x11-libs/libXrandr-1.4.2[abi_x86_32]
+ >=x11-libs/libXrender-0.9.8[abi_x86_32]
+ )
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ # Compile fix for kernel typesafe uid types #469160
+ epatch "${FILESDIR}/typesafe-kuid.diff"
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+
+ # There used to be some code here that tried to detect running
+ # under a "native multilib" portage ((precursor of)
+ # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
+ # should just work (only doing some duplicate work). --marienz
+ if has_multilib_profile; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis); do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild
new file mode 100644
index 000000000000..e8d5138c4dfb
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-14.6_beta2.ebuild
@@ -0,0 +1,609 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils multilib linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+RUN="${WORKDIR}/fglrx-14.20/amd-driver-installer-14.20-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://gentoo/linux-amd-catalyst-14.6-beta-v1.0-jul11.zip"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules multilib qt4 static-libs pax_kernel"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+
+RESTRICT="bindist test"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.15.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ virtual/glu
+ multilib? (
+ virtual/glu[abi_x86_32]
+ x11-libs/libX11[abi_x86_32]
+ x11-libs/libXext[abi_x86_32]
+ x11-libs/libXinerama[abi_x86_32]
+ x11-libs/libXrandr[abi_x86_32]
+ x11-libs/libXrender[abi_x86_32]
+ )
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ # Compile fix for kernel typesafe uid types #469160
+ epatch "${FILESDIR}/typesafe-kuid.diff"
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+
+ # There used to be some code here that tried to detect running
+ # under a "native multilib" portage ((precursor of)
+ # http://dev.gentoo.org/~kanaka/auto-multilib/). I removed that, it
+ # should just work (only doing some duplicate work). --marienz
+ if has_multilib_profile; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis); do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/ati-drivers-14.9-r2.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.9-r2.ebuild
new file mode 100644
index 000000000000..f5a57c26177e
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-14.9-r2.ebuild
@@ -0,0 +1,601 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit eutils multilib-build linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+RUN="${WORKDIR}/fglrx-14.301.1001/amd-driver-installer-14.301.1001-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://gentoo/amd-catalyst-14-9-linux-x86-x86-64.zip"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules qt4 static-libs pax_kernel"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+
+RESTRICT="bindist test fetch"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.15.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ virtual/glu
+ abi_x86_32? (
+ virtual/glu[abi_x86_32]
+ x11-libs/libX11[abi_x86_32]
+ x11-libs/libXext[abi_x86_32]
+ x11-libs/libXinerama[abi_x86_32]
+ x11-libs/libXrandr[abi_x86_32]
+ x11-libs/libXrender[abi_x86_32]
+ )
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Fix #524658
+ epatch "${FILESDIR}/fix-the-linux-3.17-no_hotplug-error.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ # Compile fix, #526602
+ epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+ multilib_foreach_abi src_install-libs
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ if multilib_is_native_abi; then
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+ fi
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/ati-drivers-15.1.ebuild b/x11-drivers/ati-drivers/ati-drivers-15.1.ebuild
new file mode 100644
index 000000000000..e7baaa0a6915
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-15.1.ebuild
@@ -0,0 +1,614 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit eutils multilib-build linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+#RUN="${WORKDIR}/fglrx-14.501.1003/amd-driver-installer-14.501.1003-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://ubuntu/pool/restricted/f/fglrx-installer/fglrx-installer_15.200.orig.tar.gz"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules qt4 static-libs pax_kernel gdm-hack"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+
+RESTRICT="bindist test"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.17.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ !x11-libs/xvba-video
+ virtual/glu[${MULTILIB_USEDEP}]
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXinerama[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXrender[${MULTILIB_USEDEP}]
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+ gdm-hack? (
+ x11-base/xorg-server:=
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/libamdhsasc\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_OUT_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ mkdir -p common
+ mv etc lib usr common || die "Assumed to find etc lib and usr for common"
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ # Compile fix, #526602
+ epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+ multilib_foreach_abi src_install-libs
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ #516816
+ if use gdm-hack; then
+ sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/usr/$(get_libdir)/xorg/modules/drivers/fglrx_drv.so" || die "Applying gdm-hack failed"
+ fi
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+
+ #516816
+ use gdm-hack && Xorg -version > "${D}/etc/ati/xvrn" 2>&1
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ if multilib_is_native_abi; then
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ #516816
+ if use gdm-hack; then
+ sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/${ATI_ROOT}/extensions/libglx.so" || die "Applying gdm-hack failed"
+ fi
+ fi
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdhsasc*.so
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ # VA-API internal wrapper
+ dosym /usr/$(get_libdir)/libXvBAW.so.1.0 /usr/$(get_libdir)/va/drivers/fglrx_drv_video.so
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/ati-drivers-15.7.ebuild b/x11-drivers/ati-drivers/ati-drivers-15.7.ebuild
new file mode 100644
index 000000000000..fda41dc3d189
--- /dev/null
+++ b/x11-drivers/ati-drivers/ati-drivers-15.7.ebuild
@@ -0,0 +1,615 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+MULTILIB_COMPAT=( abi_x86_{32,64} )
+inherit eutils multilib-build linux-info linux-mod toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+#RUN="${WORKDIR}/fglrx-14.501.1003/amd-driver-installer-14.501.1003-x86.x86_64.run"
+SLOT="1"
+# Uses javascript for download YESSSS
+#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip"
+DRIVERS_URI="mirror://gentoo/amd-driver-installer-15.20.1046-x86.x86_64.zip"
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug +modules qt4 static-libs pax_kernel gdm-hack"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+
+RESTRICT="bindist test"
+
+RDEPEND="
+ <=x11-base/xorg-server-1.17.49[-minimal]
+ >=app-eselect/eselect-opengl-1.0.7
+ app-eselect/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ !x11-libs/xvba-video
+ virtual/glu[${MULTILIB_USEDEP}]
+ x11-libs/libX11[${MULTILIB_USEDEP}]
+ x11-libs/libXext[${MULTILIB_USEDEP}]
+ x11-libs/libXinerama[${MULTILIB_USEDEP}]
+ x11-libs/libXrandr[${MULTILIB_USEDEP}]
+ x11-libs/libXrender[${MULTILIB_USEDEP}]
+ qt4? (
+ x11-libs/libICE
+ x11-libs/libSM
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXxf86vm
+ dev-qt/qtcore:4
+ dev-qt/qtgui:4[accessibility]
+ )
+ gdm-hack? (
+ x11-base/xorg-server:=
+ )
+"
+if [[ legacy != ${SLOT} ]]; then
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:legacy"
+else
+ RDEPEND="${RDEPEND}
+ !x11-drivers/ati-drivers:1"
+fi
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils
+ app-arch/unzip
+"
+
+EMULTILIB_PKG="true"
+
+S="${WORKDIR}"
+
+# QA Silencing
+QA_TEXTRELS="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/libatiadlxx.so
+ usr/lib*/xorg/modules/glesx.so
+ usr/lib*/libaticaldd.so
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_EXECSTACK="
+ opt/bin/atiode
+ opt/bin/amdcccle
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_WX_LOAD="
+ usr/lib*/opengl/ati/lib/libGL.so.1.2
+ usr/lib*/dri/fglrx_dri.so
+"
+
+QA_PRESTRIPPED="
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\).so
+"
+
+QA_SONAME="
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/libamdhsasc\(32\|64\)\?.so
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/clinfo
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ opt/sbin/amdnotifyui
+ usr/lib\(32\|64\)\?/libaticalcl.so
+ usr/lib\(32\|64\)\?/libaticalrt.so
+ usr/lib\(32\|64\)\?/libatiuki.so.1.0
+ usr/lib\(32\|64\)\?/libatiadlxx.so
+ usr/lib\(32\|64\)\?/libfglrx_dm.so.1.0
+ usr/lib\(32\|64\)\?/libXvBAW.so.1.0
+ usr/lib\(32\|64\)\?/libAMDXvBA.so.1.0
+ usr/lib\(32\|64\)\?/xorg/modules/amdxmm.so
+ usr/lib\(32\|64\)\?/xorg/modules/glesx.so
+ usr/lib\(32\|64\)\?/xorg/modules/linux/libfglrxdrm.so
+ usr/lib\(32\|64\)\?/xorg/modules/drivers/fglrx_drv.so
+ usr/lib\(32\|64\)\?/libaticaldd.so
+ usr/lib\(32\|64\)\?/dri/fglrx_dri.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/extensions/fglrx-libglx.so
+ usr/lib\(32\|64\)\?/opengl/ati/lib/fglrx-libGL.so.1.2
+ usr/lib\(32\|64\)\?/opengl/ati/lib/libGL.so.1.2
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/OpenCL/vendors/amd/libOpenCL.so.1
+"
+
+pkg_nofetch() {
+ einfo "The driver packages"
+ einfo ${A}
+ einfo "need to be downloaded manually from"
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
+ einfo "and ${XVBA_SDK_URI}"
+}
+
+pkg_pretend() {
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR"
+ use amd64 && CONFIG_CHECK+=" COMPAT"
+
+ local ERROR_MTRR="CONFIG_MTRR required for direct rendering."
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct
+ rendering to work."
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire
+ as GPL-only. This prevents ${P} from compiling with an error like this:
+ FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'"
+ local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause
+ kernel to reject loading the fglrx module with
+ \"ERROR: could not insert 'fglrx': Exec format error.\"
+ You may want to try CONFIG_PAX_KERNEXEC_PLUGIN_METHOD_BTS instead."
+ local ERROR_BKL="CONFIG_BKL must be enabled for kernels 2.6.37-2.6.38."
+
+ # workaround until bug 365543 is solved
+ if use modules; then
+ linux-info_pkg_setup
+ require_configured_kernel
+ kernel_is ge 2 6 37 && kernel_is le 2 6 38 && CONFIG_CHECK+=" BKL"
+ check_extra_config
+ if ! linux_chkconfig_present AGP && \
+ ! linux_chkconfig_present PCIEPORTBUS; then
+ ewarn "You don't have AGP and/or PCIe support enabled in the kernel"
+ ewarn "Direct rendering will not work."
+ fi
+ fi
+
+ if ! has XT ${PAX_MARKINGS} && use pax_kernel; then
+ ewarn "You have disabled xattr pax markings for portage."
+ ewarn "This will likely cause programs using ati-drivers provided"
+ ewarn "libraries to be killed kernel."
+ fi
+}
+
+pkg_setup() {
+ if use modules; then
+ MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)"
+ BUILD_TARGETS="kmod_build"
+ linux-mod_pkg_setup
+ BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_OUT_DIR}"
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\""
+ if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space"
+ else
+ BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space"
+ fi
+ fi
+ # Define module dir.
+ MODULE_DIR="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod"
+ # get the xorg-server version and set BASE_DIR for that
+ BASE_DIR="${S}/xpic"
+
+ # amd64/x86
+ if use amd64 ; then
+ MY_BASE_DIR="${BASE_DIR}_64a"
+ PKG_LIBDIR=lib64
+ ARCH_DIR="${S}/arch/x86_64"
+ else
+ MY_BASE_DIR="${BASE_DIR}"
+ PKG_LIBDIR=lib
+ ARCH_DIR="${S}/arch/x86"
+ fi
+
+ elog
+ elog "Please note that this driver only supports graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This includes the AMD Radeon HD 5400+ series at this moment."
+ elog
+ elog "If your card is older then use ${CATEGORY}/xf86-video-ati"
+ elog "For migration informations please refer to:"
+ elog "http://www.gentoo.org/proj/en/desktop/x/x11/ati-migration-guide.xml"
+ einfo
+}
+
+src_unpack() {
+ local DRIVERS_DISTFILE XVBA_SDK_DISTFILE
+ DRIVERS_DISTFILE=${DRIVERS_URI##*/}
+ XVBA_SDK_DISTFILE=${XVBA_SDK_URI##*/}
+
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.tar\.gz ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ mkdir -p common
+ mv etc lib usr common || die "Assumed to find etc lib and usr for common"
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${DRIVERS_DISTFILE} =~ .*\.zip ]]; then
+ unpack ${DRIVERS_DISTFILE}
+ [[ -z "$RUN" ]] && RUN="${S}/${DRIVERS_DISTFILE/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${DRIVERS_DISTFILE}"
+ fi
+ sh "${RUN}" --extract "${S}" 2>&1 > /dev/null || die
+ fi
+
+ mkdir xvba_sdk
+ cd xvba_sdk
+ unpack ${XVBA_SDK_DISTFILE}
+
+ mkdir -p "${WORKDIR}/extra" || die "mkdir extra failed"
+ cd "${WORKDIR}/extra"
+ tar -xf "../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz"
+}
+
+src_prepare() {
+ if use modules; then
+ if use debug; then
+ sed -i '/^#define DRM_DEBUG_CODE/s/0/1/' \
+ "${MODULE_DIR}/firegl_public.c" \
+ || die "Failed to enable debug output."
+ fi
+ fi
+
+ # These are the userspace utilities that we also have source for.
+ # We rebuild these later.
+ rm \
+ "${ARCH_DIR}"/usr/X11R6/bin/fgl_glxgears \
+ || die "bin rm failed"
+
+ # in this version amdcccle isn't static, thus we depend on qt4
+ use qt4 || rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle
+
+ # ACPI fixups
+ sed -i \
+ -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
+ -e "s:/var/lib/gdm/:/var/gdm/:" \
+ "${S}/${FOLDER_PREFIX}etc/ati/authatieventsd.sh" \
+ || die "ACPI fixups failed."
+
+ # Since "who" is in coreutils, we're using that one instead of "finger".
+ sed -i -e 's:finger:who:' \
+ "${S}/${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
+ || die "Replacing 'finger' with 'who' failed."
+ # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
+ # add function to detect default state.
+ epatch "${FILESDIR}"/ati-powermode-opt-path-3.patch
+
+ # see http://ati.cchtml.com/show_bug.cgi?id=495
+ #epatch "${FILESDIR}"/ati-drivers-old_rsp.patch
+ # first hunk applied upstream second (x32 related) was not
+ epatch "${FILESDIR}"/ati-drivers-x32_something_something.patch
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ epatch "${FILESDIR}/ati-drivers-13.8-beta-include-seq_file.patch"
+
+ # Fix #483400
+ epatch "${FILESDIR}/fgl_glxgears-do-not-include-glATI.patch"
+
+ # Compile fix, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ # Compile fix, #526602
+ epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
+
+ epatch_user
+
+ cd "${MODULE_DIR}"
+
+ # bugged fglrx build system, this file should be copied by hand
+ cp ${ARCH_DIR}/lib/modules/fglrx/build_mod/libfglrx_ip.a 2.6.x
+
+ convert_to_m 2.6.x/Makefile || die "convert_to_m failed"
+
+ # When built with ati's make.sh it defines a bunch of macros if
+ # certain .config values are set, falling back to less reliable
+ # detection methods if linux/autoconf.h is not available. We
+ # simply use the linux/autoconf.h settings directly, bypassing the
+ # detection script.
+ sed -i -e 's/__SMP__/CONFIG_SMP/' *.c *h || die "SMP sed failed"
+ sed -i -e 's/ifdef MODVERSIONS/ifdef CONFIG_MODVERSIONS/' *.c *.h \
+ || die "MODVERSIONS sed failed"
+}
+
+src_compile() {
+ use modules && linux-mod_src_compile
+
+ ebegin "Building fgl_glxgears"
+ cd "${S}"/extra/fgl_glxgears
+ # These extra libs/utils either have an Imakefile that does not
+ # work very well without tweaking or a Makefile ignoring CFLAGS
+ # and the like. We bypass those.
+ # The -DUSE_GLU is needed to compile using nvidia headers
+ # according to a comment in ati-drivers-extra-8.33.6.ebuild.
+ "$(tc-getCC)" -o fgl_glxgears ${CFLAGS} ${LDFLAGS} -DUSE_GLU \
+ -I"${S}"/${FOLDER_PREFIX}usr/include fgl_glxgears.c \
+ -lGL -lGLU -lX11 -lm || die "fgl_glxgears build failed"
+ eend $?
+}
+
+src_install() {
+ use modules && linux-mod_src_install
+
+ # We can do two things here, and neither of them is very nice.
+
+ # For direct rendering libGL has to be able to load one or more
+ # dri modules (files ending in _dri.so, like fglrx_dri.so).
+ # Gentoo's mesa looks for these files in the location specified by
+ # LIBGL_DRIVERS_PATH or LIBGL_DRIVERS_DIR, then in the hardcoded
+ # location /usr/$(get_libdir)/dri. Ati's libGL does the same
+ # thing, but the hardcoded location is /usr/X11R6/lib/modules/dri
+ # on x86 and amd64 32bit, /usr/X11R6/lib64/modules/dri on amd64
+ # 64bit. So we can either put the .so files in that (unusual,
+ # compared to "normal" mesa libGL) location or set
+ # LIBGL_DRIVERS_PATH. We currently do the latter. See also bug
+ # 101539.
+
+ # The problem with this approach is that LIBGL_DRIVERS_PATH
+ # *overrides* the default hardcoded location, it does not extend
+ # it. So if ati-drivers is merged but a non-ati libGL is selected
+ # and its hardcoded path does not match our LIBGL_DRIVERS_PATH
+ # (because it changed in a newer mesa or because it was compiled
+ # for a different set of multilib abis than we are) stuff breaks.
+
+ # We create one file per ABI to work with "native" multilib, see
+ # below.
+
+ echo "COLON_SEPARATED=LIBGL_DRIVERS_PATH" > "${T}/03ati-colon-sep"
+ doenvd "${T}/03ati-colon-sep" || die
+
+ # All libraries that we have a 32 bit and 64 bit version of on
+ # amd64 are installed in src_install-libs. Everything else
+ # (including libraries only available in native 64bit on amd64)
+ # goes in here.
+ multilib_foreach_abi src_install-libs
+
+ # This is sorted by the order the files occur in the source tree.
+
+ # X modules.
+ exeinto /usr/$(get_libdir)/xorg/modules/drivers
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ exeinto /usr/$(get_libdir)/xorg/modules/linux
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/linux/libfglrxdrm.so
+ exeinto /usr/$(get_libdir)/xorg/modules
+ doexe "${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/{glesx.so,amdxmm.so}
+
+ #516816
+ if use gdm-hack; then
+ sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/usr/$(get_libdir)/xorg/modules/drivers/fglrx_drv.so" || die "Applying gdm-hack failed"
+ fi
+
+ # Arch-specific files.
+ # (s)bin.
+ into /opt
+ dosbin "${ARCH_DIR}"/usr/sbin/atieventsd
+ use qt4 && dosbin "${ARCH_DIR}"/usr/sbin/amdnotifyui
+ dobin "${ARCH_DIR}"/usr/bin/clinfo
+ # We cleaned out the compilable stuff in src_unpack
+ dobin "${ARCH_DIR}"/usr/X11R6/bin/*
+
+ # Common files.
+ # etc.
+ insinto /etc/ati
+ exeinto /etc/ati
+ # Everything except for the authatieventsd.sh script.
+ doins ${FOLDER_PREFIX}etc/ati/{logo*,control,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+
+ # include.
+ insinto /usr
+ doins -r ${FOLDER_PREFIX}usr/include
+ insinto /usr/include/X11/extensions
+
+ # Just the atigetsysteminfo.sh script.
+ into /usr
+ dosbin ${FOLDER_PREFIX}usr/sbin/*
+
+ # data files for the control panel.
+ if use qt4 ; then
+ insinto /usr/share
+ doins -r ${FOLDER_PREFIX}usr/share/ati
+ insinto /usr/share/pixmaps
+ doins ${FOLDER_PREFIX}usr/share/icons/ccc_large.xpm
+ make_desktop_entry amdcccle 'AMD Catalyst Control Center' \
+ ccc_large System
+ fi
+
+ # doc.
+ dohtml -r ${FOLDER_PREFIX}usr/share/doc/fglrx
+
+ doman ${FOLDER_PREFIX}usr/share/man/man8/atieventsd.8
+
+ pushd ${FOLDER_PREFIX}usr/share/doc/fglrx/examples/etc/acpi > /dev/null
+
+ exeinto /etc/acpi
+ doexe ati-powermode.sh
+ insinto /etc/acpi/events
+ doins events/*
+
+ popd > /dev/null
+
+ # Done with the "source" tree. Install tools we rebuilt:
+ dobin extra/fgl_glxgears/fgl_glxgears
+ newdoc extra/fgl_glxgears/README README.fgl_glxgears
+
+ # Gentoo-specific stuff:
+ newinitd "${FILESDIR}"/atieventsd.init atieventsd
+ echo 'ATIEVENTSDOPTS=""' > "${T}"/atieventsd.conf
+ newconfd "${T}"/atieventsd.conf atieventsd
+
+ # PowerXpress stuff
+ exeinto /usr/$(get_libdir)/fglrx
+ doexe "${FILESDIR}"/switchlibGL || die "doexe switchlibGL failed"
+ cp "${FILESDIR}"/switchlibGL "${T}"/switchlibglx
+ doexe "${T}"/switchlibglx || die "doexe switchlibglx failed"
+
+ #516816
+ use gdm-hack && Xorg -version > "${D}/etc/ati/xvrn" 2>&1
+}
+
+src_install-libs() {
+ if [[ "${ABI}" == "amd64" ]]; then
+ local EX_BASE_DIR="${BASE_DIR}_64a"
+ local pkglibdir=lib64
+ local MY_ARCH_DIR="${S}/arch/x86_64"
+ local oclsuffix=64
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ local oclsuffix=32
+ fi
+ einfo "ati tree '${pkglibdir}' -> '$(get_libdir)' on system"
+
+ local ATI_ROOT=/usr/$(get_libdir)/opengl/ati
+ # To make sure we do not miss a spot when these change.
+ local libmajor=1 libminor=2
+ local libver=${libmajor}.${libminor}
+
+ # The GLX libraries
+ # (yes, this really is "lib" even on amd64/multilib --marienz)
+ exeinto ${ATI_ROOT}/lib
+ newexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/fglrx/fglrx-libGL.so.${libver} \
+ libGL.so.${libver}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so.${libmajor}
+ dosym libGL.so.${libver} ${ATI_ROOT}/lib/libGL.so
+
+ if multilib_is_native_abi; then
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ #516816
+ if use gdm-hack; then
+ sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/${ATI_ROOT}/extensions/libglx.so" || die "Applying gdm-hack failed"
+ fi
+ fi
+
+ # other libs
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed some row above
+ doexe $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -name '*.so*' -not -name '*libGL.so*')
+ insinto /usr/$(get_libdir)
+ doins $(find "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir} \
+ -maxdepth 1 -type f -not -name '*.so*')
+
+ # DRI modules, installed into the path used by recent versions of mesa.
+ exeinto /usr/$(get_libdir)/dri
+ doexe "${MY_ARCH_DIR}"/usr/X11R6/${pkglibdir}/modules/dri/fglrx_dri.so
+
+ # AMD Cal and OpenCL libraries
+ exeinto /usr/$(get_libdir)/OpenCL/vendors/amd
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libamdocl*.so*
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libOpenCL*.so*
+ dosym libOpenCL.so.${libmajor} /usr/$(get_libdir)/OpenCL/vendors/amd/libOpenCL.so
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ # OpenCL vendor files
+ insinto /etc/OpenCL/vendors/
+ cat > "${T}"/amdocl${oclsuffix}.icd <<-EOF
+ /usr/$(get_libdir)/OpenCL/vendors/amd/libamdocl${oclsuffix}.so
+ EOF
+ doins "${T}"/amdocl${oclsuffix}.icd
+
+ local envname="${T}"/04ati-dri-path
+ if [[ -n ${ABI} ]]; then
+ envname="${envname}-${ABI}"
+ fi
+ echo "LIBGL_DRIVERS_PATH=/usr/$(get_libdir)/dri" > "${envname}"
+ doenvd "${envname}"
+
+ # Silence the QA notice by creating missing soname symlinks
+ for so in $(find "${D}"/usr/$(get_libdir) -maxdepth 1 -name *.so.[0-9].[0-9])
+ do
+ local soname=${so##*/}
+ local soname_one=${soname%.[0-9]}
+ local soname_zero=${soname_one%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/${soname_one}
+ dosym ${soname_one} /usr/$(get_libdir)/${soname_zero}
+ done
+
+ # See https://bugs.gentoo.org/show_bug.cgi?id=443466
+ dodir /etc/revdep-rebuild/
+ echo "SEARCH_DIRS_MASK=\"/opt/bin/clinfo\"" > "${ED}/etc/revdep-rebuild/62-ati-drivers"
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+
+ #install xvba sdk headers
+ doheader xvba_sdk/include/amdxvba.h
+
+ # VA-API internal wrapper
+ dosym /usr/$(get_libdir)/libXvBAW.so.1.0 /usr/$(get_libdir)/va/drivers/fglrx_drv_video.so
+
+ if use pax_kernel; then
+ pax-mark m "${D}"/usr/lib*/opengl/ati/lib/libGL.so.1.2 || die "pax-mark failed"
+ fi
+}
+
+pkg_postinst() {
+ elog "To switch to AMD OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "If you experience unexplained segmentation faults and kernel crashes"
+ elog "with this driver and multi-threaded applications such as wine,"
+ elog "set UseFastTLS in xorg.conf to either 0 or 1, but not 2."
+ elog
+ elog "Fully rebooting the system after an ${PN} update is recommended"
+ elog "Stopping Xorg, reloading fglrx kernel module and restart Xorg"
+ elog "might not work"
+ elog
+ elog "Some cards need acpid running to handle events"
+ elog "Please add it to boot runlevel with rc-update add acpid boot"
+ elog
+
+ use modules && linux-mod_pkg_postinst
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+
+ if has_version "x11-drivers/xf86-video-intel[sna]"; then
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server"
+ ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience"
+ ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or"
+ ewarn "try disabling sna for xf86-video-intel."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+
+ if use pax_kernel; then
+ ewarn "Please run \"revdep-pax -s libGL.so.1 -me\" after installation and"
+ ewarn "after you have run \"eselect opengl set ati\". Executacle"
+ ewarn "revdep-pax is part of package sys-apps/elfix."
+ fi
+}
+
+pkg_preinst() {
+ use modules && linux-mod_pkg_preinst
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use modules && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-drivers/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch b/x11-drivers/ati-drivers/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
new file mode 100644
index 000000000000..0ea461b82e88
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
@@ -0,0 +1,27 @@
+From: Vasiliy Yeremeyev <vayerx@gmail.com>
+Date: Sun, 4 Nov 2012 23:59:36 +0400
+Subject: [PATCH] KCL_AGP_FindCapsRegisters stub for AGP-less systems
+
+---
+ common/lib/modules/fglrx/build_mod/kcl_agp.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/common/lib/modules/fglrx/build_mod/kcl_agp.c b/common/lib/modules/fglrx/build_mod/kcl_agp.c
+index b9c0655..cb1902b 100644
+--- a/common/lib/modules/fglrx/build_mod/kcl_agp.c
++++ b/common/lib/modules/fglrx/build_mod/kcl_agp.c
+@@ -479,6 +479,11 @@ int ATI_API_CALL KCL_AGP_Enable(unsigned long mode)
+ return -EINVAL;
+ }
+
++int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
++{
++ return -EINVAL;
++}
++
+ int ATI_API_CALL KCL_AGP_ReadCapsRegisters(KCL_PCI_DevHandle dev, unsigned int *caps)
+ {
+ return -EINVAL;
+--
+1.7.12
+
diff --git a/x11-drivers/ati-drivers/files/ati-drivers-13.12-acpi.patch b/x11-drivers/ati-drivers/files/ati-drivers-13.12-acpi.patch
new file mode 100644
index 000000000000..0a27431b1463
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/ati-drivers-13.12-acpi.patch
@@ -0,0 +1,16 @@
+diff -urN common.old/lib/modules/fglrx/build_mod/kcl_acpi.c common/lib/modules/fglrx/build_mod/kcl_acpi.c
+--- common.old/lib/modules/fglrx/build_mod/kcl_acpi.c 2013-12-27 13:32:34.734832283 +0100
++++ common/lib/modules/fglrx/build_mod/kcl_acpi.c 2013-12-27 13:33:31.849831765 +0100
+@@ -1002,7 +1002,11 @@
+ #endif
+ {
+ return KCL_ACPI_ERROR;
+- }
++ }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)
++ ((acpi_tbl_table_handler)handler)(hdr);
++#else
+ ((acpi_table_handler)handler)(hdr);
++#endif
+ return KCL_ACPI_OK;
+ }
diff --git a/x11-drivers/ati-drivers/files/ati-drivers-13.8-beta-include-seq_file.patch b/x11-drivers/ati-drivers/files/ati-drivers-13.8-beta-include-seq_file.patch
new file mode 100644
index 000000000000..fb1ba17e0223
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/ati-drivers-13.8-beta-include-seq_file.patch
@@ -0,0 +1,13 @@
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 22561c5..fdfe65e 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -520,6 +520,8 @@ static int func##_wrap(char *buf, char **start, kcl_off_t offset, \
+ }
+
+ #else
++#include <linux/seq_file.h>
++
+ #define READ_PROC_WRAP(func) \
+ static int func##_wrap(struct seq_file *m, void* data) \
+ { \
diff --git a/x11-drivers/ati-drivers/files/ati-drivers-x32_something_something.patch b/x11-drivers/ati-drivers/files/ati-drivers-x32_something_something.patch
new file mode 100644
index 000000000000..d37c1191dfbf
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/ati-drivers-x32_something_something.patch
@@ -0,0 +1,13 @@
+--- a/common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2012-05-26 19:11:03.402987821 +0200
++++ b/common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2012-05-26 19:13:00.273986422 +0200
+@@ -217,6 +217,10 @@
+ * \param size [in] Number of bytes to allocate
+ * \return Pointer to allocated memory
+ */
++#ifndef CONFIG_X86_X32
++DEFINE_PER_CPU(unsigned long, old_rsp);
++#endif
++
+ void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
+ {
+ void __user *ret = COMPAT_ALLOC_USER_SPACE(size);
diff --git a/x11-drivers/ati-drivers/files/ati-powermode-opt-path-3.patch b/x11-drivers/ati-drivers/files/ati-powermode-opt-path-3.patch
new file mode 100644
index 000000000000..278c191c39dd
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/ati-powermode-opt-path-3.patch
@@ -0,0 +1,40 @@
+--- a/common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh 2012-08-17 22:39:05.077984979 +0800
++++ b/common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh 2012-08-17 22:41:15.919976149 +0800
+@@ -4,6 +4,8 @@
+ # Control script for ACPI lid state and AC adapter state
+ #
+
++aticonfig='/opt/bin/aticonfig'
++
+ getXuser() {
+ user=`who| grep -m1 ":$displaynum " | awk '{print $1}'`
+ if [ x"$user" = x"" ]; then
+@@ -47,7 +49,7 @@
+ done
+
+ #If PPLIB is enabled
+-su $user -c '/usr/bin/aticonfig --pplib-cmd="get version"' | grep PPLIB
++su $user -c "$aticonfig --pplib-cmd='get version'" | grep PPLIB
+ if [ $? = 0 ]; then
+ echo "Has PPLIB"
+ has_pplib=1
+@@ -61,15 +63,15 @@
+ if [ ${lid_closed} -eq 1 -o ${on_dc} -eq 1 ]; then
+ echo "Low power"
+ if [ ${has_pplib} -eq 1 ]; then
+- su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
++ su $user -c "$aticonfig --pplib-cmd='notify psrc dc'"
+ else
+- su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
++ su $user -c "$aticonfig --set-powerstate=1 --effective=now"
+ fi
+ else
+ echo "high power"
+ if [ ${has_pplib} -eq 1 ]; then
+- su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
++ su $user -c "$aticonfig --pplib-cmd='notify psrc ac'"
+ else
+- su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
++ su $user -c "$aticonfig --set-powerstate=3 --effective=now"
+ fi
+ fi
diff --git a/x11-drivers/ati-drivers/files/atieventsd.init b/x11-drivers/ati-drivers/files/atieventsd.init
new file mode 100644
index 000000000000..aa7d028ed65f
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/atieventsd.init
@@ -0,0 +1,20 @@
+#!/sbin/runscript
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+depend() {
+ need acpid
+}
+
+start() {
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --exec /opt/sbin/atieventsd -- ${ATIEVENTSDOPTS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --exec /opt/sbin/atieventsd
+ eend $?
+} \ No newline at end of file
diff --git a/x11-drivers/ati-drivers/files/const-notifier-block.patch b/x11-drivers/ati-drivers/files/const-notifier-block.patch
new file mode 100644
index 000000000000..ba1fdb2b7402
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/const-notifier-block.patch
@@ -0,0 +1,25 @@
+diff -Nur common/lib/modules/fglrx/build_mod/kcl_acpi.c common-r1/lib/modules/fglrx/build_mod/kcl_acpi.c
+--- common/lib/modules/fglrx/build_mod/kcl_acpi.c 2013-01-29 17:03:51.000000000 +0200
++++ common-r1/lib/modules/fglrx/build_mod/kcl_acpi.c 2013-02-15 20:33:10.611838616 +0200
+@@ -15,6 +15,9 @@
+ ****************************************************************************/
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++#include <linux/notifier.h>
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
+ #include <generated/autoconf.h>
+ #else
+@@ -145,7 +148,11 @@
+ return NOTIFY_OK;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
++static notifier_block_no_const firegl_acpi_lid_notifier = {
++#else
+ static struct notifier_block firegl_acpi_lid_notifier = {
++#endif
+ .notifier_call = firegl_acpi_lid_event,
+ };
+ #endif
diff --git a/x11-drivers/ati-drivers/files/fgl_glxgears-do-not-include-glATI.patch b/x11-drivers/ati-drivers/files/fgl_glxgears-do-not-include-glATI.patch
new file mode 100644
index 000000000000..d46e027c5670
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/fgl_glxgears-do-not-include-glATI.patch
@@ -0,0 +1,11 @@
+diff -Nur extra/fgl_glxgears/fgl_glxgears.c extra-r1/fgl_glxgears/fgl_glxgears.c
+--- extra/fgl_glxgears/fgl_glxgears.c 2012-08-29 09:59:03.000000000 +0300
++++ extra-r1/fgl_glxgears/fgl_glxgears.c 2013-09-07 09:26:11.034723135 +0300
+@@ -78,7 +78,6 @@
+ #endif // _WIN32
+
+ #define INT_PTR ptrdiff_t
+-#include <GL/glATI.h>
+
+ #ifdef _WIN32
+ #include <GL/wglATI.h>
diff --git a/x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch b/x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch
new file mode 100644
index 000000000000..a8b546255557
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/fix-the-linux-3.17-no_hotplug-error.patch
@@ -0,0 +1,18 @@
+--- common/lib/modules/fglrx/build_mod/kcl_acpi.c.orig 2014-07-11 11:46:19.000000000 +0200
++++ common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-10-08 15:12:55.535638391 +0200
+@@ -829,6 +829,7 @@
+
+ static acpi_status KCL_ACPI_Slot_No_Hotplug(KCL_ACPI_DevHandle handle, u32 lvl, void *data, void **rv)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,7)
+ struct acpi_device *tdev;
+ struct pci_dev *pdev = (struct pci_dev *)data;
+@@ -844,6 +845,7 @@
+ }
+ }
+ #endif
++#endif
+ return 0;
+ }
+
diff --git a/x11-drivers/ati-drivers/files/switchlibGL b/x11-drivers/ati-drivers/files/switchlibGL
new file mode 100644
index 000000000000..a6aa4fceb96b
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/switchlibGL
@@ -0,0 +1,61 @@
+#!/bin/bash
+# switchlibGL
+#
+# Copyright (c) 2011 Advanced Micro Devices, Inc.
+#
+# Purpose:
+# For switch between AMD and Intel graphic driver library.
+#
+# Usage:
+# switchlibGL amd|intel|query
+# amd: switches to the AMD version of libGL.
+# intel: switches to the open-source version of libGL .
+# query: checks, which version is currently active and prints either "amd"
+# or "intel" or "unknown" on the standard output.
+# must be root to execute this script
+
+ARCH=`uname -m`
+E_ERR=1
+
+# Check if root
+if [ "`whoami`" != "root" ]; then
+ echo "Must be root to run this script." 1>&2
+ exit $E_ERR
+fi
+
+# One parameter
+if [ $# -ne 1 ]; then
+ echo "Usage: `basename $0` amd|intel|query " 1>&2
+ echo "Please choose one parameter " 1>&2
+ exit $E_ERR
+fi
+
+current=$(eselect opengl show)
+# Switch to right mode
+case "$1" in
+ "amd" )
+ if [ $current != ati ] ; then
+ eselect opengl set ati || return 1
+ fi
+ ;;
+ "intel" )
+ if [ $current != xorg-x11 ] ; then
+ eselect opengl set xorg-x11 || return 1
+ fi
+ ;;
+ "query" )
+ case "$current" in
+ "ati" )
+ echo "amd"
+ ;;
+ "xorg-x11" )
+ echo "intel"
+ ;;
+ esac
+ ;;
+ * ) echo "Usage: `basename $0` amd|intel|query" 1>&2; exit $E_ERR;;
+ # other than amd|intel|query parameter report an error
+esac
+
+# A zero return value from the script upon exit indicates success.
+exit 0
diff --git a/x11-drivers/ati-drivers/files/typesafe-kuid.diff b/x11-drivers/ati-drivers/files/typesafe-kuid.diff
new file mode 100644
index 000000000000..c226ea3dbcfd
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/typesafe-kuid.diff
@@ -0,0 +1,34 @@
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index d3ad3ce..9362b58 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -34,6 +34,11 @@
+ #include <linux/autoconf.h>
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
++#include <linux/uidgid.h>
++#endif
++
++
+ #if !defined(CONFIG_X86)
+ #if !defined(CONFIG_X86_PC)
+ #if !defined(CONFIG_X86_XEN)
+@@ -1543,9 +1548,17 @@ KCL_TYPE_Pid ATI_API_CALL KCL_GetTgid(void)
+ KCL_TYPE_Uid ATI_API_CALL KCL_GetEffectiveUid(void)
+ {
+ #ifdef current_euid
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
++ return __kuid_val(current_euid());
++# else
+ return current_euid();
++# endif
+ #else
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)
++ return __kuid_val(current->euid);
++# else
+ return current->euid;
++# endif
+ #endif
+ }
+
diff --git a/x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch b/x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch
new file mode 100644
index 000000000000..f0ba2785323d
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/use-kernel_fpu_begin.patch
@@ -0,0 +1,12 @@
+diff -Naur a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-10-27 23:30:58.630304842 +0200
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-10-27 23:32:57.300306011 +0200
+@@ -6389,7 +6389,7 @@
+ */
+ void ATI_API_CALL KCL_fpu_begin(void)
+ {
+-#ifdef CONFIG_X86_64
++#if defined(CONFIG_X86_64) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
+ kernel_fpu_begin();
+ #else
+ #ifdef TS_USEDFPU
diff --git a/x11-drivers/ati-drivers/metadata.xml b/x11-drivers/ati-drivers/metadata.xml
new file mode 100644
index 000000000000..5aa11eb6eeac
--- /dev/null
+++ b/x11-drivers/ati-drivers/metadata.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>x11@gentoo.org</email>
+ <description>Assign to herd.</description>
+ </maintainer>
+ <maintainer>
+ <email>jekarlson@gmail.com</email>
+ <description>Proxy maintainer, CC him on bugs.</description>
+ </maintainer>
+ <use>
+ <flag name='qt4'>
+ Install qt4 dependent optional tools (e.g Catalyst Control Panel)
+ </flag>
+ <flag name='modules'>Build the kernel modules</flag>
+ <flag name='gdm-hack'>Do a potentially dangerous binary search and replace to fix gdm compatibility</flag>
+ <flag name='pax_kernel'>Enable pax kernel specific patches</flag>
+ </use>
+</pkgmetadata>
diff --git a/x11-drivers/metadata.xml b/x11-drivers/metadata.xml
new file mode 100644
index 000000000000..2357fd16f5cb
--- /dev/null
+++ b/x11-drivers/metadata.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE catmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<catmetadata>
+ <longdescription lang="en">
+ x11-drivers contain drivers that interface with the core X11 server.
+ </longdescription>
+ <longdescription lang="ja">
+ x11-driversカテゴリにはX11コアサーバとインタフェスするドライバが含まれます。
+ </longdescription>
+ <longdescription lang="de">
+ Die Kategorie x11-drivers enthält zusätzliche Treiber für den X-Server.
+ </longdescription>
+ <longdescription lang="pt">
+ A categoria x11-drivers contém drivers que fazem interface com
+ o servidor de X11 principal.
+ </longdescription>
+ <longdescription lang="pl">
+ Kategoria x11-drivers zawiera sterowniki dla serwera X11.
+ </longdescription>
+ <longdescription lang="es">
+ x11-drivers contiene controladores que interactúan con el servidor
+ principal X11.
+ </longdescription>
+</catmetadata>
+
diff --git a/x11-drivers/nvidia-drivers/Manifest b/x11-drivers/nvidia-drivers/Manifest
new file mode 100644
index 000000000000..29b31675716c
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/Manifest
@@ -0,0 +1,38 @@
+DIST NVIDIA-FreeBSD-x86-173.14.39.tar.gz 20038266 SHA256 63a922ce4c5b676b4cb1ace98094dace4cc5408f2553e183df7b2127777a238b SHA512 96982fe7e0751c52fbef534193de09d187b99c1984c05e791223eb804719d8b3ba72efd983f227661ded4b71569bdbb914f1f629ab73a8bc9b8172832ccf3ec6 WHIRLPOOL 21f5906f42adf0064c7a7f81ac8e323de488e6d36356ee42c31a15c31ebb64335d5e2cff0ff022d41de480f9e0a57b3b96387f17151c7b59eceba2c61a7a102b
+DIST NVIDIA-FreeBSD-x86-304.125.tar.gz 34494889 SHA256 806d0bff9d394390b3a257472bc342857f150e9dba6673e6b930f47a93ec0269 SHA512 d2760196d3f0dfb1837d496bd11dbedab6a2bf3de98da35f16c92133452b915b425a718f72e560f5d6483caf5e2e5bcf99a462b2e392d7a08c77b59695649108 WHIRLPOOL eb008e1956043d48af5f928dc594c8ae9c8a946834d889db5b4a9b3f16bfaeb311221e5d3f83c8c599dee860b54a42030dccf2aaec31dffb6e8460bf646b82ad
+DIST NVIDIA-FreeBSD-x86-331.113.tar.gz 56371300 SHA256 f3b4b5ddf5977223646d2cdb0617ea8a5f667814ca23b29cb225c5685eacd9d7 SHA512 5c45142807a5b8ecb5e037921e4e449f4710a65358579087429e14ee50124863e6a65fbf8cc73efec22bd8ca85d3eb5a815c7301403dd3236e0bb0b177e5f3e8 WHIRLPOOL 97240066b1c45c887770bfe8539b733a2957fdc1511af5b08de4149b0ce9fedc87b6aa8ee8d243793d225c98c09681e4cca93dd1c5f601389637644e659d7863
+DIST NVIDIA-FreeBSD-x86-340.76.tar.gz 59362290 SHA256 0abbcc3bed3f017e7f1887a5c2d014e2b5a020462071998986ed49cdb8e7119f SHA512 e6d8b6d03fe0f9ab25ddeef680e0159ea4073d03762d3419761c02b917edefa9a1f81c209bd386838141c1924364c81126b0a356c325b056a0c2451865bed5eb WHIRLPOOL 7ec0cef6f92bfbd4c8b6a051dc8de4b6b138f63fd4f7e18756178a9aebb91ea32523d5ca885481d8c8c3d1531b153699f4e5606c155d6c3aa79a340637d3744b
+DIST NVIDIA-FreeBSD-x86-343.36.tar.gz 59205879 SHA256 8634e7537eca778790296f8355e39ae9a7e16642648e671a6c9339ee55fe340c SHA512 35fcf57d5e830cbe3c07ec70362ad9f0ff6ec327c6b11b6d3c533315e59031501501b9fdb80a3bef720506e5221ad84496745ce13d2c9885076f1c8e8537ba46 WHIRLPOOL 3ed3230dc190e7670c960743d94b8db1c0d9908b597f952746d851b403847e7b2836f1c60e6af0fe73072c1fda3971dfacc37c21908c227b2c20b5045dbfd61f
+DIST NVIDIA-FreeBSD-x86-346.87.tar.gz 58003852 SHA256 72481c38989c1aa1835485d2222e6a98f12f7265518fef4bd2c089fe8023d32e SHA512 6a8bf0671a48f9bfe74f844586985d7132a56b4056536e5581d695414bdebd4e393ac85bd6dd6d06f89a46dfd3b4aea0953bb254cab1b1ade2b383292686d6ae WHIRLPOOL 2358746b56d426be75af6a6665b78f2bcbf8abd7dcf954203cc09d945baf89b75fa004fec4be31cd407efc46bf2aaf5add1010ade7a6616fe8347d8954e892ef
+DIST NVIDIA-FreeBSD-x86-349.16.tar.gz 59441939 SHA256 d8b633790036f032b48196503bc6a85ca82de54edd2409f7c1ec86c053e89e07 SHA512 7d914c74b8b4b50931f27f085ca587fab9a4ba0dafab1cdbb751605cdf702b84e2e31b999b374c7adaa096d6dac6268e9b2ff6fcde5ac37b6dbdfd0ebf4a1422 WHIRLPOOL ab68e75c05a0cf2df803fcf3755c366a04cf6f973bb02b673df58dcdee6cb13a4cb5e6fec5270918c725603780b2fefbb89927789b92ddd01647852d34562b9a
+DIST NVIDIA-FreeBSD-x86-352.30.tar.gz 55043903 SHA256 6d91dce0171a0c7c21d9ce2c4c371940e4ccd273941c3c32bfd04bdc4166d2ae SHA512 cb3e160292f80aaae5d3a17fa9dbba9f3799e42e2a86c2ddae41ff2bce1ac80c68f15dc512fc3879bd7e9fdc8af472852e9d5d3c2ab5afe4e1c9cde7017fbfd9 WHIRLPOOL 351861aab1a22193f71e8231f76397ccc89a1109f583c0cc512ed1657263dd224211b7505e8b7647282bad0f85e15a38ae4d3da7d88ad45dde8d05e87877f157
+DIST NVIDIA-FreeBSD-x86-355.06.tar.gz 56677167 SHA256 49f691695228e0c2effcee4ad0f3ea90bb1086d0dd28af8f88eb10231753010a SHA512 f8698a6afb10d27e27559f56029fa38db9d0d5a7d4ead7a1f4097f113b618eb4b73c82ebbf1c53b0766a43e6a0dfe8eec9a85200b85df450f3c8d70aa713cbb4 WHIRLPOOL bf97c042f55b43ac5d9e286b2eadb75cab6d8a12e8cc54c061a9b0bcaabfd8d8b4df81f73ffff02df058fccd762afff16063b12e1d186b0e31f3aa6dece5d323
+DIST NVIDIA-FreeBSD-x86-96.43.23.tar.gz 15463464 SHA256 18d855db8381eda1a6cf548c9e5095fc5bb8694bf1d6e24fc1072fba4e54cd78 SHA512 42d7b1b76cdb3b23680363e565614a22112162a5dd3639cb804fe670c0c3f3f23595bbefa3f78afdc6a8ca848446dee853c7a355f2c96a0d01b354753ba2785c WHIRLPOOL f8e59ce521990cd9edee441e73f973f074db492952807a0931e362102874cddbb47604ff5c5eb20a0cbde27f9b6d4e440dd12cc2e5a20c9cb65bf3c0b3e62511
+DIST NVIDIA-FreeBSD-x86_64-304.125.tar.gz 35498616 SHA256 46b14b8c5ee1c02ff5e30afc9c99f4dd2edc426ccb2b73764093a1787639699d SHA512 34d48f24b1f5019b23c2937f8b5280fcc596764e1f5833cfe33db5e4d8395a0d69aa4c4214a5b97620dbaade73ac0fa333c36cceb4a137bb26d3ba37c31a0eb7 WHIRLPOOL 82677bd2aec3a60fe64211170573ef702b1dd1ab5a71ec922fb56b8d40f2163c0151a7c7f8bdace9127c8afcaf278f8f23a1cb585a8ad3bb7a0d42787ab17fb2
+DIST NVIDIA-FreeBSD-x86_64-331.113.tar.gz 47509194 SHA256 c848e187c79064ea3f52406312aa09d06f0aaef5063be7522b2b2319c43c872c SHA512 4e206719afcee47179e0756ac67fc4e61d513efb1cd0264b28726d6de16846feee873a2df362bf645b0527d395b6d82f5b54dbc447bccb74128d7bff37bb7b1b WHIRLPOOL a51b0bd9f7301d9bb76b54ffa44337ad4d875125281c4b9921e66a76d434879832f542df9c6ba436ef83fb3fa0afe5197f3425f1b7aa16274aca5080259f343d
+DIST NVIDIA-FreeBSD-x86_64-340.76.tar.gz 60206978 SHA256 60037d035b9af9f1d4dcdd5033e1b28b0cd4c7ca94f6bcb8d267e037a930fdc0 SHA512 d478eac282dfb43205f7464d6542cf1f71ed4dea6b8381314affb8647d104c5ddf7e658b6b8eb5e0bdb18207b92f76c574b24959ce23034d375cc712998e6e7c WHIRLPOOL 98ebffd792a47e3a9ef369976db11909bc13551f38977f85ece41e5a31a790c2c173badfc166e3a0bfe4361d5221129d19364c074ba11fc4aa9062d5cb1499a8
+DIST NVIDIA-FreeBSD-x86_64-343.36.tar.gz 60045074 SHA256 aa189d9fd6448ed49ff4a8dd09dd15c06f6b3ef662fd3d960b4853c485cbab8a SHA512 23c38de071ac6e2c87db2c767b07f243703e55cd6485eb8e538fb72f38e9856b7ff28430fdd7eccc4728f3d36c14eac8b1fbf7155fe864ead93ed4218d5b65b5 WHIRLPOOL 401cdc5675d5fe60b6ca492be912573e9fc56a0a67ad680e2cada783ec8a34c15c6ca1a495c8fdbf09e384bc420295750540f5c77907c459c80f400d8291e44a
+DIST NVIDIA-FreeBSD-x86_64-346.87.tar.gz 58770347 SHA256 fb91a3f66562843465cb6eb28d7d078a31dd9d9ccd65d63d87ee3d7cd7e91d8e SHA512 f1d0e1acfc0eae69d4db3200410babe559d72f46ae7d2beca4f214a35d2b6418bf6b9c333df669f2e77256e1e55959401c0525ae6568121e9b3e6aac0e77bc66 WHIRLPOOL 0df2ee60b2f49c36559aba1135d67a71b9f99dd71c8eb6f19221887f152f7b639176721f2ab3d9b75ae7de62a4248117a15ba25c2af2c469559688c0e6dc5577
+DIST NVIDIA-FreeBSD-x86_64-349.16.tar.gz 60290477 SHA256 b4cb3f3738f8a68b90fb7830ff9b48d9f1e51d3aa6e2dd555b690b4848101a86 SHA512 47c3f59f76b644e5ac69197a22ec8d17d764aa9090049633d274c579d59af8b36780e7a1aa97fa92414eb3c0e76d36e7bdf317f20ed2647482866cd5575f134d WHIRLPOOL a5455b5329211f92ca8f6e87fb796d9844e293878d4a64d2ef6a40a15b57687e66ab81baefb0132790d922b6b4e0c577469c75f98ad208433e14760cc77c6bf7
+DIST NVIDIA-FreeBSD-x86_64-352.30.tar.gz 56681273 SHA256 5fed650cb7b4298d6dac9750ee2e396b2fe24902700c16784c2d38ef0ecd80c1 SHA512 18f878325a02cf5caaba24b7892f55d0ce554492a563dce0a720741c39652c0520708432406d6c78c61fb6f92a4c9dae52dd428c02e3e8442188c49e693edc4d WHIRLPOOL aa2ea6d143a3382fef6a012ee3bfac26df26e1dcdb54ab5d34eab893b1a0459e2a1875925ccda3d531bb59d9336a166d4e369055151ecabae31356be19fd288f
+DIST NVIDIA-FreeBSD-x86_64-355.06.tar.gz 53894942 SHA256 65c5c44bdb6eb19817dfce99df052430b471b9412bd53b95b3723847b195f108 SHA512 f0bb9cff6b914a4526f48f91cb12a10a4ed99a7b550a76b73b087a8f08c90a0d5e8b6b0fb8eb866a1a7dcacbc1242064736c53a164aa48c85c9416a10e68f9ac WHIRLPOOL 989924bd876d440952a13492ea79794f2ca0a9fd026a8fd231d0d52a98bd5610a6560f628998b754cdc62b5e7c2e47948f2bbc2b01415666f433d126db26e06d
+DIST NVIDIA-Linux-x86-173.14.39-pkg0.run 15134997 SHA256 a09935f37121ed3db8ae3da63a0d8e9d4348a19c859811c9fe44d6ce8e3eab23 SHA512 e24e15ccec725d3cbca502c2b77061776a81ef92917a950adec4ff6bdc34f10903aa654433177ea74be0dade4af81c5380d5710d375a5ea445940d06154bde93 WHIRLPOOL fce3d8e4f6cdf698f5a057514b6fe220bb1011025bdce5bd4cf0e424fb4d306d38251b6726bda03f290ea8137d5a95ed418cf8751722879f9042462abd9181b6
+DIST NVIDIA-Linux-x86-304.125.run 40589395 SHA256 aec5b3a792910e152d5af756ef6fd7224c448c564564c7c448ab8ec3fc78c4f7 SHA512 cd77736790876b66c1e88bf30b7a93f755c0f94118edda8fde1701dc07dc4eb60f89a27b0ed432db74729f269cb239f32f3c5e045d701f60baf69da7fc0d0ea7 WHIRLPOOL 85cd375e1b67bbabe9a8119affec20b7a9a258f8b5be89d755f7ea596a94f98df053e8ade33f1aba1f74f753dcb636268c4f2074a09eaf68d858241f1482552c
+DIST NVIDIA-Linux-x86-331.113.run 37300924 SHA256 42535a99ab68452d30d9c3fad2fb162db01d1f6821115a3c1733ed203efd588b SHA512 bc820609e0379cc5805a5428cc364795b8a5d9e5a2a4395a1ddaa1dda85e6acc59368f87f5974a39fb42bd272458627b2c742fbf1f7fedddb17102439883b111 WHIRLPOOL 1d7b5cb8be5bb76dbe1b238aab4e39ccda0e5b07da268f0652966e79d5e0d2192773316d8f22a2d6a551305b17b610242918822e94e43263c9dbfba8a48bf49b
+DIST NVIDIA-Linux-x86-340.76.run 38818911 SHA256 9b29d93b49009caed84a8852825c3e7c6ebbbba8ec99b03ee5113108c8b036d0 SHA512 45d7b29670f9ca50de80d6d61260015b45f74422bbd12039923d04ae8b033b903b27e9f4c174461055f3cf45a4af44565ce9a8b9cd671e0e54d37770a1156839 WHIRLPOOL da7e072a56e3aff8b4688e60c5acd76c97804fa582d21c70dce043b13fa2317d1021f19927e827cf6132aebe2d40371c750e3eb56697bc7eda16bb7369bf2994
+DIST NVIDIA-Linux-x86-343.36.run 41073259 SHA256 8cc1c99fbda29b3258f57dbdacef11921aca2e3ac106ef591f0815716e1b829e SHA512 a6287cf8ad6379daa7c6d7ae6bc08f9985ad9e9353de6d88eb72d8a1acad3e25eb65076b904152c6ddd8ac54b9afcdbb7a5dfb9a46e75c5654be87b3df0e48e1 WHIRLPOOL 7aaa7977a850314045bcfcc36a8f6ed8b3f487ec972e109ea48cbe3edda4ff29c0bf02e7c11dacf6a3e71783259dc809840c32e301aa16f2d4394d7f07cffc0a
+DIST NVIDIA-Linux-x86-346.87.run 41303879 SHA256 0050d31e3c9d91d2372ddfe05ad7e217cdb68cd65aad60406a0c7ea878793999 SHA512 10b923847571576fbe31a037a16bdbaf9bac38caa7b380c12805f60163d6b0a359465e0d6acfa869c72dae701f62eb416b5874872e5cc34ae6cb5659ea899231 WHIRLPOOL ea7bc4cc1d70160f42bfcc082acbc00d39112d66e03f0b6cf17294cf9ac9b543e5242ddba3286eb3eff0f32d37227f40016dd40cf5e34ff1b26640bbba88f58b
+DIST NVIDIA-Linux-x86-349.16.run 42751511 SHA256 35c8d00ece6a450e8e72aac2bff45e89ce40ffbe3278802e8a0b4ff65c793d11 SHA512 d3609c4ccfbf6b005a8c58dc5bc3091c7b603229bb27bf48c545fafd9d7175a06ab4d5b414586a5234f2699bed4f613b809c058dff4e1f5fe4416adc53c4d3ab WHIRLPOOL ff4ff2f83e50c6675ec35035a2bd0d534acfb2f8fbb4d5b2d00770dae3b4f48db83fa789c57a6f958f13d8bdbb68971c5ba10cf2fc7b0c4a5a8cb836a09d4586
+DIST NVIDIA-Linux-x86-352.30.run 42931523 SHA256 563eb858584f3eec38f137055039cd4addc7bb4c8f47f90e87a0cc1f88db32e3 SHA512 53f03aa6bd0162d5cc068f4626f465a4a2f79c56609d8d3a86999f4cfcb4113752598337a0b893c6005b529924b677a0fd43c4e9e782b7e6e7d3d50337a07fc7 WHIRLPOOL ca56068eb5dd45b081634cabea1e9f96c54d388de79a19d7237059c45ee110118decb5a8d658605b65517ac39adae623b2c366e5d7bec219c8b9169ee71d7767
+DIST NVIDIA-Linux-x86-355.06.run 42921947 SHA256 741ba8e974f0592d3a7940cc16f9ea7b69fe8f42908c8e81988b9814a74d7859 SHA512 9229747fcdb34fefe14a89e70cc41f476cadc491245d7bc50ff7ca8b484b41f94bd900f4910eba9b6183cb0ed872cafc8918bfde82975fed5c56612b545406e9 WHIRLPOOL 1af2fc985e59686b147d7506cafd9d9e8097f071a096af103c7ef7fd22a0f684abd6b6aa25b5e82edb488c7e901f5ee41d1f9d89998c9a6a65795884ca5e3979
+DIST NVIDIA-Linux-x86-96.43.23-pkg0.run 11504817 SHA256 51e6adf4ba73071622045fc37169f80db3ae3e784dff53b29d35146a04042142 SHA512 bed5726e57637481fe4e3c03a65ec14fe949f00860e729ebde408f4fd861d7bfdc296a78bc2f5d42e8b282db09f4bbde1e0545df7228fa20227080dc4b868ba7 WHIRLPOOL 6d4fd1786c11f4e326cc3101d0bb1a2f8b63c25c3dd59f10188f8355759e2861ce44fd53d60258b513d5a1d6124d0f91ba8edf4d3668b6feabfb3e8d585f14fe
+DIST NVIDIA-Linux-x86_64-173.14.39-pkg2.run 21100833 SHA256 15a953666d5681ba54c97498b578ffd286a1dc96d605f3b02110f3f99813100e SHA512 a65cd496e6ed57f771c3d99f37f616a1242d97844f6faef7a807825ad899c0e536a99fde397020839f0857883b934032f9491024f3047a6b06d3eea1f5d77713 WHIRLPOOL dc5f243b7d1de7e2d1b7f005e018a2940d63335b11a7c83c234b348b7a1839e9131169d2ea928bd8c2f549a4535149b03e16e6c94d59dfa745f7f904ff790a45
+DIST NVIDIA-Linux-x86_64-304.125.run 69108272 SHA256 c654889b85a18326f2c610260a8fbc3b1bb6f9b8be1c052a46a213f60bd62262 SHA512 75bd5700281b0aa4e19be5b779e3484711ce3db92641a32f3bf5e890601b353b23113f6218d5a2fa6b2c8d93702fac92810013c7c0f8efe484b0a39d09b1b073 WHIRLPOOL d8b9794253b1ab270680da7420f50df5ab6aa4d5123bad695be5b7891b2df55bf06ecdd0b221fd29e799077c0a64da8059df16ebea9a3535e402f2c0cf482dcf
+DIST NVIDIA-Linux-x86_64-331.113.run 60509547 SHA256 e9d5eb4394ef31825f7a86290b19b522851d1b599284095d81bac0f33a996219 SHA512 f71f3d20016bebe4e7f83704a7539f0d53c92a2598a34f9f48ad421e5743ef554aa97315f2a762f132b730b1f37c5811aa617fed3c5a90d3e2e9cc5320e366b7 WHIRLPOOL 2f06c45cb4750eb5c7d6a2ff4e4c3abaf813df135da13691f30238baf89c2fa1477d5694088f268d8681cf719889b9e2644fc1d707785113703cd2e4d7c0b27f
+DIST NVIDIA-Linux-x86_64-340.76.run 69955037 SHA256 3bf670e9a2bdb184648dec54ce06fab65e798a9a4c9dd5155e2be4efee3e0994 SHA512 59ad49a49f170ec971e2b5ee3a45b9f972521bc4b7ab6f02f46a5cfc5b1998841195cc5c91dffc417d2183de39c5a589eabf7b48864e0c6842363a75051db40c WHIRLPOOL 8c846f2b5b6f56bd2962fe4660751a4485e0ddd2186bde0affccece32271b03f4f3c226377c0b1877ea391ab130ed6f282c316f227205488a63e4f0a19db82cc
+DIST NVIDIA-Linux-x86_64-343.36.run 73775989 SHA256 2285efa2c0e6675d8724e47a09403630a674c32e514bdcfb54cec3c81810fc78 SHA512 6e76e54b24b0c1fa16e94eaf0f99d2e7dfd28e5aaae0bcb6df3e6d4e20c7a13d5d30902e2bc9bc7609c8d87e5ec8fbf16a5a2dd513bb9d761714176c4ce5e283 WHIRLPOOL 73040a3f3073486c5d6d0a5d84be7d478a3c15bb4aee21f3c590592afe2845f8e9c7064010ddc8f93b764e48940e523952abf9978d09cd32ec1ce8b644e59eb6
+DIST NVIDIA-Linux-x86_64-346.87.run 74056785 SHA256 908446b20c9992cc6a7700866d36c13d9f53646837842d096d91b35644ee4e31 SHA512 fa192cd5b1dc44bcf23abd188b3fa292ad04cf8cc6b10042c465f10371db55e7218bd37e3101309a9b4c7e58b863c26526d33966a57ea7761d75dc04d382a119 WHIRLPOOL 6666aedd8ceffa0694ecb884e548db32899f3372b14b4fefba05ff4361655c4a1b4ff5d6b9a3ac7f354f140511fb11be01e287cb7efcdee6dcbe95bf5d6f5a75
+DIST NVIDIA-Linux-x86_64-349.16.run 77513301 SHA256 f980b22729b20c9eb3a3a800af524da181afbc78e2409a3f83845894983f8322 SHA512 143999f5401ac8634049786073203fab7e8d23dc9e0d4d62d4c6ba9945c20f7d4034c37d0f721aae540503f6bcffbf200a0af70520ae7ee10a2529ed92a14866 WHIRLPOOL 9a6817c03d11253ed606294d2cc2b5f2c4c612af2f8b6f72228a9e21d4991f8bcf248a28ff70d6f477860a64bcf795ec0ee2f73c34904e5cdf0979d41e370042
+DIST NVIDIA-Linux-x86_64-352.30.run 77669309 SHA256 4c5fb75ba94c97b6d70ddb9ea2cb11b5ed01829b5f671d9e8abce7afba20aef5 SHA512 165d2053ffb6f9251b3dbff7516541f363c460397cb0c83e4e867a9df4202082e524c8afc25402bd97d7f7ec769ec00fbec041070ee59ea88908d9f55aaeb2b7 WHIRLPOOL dc9e6abee93c49be6096e86e68a880727dcfb92b311fefac3b2e5b88d17d795e615c6cba0e5db32ce4ed4ec462a46ca659516e707e378d30f4543e6a67975852
+DIST NVIDIA-Linux-x86_64-355.06.run 75926474 SHA256 898304e1455bbccad4a3da3520d7fe17db254413f3458d0a296b45fb9cf2bcd6 SHA512 e9c617c2877ba9049f1242664dc6796c09714c495dbe7ec7705fdaf788c0ab11f35cb7a48058670ab4a56d777b7e02bc1e1f7b90959e4f1dd687a8f2f805f8a4 WHIRLPOOL 909025e9a4705a6ae1be9d1572c0491fdeeb708b3746fd2b2b38ab7e34d37c54f279861c8b33d36a71dd173ec15937b050bbc4c8c554dbeb60174348e005f201
+DIST NVIDIA-Linux-x86_64-96.43.23-pkg2.run 15962375 SHA256 ce8d8253e7dab7da63fbdac449ebf190cd0c10cbfffea0f8d0165515f851bc64 SHA512 04bec1187a6024a2b9839f008ec829281f1f2602dae2e639030bc385943186506bcaa2b46a230b2ab87f9217190841abc62f9e2d6395ab5559623389c31c6563 WHIRLPOOL 0651c44a51a1a06fcff5bfddbf9c3e408977e03263c7fe806cb6c01f9fe92f716dfe4e5190ffe1048bde72fcffdc8bca8267e74dd43ba5c9dfb22b6201fcc2bb
diff --git a/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist b/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist
new file mode 100644
index 000000000000..5e139de33211
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/50nvidia-prelink-blacklist
@@ -0,0 +1 @@
+PRELINK_PATH_MASK="/usr/lib{,64}/tls/libnvidia-tls*:/usr/lib{,64}/libnvidia*:/usr/lib{,64}/libGL*:/usr/lib{,64}/opengl/nvidia/*:/usr/lib{,64}/OpenCL/vendors/nvidia/*:/usr/lib{,64}/xorg/modules/drivers/nvidia*:/usr/lib{,64}/libvdpau_nvidia*:/usr/lib{,64}/libXvMCNVIDIA*:/usr/lib{,64}/libcuda*:/usr/lib{,64}/libnvcuvid*"
diff --git a/x11-drivers/nvidia-drivers/files/95-nvidia-settings b/x11-drivers/nvidia-drivers/files/95-nvidia-settings
new file mode 100644
index 000000000000..e9d62742e1e9
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/95-nvidia-settings
@@ -0,0 +1,2 @@
+#!/bin/sh
+/opt/bin/nvidia-settings --load-config-only
diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch
new file mode 100644
index 000000000000..da9933f6337c
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-defines.patch
@@ -0,0 +1,11 @@
+diff -ur NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h
+--- NVIDIA_GLX-1.0-4191/usr/include/GL/glx.h 2002-12-09 21:26:55.000000000 +0100
++++ NVIDIA_GLX-1.0-4191.new/usr/include/GL/glx.h 2003-01-30 18:20:23.000000000 +0100
+@@ -39,6 +39,7 @@
+ typedef XID GLXPixmap;
+ typedef XID GLXDrawable;
+ typedef XID GLXPbuffer;
++typedef XID GLXPbufferSGIX;
+ typedef XID GLXWindow;
+ typedef XID GLXFBConfigID;
+
diff --git a/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch
new file mode 100644
index 000000000000..e0393e1b9ab0
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/NVIDIA_glx-glheader.patch
@@ -0,0 +1,13 @@
+--- usr/include/GL/gl.g.orig 2004-07-17 19:56:59.789410584 +1000
++++ usr/include/GL/gl.h 2004-07-17 19:59:08.844791184 +1000
+@@ -66,6 +66,10 @@
+ typedef double GLclampd;
+ typedef void GLvoid;
+
++/* Patching for some better defines in the global system */
++#ifndef GL_GLEXT_LEGACY
++#include <GL/glext.h>
++#endif
+
+ /*************************************************************/
+
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-169.07 b/x11-drivers/nvidia-drivers/files/nvidia-169.07
new file mode 100644
index 000000000000..a96b0cd1e40f
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-169.07
@@ -0,0 +1,14 @@
+# Nvidia drivers support
+alias char-major-195 nvidia
+alias /dev/nvidiactl char-major-195
+
+# To tweak the driver the following options can be used, note that
+# you should be careful, as it could cause instability!! For more
+# options see /usr/share/doc/PACKAGE/README
+#
+# !!! SECURITY WARNING !!!
+# DO NOT MODIFY OR REMOVE THE DEVICE FILE RELATED OPTIONS UNLESS YOU KNOW
+# WHAT YOU ARE DOING.
+# ONLY ADD TRUSTED USERS TO THE VIDEO GROUP, THESE USERS MAY BE ABLE TO CRASH,
+# COMPROMISE, OR IRREPARABLY DAMAGE THE MACHINE.
+options nvidia NVreg_DeviceFileMode=432 NVreg_DeviceFileUID=0 NVreg_DeviceFileGID=VIDEOGID NVreg_ModifyDeviceFiles=1
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch
new file mode 100644
index 000000000000..9777ce6c2d43
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-331.13-pax-usercopy.patch
@@ -0,0 +1,52 @@
+--- a/kernel/nv-linux.h
++++ b/kernel/nv-linux.h
+@@ -757,16 +757,16 @@
+
+ #if defined(NV_KMEM_CACHE_CREATE_PRESENT)
+ #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6)
+-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \
++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \
+ { \
+ kmem_cache = kmem_cache_create(name, sizeof(type), \
+- 0, 0, NULL, NULL); \
++ 0, flags, NULL, NULL); \
+ }
+ #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
+-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \
++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \
+ { \
+ kmem_cache = kmem_cache_create(name, sizeof(type), \
+- 0, 0, NULL); \
++ 0, flags, NULL); \
+ }
+ #else
+ #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!"
+--- a/kernel/nv.c
++++ b/kernel/nv.c
+@@ -794,7 +794,7 @@
+ NV_SPIN_LOCK_INIT(&km_lock);
+ #endif
+
+- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t, SLAB_USERCOPY);
+ if (nv_stack_t_cache == NULL)
+ {
+ nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
+@@ -924,7 +924,7 @@
+ nv->os_state = (void *) &nv_ctl_device;
+ nv_lock_init_locks(nv);
+
+- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, NV_PTE_CACHE_STR, nv_pte_t);
++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, NV_PTE_CACHE_STR, nv_pte_t, 0);
+ if (nv_pte_t_cache == NULL)
+ {
+ rc = -ENOMEM;
+@@ -935,7 +935,7 @@
+ if (NV_BUILD_MODULE_INSTANCES == 0)
+ {
+ NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t",
+- nvidia_p2p_page_t);
++ nvidia_p2p_page_t, 0);
+ if (nvidia_p2p_page_t_cache == NULL)
+ {
+ rc = -ENOMEM;
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch
new file mode 100644
index 000000000000..0ec9edf99cc8
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-337.12-pax-constify.patch
@@ -0,0 +1,25 @@
+--- a/kernel/uvm/nvidia_uvm_common.c
++++ b/kernel/uvm/nvidia_uvm_common.c
+@@ -95,7 +95,6 @@ static RM_STATUS uvmnext_gpu_event_stop_
+ #endif // NVIDIA_UVM_NEXT_ENABLED
+
+ static dev_t g_uvmBaseDev;
+-struct UvmOpsUvmEvents g_exportedUvmOps;
+
+ // TODO: This would be easier if RM allowed for multiple registrations, since we
+ // could register UVM-Lite and UVM-Next separately (bug 1372835).
+@@ -147,9 +146,11 @@ static RM_STATUS uvmSetupGpuProvider(voi
+ RM_STATUS status = RM_OK;
+
+ #ifdef NVIDIA_UVM_RM_ENABLED
+- g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
+- g_exportedUvmOps.stopDevice = uvm_gpu_event_stop_device;
+- g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half;
++ static struct UvmOpsUvmEvents g_exportedUvmOps = {
++ .startDevice = uvm_gpu_event_start_device,
++ .stopDevice = uvm_gpu_event_stop_device,
++ .isrTopHalf = uvmnext_isr_top_half,
++ };
+
+ // call RM to exchange the function pointers.
+ status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch
new file mode 100644
index 000000000000..9b9f53e45dcc
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-constify.patch
@@ -0,0 +1,25 @@
+--- a/kernel/uvm/uvm_common.c
++++ b/kernel/uvm/uvm_common.c
+@@ -95,7 +95,6 @@ static RM_STATUS uvmnext_gpu_event_stop_
+ #endif // NVIDIA_UVM_NEXT_ENABLED
+
+ static dev_t g_uvmBaseDev;
+-struct UvmOpsUvmEvents g_exportedUvmOps;
+
+ // TODO: This would be easier if RM allowed for multiple registrations, since we
+ // could register UVM-Lite and UVM-Next separately (bug 1372835).
+@@ -147,9 +146,11 @@ static RM_STATUS uvmSetupGpuProvider(voi
+ RM_STATUS status = RM_OK;
+
+ #ifdef NVIDIA_UVM_RM_ENABLED
+- g_exportedUvmOps.startDevice = uvm_gpu_event_start_device;
+- g_exportedUvmOps.stopDevice = uvm_gpu_event_stop_device;
+- g_exportedUvmOps.isrTopHalf = uvmnext_isr_top_half;
++ static struct UvmOpsUvmEvents g_exportedUvmOps = {
++ .startDevice = uvm_gpu_event_start_device,
++ .stopDevice = uvm_gpu_event_stop_device,
++ .isrTopHalf = uvmnext_isr_top_half,
++ };
+
+ // call RM to exchange the function pointers.
+ status = nvUvmInterfaceRegisterUvmCallbacks(&g_exportedUvmOps);
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch
new file mode 100644
index 000000000000..d1a440c94aae
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-346.16-pax-usercopy.patch
@@ -0,0 +1,47 @@
+--- a/kernel/nv.c
++++ b/kernel/nv.c
+@@ -705,7 +705,7 @@ int __init nvidia_init_module(void)
+ #endif
+
+ nvidia_stack_t_cache = NV_KMEM_CACHE_CREATE(nvidia_stack_cache_name,
+- nvidia_stack_t);
++ nvidia_stack_t, SLAB_USERCOPY);
+ if (nvidia_stack_t_cache == NULL)
+ {
+ nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
+@@ -846,7 +846,7 @@ int __init nvidia_init_module(void)
+ nv_lock_init_locks(nv);
+
+ nvidia_pte_t_cache = NV_KMEM_CACHE_CREATE(nvidia_pte_cache_name,
+- nvidia_pte_t);
++ nvidia_pte_t, 0);
+ if (nvidia_pte_t_cache == NULL)
+ {
+ rc = -ENOMEM;
+@@ -857,7 +857,7 @@ int __init nvidia_init_module(void)
+ if (!nv_multiple_kernel_modules)
+ {
+ nvidia_p2p_page_t_cache = NV_KMEM_CACHE_CREATE(nvidia_p2p_page_cache_name,
+- nvidia_p2p_page_t);
++ nvidia_p2p_page_t, 0);
+ if (nvidia_p2p_page_t_cache == NULL)
+ {
+ rc = -ENOMEM;
+--- a/kernel/nv-linux.h
++++ b/kernel/nv-linux.h
+@@ -1431,11 +1431,11 @@ extern void *nvidia_stack_t_cache;
+
+ #if !defined(NV_VMWARE)
+ #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
+-#define NV_KMEM_CACHE_CREATE(name, type) \
+- kmem_cache_create(name, sizeof(type), 0, 0, NULL)
++#define NV_KMEM_CACHE_CREATE(name, type, flags) \
++ kmem_cache_create(name, sizeof(type), 0, flags, NULL)
+ #else
+-#define NV_KMEM_CACHE_CREATE(name, type) \
+- kmem_cache_create(name, sizeof(type), 0, 0, NULL, \
++#define NV_KMEM_CACHE_CREATE(name, type, flags) \
++ kmem_cache_create(name, sizeof(type), 0, flags, NULL, \
+ NULL)
+ #endif
+ #define NV_KMEM_CACHE_DESTROY(kmem_cache) \
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch
new file mode 100644
index 000000000000..f3b82593570e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-const.patch
@@ -0,0 +1,17 @@
+Binary files kernel.orig/.nv-procfs.c.swp and kernel/.nv-procfs.c.swp differ
+diff -urp kernel.orig/nv-procfs.c kernel/nv-procfs.c
+--- kernel.orig/nv-procfs.c 2011-07-13 03:29:30.000000000 +0200
++++ kernel/nv-procfs.c 2011-07-19 15:45:27.982993911 +0200
+@@ -707,8 +707,10 @@ int nv_register_procfs(void)
+ * However, in preparation for this, we need to preserve
+ * the procfs read() and write() operations.
+ */
+- nv_procfs_registry_fops.read = entry->proc_fops->read;
+- nv_procfs_registry_fops.write = entry->proc_fops->write;
++ pax_open_kernel();
++ *(void **)&nv_procfs_registry_fops.read = entry->proc_fops->read;
++ *(void **)&nv_procfs_registry_fops.write = entry->proc_fops->write;
++ pax_close_kernel();
+
+ entry = NV_CREATE_PROC_FILE("registry", proc_nvidia,
+ nv_procfs_read_registry,
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch
new file mode 100644
index 000000000000..ce8c201b8e05
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-pax-usercopy.patch
@@ -0,0 +1,54 @@
+diff -urp kernel.orig/nv.c kernel/nv.c
+--- kernel.orig/nv.c 2011-09-24 02:32:09.000000000 +0200
++++ kernel/nv.c 2011-10-05 19:13:41.474242252 +0200
+@@ -1105,7 +1105,7 @@ static int __init nvidia_init_module(voi
+ NV_SPIN_LOCK_INIT(&km_lock);
+ #endif
+
+- NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t);
++ NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY);
+ if (nv_stack_t_cache == NULL)
+ {
+ nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
+@@ -1220,7 +1220,7 @@ static int __init nvidia_init_module(voi
+ }
+ #endif
+
+- NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t);
++ NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0);
+ if (nv_pte_t_cache == NULL)
+ {
+ rc = -ENOMEM;
+@@ -1229,7 +1229,7 @@ static int __init nvidia_init_module(voi
+ }
+
+ NV_KMEM_CACHE_CREATE(nvidia_p2p_page_t_cache, "nvidia_p2p_page_t",
+- nvidia_p2p_page_t);
++ nvidia_p2p_page_t, 0);
+ if (nvidia_p2p_page_t_cache == NULL)
+ {
+ rc = -ENOMEM;
+diff -urp kernel.orig/nv-linux.h kernel/nv-linux.h
+--- kernel.orig/nv-linux.h 2011-09-24 02:32:09.000000000 +0200
++++ kernel/nv-linux.h 2011-10-05 19:14:42.522238996 +0200
+@@ -695,16 +695,16 @@ extern nv_spinlock_t km_lock;
+
+ #if defined(NV_KMEM_CACHE_CREATE_PRESENT)
+ #if (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 6)
+-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \
++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \
+ { \
+ kmem_cache = kmem_cache_create(name, sizeof(type), \
+- 0, 0, NULL, NULL); \
++ 0, flags, NULL, NULL); \
+ }
+ #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
+-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type) \
++#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags) \
+ { \
+ kmem_cache = kmem_cache_create(name, sizeof(type), \
+- 0, 0, NULL); \
++ 0, flags, NULL); \
+ }
+ #else
+ #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!"
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop
new file mode 100644
index 000000000000..773a5af24668
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-settings.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=NVIDIA X Server Settings
+Comment=Configure NVIDIA X Server Settings
+Exec=/opt/bin/nvidia-settings
+Icon=nvidia-drivers-settings
+Categories=System;Settings;
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf
new file mode 100644
index 000000000000..637ac1afb415
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.conf
@@ -0,0 +1,8 @@
+# run-time configuration file for /etc/init.d/nvidia-persistenced
+
+# NVPD_USER: The user nvidia-persistenced is intended to run for
+NVPD_USER=""
+
+# ARGS: Additional arguments to set the default persistence mode
+# (see nvidia-persistenced(1))
+ARGS=""
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init
new file mode 100755
index 000000000000..07f690547b42
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-persistenced.init
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/var/run/nvidia-persistenced/nvidia-persistenced.pid"
+
+start() {
+ if ! [ "${NVPD_USER}x" = x ]; then
+ ebegin "Starting nvidia-persistenced for ${NVPD_USER}"
+ NVPD_USER_ARG="--user ${NVPD_USER}"
+ else
+ ebegin "Starting nvidia-persistenced"
+ fi
+ start-stop-daemon --start --quiet --pidfile ${pidfile} \
+ --background --exec /opt/bin/nvidia-persistenced \
+ -- ${NVPD_USER_ARG} ${ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping nvidia-persistenced"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-smi.init b/x11-drivers/nvidia-drivers/files/nvidia-smi.init
new file mode 100644
index 000000000000..6dce4e846394
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-smi.init
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+pidfile="/run/nvidia-smi.pid"
+
+depend() {
+ after modules
+}
+
+start() {
+ ebegin "Starting NVIDIA System Management Interface"
+ rm -f ${pidfile}
+ start-stop-daemon --start --quiet --pidfile ${pidfile} \
+ --make-pidfile --background --exec /opt/bin/nvidia-smi -- \
+ -q -l 300
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping NVIDIA System Management Interface"
+ start-stop-daemon --stop --quiet --pidfile ${pidfile}
+ eend $?
+}
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-udev.sh b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh
new file mode 100644
index 000000000000..9487b08e7a5e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-udev.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+if [ $# -ne 1 ]; then
+ echo "Invalid args" >&2
+ exit 1
+fi
+
+case $1 in
+ add|ADD)
+ /opt/bin/nvidia-smi > /dev/null
+ ;;
+ remove|REMOVE)
+ rm -f /dev/nvidia*
+ ;;
+esac
+
+exit 0
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf b/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf
new file mode 100644
index 000000000000..222c5ba39265
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-uvm.conf
@@ -0,0 +1,3 @@
+# Nvidia UVM support
+
+remove nvidia modprobe -r --ignore-remove nvidia-uvm nvidia
diff --git a/x11-drivers/nvidia-drivers/files/nvidia.udev-rule b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule
new file mode 100644
index 000000000000..2eb30bb0eba5
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia.udev-rule
@@ -0,0 +1,6 @@
+ACTION=="add", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}"
+# Previously the ACTION was "add|remove" but one user on bug #376527 had a
+# problem until he recompiled udev-171-r5, which is one of the versions I
+# tested with and it was fine. I'm breaking the rules out just to be safe
+# so someone else doesn't have an issue
+ACTION=="remove", DEVPATH=="/module/nvidia", SUBSYSTEM=="module", RUN+="nvidia-udev.sh $env{ACTION}"
diff --git a/x11-drivers/nvidia-drivers/metadata.xml b/x11-drivers/nvidia-drivers/metadata.xml
new file mode 100644
index 000000000000..d4fc77506799
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>jer@gentoo.org</email>
+</maintainer>
+<use>
+ <flag name='X'>Install the X.org driver, OpenGL libraries, XvMC libraries, and VDPAU libraries</flag>
+ <flag name='gtk2'>Install nvidia-settings with support for GTK+ 2</flag>
+ <flag name='gtk3'>Install nvidia-settings with support for GTK+ 3</flag>
+ <flag name='pax_kernel'>PaX patches from the PaX project</flag>
+ <flag name='tools'>Install additional tools such as nvidia-settings</flag>
+ <flag name='uvm'>Install the Unified Memory kernel module (nvidia-uvm) for sharing memory between CPU and GPU in CUDA programs</flag>
+</use>
+</pkgmetadata>
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.39.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.39.ebuild
new file mode 100644
index 000000000000..b1a361d5fa92
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-173.14.39.ebuild
@@ -0,0 +1,546 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-mod multilib nvidia-driver portability \
+ unpacker user versionator
+
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run )
+ amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run )
+ x86-fbsd? ( http://us.download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
+
+LICENSE="GPL-2 NVIDIA-r1"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~x86-fbsd"
+IUSE="acpi multilib kernel_linux tools"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+ >=app-eselect/eselect-opengl-1.0.9
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+"
+DEPEND="
+ ${COMMON}
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ <x11-base/xorg-server-1.15.99:=
+ acpi? ( sys-power/acpid )
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+"
+
+QA_TEXTRELS_x86="usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+ usr/lib/libcuda.so.${PV}
+ usr/lib/libnvidia-cfg.so.${PV}
+ usr/lib/libvdpau_nvidia.so.${PV}
+ usr/lib/libXvMCNVIDIA.so.${PV}"
+
+QA_TEXTRELS_x86_fbsd="boot/modules/nvidia.ko
+ usr/lib/opengl/nvidia/lib/libGL.so.1
+ usr/lib/opengl/nvidia/lib/libGLcore.so.1
+ usr/lib/libnvidia-cfg.so.1
+ usr/lib/opengl/nvidia/extensions/libglx.so.1
+ usr/lib/xorg/modules/drivers/nvidia_drv.so"
+
+QA_TEXTRELS_amd64="usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib32/libcuda.so.${PV}
+ usr/lib32/libvdpau_nvidia.so.${PV}"
+
+QA_EXECSTACK_x86="usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+ usr/lib/libXvMCNVIDIA.a:NVXVMC.o"
+
+QA_EXECSTACK_amd64="usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/libnvcompiler.so.${PV}
+ usr/lib64/libXvMCNVIDIA.so.${PV}
+ usr/lib64/libXvMCNVIDIA.a:NVXVMC.o
+ usr/lib64/libnvidia-cfg.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib64/xorg/modules/drivers/nvidia_drv.so
+ opt/bin/nvidia-settings
+ opt/bin/nvidia-smi
+ opt/bin/nvidia-xconfig"
+
+QA_WX_LOAD_x86="usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/libXvMCNVIDIA.a"
+
+QA_WX_LOAD_amd64="usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}"
+
+QA_SONAME_amd64="usr/lib64/libnvcompiler.so.${PV}"
+
+QA_FLAGS_IGNORED_amd64="usr/lib32/libcuda.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib32/libvdpau_nvidia.so.${PV}
+ usr/lib64/libXvMCNVIDIA.so.${PV}
+ usr/lib64/libcuda.so.${PV}
+ usr/lib64/libnvidia-cfg.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib64/xorg/modules/drivers/nvidia_drv.so
+ usr/lib64/libvdpau_nvidia.so.${PV}
+ opt/bin/nvidia-settings
+ opt/bin/nvidia-smi
+ opt/bin/nvidia-xconfig"
+
+QA_FLAGS_IGNORED_x86="usr/lib/libcuda.so.${PV}
+ usr/lib/libnvidia-cfg.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+ usr/lib/libXvMCNVIDIA.so.${PV}
+ usr/lib/libvdpau_nvidia.so.${PV}
+ opt/bin/nvidia-settings
+ opt/bin/nvidia-smi
+ opt/bin/nvidia-xconfig"
+
+S="${WORKDIR}/"
+
+mtrr_check() {
+ ebegin "Checking for MTRR support"
+ linux_chkconfig_present MTRR
+ eend $?
+
+ if [[ $? -ne 0 ]] ; then
+ eerror "Please enable MTRR support in your kernel config, found at:"
+ eerror
+ eerror " Processor type and features"
+ eerror " [*] MTRR (Memory Type Range Register) support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "MTRR support not detected!"
+ fi
+}
+
+lockdep_check() {
+ if linux_chkconfig_present LOCKDEP; then
+ eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
+ eerror "Unfortunately, this option exports the symbol 'lockdep_init_map' as GPL-only"
+ eerror "which will prevent ${P} from compiling."
+ eerror "Please make sure the following options have been unset:"
+ eerror " Kernel hacking --->"
+ eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
+ eerror " [ ] Lock debugging: prove locking correctness"
+ eerror " [ ] Lock usage statistics"
+ eerror "in 'menuconfig'"
+ die "LOCKDEP enabled"
+ fi
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default abi."
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux; then
+ linux-mod_pkg_setup
+ MODULE_NAMES="nvidia(video:${S}/usr/src/nv)"
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ mtrr_check
+ lockdep_check
+ fi
+
+ # On BSD userland it wants real make command
+ use userland_BSD && MAKE="$(get_bmake)"
+
+ export _POSIX2_VERSION="199209"
+
+ if use kernel_linux && kernel_is ge 3 13 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-3.13"
+ ewarn "<sys-kernel/vanilla-sources-3.13"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_EXEC="${S}/obj"
+ NV_LIB="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_X11_DRV="${NV_X11}"
+ NV_X11_EXT="${NV_X11}"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}/usr/share/doc"
+ NV_EXEC="${S}/usr/bin"
+ NV_LIB="${S}/usr/lib"
+ NV_SRC="${S}/usr/src/nv"
+ NV_MAN="${S}/usr/share/man/man1"
+ NV_X11="${S}/usr/X11R6/lib"
+ NV_X11_DRV="${NV_X11}/modules/drivers"
+ NV_X11_EXT="${NV_X11}/modules/extensions"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_unpack() {
+ if use kernel_linux && kernel_is lt 2 6 7; then
+ echo
+ ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
+ ewarn "This is not officially supported for ${P}. It is likely you"
+ ewarn "will not be able to compile or use the kernel module."
+ ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
+ echo
+ ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
+ fi
+
+ if ! use x86-fbsd; then
+ mkdir "${S}"
+ cd "${S}"
+ unpack_makeself
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+ use x86-fbsd && cd doc
+
+ # Use the correct defines to make gtkglext build work
+ epatch "${FILESDIR}"/NVIDIA_glx-defines.patch
+ # Use some more sensible gl headers and make way for new glext.h
+ epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch
+
+ if use kernel_linux; then
+ # Quiet down warnings the user does not need to see
+ sed -i \
+ -e 's:-Wpointer-arith::g' \
+ -e 's:-Wsign-compare::g' \
+ "${NV_SRC}"/Makefile.kbuild
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+ convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use x86-fbsd; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)"
+ elif use kernel_linux; then
+ linux-mod_src_compile
+ fi
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ elif use kernel_FreeBSD; then
+ insinto /boot/modules
+ doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld"
+
+ exeinto /boot/modules
+ doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER} || \
+ die "failed to install libnvidia-cfg"
+ dosym libnvidia-cfg.so.${NV_SOVER} \
+ /usr/$(get_libdir)/libnvidia-cfg.so.1 || \
+ die "failed to create libnvidia-cfg.so.1 symlink"
+ dosym libnvidia-cfg.so.1 \
+ /usr/$(get_libdir)/libnvidia-cfg.so || \
+ die "failed to create libnvidia-cfg.so symlink"
+
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11_DRV}/nvidia_drv.so
+
+ # Xorg GLX driver
+ insinto /usr/$(get_libdir)/opengl/nvidia/extensions
+ doins ${NV_X11_EXT}/libglx.so.${NV_SOVER} || \
+ die "failed to install libglx.so"
+ dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so || \
+ die "failed to create libglx.so symlink"
+
+ # XvMC driver
+ dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
+ die "failed to install libXvMCNVIDIA.so"
+ dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER} || \
+ die "failed to install libXvMCNVIDIA.so"
+ dosym libXvMCNVIDIA.so.${NV_SOVER} \
+ /usr/$(get_libdir)/libXvMCNVIDIA.so.1 || \
+ die "failed to create libXvMCNVIDIA.so.1 symlink"
+ dosym libXvMCNVIDIA.so.1 \
+ /usr/$(get_libdir)/libXvMCNVIDIA.so || \
+ die "failed to create libXvMCNVIDIA.so symlink"
+ dosym libXvMCNVIDIA.so.${NV_SOVER} \
+ /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
+ die "failed to create libXvMCNVIDIA_dynamic.so.1 symlink"
+
+ # CUDA headers (driver to come)
+ if use kernel_linux && [[ -d ${S}/usr/include/cuda ]]; then
+ dodir /usr/include/cuda
+ insinto /usr/include/cuda
+ doins usr/include/cuda/*.h
+ fi
+
+ # OpenCL headers (driver to come)
+ if [[ -d ${S}/usr/include/CL ]]; then
+ dodir /usr/include/CL
+ insinto /usr/include/CL
+ doins usr/include/CL/*.h
+ fi
+
+ # Documentation
+ dodoc ${NV_DOC}/XF86Config.sample
+ dohtml ${NV_DOC}/html/*
+ if use x86-fbsd; then
+ dodoc "${NV_DOC}/README"
+ doman "${NV_MAN}/nvidia-xconfig.1"
+ doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ doman "${NV_MAN}/nvidia-settings.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+ doexe ${NV_EXEC}/nvidia-xconfig
+ doexe ${NV_EXEC}/nvidia-bug-report.sh
+ if use tools; then
+ doexe usr/bin/nvidia-settings
+ fi
+ if use kernel_linux; then
+ doexe ${NV_EXEC}/nvidia-smi
+ fi
+
+ # Desktop entry for nvidia-settings
+ if use tools && use kernel_linux; then
+ sed -e 's:__UTILS_PATH__:/opt/bin:' \
+ -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
+ -e '/^Categories/s|Application;||g' \
+ -i "${S}"/usr/share/applications//nvidia-settings.desktop
+ newmenu "${S}"/usr/share/applications/nvidia-settings.desktop \
+ nvidia-settings-opt.desktop
+ fi
+
+ if has_multilib_profile ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+# Install nvidia library:
+# the first parameter is the place where to install it
+# the second parameter is the base name of the library
+# the third parameter is the provided soversion
+donvidia() {
+ dodir $1
+ exeinto $1
+
+ libname=$(basename $2)
+
+ doexe $2.$3
+ dosym ${libname}.$3 $1/${libname}
+ [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
+ local libdir= sover=
+
+ if use kernel_linux; then
+ if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
+ libdir=usr/lib32
+ else
+ libdir=usr/lib
+ fi
+ sover=${PV}
+ else
+ libdir=obj
+ # on FreeBSD it has just .1 suffix
+ sover=1
+ fi
+
+ # The GLX libraries
+ donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover}
+ donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover}
+ if use x86-fbsd; then
+ donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover}
+ else
+ donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover}
+ fi
+
+ #cuda
+ if [[ -f ${libdir}/libcuda.so.${sover} ]]; then
+ dolib.so ${libdir}/libcuda.so.${sover}
+ [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1
+ dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so
+ fi
+
+ #vdpau
+ if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then
+ dolib.so ${libdir}/libvdpau_nvidia.so.${sover}
+ dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so
+ fi
+
+ # OpenCL
+ # NOTE: This isn't currently available in the publicly released drivers.
+ if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then
+
+ dolib.so ${libdir}/libnvcompiler.so.${sover}
+ [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1
+ dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so
+
+ dolib.so ${libdir}/libOpenCL.so.1.0.0
+ dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1
+ dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ fi
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-304.125.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-304.125.ebuild
new file mode 100644
index 000000000000..d3ed1ff85026
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-304.125.ebuild
@@ -0,0 +1,457 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user versionator udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r1"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )"
+DEPEND="${COMMON}
+ kernel_linux? (
+ virtual/linux-sources
+ virtual/pkgconfig
+ )"
+RDEPEND="${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ x11-libs/pangox-compat
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ x11-libs/libXvMC
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+PDEPEND="X? ( >=x11-libs/libvdpau-0.3-r1 )"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 3 18 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-3.18"
+ ewarn "<sys-kernel/vanilla-sources-3.18"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ linux-mod_pkg_setup
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_unpack() {
+ if ! use kernel_FreeBSD; then
+ cd "${S}"
+ unpack_makeself
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+ convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-pax-const.patch
+ epatch "${FILESDIR}"/${PN}-pax-usercopy.patch
+ fi
+
+ cat <<- EOF > "${S}"/nvidia.icd
+ /usr/$(get_libdir)/libnvidia-opencl.so
+ EOF
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ MAKEOPTS=-j1 linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ if use kernel_linux; then
+ # NVIDIA video decode <-> CUDA
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+
+ # XvMC driver
+ dolib.a ${NV_X11}/libXvMCNVIDIA.a || \
+ die "failed to install libXvMCNVIDIA.so"
+ donvidia ${NV_X11}/libXvMCNVIDIA.so ${NV_SOVER}
+ dosym libXvMCNVIDIA.so.${NV_SOVER} \
+ /usr/$(get_libdir)/libXvMCNVIDIA_dynamic.so.1 || \
+ die "failed to create libXvMCNVIDIA_dynamic.so symlink"
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins nvidia.icd
+ donvidia ${NV_OBJ}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-proxy-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-cuda-proxy-control
+ doexe ${NV_OBJ}/nvidia-cuda-proxy-server
+ doexe ${NV_OBJ}/nvidia-smi
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER} ${GL_ROOT}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries, XvMC, and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild
new file mode 100644
index 000000000000..41d98c3ce48d
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-331.113.ebuild
@@ -0,0 +1,474 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X uvm"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 3 18 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-3.18"
+ ewarn "<sys-kernel/vanilla-sources-3.18"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_unpack() {
+ if use kernel_FreeBSD; then
+ unpack ${A}
+ elif use kernel_linux; then
+ cd "${S}"
+ unpack_makeself
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-337.12-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ use uvm && MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-340.76.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-340.76.ebuild
new file mode 100644
index 000000000000..baf8a371834f
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-340.76.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X uvm"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ >=x11-libs/gtk+-2.4:2
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 3 18 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-3.18"
+ ewarn "<sys-kernel/vanilla-sources-3.18"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-337.12-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ use uvm && MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ insinto /usr/share/nvidia/
+ doins nvidia-application-profiles-${PV}-key-documentation
+ insinto /etc/nvidia
+ newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+ # GLES v2 libraries
+ insinto ${GL_ROOT}
+ doexe ${libdir}/libGLESv2.so.${PV}
+ dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+ dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-343.36.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-343.36.ebuild
new file mode 100644
index 000000000000..baf8a371834f
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-343.36.ebuild
@@ -0,0 +1,479 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools +X uvm"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ >=x11-libs/gtk+-2.4:2
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+REQUIRED_USE="tools? ( X )"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 3 18 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-3.18"
+ ewarn "<sys-kernel/vanilla-sources-3.18"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-331.13-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-337.12-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ use uvm && MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ insinto /usr/share/nvidia/
+ doins nvidia-application-profiles-${PV}-key-documentation
+ insinto /etc/nvidia
+ newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+ # GLES v2 libraries
+ insinto ${GL_ROOT}
+ doexe ${libdir}/libGLESv2.so.${PV}
+ dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+ dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-346.87.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-346.87.ebuild
new file mode 100644
index 000000000000..e7cd202f2919
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-346.87.ebuild
@@ -0,0 +1,489 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X uvm"
+REQUIRED_USE="
+ tools? ( X || ( gtk2 gtk3 ) )
+"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ gtk2? ( >=x11-libs/gtk+-2.4:2 )
+ gtk3? ( x11-libs/gtk+:3 )
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 4 2 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-4.2"
+ ewarn "<sys-kernel/vanilla-sources-4.2"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+
+ # Xorg nvidia.conf
+ if has_version '>=x11-base/xorg-server-1.16'; then
+ insinto /usr/share/X11/xorg.conf.d
+ newins {,50-}nvidia-drm-outputclass.conf
+ fi
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ use gtk2 && donvidia libnvidia-gtk2.so ${PV}
+ use gtk3 && donvidia libnvidia-gtk3.so ${PV}
+ insinto /usr/share/nvidia/
+ doins nvidia-application-profiles-${PV}-key-documentation
+ insinto /etc/nvidia
+ newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+ # GLES v2 libraries
+ insinto ${GL_ROOT}
+ doexe ${libdir}/libGLESv2.so.${PV}
+ dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+ dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-349.16.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-349.16.ebuild
new file mode 100644
index 000000000000..a7432941a883
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-349.16.ebuild
@@ -0,0 +1,489 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X uvm"
+REQUIRED_USE="
+ tools? ( X || ( gtk2 gtk3 ) )
+"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ gtk2? ( >=x11-libs/gtk+-2.4:2 )
+ gtk3? ( x11-libs/gtk+:3 )
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 4 1 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-4.1"
+ ewarn "<sys-kernel/vanilla-sources-4.1"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+
+ # Xorg nvidia.conf
+ if has_version '>=x11-base/xorg-server-1.16'; then
+ insinto /usr/share/X11/xorg.conf.d
+ newins {,50-}nvidia-drm-outputclass.conf
+ fi
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ use gtk2 && donvidia libnvidia-gtk2.so ${PV}
+ use gtk3 && donvidia libnvidia-gtk3.so ${PV}
+ insinto /usr/share/nvidia/
+ doins nvidia-application-profiles-${PV}-key-documentation
+ insinto /etc/nvidia
+ newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+ # GLES v2 libraries
+ insinto ${GL_ROOT}
+ doexe ${libdir}/libGLESv2.so.${PV}
+ dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+ dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-352.30.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-352.30.ebuild
new file mode 100644
index 000000000000..e7cd202f2919
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-352.30.ebuild
@@ -0,0 +1,489 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X uvm"
+REQUIRED_USE="
+ tools? ( X || ( gtk2 gtk3 ) )
+"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ gtk2? ( >=x11-libs/gtk+-2.4:2 )
+ gtk3? ( x11-libs/gtk+:3 )
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 4 2 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-4.2"
+ ewarn "<sys-kernel/vanilla-sources-4.2"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+ use uvm && MODULE_NAMES+=" nvidia-uvm(video:${S}/kernel/uvm)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9 ; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if its not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+ use uvm && doins "${FILESDIR}"/nvidia-uvm.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+
+ # Xorg nvidia.conf
+ if has_version '>=x11-base/xorg-server-1.16'; then
+ insinto /usr/share/X11/xorg.conf.d
+ newins {,50-}nvidia-drm-outputclass.conf
+ fi
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux ; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ use gtk2 && donvidia libnvidia-gtk2.so ${PV}
+ use gtk3 && donvidia libnvidia-gtk3.so ${PV}
+ insinto /usr/share/nvidia/
+ doins nvidia-application-profiles-${PV}-key-documentation
+ insinto /etc/nvidia
+ newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools ; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && \
+ [[ ${ABI} == "x86" ]] ; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ # The GLX libraries
+ donvidia ${libdir}/libEGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGL.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}
+ donvidia ${libdir}/libnvidia-eglcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glcore.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-glsi.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-ifr.so ${NV_SOVER}
+ if use kernel_FreeBSD; then
+ donvidia ${libdir}/libnvidia-tls.so ${NV_SOVER}
+ else
+ donvidia ${libdir}/tls/libnvidia-tls.so ${NV_SOVER}
+ fi
+
+ # VDPAU
+ donvidia ${libdir}/libvdpau_nvidia.so ${NV_SOVER}
+
+ # GLES v2 libraries
+ insinto ${GL_ROOT}
+ doexe ${libdir}/libGLESv2.so.${PV}
+ dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+ dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+ fi
+
+ # NVIDIA monitoring library
+ if use kernel_linux ; then
+ donvidia ${libdir}/libnvidia-ml.so ${NV_SOVER}
+ fi
+
+ # CUDA & OpenCL
+ if use kernel_linux; then
+ donvidia ${libdir}/libcuda.so ${NV_SOVER}
+ donvidia ${libdir}/libnvidia-compiler.so ${NV_SOVER}
+ donvidia ${libdir}/libOpenCL.so 1.0.0 ${CL_ROOT}
+ donvidia ${libdir}/libnvidia-opencl.so ${NV_SOVER}
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-355.06.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-355.06.ebuild
new file mode 100644
index 000000000000..8391d8443eb3
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-355.06.ebuild
@@ -0,0 +1,498 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit eutils flag-o-matic linux-info linux-mod multilib nvidia-driver \
+ portability toolchain-funcs unpacker user udev
+
+NV_URI="http://us.download.nvidia.com/XFree86/"
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+AMD64_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86_64-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="
+ amd64-fbsd? ( ${NV_URI}FreeBSD-x86_64/${PV}/${AMD64_FBSD_NV_PACKAGE}.tar.gz )
+ amd64? ( ${NV_URI}Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}.run )
+ x86-fbsd? ( ${NV_URI}FreeBSD-x86/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )
+ x86? ( ${NV_URI}Linux-x86/${PV}/${X86_NV_PACKAGE}.run )
+"
+
+LICENSE="GPL-2 NVIDIA-r2"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+IUSE="acpi multilib kernel_FreeBSD kernel_linux pax_kernel +tools gtk2 gtk3 +X"
+REQUIRED_USE="
+ tools? ( X || ( gtk2 gtk3 ) )
+"
+
+COMMON="
+ app-eselect/eselect-opencl
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ X? (
+ >=app-eselect/eselect-opengl-1.0.9
+ )
+"
+DEPEND="
+ ${COMMON}
+ app-arch/xz-utils
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="
+ ${COMMON}
+ acpi? ( sys-power/acpid )
+ tools? (
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ gtk2? ( >=x11-libs/gtk+-2.4:2 )
+ gtk3? ( x11-libs/gtk+:3 )
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ )
+ X? (
+ <x11-base/xorg-server-1.17.99:=
+ >=x11-libs/libvdpau-0.3-r1
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+ )
+"
+
+QA_PREBUILT="opt/* usr/lib*"
+
+S=${WORKDIR}/
+
+pkg_pretend() {
+ if use amd64 && has_multilib_profile && \
+ [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default ABI"
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux && kernel_is ge 4 2; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-4.2"
+ ewarn "<sys-kernel/vanilla-sources-4.2"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # Kernel features/options to check for
+ CONFIG_CHECK="~ZONE_DMA ~MTRR ~SYSVIPC ~!LOCKDEP"
+ use x86 && CONFIG_CHECK+=" ~HIGHMEM"
+
+ # Now do the above checks
+ use kernel_linux && check_extra_config
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use kernel_linux; then
+ MODULE_NAMES="nvidia(video:${S}/kernel)"
+
+ # This needs to run after MODULE_NAMES (so that the eclass checks
+ # whether the kernel supports loadable modules) but before BUILD_PARAMS
+ # is set (so that KV_DIR is populated).
+ linux-mod_pkg_setup
+
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC) NV_VERBOSE=1"
+
+ # linux-mod_src_compile calls set_arch_to_kernel, which
+ # sets the ARCH to x86 but NVIDIA's wrapping Makefile
+ # expects x86_64 or i386 and then converts it to x86
+ # later on in the build process
+ BUILD_FIXES="ARCH=$(uname -m | sed -e 's/i.86/i386/')"
+ fi
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ use amd64-fbsd && S="${WORKDIR}/${AMD64_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_OBJ="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}"
+ NV_OBJ="${S}"
+ NV_SRC="${S}/kernel"
+ NV_MAN="${S}"
+ NV_X11="${S}"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+
+ if use kernel_linux; then
+ if kernel_is lt 2 6 9; then
+ eerror "You must build this against 2.6.9 or higher kernels."
+ fi
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+# convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+
+ if use pax_kernel; then
+ ewarn "Using PAX patches is not supported. You will be asked to"
+ ewarn "use a standard kernel should you have issues. Should you"
+ ewarn "need support with these patches, contact the PaX team."
+ epatch "${FILESDIR}"/${PN}-346.16-pax-usercopy.patch
+ epatch "${FILESDIR}"/${PN}-346.16-pax-constify.patch
+ fi
+
+ # Allow user patches so they can support RC kernels and whatever else
+ epatch_user
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use kernel_FreeBSD; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ MAKEOPTS=-j1
+ linux-mod_src_compile
+ fi
+}
+
+# Install nvidia library:
+# the first parameter is the library to install
+# the second parameter is the provided soversion
+# the third parameter is the target directory if it is not /usr/lib
+donvidia() {
+ # Full path to library minus SOVER
+ MY_LIB="$1"
+
+ # SOVER to use
+ MY_SOVER="$2"
+
+ # Where to install
+ MY_DEST="$3"
+
+ if [[ -z "${MY_DEST}" ]]; then
+ MY_DEST="/usr/$(get_libdir)"
+ action="dolib.so"
+ else
+ exeinto ${MY_DEST}
+ action="doexe"
+ fi
+
+ # Get just the library name
+ libname=$(basename $1)
+
+ # Install the library with the correct SOVER
+ ${action} ${MY_LIB}.${MY_SOVER} || \
+ die "failed to install ${libname}"
+
+ # If SOVER wasn't 1, then we need to create a .1 symlink
+ if [[ "${MY_SOVER}" != "1" ]]; then
+ dosym ${libname}.${MY_SOVER} \
+ ${MY_DEST}/${libname}.1 || \
+ die "failed to create ${libname} symlink"
+ fi
+
+ # Always create the symlink from the raw lib to the .1
+ dosym ${libname}.1 \
+ ${MY_DEST}/${libname} || \
+ die "failed to create ${libname} symlink"
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ # Add the aliases
+ # This file is tweaked with the appropriate video group in
+ # pkg_preinst, see bug #491414
+ insinto /etc/modprobe.d
+ newins "${FILESDIR}"/nvidia-169.07 nvidia.conf
+
+ # Ensures that our device nodes are created when not using X
+ exeinto "$(get_udevdir)"
+ doexe "${FILESDIR}"/nvidia-udev.sh
+ udev_newrules "${FILESDIR}"/nvidia.udev-rule 99-nvidia.rules
+ elif use kernel_FreeBSD; then
+ if use x86-fbsd; then
+ insinto /boot/modules
+ doins "${S}/src/nvidia.kld"
+ fi
+
+ exeinto /boot/modules
+ doexe "${S}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ donvidia ${NV_OBJ}/libnvidia-cfg.so ${NV_SOVER}
+
+ # NVIDIA framebuffer capture library
+ donvidia ${NV_OBJ}/libnvidia-fbc.so ${NV_SOVER}
+
+ # NVIDIA video encode/decode <-> CUDA
+ if use kernel_linux; then
+ donvidia ${NV_OBJ}/libnvcuvid.so ${NV_SOVER}
+ donvidia ${NV_OBJ}/libnvidia-encode.so ${NV_SOVER}
+ fi
+
+ if use X; then
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11}/nvidia_drv.so
+
+ # Xorg GLX driver
+ donvidia ${NV_X11}/libglx.so ${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions
+
+ # Xorg nvidia.conf
+ if has_version '>=x11-base/xorg-server-1.16'; then
+ insinto /usr/share/X11/xorg.conf.d
+ newins {,50-}nvidia-drm-outputclass.conf
+ fi
+ fi
+
+ # OpenCL ICD for NVIDIA
+ if use kernel_linux; then
+ insinto /etc/OpenCL/vendors
+ doins ${NV_OBJ}/nvidia.icd
+ fi
+
+ # Documentation
+ dohtml ${NV_DOC}/html/*
+ if use kernel_FreeBSD; then
+ dodoc "${NV_DOC}/README"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1"
+ use tools && doman "${NV_MAN}/nvidia-settings.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+ doman "${NV_MAN}/nvidia-smi.1.gz"
+ use X && doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ use tools && doman "${NV_MAN}/nvidia-settings.1.gz"
+ doman "${NV_MAN}/nvidia-cuda-mps-control.1.gz"
+ fi
+
+ # Helper Apps
+ exeinto /opt/bin/
+
+ if use X; then
+ doexe ${NV_OBJ}/nvidia-xconfig
+ fi
+
+ if use kernel_linux; then
+ doexe ${NV_OBJ}/nvidia-cuda-mps-control
+ doexe ${NV_OBJ}/nvidia-cuda-mps-server
+ doexe ${NV_OBJ}/nvidia-debugdump
+ doexe ${NV_OBJ}/nvidia-persistenced
+ doexe ${NV_OBJ}/nvidia-smi
+
+ # install nvidia-modprobe setuid and symlink in /usr/bin (bug #505092)
+ doexe ${NV_OBJ}/nvidia-modprobe
+ fowners root:video /opt/bin/nvidia-modprobe
+ fperms 4710 /opt/bin/nvidia-modprobe
+ dosym /{opt,usr}/bin/nvidia-modprobe
+
+ doman nvidia-cuda-mps-control.1.gz
+ doman nvidia-modprobe.1.gz
+ doman nvidia-persistenced.1.gz
+ newinitd "${FILESDIR}/nvidia-smi.init" nvidia-smi
+ newconfd "${FILESDIR}/nvidia-persistenced.conf" nvidia-persistenced
+ newinitd "${FILESDIR}/nvidia-persistenced.init" nvidia-persistenced
+ fi
+
+ if use tools; then
+ doexe ${NV_OBJ}/nvidia-settings
+ use gtk2 && donvidia libnvidia-gtk2.so ${PV}
+ use gtk3 && donvidia libnvidia-gtk3.so ${PV}
+ insinto /usr/share/nvidia/
+ doins nvidia-application-profiles-${PV}-key-documentation
+ insinto /etc/nvidia
+ newins nvidia-application-profiles-${PV}-rc nvidia-application-profiles-rc
+ fi
+
+ dobin ${NV_OBJ}/nvidia-bug-report.sh
+
+ # Desktop entries for nvidia-settings
+ if use tools; then
+ # There is no icon in the FreeBSD tarball.
+ use kernel_FreeBSD || newicon ${NV_OBJ}/nvidia-settings.png ${PN}-settings.png
+ domenu "${FILESDIR}"/${PN}-settings.desktop
+ exeinto /etc/X11/xinit/xinitrc.d
+ doexe "${FILESDIR}"/95-nvidia-settings
+ fi
+
+ #doenvd "${FILESDIR}"/50nvidia-prelink-blacklist
+
+ if has_multilib_profile && use multilib; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis); do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local GL_ROOT="/usr/$(get_libdir)/opengl/nvidia/lib"
+ local CL_ROOT="/usr/$(get_libdir)/OpenCL/vendors/nvidia"
+ local libdir=${NV_OBJ}
+
+ if use kernel_linux && has_multilib_profile && [[ ${ABI} == "x86" ]]; then
+ libdir=${NV_OBJ}/32
+ fi
+
+ if use X; then
+ NV_GLX_LIBRARIES=(
+ "libEGL.so 1 ${GL_ROOT}"
+ "libEGL_nvidia.so 0 ${GL_ROOT}"
+ "libGL.so ${NV_SOVER} ${GL_ROOT}"
+ "libGLESv1_CM.so ${NV_SOVER} ${GL_ROOT}"
+ "libGLdispatch.so 0 ${GL_ROOT}"
+ "libOpenCL.so 1.0.0 ${GL_ROOT}"
+ "libOpenGL.so 0 ${GL_ROOT}"
+ "libcuda.so ${NV_SOVER}"
+ "libnvcuvid.so ${NV_SOVER}"
+ "libnvidia-compiler.so ${NV_SOVER}"
+ "libnvidia-eglcore.so ${NV_SOVER}"
+ "libnvidia-encode.so ${NV_SOVER}"
+ "libnvidia-fbc.so ${NV_SOVER}"
+ "libnvidia-glcore.so ${NV_SOVER}"
+ "libnvidia-glsi.so ${NV_SOVER}"
+ "libnvidia-ifr.so ${NV_SOVER}"
+ "libnvidia-opencl.so ${NV_SOVER}"
+ "libvdpau.so ${NV_SOVER} ${GL_ROOT}"
+ "libvdpau_nvidia.so ${NV_SOVER}"
+ "libvdpau_trace.so ${NV_SOVER} ${GL_ROOT}"
+ )
+ if use kernel_linux && has_multilib_profile && [[ ${ABI} == "amd64" ]];
+ then
+ NV_GLX_LIBRARIES+=( "libnvidia-wfb.so ${NV_SOVER}" )
+ fi
+
+ if use kernel_FreeBSD; then
+ NV_GLX_LIBRARIES+=( "libnvidia-tls.so ${NV_SOVER}" )
+ fi
+
+ if use kernel_linux; then
+ NV_GLX_LIBRARIES+=(
+ "libnvidia-ml.so ${NV_SOVER}"
+ "tls/libnvidia-tls.so ${NV_SOVER}"
+ )
+ fi
+
+ for NV_LIB in "${NV_GLX_LIBRARIES[@]}"; do
+ donvidia ${libdir}/${NV_LIB}
+ done
+
+ # GLES v2 library is special
+ insinto ${GL_ROOT}
+ doexe ${libdir}/libGLESv2.so.${PV}
+ dosym libGLESv2.so.${PV} ${GL_ROOT}/libGLESv2.so.2
+ dosym libGLESv2.so.2 ${GL_ROOT}/libGLESv2.so
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_preinst
+
+ local videogroup="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "${videogroup}" ]; then
+ eerror "Failed to determine the video group gid"
+ die "Failed to determine the video group gid"
+ else
+ sed -i \
+ -e "s:PACKAGE:${PF}:g" \
+ -e "s:VIDEOGID:${videogroup}:" \
+ "${D}"/etc/modprobe.d/nvidia.conf || die
+ fi
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ]; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ]; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ use kernel_linux && linux-mod_pkg_postinst
+
+ # Switch to the nvidia implementation
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old nvidia
+ "${ROOT}"/usr/bin/eselect opencl set --use-old nvidia
+
+ readme.gentoo_print_elog
+
+ if ! use X; then
+ elog "You have elected to not install the X.org driver. Along with"
+ elog "this the OpenGL libraries and VDPAU libraries were not"
+ elog "installed. Additionally, once the driver is loaded your card"
+ elog "and fan will run at max speed which may not be desirable."
+ elog "Use the 'nvidia-smi' init script to have your card and fan"
+ elog "speed scale appropriately."
+ elog
+ fi
+ if ! use tools; then
+ elog "USE=tools controls whether the nvidia-settings application"
+ elog "is installed. If you would like to use it, enable that"
+ elog "flag and re-emerge this ebuild. Optionally you can install"
+ elog "media-video/nvidia-settings"
+ elog
+ fi
+}
+
+pkg_prerm() {
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ use kernel_linux && linux-mod_pkg_postrm
+ use X && "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23.ebuild
new file mode 100644
index 000000000000..33db0dc47a26
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-96.43.23.ebuild
@@ -0,0 +1,519 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit eutils flag-o-matic linux-mod multilib nvidia-driver portability unpacker user versionator
+
+X86_NV_PACKAGE="NVIDIA-Linux-x86-${PV}"
+AMD64_NV_PACKAGE="NVIDIA-Linux-x86_64-${PV}"
+X86_FBSD_NV_PACKAGE="NVIDIA-FreeBSD-x86-${PV}"
+
+DESCRIPTION="NVIDIA Accelerated Graphics Driver"
+HOMEPAGE="http://www.nvidia.com/"
+SRC_URI="x86? ( http://us.download.nvidia.com/XFree86/Linux-x86/${PV}/${X86_NV_PACKAGE}-pkg0.run )
+ amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/${PV}/${AMD64_NV_PACKAGE}-pkg2.run )
+ x86-fbsd? ( http://us.download.nvidia.com/freebsd/${PV}/${X86_FBSD_NV_PACKAGE}.tar.gz )"
+
+LICENSE="GPL-2 NVIDIA-r1"
+SLOT="0"
+KEYWORDS="-* amd64 x86 ~x86-fbsd"
+IUSE="acpi custom-cflags gtk multilib kernel_linux"
+RESTRICT="bindist mirror strip"
+EMULTILIB_PKG="true"
+
+COMMON="
+ kernel_linux? ( >=sys-libs/glibc-2.6.1 )
+ >=app-eselect/eselect-opengl-1.0.9
+"
+DEPEND="${COMMON}
+ kernel_linux? ( virtual/linux-sources )
+"
+RDEPEND="${COMMON}
+ <x11-base/xorg-server-1.12.99:=
+ acpi? ( sys-power/acpid )
+ gtk? (
+ !media-video/nvidia-settings
+ dev-libs/atk
+ dev-libs/glib:2
+ x11-libs/gdk-pixbuf
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/pango[X]
+ x11-libs/pangox-compat
+ )
+ multilib? (
+ >=x11-libs/libX11-1.6.2[abi_x86_32]
+ >=x11-libs/libXext-1.3.2[abi_x86_32]
+ )
+"
+
+QA_TEXTRELS_x86="
+ usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+ usr/lib/libcuda.so.${PV}
+ usr/lib/libnvidia-cfg.so.${PV}
+ usr/lib/libvdpau_nvidia.so.${PV}
+ usr/lib/libXvMCNVIDIA.so.${PV}
+"
+
+QA_TEXTRELS_x86_fbsd="
+ boot/modules/nvidia.ko
+ usr/lib/opengl/nvidia/lib/libGL.so.1
+ usr/lib/opengl/nvidia/lib/libGLcore.so.1
+ usr/lib/libnvidia-cfg.so.1
+ usr/lib/opengl/nvidia/extensions/libglx.so.1
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+"
+
+QA_TEXTRELS_amd64="
+ usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib32/libcuda.so.${PV}
+ usr/lib32/libvdpau_nvidia.so.${PV}
+"
+
+QA_EXECSTACK_x86="
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+ usr/lib/libXvMCNVIDIA.a:NVXVMC.o
+"
+
+QA_EXECSTACK_amd64="
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/libnvcompiler.so.${PV}
+ usr/lib64/libXvMCNVIDIA.so.${PV}
+ usr/lib64/libXvMCNVIDIA.a:NVXVMC.o
+ usr/lib64/libnvidia-cfg.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib64/xorg/modules/drivers/nvidia_drv.so
+ usr/bin/nvidia-settings
+ usr/bin/nvidia-smi
+ usr/bin/nvidia-xconfig
+"
+
+QA_WX_LOAD_x86="
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/libXvMCNVIDIA.a
+"
+
+QA_WX_LOAD_amd64="
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
+"
+
+QA_SONAME_amd64="
+ usr/lib64/libnvcompiler.so.${PV}
+"
+
+QA_FLAGS_IGNORED_amd64="
+ usr/lib32/libcuda.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib32/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib32/libvdpau_nvidia.so.${PV}
+ usr/lib64/libXvMCNVIDIA.so.${PV}
+ usr/lib64/libcuda.so.${PV}
+ usr/lib64/libnvidia-cfg.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib64/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib64/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib64/xorg/modules/drivers/nvidia_drv.so
+ usr/lib64/libvdpau_nvidia.so.${PV}
+ usr/bin/nvidia-settings
+ usr/bin/nvidia-smi
+ usr/bin/nvidia-xconfig
+"
+
+QA_FLAGS_IGNORED_x86="
+ usr/lib/libcuda.so.${PV}
+ usr/lib/libnvidia-cfg.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGLcore.so.${PV}
+ usr/lib/opengl/nvidia/lib/libGL.so.${PV}
+ usr/lib/opengl/nvidia/lib/libnvidia-tls.so.${PV}
+ usr/lib/opengl/nvidia/extensions/libglx.so.${PV}
+ usr/lib/xorg/modules/drivers/nvidia_drv.so
+ usr/lib/libXvMCNVIDIA.so.${PV}
+ usr/lib/libvdpau_nvidia.so.${PV}
+ usr/bin/nvidia-settings
+ usr/bin/nvidia-smi
+ usr/bin/nvidia-xconfig
+"
+
+S="${WORKDIR}/"
+
+mtrr_check() {
+ ebegin "Checking for MTRR support"
+ linux_chkconfig_present MTRR
+ eend $?
+
+ if [[ $? -ne 0 ]] ; then
+ eerror "Please enable MTRR support in your kernel config, found at:"
+ eerror
+ eerror " Processor type and features"
+ eerror " [*] MTRR (Memory Type Range Register) support"
+ eerror
+ eerror "and recompile your kernel ..."
+ die "MTRR support not detected!"
+ fi
+}
+
+lockdep_check() {
+ if linux_chkconfig_present LOCKDEP; then
+ eerror "You've enabled LOCKDEP -- lock tracking -- in the kernel."
+ eerror "Unfortunately, this option exports the symbol 'lockdep_init_map' as GPL-only"
+ eerror "which will prevent ${P} from compiling."
+ eerror "Please make sure the following options have been unset:"
+ eerror " Kernel hacking --->"
+ eerror " [ ] Lock debugging: detect incorrect freeing of live locks"
+ eerror " [ ] Lock debugging: prove locking correctness"
+ eerror " [ ] Lock usage statistics"
+ eerror "in 'menuconfig'"
+ die "LOCKDEP enabled"
+ fi
+}
+
+pkg_setup() {
+ # try to turn off distcc and ccache for people that have a problem with it
+ export DISTCC_DISABLE=1
+ export CCACHE_DISABLE=1
+
+ if use amd64 && has_multilib_profile && [ "${DEFAULT_ABI}" != "amd64" ]; then
+ eerror "This ebuild doesn't currently support changing your default abi."
+ die "Unexpected \${DEFAULT_ABI} = ${DEFAULT_ABI}"
+ fi
+
+ if use kernel_linux; then
+ linux-mod_pkg_setup
+ MODULE_NAMES="nvidia(video:${S}/usr/src/nv)"
+ BUILD_PARAMS="IGNORE_CC_MISMATCH=yes V=1 SYSSRC=${KV_DIR} \
+ SYSOUT=${KV_OUT_DIR} CC=$(tc-getBUILD_CC)"
+ mtrr_check
+ lockdep_check
+ fi
+
+ # On BSD userland it wants real make command
+ use userland_BSD && MAKE="$(get_bmake)"
+
+ export _POSIX2_VERSION="199209"
+
+ if use kernel_linux && kernel_is ge 3 7 ; then
+ ewarn "Gentoo supports kernels which are supported by NVIDIA"
+ ewarn "which are limited to the following kernels:"
+ ewarn "<sys-kernel/gentoo-sources-3.7"
+ ewarn "<sys-kernel/vanilla-sources-3.7"
+ ewarn ""
+ ewarn "You are free to utilize epatch_user to provide whatever"
+ ewarn "support you feel is appropriate, but will not receive"
+ ewarn "support as a result of those changes."
+ ewarn ""
+ ewarn "Do not file a bug report about this."
+ fi
+
+ # Since Nvidia ships 3 different series of drivers, we need to give the user
+ # some kind of guidance as to what version they should install. This tries
+ # to point the user in the right direction but can't be perfect. check
+ # nvidia-driver.eclass
+ nvidia-driver-check-warning
+
+ # set variables to where files are in the package structure
+ if use kernel_FreeBSD; then
+ use x86-fbsd && S="${WORKDIR}/${X86_FBSD_NV_PACKAGE}"
+ NV_DOC="${S}/doc"
+ NV_EXEC="${S}/obj"
+ NV_LIB="${S}/obj"
+ NV_SRC="${S}/src"
+ NV_MAN="${S}/x11/man"
+ NV_X11="${S}/obj"
+ NV_X11_DRV="${NV_X11}"
+ NV_X11_EXT="${NV_X11}"
+ NV_SOVER=1
+ elif use kernel_linux; then
+ NV_DOC="${S}/usr/share/doc"
+ NV_EXEC="${S}/usr/bin"
+ NV_LIB="${S}/usr/lib"
+ NV_SRC="${S}/usr/src/nv"
+ NV_MAN="${S}/usr/share/man/man1"
+ NV_X11="${S}/usr/X11R6/lib"
+ NV_X11_DRV="${NV_X11}/modules/drivers"
+ NV_X11_EXT="${NV_X11}/modules/extensions"
+ NV_SOVER=${PV}
+ else
+ die "Could not determine proper NVIDIA package"
+ fi
+}
+
+src_unpack() {
+ if use kernel_linux && kernel_is lt 2 6 7; then
+ echo
+ ewarn "Your kernel version is ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}"
+ ewarn "This is not officially supported for ${P}. It is likely you"
+ ewarn "will not be able to compile or use the kernel module."
+ ewarn "It is recommended that you upgrade your kernel to a version >= 2.6.7"
+ echo
+ ewarn "DO NOT file bug reports for kernel versions less than 2.6.7 as they will be ignored."
+ fi
+
+ if ! use x86-fbsd; then
+ mkdir "${S}"
+ cd "${S}"
+ unpack_makeself
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # Please add a brief description for every added patch
+ use x86-fbsd && cd doc
+
+ # Use the correct defines to make gtkglext build work
+ epatch "${FILESDIR}"/NVIDIA_glx-defines.patch
+ # Use some more sensible gl headers and make way for new glext.h
+ epatch "${FILESDIR}"/NVIDIA_glx-glheader.patch
+
+ if use kernel_linux; then
+ # Quiet down warnings the user does not need to see
+ sed -i \
+ -e 's:-Wpointer-arith::g' \
+ -e 's:-Wsign-compare::g' \
+ "${NV_SRC}"/Makefile.kbuild
+
+ # If you set this then it's your own fault when stuff breaks :)
+ use custom-cflags && sed -i "s:-O:${CFLAGS}:" "${NV_SRC}"/Makefile.*
+
+ # If greater than 2.6.5 use M= instead of SUBDIR=
+ convert_to_m "${NV_SRC}"/Makefile.kbuild
+ fi
+}
+
+src_compile() {
+ # This is already the default on Linux, as there's no toplevel Makefile, but
+ # on FreeBSD there's one and triggers the kernel module build, as we install
+ # it by itself, pass this.
+
+ cd "${NV_SRC}"
+ if use x86-fbsd; then
+ MAKE="$(get_bmake)" CFLAGS="-Wno-sign-compare" emake CC="$(tc-getCC)" \
+ LD="$(tc-getLD)" LDFLAGS="$(raw-ldflags)" || die
+ elif use kernel_linux; then
+ BUILD_PARAMS+=" PATCHLEVEL=not4"
+ linux-mod_src_compile
+ fi
+}
+
+src_install() {
+ if use kernel_linux; then
+ linux-mod_src_install
+
+ VIDEOGROUP="$(egetent group video | cut -d ':' -f 3)"
+ if [ -z "$VIDEOGROUP" ]; then
+ eerror "Failed to determine the video group gid."
+ die "Failed to determine the video group gid."
+ fi
+
+ # Add the aliases
+ sed -e 's:PACKAGE:'${PF}':g' \
+ -e 's:VIDEOGID:'${VIDEOGROUP}':' "${FILESDIR}"/nvidia-169.07 > \
+ "${WORKDIR}"/nvidia || die
+ insinto /etc/modprobe.d
+ newins "${WORKDIR}"/nvidia nvidia.conf
+ elif use x86-fbsd; then
+ insinto /boot/modules
+ doins "${WORKDIR}/${NV_PACKAGE}/src/nvidia.kld"
+
+ exeinto /boot/modules
+ doexe "${WORKDIR}/${NV_PACKAGE}/src/nvidia.ko"
+ fi
+
+ # NVIDIA kernel <-> userspace driver config lib
+ dolib.so ${NV_LIB}/libnvidia-cfg.so.${NV_SOVER}
+
+ # Xorg DDX driver
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ doins ${NV_X11_DRV}/nvidia_drv.so
+
+ # Xorg GLX driver
+ insinto /usr/$(get_libdir)/opengl/nvidia/extensions
+ doins ${NV_X11_EXT}/libglx.so.${NV_SOVER}
+ dosym /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so.${NV_SOVER} \
+ /usr/$(get_libdir)/opengl/nvidia/extensions/libglx.so
+
+ # XvMC driver
+ dolib.a ${NV_X11}/libXvMCNVIDIA.a
+ dolib.so ${NV_X11}/libXvMCNVIDIA.so.${NV_SOVER}
+ dosym libXvMCNVIDIA.so.${NV_SOVER} /usr/$(get_libdir)/libXvMCNVIDIA.so
+
+ # CUDA headers (driver to come)
+ if [[ -d ${S}/usr/include/cuda ]]; then
+ dodir /usr/include/cuda
+ insinto /usr/include/cuda
+ doins usr/include/cuda/*.h
+ fi
+
+ # OpenCL headers (driver to come)
+ if [[ -d ${S}/usr/include/CL ]]; then
+ dodir /usr/include/CL
+ insinto /usr/include/CL
+ doins usr/include/CL/*.h
+ fi
+
+ # Documentation
+ dodoc ${NV_DOC}/XF86Config.sample
+ dohtml ${NV_DOC}/html/*
+ if use x86-fbsd; then
+ dodoc "${NV_DOC}/README"
+ doman "${NV_MAN}/nvidia-xconfig.1"
+ else
+ # Docs
+ newdoc "${NV_DOC}/README.txt" README
+ dodoc "${NV_DOC}/NVIDIA_Changelog"
+# doman "${NV_MAN}/nvidia-smi.1.gz"
+ doman "${NV_MAN}/nvidia-xconfig.1.gz"
+ fi
+
+ # Helper Apps
+ dobin ${NV_EXEC}/nvidia-xconfig
+ dobin ${NV_EXEC}/nvidia-bug-report.sh
+ if use gtk; then
+ dobin usr/bin/nvidia-settings
+ fi
+# if use kernel_linux; then
+# dobin ${NV_EXEC}/nvidia-smi || die
+# fi
+
+ if has_multilib_profile ; then
+ local OABI=${ABI}
+ for ABI in $(get_install_abis) ; do
+ src_install-libs
+ done
+ ABI=${OABI}
+ unset OABI
+ else
+ src_install-libs
+ fi
+
+ is_final_abi || die "failed to iterate through all ABIs"
+
+ readme.gentoo_create_doc
+}
+
+# Install nvidia library:
+# the first parameter is the place where to install it
+# the second parameter is the base name of the library
+# the third parameter is the provided soversion
+donvidia() {
+ dodir $1
+ exeinto $1
+
+ libname=$(basename $2)
+
+ doexe $2.$3
+ dosym ${libname}.$3 $1/${libname}
+ [[ $3 != "1" ]] && dosym ${libname}.$3 $1/${libname}.1
+}
+
+src_install-libs() {
+ local inslibdir=$(get_libdir)
+ local NV_ROOT="/usr/${inslibdir}/opengl/nvidia"
+ local libdir= sover=
+
+ if use kernel_linux; then
+ if has_multilib_profile && [[ ${ABI} == "x86" ]] ; then
+ libdir=usr/lib32
+ else
+ libdir=usr/lib
+ fi
+ sover=${PV}
+ else
+ libdir=obj
+ # on FreeBSD it has just .1 suffix
+ sover=1
+ fi
+
+ # The GLX libraries
+ donvidia ${NV_ROOT}/lib ${libdir}/libGL.so ${sover}
+ donvidia ${NV_ROOT}/lib ${libdir}/libGLcore.so ${sover}
+ if use x86-fbsd; then
+ donvidia ${NV_ROOT}/lib ${libdir}/libnvidia-tls.so ${sover}
+ else
+ donvidia ${NV_ROOT}/lib ${libdir}/tls/libnvidia-tls.so ${sover}
+ fi
+
+ #cuda
+ if [[ -f ${libdir}/libcuda.so.${sover} ]]; then
+ dolib.so ${libdir}/libcuda.so.${sover}
+ [[ "${sover}" != "1" ]] && dosym libcuda.so.${sover} /usr/${inslibdir}/libcuda.so.1
+ dosym libcuda.so.1 /usr/${inslibdir}/libcuda.so
+ fi
+
+ #vdpau
+ if [[ -f ${libdir}/libvdpau_nvidia.so.${sover} ]]; then
+ dolib.so ${libdir}/libvdpau_nvidia.so.${sover}
+ dosym libvdpau_nvidia.so.${sover} /usr/${inslibdir}/libvdpau_nvidia.so
+ fi
+
+ # OpenCL
+ # NOTE: This isn't currently available in the publicly released drivers.
+ if [[ -f ${libdir}/libOpenCL.so.1.0.0 ]]; then
+
+ dolib.so ${libdir}/libnvcompiler.so.${sover}
+ [[ "${sover}" != "1" ]] && dosym libnvcompiler.so.${sover} /usr/${inslibdir}/libnvcompiler.so.1
+ dosym libnvcompiler.so.1 /usr/${inslibdir}/libnvcompiler.so
+
+ dolib.so ${libdir}/libOpenCL.so.1.0.0
+ dosym libOpenCL.so.1.0.0 /usr/${inslibdir}/libOpenCL.so.1
+ dosym libOpenCL.so.1 /usr/${inslibdir}/libOpenCL.so
+ fi
+}
+
+pkg_preinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_postinst
+ fi
+
+ # Clean the dynamic libGL stuff's home to ensure
+ # we dont have stale libs floating around
+ if [ -d "${ROOT}"/usr/lib/opengl/nvidia ] ; then
+ rm -rf "${ROOT}"/usr/lib/opengl/nvidia/*
+ fi
+ # Make sure we nuke the old nvidia-glx's env.d file
+ if [ -e "${ROOT}"/etc/env.d/09nvidia ] ; then
+ rm -f "${ROOT}"/etc/env.d/09nvidia
+ fi
+}
+
+pkg_postinst() {
+ if use kernel_linux; then
+ linux-mod_pkg_postinst
+ fi
+
+ # Switch to the nvidia implementation
+ eselect opengl set --use-old nvidia
+
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ if use kernel_linux; then
+ linux-mod_pkg_postrm
+ fi
+ eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/radeon-ucode/Manifest b/x11-drivers/radeon-ucode/Manifest
new file mode 100644
index 000000000000..9e778f939c03
--- /dev/null
+++ b/x11-drivers/radeon-ucode/Manifest
@@ -0,0 +1,3 @@
+DIST radeon-ucode-20140204.tar.xz 523300 SHA256 9e10b5c5dd052c9a2347b76d86a36f46b9aec568067aeba1bcff5b830f75a7c4 SHA512 c116f8612d0cc19fe8f117c42daba59132a04079e898e392f4661e302c7052229b4ced94be9627aa07e433fd9e07d9a9e538ee8004d5b261ec1e0ddad4abc7dc WHIRLPOOL d6483cca8cbc831f1590ce49a6d0685b2565a5d63a063a8b1c43929a5cc2027cd60009572c34c9889ce4ef3c4f6e23c263c672714bfaea35edf205c65bcbed83
+DIST radeon-ucode-20140430.tar.xz 531304 SHA256 a29fab53ac0ecca1775d0338f693954f9336911beaa32536fa6c70a21eefd06c SHA512 adb72e783a782242561fb036b58129b53b312ed1d58d6f05eca0725f3544ea41d3bd13cd712aa90b9cd0e95219c5789018c7a925d5045a253993442bed0a80c4 WHIRLPOOL 724455e7d5c2e48213b93e9ba3e310dbaa9863006e3ec05712be324b3efbf7b3d0d6ac6a20aafab771bf67ea35d291cfa505baa6f1e427393ea88149e3e771e3
+DIST radeon-ucode-20140823.tar.xz 694248 SHA256 37eb33aea68e06ecfad79c871a1ceedd99a04d03f5ae8e3449e4331d2b19e2c4 SHA512 c23326700d41ecdef4ce8d6f8638a1faa335a9ded7d717e3edd0422ba6e7d118981fd153de50892e87fa45f6da28ea973f6b29cd1025123fe1770f783dc99812 WHIRLPOOL a86382353f71e8b9735db80491258d7d670ada31ba89c514fb1e5fd3d2b7121cbc7c8007af36c01d5dcc85ffb5ea3e6a726c78557af1b186df8f3bbab5564050
diff --git a/x11-drivers/radeon-ucode/metadata.xml b/x11-drivers/radeon-ucode/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/radeon-ucode/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/radeon-ucode/radeon-ucode-20140204.ebuild b/x11-drivers/radeon-ucode/radeon-ucode-20140204.ebuild
new file mode 100644
index 000000000000..27f3dd985f44
--- /dev/null
+++ b/x11-drivers/radeon-ucode/radeon-ucode-20140204.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info
+
+DESCRIPTION="IRQ microcode for r6xx/r7xx/Evergreen/N.Islands/S.Islands Radeon GPUs and APUs"
+HOMEPAGE="http://people.freedesktop.org/~agd5f/radeon_ucode/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="radeon-ucode"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="!sys-kernel/linux-firmware[-savedconfig]"
+
+S=${WORKDIR}/${PN/-/_}
+
+src_install() {
+ insinto /lib/firmware/radeon
+ FILES=( *.bin )
+ doins ${FILES[@]} || die "doins failed"
+}
+
+pkg_postinst() {
+ if linux_config_exists && linux_chkconfig_builtin DRM_RADEON; then
+ if ! linux_chkconfig_present FIRMWARE_IN_KERNEL || \
+ ! [[ "$(linux_chkconfig_string EXTRA_FIRMWARE)" == *_rlc.bin* ]]; then
+ ewarn "Your kernel has radeon DRM built-in but not the IRQ microcode."
+ ewarn "For kernel modesetting to work, please set in kernel config"
+ ewarn "CONFIG_FIRMWARE_IN_KERNEL=y"
+ ewarn "CONFIG_EXTRA_FIRMWARE_DIR=\"/lib/firmware\""
+ ewarn "CONFIG_EXTRA_FIRMWARE=\"${FILES[@]/#/radeon/}\""
+ ewarn "You may skip microcode files for which no hardware is installed."
+ ewarn "More information at http://wiki.gentoo.org/wiki/Radeon#Firmware"
+ fi
+ fi
+}
diff --git a/x11-drivers/radeon-ucode/radeon-ucode-20140430.ebuild b/x11-drivers/radeon-ucode/radeon-ucode-20140430.ebuild
new file mode 100644
index 000000000000..e58607f5f315
--- /dev/null
+++ b/x11-drivers/radeon-ucode/radeon-ucode-20140430.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info
+
+DESCRIPTION="IRQ microcode for r6xx/r7xx/Evergreen/N.Islands/S.Islands Radeon GPUs and APUs"
+HOMEPAGE="http://people.freedesktop.org/~agd5f/radeon_ucode/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="radeon-ucode"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+RDEPEND="!sys-kernel/linux-firmware[-savedconfig]"
+
+S=${WORKDIR}/${PN/-/_}
+
+src_install() {
+ insinto /lib/firmware/radeon
+ FILES=( *.bin )
+ doins ${FILES[@]} || die "doins failed"
+}
+
+pkg_postinst() {
+ if linux_config_exists && linux_chkconfig_builtin DRM_RADEON; then
+ if ! linux_chkconfig_present FIRMWARE_IN_KERNEL || \
+ ! [[ "$(linux_chkconfig_string EXTRA_FIRMWARE)" == *_rlc.bin* ]]; then
+ ewarn "Your kernel has radeon DRM built-in but not the IRQ microcode."
+ ewarn "For kernel modesetting to work, please set in kernel config"
+ ewarn "CONFIG_FIRMWARE_IN_KERNEL=y"
+ ewarn "CONFIG_EXTRA_FIRMWARE_DIR=\"/lib/firmware\""
+ ewarn "CONFIG_EXTRA_FIRMWARE=\"${FILES[@]/#/radeon/}\""
+ ewarn "You may skip microcode files for which no hardware is installed."
+ ewarn "More information at http://wiki.gentoo.org/wiki/Radeon#Firmware"
+ fi
+ fi
+}
diff --git a/x11-drivers/radeon-ucode/radeon-ucode-20140823.ebuild b/x11-drivers/radeon-ucode/radeon-ucode-20140823.ebuild
new file mode 100644
index 000000000000..27f3dd985f44
--- /dev/null
+++ b/x11-drivers/radeon-ucode/radeon-ucode-20140823.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info
+
+DESCRIPTION="IRQ microcode for r6xx/r7xx/Evergreen/N.Islands/S.Islands Radeon GPUs and APUs"
+HOMEPAGE="http://people.freedesktop.org/~agd5f/radeon_ucode/"
+SRC_URI="mirror://gentoo/${P}.tar.xz"
+
+LICENSE="radeon-ucode"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+RDEPEND="!sys-kernel/linux-firmware[-savedconfig]"
+
+S=${WORKDIR}/${PN/-/_}
+
+src_install() {
+ insinto /lib/firmware/radeon
+ FILES=( *.bin )
+ doins ${FILES[@]} || die "doins failed"
+}
+
+pkg_postinst() {
+ if linux_config_exists && linux_chkconfig_builtin DRM_RADEON; then
+ if ! linux_chkconfig_present FIRMWARE_IN_KERNEL || \
+ ! [[ "$(linux_chkconfig_string EXTRA_FIRMWARE)" == *_rlc.bin* ]]; then
+ ewarn "Your kernel has radeon DRM built-in but not the IRQ microcode."
+ ewarn "For kernel modesetting to work, please set in kernel config"
+ ewarn "CONFIG_FIRMWARE_IN_KERNEL=y"
+ ewarn "CONFIG_EXTRA_FIRMWARE_DIR=\"/lib/firmware\""
+ ewarn "CONFIG_EXTRA_FIRMWARE=\"${FILES[@]/#/radeon/}\""
+ ewarn "You may skip microcode files for which no hardware is installed."
+ ewarn "More information at http://wiki.gentoo.org/wiki/Radeon#Firmware"
+ fi
+ fi
+}
diff --git a/x11-drivers/xf86-input-acecad/Manifest b/x11-drivers/xf86-input-acecad/Manifest
new file mode 100644
index 000000000000..f8849e42234f
--- /dev/null
+++ b/x11-drivers/xf86-input-acecad/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-acecad-1.5.0.tar.bz2 262818 SHA256 c3032f38a07b54772299ce8832e16109a685ee63eeefbb17cef9fe1dd100a448
diff --git a/x11-drivers/xf86-input-acecad/metadata.xml b/x11-drivers/xf86-input-acecad/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-acecad/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-acecad/xf86-input-acecad-1.5.0.ebuild b/x11-drivers/xf86-input-acecad/xf86-input-acecad-1.5.0.ebuild
new file mode 100644
index 000000000000..38b5e756eae3
--- /dev/null
+++ b/x11-drivers/xf86-input-acecad/xf86-input-acecad-1.5.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Acecad Flair input driver"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-aiptek/Manifest b/x11-drivers/xf86-input-aiptek/Manifest
new file mode 100644
index 000000000000..7b4e1d0a0b28
--- /dev/null
+++ b/x11-drivers/xf86-input-aiptek/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-aiptek-1.4.1.tar.bz2 294033 SHA256 ba2223cd4a537275e11c54974094252d053b490a2b663af3a2b7e3038b3cf65f
diff --git a/x11-drivers/xf86-input-aiptek/metadata.xml b/x11-drivers/xf86-input-aiptek/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-aiptek/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-aiptek/xf86-input-aiptek-1.4.1.ebuild b/x11-drivers/xf86-input-aiptek/xf86-input-aiptek-1.4.1.ebuild
new file mode 100644
index 000000000000..5f48f3705437
--- /dev/null
+++ b/x11-drivers/xf86-input-aiptek/xf86-input-aiptek-1.4.1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Aiptek USB Digital Tablet Input Driver for Linux"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-elographics/Manifest b/x11-drivers/xf86-input-elographics/Manifest
new file mode 100644
index 000000000000..49a442c3e619
--- /dev/null
+++ b/x11-drivers/xf86-input-elographics/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-elographics-1.4.1.tar.bz2 280311 SHA256 a21af744d57f158e6dff9d60a68aaac46b8d726d602911940cb61f4d6bb2c6a4 SHA512 94248fbd256ab32af3d6a72179c261231a710b39731e59626e6aa45ade65abb865fb5e62da0b835d52edfe5d9fcc46c03076e0179a8de9a89341d852103195ad WHIRLPOOL cde0d7ff934dd0e58afd66d1c02fbec51ff3a8ea8e8aac54a5b356497578bdf59bcc0fe849845a5ddc572082b117de8997055bded8058a7501e8c60fcde76bb0
diff --git a/x11-drivers/xf86-input-elographics/metadata.xml b/x11-drivers/xf86-input-elographics/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-elographics/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.1.ebuild b/x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.1.ebuild
new file mode 100644
index 000000000000..4e8035faafc9
--- /dev/null
+++ b/x11-drivers/xf86-input-elographics/xf86-input-elographics-1.4.1.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+XORG_STATIC="no"
+inherit xorg-2
+
+DESCRIPTION="Elographics input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-evdev/Manifest b/x11-drivers/xf86-input-evdev/Manifest
new file mode 100644
index 000000000000..9e2e975a966b
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/Manifest
@@ -0,0 +1,7 @@
+DIST xf86-input-evdev-2.7.3.tar.bz2 364819 SHA256 eb389413602c3d28c44bbfab0477c98582f0e2f5be5f41986e58e93a033fa504 SHA512 edd5691bc6878bb491d7ffb04b35ab60cd70853ae702883c672c53c9f6cb8e81817f94cc03feaaca4e4a02a2a436f1417bd1e1e5f52a151a416fd04306159879 WHIRLPOOL 750605a0efabcb078e65d08b7ea610fdfc4cab49b73a2676247f95f50fcf7d17e80ab2186ef103830865a564dc695f035739f1b88e28f68c981fc703e26610a6
+DIST xf86-input-evdev-2.8.1.tar.bz2 369337 SHA256 09f887e1ce6cdb92154035db9044e0795a5c80f1ffb9efc599aed9a9dc1ff539 SHA512 8a9fce3b1d7a577a914d662b5a36dc43d56f16ae9318bbaf09fbd28ee572a69f40b7960d6d51ede9074284eed5a01732a4a246b43f8a1140cb8f1c0073ea189c WHIRLPOOL f0b337aebb5168efe382d69f47c2b332097470c82bcd3dfcb61e4d599a73da2cec36c4a51c77584ffa548e5a2ce1c512a2ebc304e64e37ce8e74fa551d1efd99
+DIST xf86-input-evdev-2.8.2.tar.bz2 369981 SHA256 750461749a83bdee7771592aa5c0db5e267b18d847078a4b8622f55b04797eb3 SHA512 20ff24785333f3742b191a6cbfad79ab9ac67ea97fa78cc8037fbc6946c437ee61a717aa3b7e21d5942a282917667d93d65ef424c4db4cec38e38dc41197386b WHIRLPOOL 432e22c5f12f33175f70c379a7d0e872b81e413046c9138f9e5daaf59e4e86b4a075dc38a696ad2f84292c13107c91e2a3315582acbfb57f93528dfb102a8a13
+DIST xf86-input-evdev-2.8.4.tar.bz2 370325 SHA256 85fade9f5e9cf70f02c877165e95b3df4cdb9e08282416122ca80218e254100c SHA512 358909c9ba3a7cd094b4408b0c158964deabade0de160e1d8b9d4fde96b0fc65a7fd8e7dcf83203f4ec5edfe8bbf3870c258958cd0927cd6dbe415e983670e09 WHIRLPOOL 0f5cd7677c0f250b14be73fd99896d0ed27541997691c8f808e570b9e1ff83af6b4cec2c184fba0132197b3f687a33ff7ce0652e7aff7830314388a1b5eaacad
+DIST xf86-input-evdev-2.9.0.tar.bz2 372098 SHA256 0c0c4aa393cb027a2304967944867a21a340bcad2e5efe630291b6906c3abc35 SHA512 82b797bed6384b0cb7f79681086d91ac13ce8cddb8ce6dbb002caddc8f32396171c38b73e61e3aa9eaa3d78deb583c398d0f3e7a970ecf10a2a67c9e2979183f WHIRLPOOL f165762a316d6e8df27b209310239b99ab224191250eaa45f15f3688129ad5c7af2ca562baad6bae9a7848ffa1b364d9fdafc733c5c730dca8c5e9a9ac64f42b
+DIST xf86-input-evdev-2.9.1.tar.bz2 386505 SHA256 0ce30328adfeac90a6f4b508d992fb834d8e50b484b29d3d58cf6683fa8502f9 SHA512 0cd65a4dfc6f6c1a50814ff820019b6b2a26dd017e17e11785e37b1705c1d6adccf017781f92a5abbb2204f812a13351cc44d542ee721c9f8c0cec91b6f15975 WHIRLPOOL 9ea9e1bfb1d1d6da87ae2b742bcd3b68a0dc608f4e98297c768dbc3783bb92582f0f93fa3cc772563beab9271620f7a0cc117716b8876803b92069c8b1e01faa
+DIST xf86-input-evdev-2.9.2.tar.bz2 387095 SHA256 792329b531afc6928ccda94e4b51a5520d4ddf8ef9a00890a5d0d31898acefec SHA512 258c4c391fdd5a3c5a5bef86f55f27d47fd7527f37edd601ee76c0acc2e1830e8899cc8d7a59d646b49f3f23d93971bcc70a76185a7580942935cbf3a0d888f7 WHIRLPOOL 550e7c292960c1d04c0e650eee9825dd81ec26f4bbb3817417925857063930bad98f7bd27769f04fee736f4e7f0e7df40696bf8e0287c7355d477a7b3cc23745
diff --git a/x11-drivers/xf86-input-evdev/metadata.xml b/x11-drivers/xf86-input-evdev/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.7.3.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.7.3.ebuild
new file mode 100644
index 000000000000..c389599e6723
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.7.3.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.10[udev]
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.1.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.1.ebuild
new file mode 100644
index 000000000000..939458506f35
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.1.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.12[udev]
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.2.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.2.ebuild
new file mode 100644
index 000000000000..1d649ace7fb9
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.2.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit linux-info xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.12[udev]
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~INPUT_EVDEV"
+ fi
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.4.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.4.ebuild
new file mode 100644
index 000000000000..34884c1b6658
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.8.4.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit linux-info xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.12[udev]
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~INPUT_EVDEV"
+ fi
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.0.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.0.ebuild
new file mode 100644
index 000000000000..bc2ab59093e1
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.0.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit linux-info xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.12[udev]
+ dev-libs/libevdev
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~INPUT_EVDEV"
+ fi
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.1.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.1.ebuild
new file mode 100644
index 000000000000..c1c3c1ad5e43
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.1.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit linux-info xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.12[udev]
+ dev-libs/libevdev
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~INPUT_EVDEV"
+ fi
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.2.ebuild b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.2.ebuild
new file mode 100644
index 000000000000..141404143932
--- /dev/null
+++ b/x11-drivers/xf86-input-evdev/xf86-input-evdev-2.9.2.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit linux-info xorg-2
+
+DESCRIPTION="Generic Linux input driver"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.12[udev]
+ dev-libs/libevdev
+ sys-libs/mtdev"
+DEPEND="${RDEPEND}
+ >=x11-proto/inputproto-2.1.99.3
+ >=sys-kernel/linux-headers-2.6"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ CONFIG_CHECK="~INPUT_EVDEV"
+ fi
+ check_extra_config
+}
diff --git a/x11-drivers/xf86-input-fpit/Manifest b/x11-drivers/xf86-input-fpit/Manifest
new file mode 100644
index 000000000000..9e9a67630b28
--- /dev/null
+++ b/x11-drivers/xf86-input-fpit/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-fpit-1.4.0.tar.bz2 277843 SHA256 38a80ad6e9b367e068390b2ef92e0bbb9c21c09ea835a5190ae14c2271e68f9a
diff --git a/x11-drivers/xf86-input-fpit/metadata.xml b/x11-drivers/xf86-input-fpit/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-fpit/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-fpit/xf86-input-fpit-1.4.0.ebuild b/x11-drivers/xf86-input-fpit/xf86-input-fpit-1.4.0.ebuild
new file mode 100644
index 000000000000..3b08602c574a
--- /dev/null
+++ b/x11-drivers/xf86-input-fpit/xf86-input-fpit-1.4.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Fujitsu Stylistic input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-hyperpen/Manifest b/x11-drivers/xf86-input-hyperpen/Manifest
new file mode 100644
index 000000000000..e075d35f2f75
--- /dev/null
+++ b/x11-drivers/xf86-input-hyperpen/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-hyperpen-1.4.1.tar.bz2 266891 SHA256 31a816f032a2adf4be10909811831191a7528152347e1726b04810ff88436816
diff --git a/x11-drivers/xf86-input-hyperpen/metadata.xml b/x11-drivers/xf86-input-hyperpen/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-hyperpen/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-hyperpen/xf86-input-hyperpen-1.4.1.ebuild b/x11-drivers/xf86-input-hyperpen/xf86-input-hyperpen-1.4.1.ebuild
new file mode 100644
index 000000000000..59a87d224e85
--- /dev/null
+++ b/x11-drivers/xf86-input-hyperpen/xf86-input-hyperpen-1.4.1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for hyperpen input devices"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-joystick/Manifest b/x11-drivers/xf86-input-joystick/Manifest
new file mode 100644
index 000000000000..25defa817011
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-input-joystick-1.6.1.tar.bz2 323230 SHA256 1ded5d8f990a7687c44b45f68ad4a516f14fa94efa9da436955011ee6a9bf7f5 SHA512 1c241e005d861ec57b5fe8144f6ab06403639069a973be15c23d3273c8d947a72c888c2eca45cb3676e8c03153f077c73679f420145ef5b6612823185c21c85f WHIRLPOOL 88132cbcb8d781bf33015f02565f6a8f6d42a10a4d44bccf3fa05e942bc7e58177227099b82d1d87ef3ca944fad5151e50a172ddf8831143fcafcef3a137668a
+DIST xf86-input-joystick-1.6.2.tar.bz2 327539 SHA256 ee3b86ed72f3b5befdeed39909320f4b6970401cfbcc2cc0dfd8fb1c1576150d SHA512 2c3e9d9fefa8010198a895fea1caa0475c8005480b5db14fc7e547ae9ac4da2dbfa10e8ecbdcf7a6bf31c7590f6414685a11964ef00f6ca99b88e81b404f5ef8 WHIRLPOOL f8bee8267733cb8d0cc4d6d453a765e55886cebd31e137755a5c02bf311eb02e4f262e7c5779e89db9785308b035a1817b85ab4bbc1023b200792909cd95d5a7
diff --git a/x11-drivers/xf86-input-joystick/metadata.xml b/x11-drivers/xf86-input-joystick/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.1.ebuild b/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.1.ebuild
new file mode 100644
index 000000000000..ec5d89aeae24
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.1.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for joystick input devices"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.10"
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/kbproto"
diff --git a/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.2.ebuild b/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.2.ebuild
new file mode 100644
index 000000000000..a43f0270f267
--- /dev/null
+++ b/x11-drivers/xf86-input-joystick/xf86-input-joystick-1.6.2.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for joystick input devices"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.10"
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/kbproto"
+
+src_install() {
+ xorg-2_src_install
+ insinto /usr/share/X11/xorg.conf.d
+ doins config/50-joystick-all.conf
+}
diff --git a/x11-drivers/xf86-input-keyboard/Manifest b/x11-drivers/xf86-input-keyboard/Manifest
new file mode 100644
index 000000000000..f4ec6e314556
--- /dev/null
+++ b/x11-drivers/xf86-input-keyboard/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-input-keyboard-1.8.0.tar.bz2 323838 SHA256 41c51c4e0a87aad6a1c4973c68a8de23b61162d0223f4ab36c627c307830cb5b SHA512 a4fcace65414f011fb4c5d68622182acef7d606fb1a121687244a0a3442c05906d54d30664c942eba8d7209e0dccefe733ab196c7c3ab8cf690e9fd715c87aa6 WHIRLPOOL ea86550df8c36784b9ef280a7eb586211996ad030cb9ded3694b30938392eb9cee5d66875c95e8f6ff0068c5993a13d69f00cdff52da544954b429411523d3fd
+DIST xf86-input-keyboard-1.8.1.tar.bz2 319232 SHA256 1ac8ff39bf9da7d2fc7fd6c24515726e8138340c0518ab8c606e008cf93ca211 SHA512 51c6ed6c7daa660a519f1c96d3100e3a0cabf6245a05cd5b8797e9c4b237508802a7087e7e0327cdda1a3b681f83845ecc625fb739d7e992020026f385af8d5d WHIRLPOOL 8bfb0fae0f04de8352d91b069dd496a4745eecac6e580d04c8020a1cf77055da905eac00482a1d325d1bfe4da6c1c13455159b2b8a2163389dfc4944b67af156
diff --git a/x11-drivers/xf86-input-keyboard/metadata.xml b/x11-drivers/xf86-input-keyboard/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-keyboard/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.0.ebuild b/x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.0.ebuild
new file mode 100644
index 000000000000..cb5c0465a943
--- /dev/null
+++ b/x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Keyboard input driver"
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.6.3"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.1.ebuild b/x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.1.ebuild
new file mode 100644
index 000000000000..2861ea4882e5
--- /dev/null
+++ b/x11-drivers/xf86-input-keyboard/xf86-input-keyboard-1.8.1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Keyboard input driver"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.6.3"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-libinput/Manifest b/x11-drivers/xf86-input-libinput/Manifest
new file mode 100644
index 000000000000..30e8575809b4
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/Manifest
@@ -0,0 +1,4 @@
+DIST xf86-input-libinput-0.11.0.tar.bz2 294627 SHA256 56babf46c13d15fbd15c9d43815e9220e63acd9ed28095e7d68ad03f9148bbda SHA512 3d8463a9f5275a54b1d5299aca0a12271715582fed882e39ff10934308aadce864357cd9e3c75a4713aee8b12b81f139f33f25e8f92846c98cc299b3c4d6389b WHIRLPOOL 239cf0e7fed5cf82a417a73623b16d0c505695095c2e0957012df030201c1745cd4a1062b691952b39338e167b0eea7e581ad59032382620d896b04617f51bca
+DIST xf86-input-libinput-0.12.0.tar.bz2 295050 SHA256 db8f919c24a381cec1e7840f1f2117251501c0c7ae2a43941d84753154a826d6 SHA512 983a40b5b153deb8fff8c4ca6bfd6ede40304365a66f32c2b36942e207ed5fd930ae715aaba7333cd6c3cdddcccf5a8b841f223ce61264f6edafc841145d135f WHIRLPOOL 2af6a411ebdb1404c6216db701e32a1692ee4b69e9298d997d9152f2ea800fa07e6b843bbd8405884bc1e84034ee79344b72737a5f93c9ae3ee3d1b3ba399987
+DIST xf86-input-libinput-0.6.0.tar.bz2 287826 SHA256 2f29be1ed7f9b9c597b6f5c6ef24c37a244a0ba87ccd1c2586ffa4d08452ad79 SHA512 536324b4bf52b6a1905655d6d82af5d12d40503e48018e10b1922bcfd18bddad742a716bcc7588188993f46f9724874456e90a70e5a764432f968a66a9d2b639 WHIRLPOOL 5d8994c86b5682d7e5ae0e53b7c8d1b13fdba304603b9ecf3c97297ab732e59111f4c902403a6d0a19492f3e34a7b9a718fbbe105591da19260a3c1f3e2c2a4b
+DIST xf86-input-libinput-0.8.0.tar.bz2 290565 SHA256 2152b0984feffe8151934ad9af29bde7fc621e0a54b0cdedbaf1abc367dea43a SHA512 44d2c77b2cc9b29151f90458dbd6fb61b6cdfb23c878ea553e7b96f1085cd547080ab3afe804d0b6cb4d806ae2c9a4c4594b0164a54f3f44741016ec918b9d0e WHIRLPOOL 2c43000edbf688ce6e7bf87f64d1a290e8e7183906e4c586223aa0ef5b9a443b161e0aeca428ec713b0f0aea8b59830040d98ab556566fdaea44b77ae0a16482
diff --git a/x11-drivers/xf86-input-libinput/metadata.xml b/x11-drivers/xf86-input-libinput/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.11.0.ebuild b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.11.0.ebuild
new file mode 100644
index 000000000000..bba8c3c63703
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.11.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.org input driver based on libinput"
+
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/libinput-0.14.0:0="
+DEPEND="${RDEPEND}"
+
+DOCS=( "README.md" "conf/99-libinput.conf" )
diff --git a/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.12.0.ebuild b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.12.0.ebuild
new file mode 100644
index 000000000000..b66b7aadbcea
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.12.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.org input driver based on libinput"
+
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/libinput-0.19.0:0="
+DEPEND="${RDEPEND}"
+
+DOCS=( "README.md" "conf/99-libinput.conf" )
diff --git a/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.6.0.ebuild b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.6.0.ebuild
new file mode 100644
index 000000000000..3613f2112aee
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.6.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.org input driver based on libinput"
+
+KEYWORDS="alpha amd64 arm hppa ppc ppc64 x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/libinput-0.8.0:0="
+DEPEND="${RDEPEND}"
+
+DOCS=( "README.md" "conf/99-libinput.conf" )
diff --git a/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.8.0.ebuild b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.8.0.ebuild
new file mode 100644
index 000000000000..cc1cfe784a03
--- /dev/null
+++ b/x11-drivers/xf86-input-libinput/xf86-input-libinput-0.8.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.org input driver based on libinput"
+
+KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND=">=dev-libs/libinput-0.11.0:0="
+DEPEND="${RDEPEND}"
+
+DOCS=( "README.md" "conf/99-libinput.conf" )
diff --git a/x11-drivers/xf86-input-mouse/Manifest b/x11-drivers/xf86-input-mouse/Manifest
new file mode 100644
index 000000000000..a1158803a866
--- /dev/null
+++ b/x11-drivers/xf86-input-mouse/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-input-mouse-1.8.1.tar.bz2 352034 SHA256 f5b97aac9aab8fa8b933e960631441ae23b18681c8bf3d5007c00da838f9c9c8 SHA512 22f0a43c2353e76aaee7d20c627e97c9daa77b2a33a03788f2c0c94aed9af8009345555b0afd856dff528f668213b51303cd653f95e98e06fc3ea6f194138f01 WHIRLPOOL 9238a48630f3d26e17603a17627abe58fbae758d0e2277b96122b2a04720d8356e71e9fdba31a59f63b43d14f7faf5dbf0351d12283ec1a463309c9526ba4907
+DIST xf86-input-mouse-1.9.0.tar.bz2 353339 SHA256 5d601e4bae53d5e9ead4ecd700f1beb5aeaf78b79e634c4aa381a9ce00276488 SHA512 ef48a39765a874b8063ea0f76abe5240061185c8dde2e613d0833c2436ea133144c027e6130118251d65ed8a487ce6105e3ebd9543728ac8942485aca24550db WHIRLPOOL 8c6bda230ac93482c0edfe67a31a0fb1e7eb1591f1fc08a757d3dccfa439601b0fa2e0a63336025ee12c9f482be8ba8e39cdb3dc924f49bff0a5d9c1a1fdab77
+DIST xf86-input-mouse-1.9.1.tar.bz2 348244 SHA256 3485d375779c08406f0789feedde15933dc703158a086ddac638598f479fc5ce SHA512 0b9647c21b949fe5b357de29028d823b5d385ebb5c59fddd53a11fceae3bf65e25bb988ac05d833abe7e071f6813d5a4dc4cdf61d240fc8a4f591866a86b5926 WHIRLPOOL 2710dbfee0e9b389d8e83b28e569270951fbc26e91d71dddd9c1bdcfe2281c67e0e6e3fb4fdca3abdaf7610ba96e40cafd74ab2137ce45dcb7c876f7a0053424
diff --git a/x11-drivers/xf86-input-mouse/files/xf86-input-mouse-1.8.1-gcc46-workaround.patch b/x11-drivers/xf86-input-mouse/files/xf86-input-mouse-1.8.1-gcc46-workaround.patch
new file mode 100644
index 000000000000..68670321ced1
--- /dev/null
+++ b/x11-drivers/xf86-input-mouse/files/xf86-input-mouse-1.8.1-gcc46-workaround.patch
@@ -0,0 +1,16 @@
+diff -Nur xf86-input-mouse-1.8.1.orig/src/bsd_mouse.c xf86-input-mouse-1.8.1/src/bsd_mouse.c
+--- xf86-input-mouse-1.8.1.orig/src/bsd_mouse.c 2012-05-28 09:01:45.000000000 +0900
++++ xf86-input-mouse-1.8.1/src/bsd_mouse.c 2012-09-20 22:27:36.167583000 +0900
+@@ -139,10 +139,10 @@
+ {
+ int i;
+
+- for (i = 0; internalNames[i]; i++)
++ for (i = 0; i < (sizeof(internalNames) / sizeof(internalNames[0])) - 1; i++)
+ if (xf86NameCmp(protocol, internalNames[i]) == 0)
+ return TRUE;
+- for (i = 0; miscNames[i]; i++)
++ for (i = 0; i < (sizeof(miscNames) / sizeof (miscNames[0])) - 1; i++)
+ if (xf86NameCmp(protocol, miscNames[i]) == 0)
+ return TRUE;
+ return FALSE;
diff --git a/x11-drivers/xf86-input-mouse/metadata.xml b/x11-drivers/xf86-input-mouse/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-mouse/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.8.1.ebuild b/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.8.1.ebuild
new file mode 100644
index 000000000000..b8faa5ee1f35
--- /dev/null
+++ b/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.8.1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for mouse input devices"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.7"
+DEPEND="${RDEPEND}"
+
+# To workaround gcc-4.6 bug 435640
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc46-workaround.patch
+)
diff --git a/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.0.ebuild b/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.0.ebuild
new file mode 100644
index 000000000000..5a7d7692bfa9
--- /dev/null
+++ b/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for mouse input devices"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.7"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.1.ebuild b/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.1.ebuild
new file mode 100644
index 000000000000..2ff71aa5c8b8
--- /dev/null
+++ b/x11-drivers/xf86-input-mouse/xf86-input-mouse-1.9.1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for mouse input devices"
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.7"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-mtrack/Manifest b/x11-drivers/xf86-input-mtrack/Manifest
new file mode 100644
index 000000000000..d00a56a1b642
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-input-mtrack-0.3.0.tar.gz 35826 SHA256 db509f64fff01ae77e1393a8461df5cbfd60e5bba45f5e9fb49a83fd0e6f999c SHA512 68422f04ce0b73473cbb4dc7e920dedfce2c91ece1ee59e84dc7f7be5d8e77a2c9b2284dbaefcb0b08ee14868e204c5841fd05320129ec56b33e6ee352c04688 WHIRLPOOL 953abd0200610be3d5ee7d93743d95166bfd5776be2534a83170ec77e3af4a43b140a9d86c78f0ef97873f55f52853a24bb1a0a2625afa94fb744705683ba86e
+DIST xf86-input-mtrack-0.3.1.tar.gz 370599 SHA256 bf972406d4d0fba1dec22ae3dbc1bbaee96763ee3457bfc57d64ffd99e6c6c10 SHA512 b8615970092138a7d3670a9783ac29bd57e8f86312af722e6439ef55ca5812a33bbf8460adda1931699084e8a56601c02f307d375e54723857a47f934718a448 WHIRLPOOL d9a3318e9585aaa88b5207a99bf8a3f3c60aa7f6bdbc694c6d150d569d86d2d8d0c2af2439224f23b376b9867e8ef39190778a466d22117fb0fe2605330947cf
diff --git a/x11-drivers/xf86-input-mtrack/files/xf86-input-mtrack-0.2.0-drop-mtrack-test.patch b/x11-drivers/xf86-input-mtrack/files/xf86-input-mtrack-0.2.0-drop-mtrack-test.patch
new file mode 100644
index 000000000000..5ee5e55db355
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/files/xf86-input-mtrack-0.2.0-drop-mtrack-test.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile.am b/Makefile.am
+index b22df2f..ed4c53c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -14,7 +14,7 @@ SOURCES_COMMON = \
+ $(srcdir)/driver/mprops.c
+ @DRIVER_NAME@_drv_ladir = @inputdir@
+
+-noinst_PROGRAMS = mtrack-test
++noinst_PROGRAMS =
+ mtrack_test_SOURCES = $(SOURCES_COMMON) \
+ $(srcdir)/tools/mtrack-test.c
+ mtrack_test_CFLAGS = $(AM_CFLAGS)
diff --git a/x11-drivers/xf86-input-mtrack/metadata.xml b/x11-drivers/xf86-input-mtrack/metadata.xml
new file mode 100644
index 000000000000..9f444a786712
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <maintainer>
+ <email>naota@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">BlueDragonX/xf86-input-mtrack</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.0.ebuild b/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.0.ebuild
new file mode 100644
index 000000000000..123fbab4b5e0
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.0.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+XORG_EAUTORECONF=yes
+
+inherit xorg-2 vcs-snapshot
+
+DESCRIPTION="Xorg Driver for Multitouch Trackpads"
+HOMEPAGE="https://github.com/BlueDragonX/xf86-input-mtrack"
+SRC_URI="http://github.com/BlueDragonX/xf86-input-mtrack/tarball/v${PV/_/-} -> ${P}.tar.gz"
+IUSE="debug"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm x86"
+
+RDEPEND="${RDEPEND}
+ >=sys-libs/mtdev-1.0"
+DEPEND="${DEPEND}
+ >=sys-libs/mtdev-1.0
+ x11-proto/randrproto
+ x11-proto/videoproto
+ x11-proto/xineramaproto"
+
+DOCS=( "README.md" )
+PATCHES=( "${FILESDIR}"/${PN}-0.2.0-drop-mtrack-test.patch )
+
+pkg_setup() {
+ xorg-2_pkg_setup
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ )
+}
+
+pkg_postinst() {
+ xorg-2_pkg_postinst
+
+ elog
+ elog "To enable multitouch support add the following lines"
+ elog "to your xorg.conf:"
+ elog ""
+ elog "Section \"InputClass\""
+ elog " MatchIsTouchpad \"true\""
+ elog " Identifier \"Touchpads\""
+ elog " Driver \"mtrack\""
+ elog "EndSection"
+ elog
+}
diff --git a/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.1.ebuild b/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.1.ebuild
new file mode 100644
index 000000000000..e9064683e84c
--- /dev/null
+++ b/x11-drivers/xf86-input-mtrack/xf86-input-mtrack-0.3.1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_EAUTORECONF=yes
+
+inherit xorg-2 vcs-snapshot
+
+DESCRIPTION="Xorg Driver for Multitouch Trackpads"
+HOMEPAGE="https://github.com/BlueDragonX/xf86-input-mtrack"
+SRC_URI="http://github.com/BlueDragonX/xf86-input-mtrack/tarball/v${PV/_/-} -> ${P}.tar.gz"
+IUSE="debug"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+
+RDEPEND="${RDEPEND}
+ >=sys-libs/mtdev-1.0"
+DEPEND="${DEPEND}
+ >=sys-libs/mtdev-1.0
+ x11-proto/randrproto
+ x11-proto/videoproto
+ x11-proto/xineramaproto"
+
+DOCS=( "README.md" )
+PATCHES=( "${FILESDIR}"/${PN}-0.2.0-drop-mtrack-test.patch )
+
+pkg_setup() {
+ xorg-2_pkg_setup
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ )
+}
+
+pkg_postinst() {
+ xorg-2_pkg_postinst
+
+ elog
+ elog "To enable multitouch support add the following lines"
+ elog "to your xorg.conf:"
+ elog ""
+ elog "Section \"InputClass\""
+ elog " MatchIsTouchpad \"true\""
+ elog " Identifier \"Touchpads\""
+ elog " Driver \"mtrack\""
+ elog "EndSection"
+ elog
+}
diff --git a/x11-drivers/xf86-input-mutouch/Manifest b/x11-drivers/xf86-input-mutouch/Manifest
new file mode 100644
index 000000000000..6bed043c215f
--- /dev/null
+++ b/x11-drivers/xf86-input-mutouch/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-mutouch-1.3.0.tar.bz2 268865 SHA256 e28907ec71f010353550e897c7a1f161b59969c6ad84379fb5285e032448a43c
diff --git a/x11-drivers/xf86-input-mutouch/metadata.xml b/x11-drivers/xf86-input-mutouch/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-mutouch/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-mutouch/xf86-input-mutouch-1.3.0.ebuild b/x11-drivers/xf86-input-mutouch/xf86-input-mutouch-1.3.0.ebuild
new file mode 100644
index 000000000000..904b450c3e03
--- /dev/null
+++ b/x11-drivers/xf86-input-mutouch/xf86-input-mutouch-1.3.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Microtouch input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-penmount/Manifest b/x11-drivers/xf86-input-penmount/Manifest
new file mode 100644
index 000000000000..d957ebef4655
--- /dev/null
+++ b/x11-drivers/xf86-input-penmount/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-penmount-1.5.0.tar.bz2 276864 SHA256 f45a85911a59647ba24f84c15f49d31d5f62a9bb86ca56881bf3ecbc21113ce7
diff --git a/x11-drivers/xf86-input-penmount/metadata.xml b/x11-drivers/xf86-input-penmount/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-penmount/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-penmount/xf86-input-penmount-1.5.0.ebuild b/x11-drivers/xf86-input-penmount/xf86-input-penmount-1.5.0.ebuild
new file mode 100644
index 000000000000..80f84ccffa7e
--- /dev/null
+++ b/x11-drivers/xf86-input-penmount/xf86-input-penmount-1.5.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="PenMount input driver"
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-synaptics/Manifest b/x11-drivers/xf86-input-synaptics/Manifest
new file mode 100644
index 000000000000..3bbf2d2e9986
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/Manifest
@@ -0,0 +1,4 @@
+DIST xf86-input-synaptics-1.7.4.tar.bz2 451614 SHA256 56a2d2df7bd39e29f56102c62f153e023f3e9b2f5e255309d33fab8e81945af7 SHA512 66db2e51be11e582ba3ea761d5ab65d05278230ddbe7741d7ae58cd844136feb9fc934e1ddc4845bb9961fa5a63743c3e612893d9196b1745140e4105b69220a WHIRLPOOL 914b8fa1db25c0c550368ccdd0e8856b5aefe091e1f29744c6bd350f5156018a6124c75f45517161a91773e54a045d09099c4d9cffa5800fd6e06b025f2822ce
+DIST xf86-input-synaptics-1.7.8.tar.bz2 495292 SHA256 14e7d54f81c2a2503f8acbe5e265dc336a0f2b30d007657d7afbeff979821c11 SHA512 b0f9ec0bd7ff2b7da40e597c331e3c0bffbb8abf2374ddaee5bbac3d1c848cb8a674e9b440c0e41b73916d3e89141d06d0d2ac9cb6ee0a050cba62379c004f50 WHIRLPOOL e02b0c56470b7e464d6516c98009d0953a80b9efe9a35ef2cb1c9a9018fa80952ba30cc9f882268aa64a280103b8953f4b6ee46ea3dd6b1c64467eea67d42fb5
+DIST xf86-input-synaptics-1.8.1.tar.bz2 479212 SHA256 d74fdaf29e9888a2cb494e16d0a9ddb24265c5c765b05392b69c50e84ffbf09a SHA512 15e3250accc5959705aa0cd4e36ed46767860e07ba34561a227b58476df0649739057087d65e9f77d094f766cc06dd9ebd4174abb5efdcc3a04e58031567c178 WHIRLPOOL 3172534dfd193fcc757844cec25ef23a051cd1cf8f4e9dfc31c774cdad170bf32399dd38a00714fcd22b4a776ad1eb0abbf01064f2770a9077e9f560435f12bf
+DIST xf86-input-synaptics-1.8.2.tar.bz2 484261 SHA256 7b0e164ebd02a680e0c695955e783059f37edb0c2656398e0a972adc8e698c80 SHA512 b8880e229437586e9be34aa26f1cfdac20de009caf85a95db39b0232221baf4dee670b2740b1946356fcbfb0bcc2515092daffaab826b3460698c28b48e20a12 WHIRLPOOL 9cbc809e5386c4d65394b5bcc8b3f569a0b754e04f9738a6ada3e7753ef9f8cfee81fddc62de15a99e36410116be935207e5947cd7bf969d2215b8e979d02e77
diff --git a/x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.7-glibc-2.20.patch b/x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.7-glibc-2.20.patch
new file mode 100644
index 000000000000..a599d8db4ccc
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/files/xf86-input-synaptics-1.7-glibc-2.20.patch
@@ -0,0 +1,61 @@
+From 96e60a4ea242d2decf109835981ae186cc36f642 Mon Sep 17 00:00:00 2001
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Fri, 29 Aug 2014 07:57:41 +1000
+Subject: Include xorg-server.h to fix build errors on newest glibc
+
+In file included from /usr/include/string.h:634:0,
+ from /usr/include/xorg/os.h:53,
+ from /usr/include/xorg/misc.h:115,
+ from /usr/include/xorg/xf86str.h:37,
+ from /usr/include/xorg/xf86Xinput.h:54,
+ from synproto.h:36,
+ from synproto.c:24:
+/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+
+See http://lists.freedesktop.org/archives/xorg-devel/2014-July/043070.html
+
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+diff --git a/src/eventcomm.h b/src/eventcomm.h
+index 4d759ff..e0f8743 100644
+--- a/src/eventcomm.h
++++ b/src/eventcomm.h
+@@ -27,6 +27,8 @@
+ #ifndef _EVENTCOMM_H_
+ #define _EVENTCOMM_H_
+
++#include <xorg-server.h>
++
+ #include <linux/input.h>
+ #include <linux/version.h>
+ #include <xf86Xinput.h>
+diff --git a/src/ps2comm.h b/src/ps2comm.h
+index 2be55e4..fa71d10 100644
+--- a/src/ps2comm.h
++++ b/src/ps2comm.h
+@@ -22,6 +22,8 @@
+ #ifndef _PS2COMM_H_
+ #define _PS2COMM_H_
+
++#include <xorg-server.h>
++
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+ #include "xf86_OSproc.h"
+diff --git a/src/synproto.h b/src/synproto.h
+index c52838c..6ba6740 100644
+--- a/src/synproto.h
++++ b/src/synproto.h
+@@ -31,6 +31,8 @@
+ #include "config.h"
+ #endif
+
++#include <xorg-server.h>
++
+ #include <unistd.h>
+ #include <sys/ioctl.h>
+ #include <xf86Xinput.h>
+--
+cgit v0.10.2
+
diff --git a/x11-drivers/xf86-input-synaptics/metadata.xml b/x11-drivers/xf86-input-synaptics/metadata.xml
new file mode 100644
index 000000000000..c923f3ff7c16
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>eva@gentoo.org</email>
+ <name>Gilles Dartiguelongue</name>
+ </maintainer>
+ <maintainer>
+ <email>egore@gmx.de</email>
+ <name>Christoph Brill</name>
+ <description>upstream co-maintainer</description>
+ </maintainer>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.4.ebuild b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.4.ebuild
new file mode 100644
index 000000000000..b745fcab1872
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.4.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Synaptics touchpads"
+HOMEPAGE="http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/"
+
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+IUSE=""
+
+RDEPEND="sys-libs/mtdev
+ >=x11-base/xorg-server-1.12
+ >=x11-libs/libXi-1.2
+ >=x11-libs/libXtst-1.1.0"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.37
+ >=x11-proto/inputproto-2.1.99.3
+ >=x11-proto/recordproto-1.14"
+
+DOCS=( "README" )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7-glibc-2.20.patch
+)
+
+pkg_pretend() {
+ linux-info_pkg_setup
+ # Just a friendly warning
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "This driver requires event interface support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.8.ebuild b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.8.ebuild
new file mode 100644
index 000000000000..21f5f57e9d76
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.7.8.ebuild
@@ -0,0 +1,42 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Synaptics touchpads"
+HOMEPAGE="http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/"
+
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="sys-libs/mtdev
+ >=x11-base/xorg-server-1.12
+ >=x11-libs/libXi-1.2
+ >=x11-libs/libXtst-1.1.0"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.37
+ >=x11-proto/inputproto-2.1.99.3
+ >=x11-proto/recordproto-1.14"
+
+DOCS=( "README" )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.7-glibc-2.20.patch
+)
+
+pkg_pretend() {
+ linux-info_pkg_setup
+ # Just a friendly warning
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "This driver requires event interface support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.1.ebuild b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.1.ebuild
new file mode 100644
index 000000000000..5d896923c970
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.1.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Synaptics touchpads"
+HOMEPAGE="http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/"
+
+KEYWORDS="amd64 arm ~mips ppc ppc64 x86"
+IUSE="kernel_linux"
+
+RDEPEND="kernel_linux? ( >=dev-libs/libevdev-0.4 )
+ >=x11-base/xorg-server-1.14
+ >=x11-libs/libXi-1.2
+ >=x11-libs/libXtst-1.1.0"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.37
+ >=x11-proto/inputproto-2.1.99.3
+ >=x11-proto/recordproto-1.14"
+
+DOCS=( "README" )
+
+pkg_pretend() {
+ linux-info_pkg_setup
+ # Just a friendly warning
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "This driver requires event interface support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.2.ebuild b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.2.ebuild
new file mode 100644
index 000000000000..215fd1050aa1
--- /dev/null
+++ b/x11-drivers/xf86-input-synaptics/xf86-input-synaptics-1.8.2.ebuild
@@ -0,0 +1,38 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Synaptics touchpads"
+HOMEPAGE="http://cgit.freedesktop.org/xorg/driver/xf86-input-synaptics/"
+
+KEYWORDS="~amd64 ~arm ~mips ~ppc ~ppc64 ~x86"
+IUSE="kernel_linux"
+
+RDEPEND="kernel_linux? ( >=dev-libs/libevdev-0.4 )
+ >=x11-base/xorg-server-1.14
+ >=x11-libs/libXi-1.2
+ >=x11-libs/libXtst-1.1.0"
+DEPEND="${RDEPEND}
+ >=sys-kernel/linux-headers-2.6.37
+ >=x11-proto/inputproto-2.1.99.3
+ >=x11-proto/recordproto-1.14"
+
+DOCS=( "README" )
+
+pkg_pretend() {
+ linux-info_pkg_setup
+ # Just a friendly warning
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "This driver requires event interface support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-input-tslib/Manifest b/x11-drivers/xf86-input-tslib/Manifest
new file mode 100644
index 000000000000..58f1a19717c7
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/Manifest
@@ -0,0 +1 @@
+DIST xf86-input-tslib_0.0.6-3.tar.gz 307751 SHA256 546083a3d70b0da4403fb2add28036ed48f6a91adb802044ac0e4f3bcbc429f5 SHA512 abc6060ba595790dab02a191861ee128a729916a6ea2df2a818a0b3388839dac933a0d7ee5530735f376f917f33bf8db40d42a7dce90b20a7682344370bc7b48 WHIRLPOOL ebaff4f9afb00ea49254faf1a858fafe885f904b14d682a6ad9731df334c42797d68f0bf3dff9487817e173e9ef450c7b5154edf9e4adb4f9b0b6fd989e908d5
diff --git a/x11-drivers/xf86-input-tslib/files/fix-overlapped-variable.patch b/x11-drivers/xf86-input-tslib/files/fix-overlapped-variable.patch
new file mode 100644
index 000000000000..7a4363e97277
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/files/fix-overlapped-variable.patch
@@ -0,0 +1,20 @@
+--- src/tslib.c.orig 2010-05-19 19:01:01.000000000 +0200
++++ src/tslib.c 2010-05-19 19:02:00.000000000 +0200
+@@ -543,7 +543,7 @@
+ return (pInfo);
+ }
+
+-_X_EXPORT InputDriverRec TSLIB = {
++_X_EXPORT InputDriverRec TSLIB_DRIVER = {
+ 1, /* driver version */
+ "tslib", /* driver name */
+ NULL, /* identify */
+@@ -580,7 +580,7 @@
+ {
+ static Bool Initialised = FALSE;
+
+- xf86AddInputDriver(&TSLIB, module, 0);
++ xf86AddInputDriver(&TSLIB_DRIVER, module, 0);
+
+ return module;
+ }
diff --git a/x11-drivers/xf86-input-tslib/files/xf86-input-tslib-0.0.6-xf86XInputSetScreen.patch b/x11-drivers/xf86-input-tslib/files/xf86-input-tslib-0.0.6-xf86XInputSetScreen.patch
new file mode 100644
index 000000000000..d3738bfecb96
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/files/xf86-input-tslib-0.0.6-xf86XInputSetScreen.patch
@@ -0,0 +1,23 @@
+diff -ur xf86-input-tslib-0.0.6.orig/src/tslib.c xf86-input-tslib-0.0.6/src/tslib.c
+--- xf86-input-tslib-0.0.6.orig/src/tslib.c 2012-12-05 01:12:16.286597071 +0100
++++ xf86-input-tslib-0.0.6/src/tslib.c 2012-12-05 01:11:02.686598595 +0100
+@@ -75,6 +75,19 @@
+ #define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options))
+ #endif
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 13
++static void
++xf86XInputSetScreen(InputInfoPtr pInfo,
++ int screen_number,
++ int x,
++ int y)
++{
++ if (miPointerGetScreen(pInfo->dev) !=
++ screenInfo.screens[screen_number]) {
++ miPointerSetScreen(pInfo->dev, screen_number, x, y);
++ }
++}
++#endif
+
+ enum { TSLIB_ROTATE_NONE=0, TSLIB_ROTATE_CW=270, TSLIB_ROTATE_UD=180, TSLIB_ROTATE_CCW=90 };
+
diff --git a/x11-drivers/xf86-input-tslib/files/xf86-input-tslib-port-ABI-12-r48.patch b/x11-drivers/xf86-input-tslib/files/xf86-input-tslib-port-ABI-12-r48.patch
new file mode 100644
index 000000000000..a4288fdc1350
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/files/xf86-input-tslib-port-ABI-12-r48.patch
@@ -0,0 +1,191 @@
+Index: xf86-input-tslib-trunk/src/tslib.c
+===================================================================
+--- xf86-input-tslib-trunk/src/tslib.c (revision 48)
++++ xf86-input-tslib-trunk/src/tslib.c (working copy)
+@@ -69,6 +69,13 @@
+ #define DEFAULT_HEIGHT 240
+ #define DEFAULT_WIDTH 320
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
++#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options), NULL)
++#else
++#define COLLECT_INPUT_OPTIONS(pInfo, options) xf86CollectInputOptions((pInfo), (options))
++#endif
++
++
+ enum { TSLIB_ROTATE_NONE=0, TSLIB_ROTATE_CW=270, TSLIB_ROTATE_UD=180, TSLIB_ROTATE_CCW=90 };
+
+ enum button_state { BUTTON_NOT_PRESSED = 0, BUTTON_1_PRESSED = 1, BUTTON_3_CLICK = 3, BUTTON_3_CLICKED=4, BUTTON_EMULATION_OFF=-1 };
+@@ -106,7 +113,7 @@
+ }
+
+ static Bool
+-ConvertProc( LocalDevicePtr local,
++ConvertProc( InputInfoPtr local,
+ int first,
+ int num,
+ int v0,
+@@ -135,7 +142,7 @@
+ return t;
+ }
+
+-static void ReadInput (LocalDevicePtr local)
++static void ReadInput (InputInfoPtr local)
+ {
+ struct ts_priv *priv = (struct ts_priv *) (local->private);
+ struct ts_sample samp;
+@@ -382,7 +389,11 @@
+ axiswidth - 1, /* max val */
+ axiswidth, /* resolution */
+ 0, /* min_res */
+- axiswidth); /* max_res */
++ axiswidth /* max_res */
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ ,Absolute
++#endif
++ );
+
+ InitValuatorAxisStruct(device, 1,
+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+@@ -392,7 +403,11 @@
+ axisheight - 1, /* max val */
+ axisheight, /* resolution */
+ 0, /* min_res */
+- axisheight); /* max_res */
++ axisheight /* max_res */
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++ ,Absolute
++#endif
++ );
+
+ if (InitProximityClassDeviceStruct (device) == FALSE) {
+ ErrorF ("Unable to allocate EVTouch touchscreen ProximityClassDeviceStruct\n");
+@@ -434,7 +449,7 @@
+ ErrorF("%s\n", __FUNCTION__);
+ xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
+ ts_close(priv->ts);
+- xfree(pInfo->private);
++ free(pInfo->private);
+ pInfo->private = NULL;
+ xf86DeleteInput(pInfo, 0);
+ }
+@@ -444,47 +459,57 @@
+ *
+ * called when the module subsection is found in XF86Config
+ */
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
++static int
++xf86TslibInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
++#else
+ static InputInfoPtr
+ xf86TslibInit(InputDriverPtr drv, IDevPtr dev, int flags)
++#endif
+ {
+ struct ts_priv *priv;
+ char *s;
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ InputInfoPtr pInfo;
++#endif
+
+- priv = xcalloc (1, sizeof (struct ts_priv));
++ priv = calloc (1, sizeof (struct ts_priv));
+ if (!priv)
+- return NULL;
++ return BadValue;
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ if (!(pInfo = xf86AllocateInput(drv, 0))) {
+- xfree(priv);
+- return NULL;
++ free(priv);
++ return BadValue;
+ }
+
+ /* Initialise the InputInfoRec. */
+ pInfo->name = dev->identifier;
+- pInfo->type_name = XI_TOUCHSCREEN;
+ pInfo->flags =
+ XI86_KEYBOARD_CAPABLE | XI86_POINTER_CAPABLE |
+ XI86_SEND_DRAG_EVENTS;
+- pInfo->device_control = xf86TslibControlProc;
+- pInfo->read_input = ReadInput;
+ #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
+ pInfo->motion_history_proc = xf86GetMotionEvents;
+ pInfo->history_size = 0;
+ #endif
+- pInfo->control_proc = NULL;
++ pInfo->conf_idev = dev;
+ pInfo->close_proc = NULL;
+- pInfo->switch_mode = NULL;
+ pInfo->conversion_proc = ConvertProc;
+ pInfo->reverse_conversion_proc = NULL;
+- pInfo->dev = NULL;
+ pInfo->private_flags = 0;
+ pInfo->always_core_feedback = 0;
+- pInfo->conf_idev = dev;
++#endif
++
++ pInfo->type_name = XI_TOUCHSCREEN;
++ pInfo->control_proc = NULL;
++ pInfo->read_input = ReadInput;
++ pInfo->device_control = xf86TslibControlProc;
++ pInfo->switch_mode = NULL;
+ pInfo->private = priv;
++ pInfo->dev = NULL;
+
+ /* Collect the options, and process the common options. */
+- xf86CollectInputOptions(pInfo, NULL, NULL);
++ COLLECT_INPUT_OPTIONS(pInfo, NULL);
+ xf86ProcessCommonOptions(pInfo, pInfo->options);
+
+ priv->screen_num = xf86SetIntOption(pInfo->options, "ScreenNumber", 0 );
+@@ -510,23 +535,31 @@
+ priv->rotate = TSLIB_ROTATE_NONE;
+ }
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ s = xf86CheckStrOption(dev->commonOptions, "path", NULL);
++#else
++ s = xf86CheckStrOption(pInfo->options, "path", NULL);
++#endif
+ if (!s)
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ s = xf86CheckStrOption(dev->commonOptions, "Device", NULL);
++#else
++ s = xf86CheckStrOption(pInfo->options, "Device", NULL);
++#endif
+
+ priv->ts = ts_open(s, 1);
+- xfree(s);
++ free(s);
+
+ if (!priv->ts) {
+ ErrorF("ts_open failed (device=%s)\n",s);
+ xf86DeleteInput(pInfo, 0);
+- return NULL;
++ return BadValue;
+ }
+
+ if (ts_config(priv->ts)) {
+ ErrorF("ts_config failed\n");
+ xf86DeleteInput(pInfo, 0);
+- return NULL;
++ return BadValue;
+ }
+
+ pInfo->fd = ts_fd(priv->ts);
+@@ -536,11 +569,13 @@
+ priv->state = BUTTON_EMULATION_OFF;
+ }
+
++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12
+ /* Mark the device configured */
+ pInfo->flags |= XI86_CONFIGURED;
++#endif
+
+ /* Return the configured device */
+- return (pInfo);
++ return Success;
+ }
+
+ _X_EXPORT InputDriverRec TSLIB = {
diff --git a/x11-drivers/xf86-input-tslib/metadata.xml b/x11-drivers/xf86-input-tslib/metadata.xml
new file mode 100644
index 000000000000..83fba9ad767e
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>embedded</herd>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r2.ebuild b/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r2.ebuild
new file mode 100644
index 000000000000..f8f3d6f5c5eb
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r2.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+PATCHLEVEL=3
+DEBSOURCES="${PN}_${PV}-${PATCHLEVEL}.tar.gz"
+
+DESCRIPTION="xorg input driver for use of tslib based touchscreen devices"
+HOMEPAGE="http://www.pengutronix.de/software/xf86-input-tslib/index_en.html"
+SRC_URI="ftp://cdn.debian.net/debian/pool/main/x/${PN}/${DEBSOURCES}"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86"
+IUSE=""
+
+RDEPEND="x11-libs/tslib"
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+S=${WORKDIR}/${PN}-trunk
+
+DOCS=( COPYING ChangeLog )
+
+PATCHES=(
+ "${FILESDIR}"/fix-overlapped-variable.patch
+ "${FILESDIR}"/${PN}-port-ABI-12-r48.patch
+)
diff --git a/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r3.ebuild b/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r3.ebuild
new file mode 100644
index 000000000000..061312c06dd4
--- /dev/null
+++ b/x11-drivers/xf86-input-tslib/xf86-input-tslib-0.0.6-r3.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+PATCHLEVEL=3
+DEBSOURCES="${PN}_${PV}-${PATCHLEVEL}.tar.gz"
+
+DESCRIPTION="xorg input driver for use of tslib based touchscreen devices"
+HOMEPAGE="http://www.pengutronix.de/software/xf86-input-tslib/index_en.html"
+SRC_URI="ftp://cdn.debian.net/debian/pool/main/x/${PN}/${DEBSOURCES}"
+
+LICENSE="GPL-2"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86"
+IUSE=""
+
+RDEPEND="x11-libs/tslib"
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+S=${WORKDIR}/${PN}-trunk
+
+DOCS=( COPYING ChangeLog )
+
+PATCHES=(
+ "${FILESDIR}"/fix-overlapped-variable.patch
+ "${FILESDIR}"/${PN}-port-ABI-12-r48.patch
+ "${FILESDIR}"/${P}-xf86XInputSetScreen.patch
+)
diff --git a/x11-drivers/xf86-input-vmmouse/Manifest b/x11-drivers/xf86-input-vmmouse/Manifest
new file mode 100644
index 000000000000..24ff2defbe47
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-input-vmmouse-13.0.0.tar.bz2 314269 SHA256 04cfb60366008d4db815c550d8fb8d0a4270c75fa7a20fa3bddc9ecbd355612c SHA512 738e1f8014099e4361344088de03d6c15f3c344ac6f194fdec27bd04a89eac6fd04bccede4cf4d54ca0c0a90f49a38563dcdd83b5cca1839f5f3a418aae75f30 WHIRLPOOL fa2f2b9a3f3ceae32dde6749fab91fa729808b92ebef12dfd8639045a1283116c942399fef9c691eaee79dd9ef271cbc569f523d531f774cd0124d7b4768b0b7
+DIST xf86-input-vmmouse-13.1.0.tar.bz2 319188 SHA256 0af558957ac1be1b2863712c2475de8f4d7f14921fd01ded2e2fde4921b19319 SHA512 38e09c5d7da971eb25ed79fc2daac3b8e1f5e6ec1096424696652c975ea653ed4a49d7779e7735d81a512c12c0a30829d5443ca78a275f3181ebd1740dd2dfd4 WHIRLPOOL df745f4be01ccc31c705d96624e8da084bfe83db4386a971bb01c4f867b7e36af5dab370172d6a22243eb7a3c9ad99ffcda7ddca9c9a87e3a3262d6b909e26ed
diff --git a/x11-drivers/xf86-input-vmmouse/files/xf86-input-vmmouse-13.0.0-add-missing-include.patch b/x11-drivers/xf86-input-vmmouse/files/xf86-input-vmmouse-13.0.0-add-missing-include.patch
new file mode 100644
index 000000000000..e8d57d8b8150
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/files/xf86-input-vmmouse-13.0.0-add-missing-include.patch
@@ -0,0 +1,44 @@
+From 1cbbc03c4b37d57760c57bd2e0b0f89d744a5795 Mon Sep 17 00:00:00 2001
+From: Stefan Dirsch <sndirsch@suse.de>
+Date: Tue, 7 Oct 2014 11:32:01 +0200
+Subject: vmmouse_client.h: Include xorg-server.h before xf86_OSproc.h
+
+xf86_OSproc.h cannot be included without first including xorg-server.h.
+
+Without this the build fails on systems with the latest glibc,
+throwing this error:
+
+In file included from /usr/include/string.h:634:0,
+ from /usr/include/xorg/os.h:53,
+ from /usr/include/xorg/misc.h:115,
+ from /usr/include/xorg/window.h:50,
+ from /usr/include/xorg/globals.h:7,
+ from /usr/include/xorg/opaque.h:34,
+ from /usr/include/xorg/xf86_OSproc.h:127,
+ from vmmouse_client.h:42,
+ from vmmouse_client.c:38:
+/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+strndup(const char *str, size_t n);
+
+This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h),
+causing os.h to redefine it.
+
+Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
+Reviewed-by: Daniel Stone <daniels@collabora.com>
+Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
+
+diff --git a/shared/vmmouse_client.h b/shared/vmmouse_client.h
+index b01bf08..1de51e5 100644
+--- a/shared/vmmouse_client.h
++++ b/shared/vmmouse_client.h
+@@ -39,6 +39,7 @@
+ #ifndef _VMMOUSE_CLIENT_H_
+ #define _VMMOUSE_CLIENT_H_
+
++#include "xorg-server.h"
+ #include "xf86_OSproc.h"
+
+ /*
+--
+cgit v0.10.2
+
diff --git a/x11-drivers/xf86-input-vmmouse/metadata.xml b/x11-drivers/xf86-input-vmmouse/metadata.xml
new file mode 100644
index 000000000000..8a4ab6d163db
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.0.0-r1.ebuild b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.0.0-r1.ebuild
new file mode 100644
index 000000000000..b519aa6bba5c
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.0.0-r1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="VMWare mouse input driver"
+IUSE=""
+KEYWORDS="amd64 x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-add-missing-include.patch
+)
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ --with-hal-bin-dir=/punt
+ --with-hal-callouts-dir=/punt
+ --with-hal-fdi-dir=/punt
+ )
+
+ xorg-2_pkg_setup
+}
+
+src_install() {
+ xorg-2_src_install
+ rm -rf "${ED}"/punt
+}
diff --git a/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.1.0.ebuild b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.1.0.ebuild
new file mode 100644
index 000000000000..e0bf9aea3297
--- /dev/null
+++ b/x11-drivers/xf86-input-vmmouse/xf86-input-vmmouse-13.1.0.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="VMWare mouse input driver"
+IUSE=""
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd ~x86-fbsd"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ --with-hal-bin-dir=/punt
+ --with-hal-callouts-dir=/punt
+ --with-hal-fdi-dir=/punt
+ )
+
+ xorg-2_pkg_setup
+}
+
+src_install() {
+ xorg-2_src_install
+ rm -rf "${ED}"/punt
+}
diff --git a/x11-drivers/xf86-input-void/Manifest b/x11-drivers/xf86-input-void/Manifest
new file mode 100644
index 000000000000..173c247e622a
--- /dev/null
+++ b/x11-drivers/xf86-input-void/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-input-void-1.4.0.tar.bz2 273454 SHA256 2ab95865252c64cc88050fa0089a74e063c357b71907bf9be7886047c4987505 SHA512 f7bc9820f93b266ac5b9c3e03c9921cc983c566df0ef195fff18408aac5dd2866b4a5bdbdeb69ac1f9af81c61abbf0c8b564299e5b5ebbcae9a27574843c0c85 WHIRLPOOL f4b24a88dd83d20283db929853540b17f70c70ccdcf1dd580b7f1170607f732fb1c79d007637a657c5d63611c039b8cd5c3284e07740b60d5c77fe8eec8e64ac
+DIST xf86-input-void-1.4.1.tar.bz2 271597 SHA256 f96e4f0a622821bf43a74bd419f2a18423343996c9d243c7e1430ba2d142339c SHA512 3cbcba9510635fc4a3b610fb940584417d4b3fcace88670b1289906a7da15614e9a286590cecd1840af4bb3bd0c62f246522b1203700067ec384c3cc11b7e94a WHIRLPOOL 010ef396474970d5f4dcd377eff91ee63617d771631740f745d63b7f076613aa76669a96506eff97b6f3b327ae64de42d47696fd3a054fe49c82c06c277fad3a
diff --git a/x11-drivers/xf86-input-void/metadata.xml b/x11-drivers/xf86-input-void/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-input-void/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-void/xf86-input-void-1.4.0.ebuild b/x11-drivers/xf86-input-void/xf86-input-void-1.4.0.ebuild
new file mode 100644
index 000000000000..f4e832783afb
--- /dev/null
+++ b/x11-drivers/xf86-input-void/xf86-input-void-1.4.0.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="null input driver"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.9.99.1"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-void/xf86-input-void-1.4.1.ebuild b/x11-drivers/xf86-input-void/xf86-input-void-1.4.1.ebuild
new file mode 100644
index 000000000000..60dde8a20f09
--- /dev/null
+++ b/x11-drivers/xf86-input-void/xf86-input-void-1.4.1.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="null input driver"
+
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.9.99.1"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-input-wacom/Manifest b/x11-drivers/xf86-input-wacom/Manifest
new file mode 100644
index 000000000000..70fc4121ee35
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-input-wacom-0.24.0.tar.bz2 581176 SHA256 96478b26c125938245d386f50b5286e362b85efdd71bf7faf27ed3d5292032b8 SHA512 e7c3af4a358d9a8e39992b6151201bb19c7df69b9b3a162015c73b8789e2e803317e02dd8492b00e769815b6936ff06f300676d64726b4dd5b5896122cd05fd6 WHIRLPOOL 5b9ec0321e2a35f23eb9242d71401b0f312983805297d9ac7586050f8f00c8890eabd823a08ff629cf2829b639098030f0e2247648697322342656479d0e85b9
+DIST xf86-input-wacom-0.29.0.tar.bz2 589495 SHA256 88507e76f1eb98a20c4381806e03c694adcff88ac0028f93892019a7a6fc8b96 SHA512 26035a0b49f15f1782ab0ffe4c24383db84f203f0e8c2e82a9e1f4fa015bc3272b6e7250ee2c25eaa1bba4c4eeb71775f2adc331d0df957bbb952dbe1c6766a4 WHIRLPOOL 68a89ea73370bcd7b9b79a7c17c6c10edf603c80300d3ea0b6092731bb9fff767fe4cc454a1f60585fa273165ce7706e72a6a07cf9d287867a504c385dcff8f1
+DIST xf86-input-wacom-0.30.0.tar.bz2 591648 SHA256 8ad4e479a4fc6d3c18e680958a8f42c3c87f15fdf8d2561810ca01a0a78841f5 SHA512 115e87715e736d77ad4e45e29287c855289cea5871983b7ad2e7e1e64954078de184d1b78157e958a0c9e7b949061b4c5599e2b11e87d5019a843bcaa34e0381 WHIRLPOOL 92f93b8694760c5dfbfb0182909e5b2ec3a8c197143962249c032f51483f3b194db12ad522cdfe8401b7368f99395dbf0b941b73a9691cea19cc156a180e6fb6
diff --git a/x11-drivers/xf86-input-wacom/metadata.xml b/x11-drivers/xf86-input-wacom/metadata.xml
new file mode 100644
index 000000000000..dfa7f95c2666
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <longdescription>Driver for Wacom tablets and drawing devices (friendly fork of linuxwacom)</longdescription>
+ <upstream>
+ <remote-id type="sourceforge">linuxwacom</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.24.0.ebuild b/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.24.0.ebuild
new file mode 100644
index 000000000000..6420bbe14477
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.24.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Wacom tablets and drawing devices"
+HOMEPAGE="http://linuxwacom.sourceforge.net/"
+LICENSE="GPL-2"
+EGIT_REPO_URI="git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/${PN}"
+[[ ${PV} != 9999* ]] && \
+ SRC_URI="mirror://sourceforge/linuxwacom/${PN}/${P}.tar.bz2"
+
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sparc x86"
+IUSE="debug"
+
+# depend on libwacom for its udev rules, bug #389633
+RDEPEND="dev-libs/libwacom
+ virtual/udev
+ >=x11-base/xorg-server-1.7
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama"
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ )
+}
+
+src_install() {
+ xorg-2_src_install
+
+ rm -rf "${ED}"/usr/share/hal
+}
+
+pkg_pretend() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present TABLET_USB_WACOM \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "If you use a USB Wacom tablet, you need to enable support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ ewarn " [*] Tablets --->"
+ ewarn " <*> Wacom Intuos/Graphire tablet support (USB)"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.29.0.ebuild b/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.29.0.ebuild
new file mode 100644
index 000000000000..8ec78b81c76c
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.29.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Wacom tablets and drawing devices"
+HOMEPAGE="http://linuxwacom.sourceforge.net/"
+LICENSE="GPL-2"
+EGIT_REPO_URI="git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/${PN}"
+[[ ${PV} != 9999* ]] && \
+ SRC_URI="mirror://sourceforge/linuxwacom/${PN}/${P}.tar.bz2"
+
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug"
+
+# depend on libwacom for its udev rules, bug #389633
+RDEPEND="dev-libs/libwacom
+ virtual/udev
+ >=x11-base/xorg-server-1.7
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama"
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ )
+}
+
+src_install() {
+ xorg-2_src_install
+
+ rm -rf "${ED}"/usr/share/hal
+}
+
+pkg_pretend() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present TABLET_USB_WACOM \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "If you use a USB Wacom tablet, you need to enable support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ ewarn " [*] Tablets --->"
+ ewarn " <*> Wacom Intuos/Graphire tablet support (USB)"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.30.0.ebuild b/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.30.0.ebuild
new file mode 100644
index 000000000000..8ec78b81c76c
--- /dev/null
+++ b/x11-drivers/xf86-input-wacom/xf86-input-wacom-0.30.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit linux-info xorg-2
+
+DESCRIPTION="Driver for Wacom tablets and drawing devices"
+HOMEPAGE="http://linuxwacom.sourceforge.net/"
+LICENSE="GPL-2"
+EGIT_REPO_URI="git://linuxwacom.git.sourceforge.net/gitroot/linuxwacom/${PN}"
+[[ ${PV} != 9999* ]] && \
+ SRC_URI="mirror://sourceforge/linuxwacom/${PN}/${P}.tar.bz2"
+
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="debug"
+
+# depend on libwacom for its udev rules, bug #389633
+RDEPEND="dev-libs/libwacom
+ virtual/udev
+ >=x11-base/xorg-server-1.7
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXrandr
+ x11-libs/libXinerama"
+DEPEND="${RDEPEND}
+ x11-proto/randrproto"
+
+pkg_setup() {
+ linux-info_pkg_setup
+
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ )
+}
+
+src_install() {
+ xorg-2_src_install
+
+ rm -rf "${ED}"/usr/share/hal
+}
+
+pkg_pretend() {
+ linux-info_pkg_setup
+
+ if ! linux_config_exists \
+ || ! linux_chkconfig_present TABLET_USB_WACOM \
+ || ! linux_chkconfig_present INPUT_EVDEV; then
+ echo
+ ewarn "If you use a USB Wacom tablet, you need to enable support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Input device support --->"
+ ewarn " <*> Event interface"
+ ewarn " [*] Tablets --->"
+ ewarn " <*> Wacom Intuos/Graphire tablet support (USB)"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-apm/Manifest b/x11-drivers/xf86-video-apm/Manifest
new file mode 100644
index 000000000000..8a0d9deb8bbb
--- /dev/null
+++ b/x11-drivers/xf86-video-apm/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-apm-1.2.4.tar.bz2 325979 SHA256 ae65982961fe884728497db9b805123d486d2aade2ba8e7bba9a3ee9dccf4302 SHA512 4b98614d8f2889d5330b50cb211f8b1f03ac9be30d531b7c14b117fa144b8a279b2f892370e19380a898711d95a6bfc11a116955c1caed65981798e3199211f1 WHIRLPOOL 07f2d1b17e8e63f6e34c4d8d335951552380649339df6d3fb87cb6b46bde3170312fce0498baccec5f2fea5b635693731c83f983186c3e3967a548176ff743e7
+DIST xf86-video-apm-1.2.5.tar.bz2 325277 SHA256 953b04320117b14c5b7efb37de45cef45592409f639c2aa87b7e2d77dc8d3d0f SHA512 652307d5e21fcd0df890b941821f409cc0c9846133cf7e522799710d28ebf0d8ff2d8ead3235d8207169f416a6561bc14b4fedb1baaddb1bddf03007372af622 WHIRLPOOL 04f34982d8483eaf8a9b8fa8d92593635f6a1abe78ba904cf3ad88a605c03fd0283bc42c6f42c1c8e6c0d70298a0c98b3cde3fc16bda70e32c3fc2cde979223a
diff --git a/x11-drivers/xf86-video-apm/files/xf86-video-apm-1.2.5-remove-mibstore_h.patch b/x11-drivers/xf86-video-apm/files/xf86-video-apm-1.2.5-remove-mibstore_h.patch
new file mode 100644
index 000000000000..e48d2c42d832
--- /dev/null
+++ b/x11-drivers/xf86-video-apm/files/xf86-video-apm-1.2.5-remove-mibstore_h.patch
@@ -0,0 +1,23 @@
+From 9f67408e4f078e907fbf4feb45cfdcfd0cdebcca Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Thu, 10 Jan 2013 03:03:29 +0000
+Subject: Remove #include "mibstore.h"
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/apm.h b/src/apm.h
+index a3c06f8..365e5e2 100644
+--- a/src/apm.h
++++ b/src/apm.h
+@@ -33,9 +33,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+-
+ /* I2C support */
+ #include "xf86i2c.h"
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-apm/metadata.xml b/x11-drivers/xf86-video-apm/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-apm/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.4.ebuild b/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.4.ebuild
new file mode 100644
index 000000000000..c42402937409
--- /dev/null
+++ b/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.4.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Alliance ProMotion video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5-r1.ebuild b/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5-r1.ebuild
new file mode 100644
index 000000000000..cc1d1ee4b372
--- /dev/null
+++ b/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="Alliance ProMotion video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5.ebuild b/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5.ebuild
new file mode 100644
index 000000000000..c42402937409
--- /dev/null
+++ b/x11-drivers/xf86-video-apm/xf86-video-apm-1.2.5.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Alliance ProMotion video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-ark/Manifest b/x11-drivers/xf86-video-ark/Manifest
new file mode 100644
index 000000000000..fe023236c117
--- /dev/null
+++ b/x11-drivers/xf86-video-ark/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-ark-0.7.5.tar.bz2 290423 SHA256 c690e046f34a393aac1c8d9616b4790e93cda60a460b00b9597d322175dbe51e SHA512 67c2b4e2109bf9d84a007c9679d35e7c0a4e4ddcdb7be9fa5070ce7e2f666e018d8421ddd4890cf3abb4eb37e060a10666c62a9efbb5369eb7cd8647ee18a644 WHIRLPOOL f1d2f76eb10dd475f8bbd562300cff9f89874f3676eff12e54d86ee9d0ec291e6e9763f2d98b753684c328e92a138dee1bfcda6423ac33dbb4003d7edb1336cd
diff --git a/x11-drivers/xf86-video-ark/files/xf86-video-ark-0.7.5-remove-mibstore_h.patch b/x11-drivers/xf86-video-ark/files/xf86-video-ark-0.7.5-remove-mibstore_h.patch
new file mode 100644
index 000000000000..1acea99c45b1
--- /dev/null
+++ b/x11-drivers/xf86-video-ark/files/xf86-video-ark-0.7.5-remove-mibstore_h.patch
@@ -0,0 +1,35 @@
+From 3a3eb72baec46f48e6cf15a834271c3d3386deac Mon Sep 17 00:00:00 2001
+From: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue, 17 Sep 2013 19:55:37 +0000
+Subject: Remove usage of mibstore.h (removed from server)
+
+The module had a compile error for this missing header file.
+
+Changes similar to vmware commit
+23d87c92b7211cc5249eefe4ab3a2c7f370e279e
+
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+---
+diff --git a/src/ark_driver.c b/src/ark_driver.c
+index b7c287c..65cfe84 100644
+--- a/src/ark_driver.c
++++ b/src/ark_driver.c
+@@ -39,7 +39,6 @@
+ #include "compiler.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+-#include "mibstore.h"
+ #include "fb.h"
+ #include "ark.h"
+
+@@ -538,7 +537,6 @@ static Bool ARKScreenInit(SCREEN_INIT_ARGS_DECL)
+
+ fbPictureInit (pScreen, 0, 0);
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+
+ if (!pARK->NoAccel) {
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-ark/metadata.xml b/x11-drivers/xf86-video-ark/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-ark/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-ark/xf86-video-ark-0.7.5.ebuild b/x11-drivers/xf86-video-ark/xf86-video-ark-0.7.5.ebuild
new file mode 100644
index 000000000000..30731527903c
--- /dev/null
+++ b/x11-drivers/xf86-video-ark/xf86-video-ark-0.7.5.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for ark cards"
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ >=x11-libs/libpciaccess-0.12.901"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-ast/Manifest b/x11-drivers/xf86-video-ast/Manifest
new file mode 100644
index 000000000000..4e506ec30333
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-ast-0.97.0.tar.bz2 336424 SHA256 28fcd4781676485293f6dcd46e0797866f6219e22e1851c9796b037589998e76 SHA512 7eadb06c0159d460977b6e99183e6f1c4673f18b26072d9c28fc38518522fe9adade89531a42d83e277d545a3f157c37c6600b0330bb90327c1a17b5698fa22d WHIRLPOOL 4071241b698f88abb88b932aee7ad9743c967fb9ba0f19cba2fa8671543fb27beeae5747e7b0126810027bbcd766f3528bd74179faaa149a002180929e534d59
+DIST xf86-video-ast-1.0.1.tar.bz2 334841 SHA256 e778f1824f5eed7e3197f00f39418de1525e310fd78e0335f6178c26b9b0495b SHA512 d7c5bb52f05a8ebd4a3e5ae8554462793d9038980d8607c1bfd5c6b89f4a1b0a83931792315cd170900197c8d7a28d47e761f2e1a344218d2b1c49140eb8faa0 WHIRLPOOL 56cacfc2ad3c020e6dae92d47d5fde15dbfff3f6af07eadc840c90f273825861f6cd247f3d8e5452d5b278bb57994f0adc09b65fdd1f3f80d5808ffcf1f8c3ca
diff --git a/x11-drivers/xf86-video-ast/files/xf86-video-ast-0.97.0-remove-mibstore_h.patch b/x11-drivers/xf86-video-ast/files/xf86-video-ast-0.97.0-remove-mibstore_h.patch
new file mode 100644
index 000000000000..006daaa13530
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/files/xf86-video-ast-0.97.0-remove-mibstore_h.patch
@@ -0,0 +1,101 @@
+From 0833e0086b9712b1c29571919899d5d17fea8382 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:33 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/ast_2dtool.c b/src/ast_2dtool.c
+index 6be9a4f..684e400 100644
+--- a/src/ast_2dtool.c
++++ b/src/ast_2dtool.c
+@@ -27,7 +27,6 @@
+ #include "xf86_OSproc.h"
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+diff --git a/src/ast_accel.c b/src/ast_accel.c
+index a789b21..0e7e5d3 100644
+--- a/src/ast_accel.c
++++ b/src/ast_accel.c
+@@ -27,7 +27,6 @@
+ #include "xf86_OSproc.h"
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+diff --git a/src/ast_cursor.c b/src/ast_cursor.c
+index 47ea09d..c672564 100644
+--- a/src/ast_cursor.c
++++ b/src/ast_cursor.c
+@@ -27,7 +27,6 @@
+ #include "xf86_OSproc.h"
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+diff --git a/src/ast_driver.c b/src/ast_driver.c
+index 5e6a26e..43fcdbc 100644
+--- a/src/ast_driver.c
++++ b/src/ast_driver.c
+@@ -31,7 +31,6 @@
+ #endif
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+@@ -888,7 +887,6 @@ ASTScreenInit(SCREEN_INIT_ARGS_DECL)
+ }
+ #endif /* end of Accel_2D */
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+diff --git a/src/ast_mode.c b/src/ast_mode.c
+index 50289f1..2e06062 100644
+--- a/src/ast_mode.c
++++ b/src/ast_mode.c
+@@ -27,7 +27,6 @@
+ #include "xf86_OSproc.h"
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+diff --git a/src/ast_tool.c b/src/ast_tool.c
+index c701c1e..c2bfac6 100644
+--- a/src/ast_tool.c
++++ b/src/ast_tool.c
+@@ -27,7 +27,6 @@
+ #include "xf86_OSproc.h"
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+diff --git a/src/ast_vgatool.c b/src/ast_vgatool.c
+index 42de52c..513cf7b 100644
+--- a/src/ast_vgatool.c
++++ b/src/ast_vgatool.c
+@@ -27,7 +27,6 @@
+ #include "xf86_OSproc.h"
+ #include "xf86cmap.h"
+ #include "compiler.h"
+-#include "mibstore.h"
+ #include "vgaHW.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-ast/metadata.xml b/x11-drivers/xf86-video-ast/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-ast/xf86-video-ast-0.97.0-r1.ebuild b/x11-drivers/xf86-video-ast/xf86-video-ast-0.97.0-r1.ebuild
new file mode 100644
index 000000000000..204b053a9a44
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/xf86-video-ast-0.97.0-r1.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for ASpeedTech cards"
+KEYWORDS="amd64 x86 ~amd64-fbsd ~x86-fbsd"
+LICENSE="MIT"
+IUSE=""
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-ast/xf86-video-ast-1.0.1.ebuild b/x11-drivers/xf86-video-ast/xf86-video-ast-1.0.1.ebuild
new file mode 100644
index 000000000000..4809ecb3124f
--- /dev/null
+++ b/x11-drivers/xf86-video-ast/xf86-video-ast-1.0.1.ebuild
@@ -0,0 +1,12 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for ASpeedTech cards"
+KEYWORDS="amd64 x86 ~amd64-fbsd ~x86-fbsd"
+LICENSE="MIT"
+IUSE=""
diff --git a/x11-drivers/xf86-video-ati/Manifest b/x11-drivers/xf86-video-ati/Manifest
new file mode 100644
index 000000000000..7d030a4fbe16
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/Manifest
@@ -0,0 +1,4 @@
+DIST xf86-video-ati-6.14.6.tar.bz2 1139495 SHA256 aa5286b3e4f0187d7df14785c06dd800255d9405205dbf061da5d77df86bec36 SHA512 7ed64bb3596703f7c575aec37a6918bac251819fe638acc66a29aab7648d8a81dedd8d416f970faa1f757fa8e9e3ccdc43e4499d06271cc2751288040d1d957e WHIRLPOOL 9b72e873c3108daeb10cfc68523eb9bc2c12f5525096f9a2639a7dbeb58fd2912b474b8820172ffc9351458d2e046b43e0d064bb4f4189bb99b06a995f3204e8
+DIST xf86-video-ati-7.3.0.tar.bz2 816346 SHA256 107c072c4919a996e04f47afdb53d5946a3ad574f270b8c560ef8b3a032046fe SHA512 185fd0714cae2b5fd29be201dd272f58964303c1bd3e006bfd85e7b260afc0787ee4eb3954fb8452e8876f0094ac8b0be67ebeb29e1b768937afeeecdad3dc32 WHIRLPOOL f70b29c585f4b51aa487173a14050a0bd5772143884d3bc3ef5be00fd3701a4c95ea83079ac045f3c215a0f1c41d8cc83f0db60a151da9b624c4808efbcac19e
+DIST xf86-video-ati-7.4.0.tar.bz2 832763 SHA256 96230ca9859a2a3e347b7f37597b7b344e80b83f378d3a8463ab1ceb69df76d9 SHA512 94f3620972f21dab3c4ead8d18dcd0333903fe820b647f86a0e6efe4edb712ec0450a1cfd32b1ff51ab803ae76aaa889fc8c8cad7b6c52a3b51462c780111458 WHIRLPOOL 7bd0e6d98db97d4fa282e975826aab2e6ade9ce9bdbb958df41f0961a62fc7f78c18755ec10bc1665a80e24db890ca5d9cacbeba19eb70a53a226133e7817044
+DIST xf86-video-ati-7.5.0.tar.bz2 809756 SHA256 ec3e6f06b6cf9a40c72aafa3448aae8b034c80b37410ca9442d5cf6806e07936 SHA512 51ea3934285c579314614e336cee0d5c079a466cdc94f2c8649d9499515af3dfb37a7ac87ed69c6dbf6befa5bfca27f8305bbc028ff722e2f87143da5f101f7c WHIRLPOOL ba132708f423cebde7398cc6c9c18334a544ebaef4a60104ea27abeb4afa4a01b9a3dffa00c89e01a6cbf858cc410041d102c8327bc2167ebca5e941d4463f23
diff --git a/x11-drivers/xf86-video-ati/metadata.xml b/x11-drivers/xf86-video-ati/metadata.xml
new file mode 100644
index 000000000000..b19c4dca8ea3
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<use>
+ <flag name="glamor">Enable Glamor OpenGL 2D acceleration</flag>
+</use>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-ati/xf86-video-ati-6.14.6-r1.ebuild b/x11-drivers/xf86-video-ati/xf86-video-ati-6.14.6-r1.ebuild
new file mode 100644
index 000000000000..00b7132b17a6
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/xf86-video-ati-6.14.6-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+XORG_DRI=always
+XORG_EAUTORECONF=yes
+inherit xorg-2
+
+DESCRIPTION="ATI video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-libs/libdrm-2.4.36[video_cards_radeon]"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # disable XAA to allow building against >=xorg-server-1.12.99.902, bug #428094
+ sed -i '/USE_XAA, 1/d' configure.ac || die
+ xorg-2_src_prepare
+}
+
+pkg_setup() {
+ xorg-2_pkg_setup
+ XORG_CONFIGURE_OPTIONS=(
+ --enable-dri
+ --enable-kms
+ --enable-exa
+ )
+}
diff --git a/x11-drivers/xf86-video-ati/xf86-video-ati-7.3.0.ebuild b/x11-drivers/xf86-video-ati/xf86-video-ati-7.3.0.ebuild
new file mode 100644
index 000000000000..e90ba6211db9
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/xf86-video-ati-7.3.0.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit linux-info xorg-2
+
+DESCRIPTION="ATI video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86"
+IUSE="+glamor udev"
+
+RDEPEND=">=x11-libs/libdrm-2.4.46[video_cards_radeon]
+ glamor? ( >=x11-libs/glamor-0.6 )
+ udev? ( virtual/udev )"
+DEPEND="${RDEPEND}"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ if kernel_is -ge 3 9; then
+ CONFIG_CHECK="~!DRM_RADEON_UMS ~!FB_RADEON"
+ else
+ CONFIG_CHECK="~DRM_RADEON_KMS ~!FB_RADEON"
+ fi
+ fi
+ check_extra_config
+}
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable glamor)
+ $(use_enable udev)
+ )
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-ati/xf86-video-ati-7.4.0.ebuild b/x11-drivers/xf86-video-ati/xf86-video-ati-7.4.0.ebuild
new file mode 100644
index 000000000000..c1f06089a841
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/xf86-video-ati-7.4.0.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit linux-info xorg-2
+
+DESCRIPTION="ATI video driver"
+
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="+glamor udev"
+
+RDEPEND=">=x11-libs/libdrm-2.4.54[video_cards_radeon]
+ glamor? ( || (
+ x11-base/xorg-server[glamor]
+ >=x11-libs/glamor-0.6
+ ) )
+ udev? ( virtual/udev )"
+DEPEND="${RDEPEND}"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ if kernel_is -ge 3 9; then
+ CONFIG_CHECK="~!DRM_RADEON_UMS ~!FB_RADEON"
+ else
+ CONFIG_CHECK="~DRM_RADEON_KMS ~!FB_RADEON"
+ fi
+ fi
+ check_extra_config
+}
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable glamor)
+ $(use_enable udev)
+ )
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-ati/xf86-video-ati-7.5.0.ebuild b/x11-drivers/xf86-video-ati/xf86-video-ati-7.5.0.ebuild
new file mode 100644
index 000000000000..4d6f4d29786c
--- /dev/null
+++ b/x11-drivers/xf86-video-ati/xf86-video-ati-7.5.0.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit linux-info xorg-2
+
+DESCRIPTION="ATI video driver"
+HOMEPAGE="http://www.x.org/wiki/ati/"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86"
+IUSE="+glamor udev"
+
+RDEPEND=">=x11-libs/libdrm-2.4.58[video_cards_radeon]
+ >=x11-libs/libpciaccess-0.8.0
+ glamor? ( || (
+ x11-base/xorg-server[glamor]
+ >=x11-libs/glamor-0.6
+ ) )
+ udev? ( virtual/udev )"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/videoproto
+ x11-proto/xextproto
+ x11-proto/xf86driproto
+ x11-proto/xproto"
+
+pkg_pretend() {
+ if use kernel_linux ; then
+ if kernel_is -ge 3 9; then
+ CONFIG_CHECK="~!DRM_RADEON_UMS ~!FB_RADEON"
+ else
+ CONFIG_CHECK="~DRM_RADEON_KMS ~!FB_RADEON"
+ fi
+ fi
+ check_extra_config
+}
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable glamor)
+ $(use_enable udev)
+ )
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-chips/Manifest b/x11-drivers/xf86-video-chips/Manifest
new file mode 100644
index 000000000000..64f3776e6385
--- /dev/null
+++ b/x11-drivers/xf86-video-chips/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-chips-1.2.4.tar.bz2 365618 SHA256 fb6dc34a8d7db82dc6d555cebe6f95c2269dda4872118978345f6e1215ab4d25 SHA512 e10e175caf280d158f94fcd10bc16c98b9df46eaaae58a524faca5c91248213ecb9ee0b630ec0c70d0faf3fcc710e6a3360aed212d1c824c82c32d1a077f91cb WHIRLPOOL 0339f4c1b4e26644c70d27fce72b5fac9d92f3e8eab35e53ee13c9309a2c661628f98d019f941132c5ed06a47ba1985fb610064813d926a48db335535eb8bef1
+DIST xf86-video-chips-1.2.5.tar.bz2 398804 SHA256 8d3c744d035b3d769049647bb8022ec24500d31b1b224cd0ea4efe61f86bfed2 SHA512 3468d453fb3bc01b115d0a4a9f10bebe43b89c9cd997e2991d459a40a2f8a0e3ed2cb40bfcb2b80fae853af8c9ea6a94c82d73d16a27fe9612c8a1f2a6fbd3d4 WHIRLPOOL e776be36cc09cd43165d8798a1327bd7a35bd990fc76c320d550137b726601369bc8baa9d0deec649e6cd170eb04ab7b8570bb8d7483ff3a919d27a7ca277eb8
diff --git a/x11-drivers/xf86-video-chips/files/xf86-video-chips-1.2.5-remove-mibstore_h.patch b/x11-drivers/xf86-video-chips/files/xf86-video-chips-1.2.5-remove-mibstore_h.patch
new file mode 100644
index 000000000000..bfd94181e9f8
--- /dev/null
+++ b/x11-drivers/xf86-video-chips/files/xf86-video-chips-1.2.5-remove-mibstore_h.patch
@@ -0,0 +1,39 @@
+From 151a1ec855a9ada44907cb6bef06a71e9080504b Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:34 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/ct_driver.c b/src/ct_driver.c
+index 6f3a5d4..effbc60 100644
+--- a/src/ct_driver.c
++++ b/src/ct_driver.c
+@@ -96,9 +96,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+-
+ /* All drivers using the mi banking wrapper need this */
+ #ifdef HAVE_ISA
+ #include "mibank.h"
+@@ -4145,7 +4142,6 @@ CHIPSScreenInit(SCREEN_INIT_ARGS_DECL)
+ pBankInfo = NULL;
+ return FALSE;
+ }
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+
+ /* Initialise cursor functions */
+@@ -4296,7 +4292,6 @@ CHIPSScreenInit(SCREEN_INIT_ARGS_DECL)
+ }
+ }
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ #ifdef ENABLE_SILKEN_MOUSE
+ xf86SetSilkenMouse(pScreen);
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-chips/metadata.xml b/x11-drivers/xf86-video-chips/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-chips/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.4.ebuild b/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.4.ebuild
new file mode 100644
index 000000000000..9231092ac6f8
--- /dev/null
+++ b/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.4.ebuild
@@ -0,0 +1,12 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Chips and Technologies video driver"
+
+KEYWORDS="amd64 ia64 ppc x86 ~x86-fbsd"
+IUSE=""
diff --git a/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5-r1.ebuild b/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5-r1.ebuild
new file mode 100644
index 000000000000..f8e0e2dc3aac
--- /dev/null
+++ b/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5-r1.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="Chips and Technologies video driver"
+
+KEYWORDS="amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5.ebuild b/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5.ebuild
new file mode 100644
index 000000000000..28ae72c4cb70
--- /dev/null
+++ b/x11-drivers/xf86-video-chips/xf86-video-chips-1.2.5.ebuild
@@ -0,0 +1,12 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Chips and Technologies video driver"
+
+KEYWORDS="amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
diff --git a/x11-drivers/xf86-video-cirrus/Manifest b/x11-drivers/xf86-video-cirrus/Manifest
new file mode 100644
index 000000000000..c8326f318239
--- /dev/null
+++ b/x11-drivers/xf86-video-cirrus/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-video-cirrus-1.5.1.tar.bz2 329436 SHA256 a955429cbd673230c4b171afd6d0a6b28372d2f9d0a400f5124869274a27c557 SHA512 1f134986e6d91ecb9f88c331240f3d4b687029c45db1321dd1d95fefd88991bc38c2ec634259a58a8178d567dc0902d98800edf87886f691db10e5fd5385c526 WHIRLPOOL ef8452daa41000bf2023de78ae8b3026ec9fc21f123bc5f121eb56fc185ccbe1d8611845f6bcec4e35e706b36c7670bbadb11cbb7206ab6584277df01ad8c425
+DIST xf86-video-cirrus-1.5.2.tar.bz2 327547 SHA256 3361e1a65d9b84c464752fd612bdf6087622c6dd204121715366a170e5c3ccd7 SHA512 2af1b089527fb715b07b6d50da863972a1d063863e976c5e75576e70b502b74af43bc38adba917dc916f79d9d122ada41f49dcaf41b4b4289de012a4ef4be838 WHIRLPOOL fa5e0c40b8ad1fe42d7d9ed843c89a33694085552e6b8e047df4b4e5143d73613128ffb5d38c7db7b030ba7731a7b674ea79cd24a9b0c19771835f73c429d6c0
+DIST xf86-video-cirrus-1.5.3.tar.bz2 338930 SHA256 edc87b20a55259126b5239b5c1ef913419eab7ded0ed12ae9ae989460d7351ab SHA512 6aec70f943d9bf7455782d300bd5e1caab5c90408cdca25b9a3ef314e565082f3249a179fb508be36a61c8a34006c0ace14b9aa41f724f479511a906fa8f4798 WHIRLPOOL f7d584d9e435c73152a6526a808bfc07d5ef2117a04c6d7400b3d966ea08fa49b3c297a3c0ce6278721ec1bf1c04ebef0be5eb76d8bea7518c890dbca1c804f4
diff --git a/x11-drivers/xf86-video-cirrus/metadata.xml b/x11-drivers/xf86-video-cirrus/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-cirrus/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.1.ebuild b/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.1.ebuild
new file mode 100644
index 000000000000..d900fee93902
--- /dev/null
+++ b/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.1.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="Cirrus Logic video driver"
+KEYWORDS="alpha amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.2.ebuild b/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.2.ebuild
new file mode 100644
index 000000000000..d900fee93902
--- /dev/null
+++ b/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.2.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="Cirrus Logic video driver"
+KEYWORDS="alpha amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.3.ebuild b/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.3.ebuild
new file mode 100644
index 000000000000..8f0e45db4e56
--- /dev/null
+++ b/x11-drivers/xf86-video-cirrus/xf86-video-cirrus-1.5.3.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="Cirrus Logic video driver"
+KEYWORDS="alpha amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-dummy/Manifest b/x11-drivers/xf86-video-dummy/Manifest
new file mode 100644
index 000000000000..9ac79f47954c
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-dummy-0.3.6.tar.bz2 285892 SHA256 44335b640126d339700256dae731bd5af79afd027da172bad8a991a33a1de798 SHA512 3a530083d591ebde37b58a329d9a6ed4955d09d8f3f7fb566840681f2588aa752014c8753f411aec0410a2704b3b55729868a27aee138df42eb7d7bb5a5a52c5 WHIRLPOOL 4475426b4469968ad63f830a66cc44452f39194c0abcaf9b54e527fe8c560f6dc7b38030a5f1dd95ecec9e82f291bcb3bde3820c1506f2bcdce60d1e352e6ec4
+DIST xf86-video-dummy-0.3.7.tar.bz2 279806 SHA256 56f84fcbc515685529ad8e10bca1072731d9c096b97c5d35ddc95cd589b98680 SHA512 2893964f19901af0b18417a271a3418c5adfaa311cd1688c159b86a7bdf68517d53d98a9b2c1a9942c7d2cde8ccb742832fd78c2ab0aa29844d261b9334548ec WHIRLPOOL 7c028fdd13ee0194cedecc7ca1409254b5cfc3f1766c50f87cbd36e9d8e705e603c4cb7d02980b2ad6f35774686560690441b292206ec637bcbe3e9237196315
diff --git a/x11-drivers/xf86-video-dummy/metadata.xml b/x11-drivers/xf86-video-dummy/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.6.ebuild b/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.6.ebuild
new file mode 100644
index 000000000000..5552b569a23f
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.6.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for dummy cards"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="dga"
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ dga? (
+ x11-proto/xf86dgaproto
+ )"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dga)
+ )
+ xorg-2_pkg_setup
+}
diff --git a/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.7.ebuild b/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.7.ebuild
new file mode 100644
index 000000000000..ddbb5c625ff6
--- /dev/null
+++ b/x11-drivers/xf86-video-dummy/xf86-video-dummy-0.3.7.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for dummy cards"
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
+IUSE="dga"
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ dga? (
+ x11-proto/xf86dgaproto
+ )"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dga)
+ )
+ xorg-2_pkg_setup
+}
diff --git a/x11-drivers/xf86-video-fbdev/Manifest b/x11-drivers/xf86-video-fbdev/Manifest
new file mode 100644
index 000000000000..ebe2ef8c62d8
--- /dev/null
+++ b/x11-drivers/xf86-video-fbdev/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-fbdev-0.4.4.tar.bz2 293545 SHA256 9dd4b326498223abbfdf786089a46ea3db4fa6bbd341308eb48a9e00bc3fd51b SHA512 942ccf7e528b7cf0af19ef0efc9f5c60ab558bd865aad330f1c58a9ef063f9b38b4e62e5622270c0bfc237cb3cbc579d43b854aaa64fa2a9130eede73b1e55e9 WHIRLPOOL 0f1a3ad97f85ce1631501b08c7f6207b90e10fc2566d7a579ae018e19ddbd481bcf25dc203cb14c623ee038fcef60ab544b509e773df422f2d73e764bb6b134e
diff --git a/x11-drivers/xf86-video-fbdev/metadata.xml b/x11-drivers/xf86-video-fbdev/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-fbdev/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.4.4.ebuild b/x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.4.4.ebuild
new file mode 100644
index 000000000000..9aa2bc5c433b
--- /dev/null
+++ b/x11-drivers/xf86-video-fbdev/xf86-video-fbdev-0.4.4.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="video driver for framebuffer device"
+
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="x11-base/xorg-server"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/videoproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-freedreno/Manifest b/x11-drivers/xf86-video-freedreno/Manifest
new file mode 100644
index 000000000000..a2df8d6070fd
--- /dev/null
+++ b/x11-drivers/xf86-video-freedreno/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-video-freedreno-1.0.0.tar.bz2 310884 SHA256 6f11ce10a86b154c2a827632c6be4d33d32c4f982a72c355680f8c3bb22db767 SHA512 80d1d8a5d69dd36df2c23f72460c40604d1873389bc3ab446b876587500dac4c88b10512552a884809bdc886207649ba3815d5a0e576d23ea723823055ac4877 WHIRLPOOL e23ef483791a9dccfd8284af71631a3c9289ea665d321215e3a36c8c79924ee5c6300a09fc667d4f9d1e2f8400bc5c6d96f74856accbdf37e5cfd387de30925f
+DIST xf86-video-freedreno-1.1.0.tar.bz2 324575 SHA256 7ac0a972d4a5610a1ca32ae0aee2733db907fd017c1c8b9c4c0482540bb985cf SHA512 f4dfa1e246340b59ebf49826b71edc8d69ae9fea3ff41780d0a11fe5fab8e714b094cc8bd7e8d20537eac52d489518a8ae3848fd13d584ed764d14066d0cf117 WHIRLPOOL 2844805c73f61d5e7e67449c954eed806e31ddedf0cc5354318e847dc3a76678cbc28acd79a046f0e727e320ba1d99907497295b8e5300cffc7b34f87b2c43f3
+DIST xf86-video-freedreno-1.3.0.tar.bz2 327153 SHA256 1c9d872d1e7389c7771c33e0070f6eb730c406511afcda63867b096aa3d9301d SHA512 f897cf0f7dda36212ef44379cd23d838f1a01832911b3ca52771ccbca6c3722da2c9218bac78679b610d8c3a7f56d05ba3823bea7cbbaef3366b4b14e9e311fd WHIRLPOOL 4d06a33160da61477e22f7c19788b9f66027a20db8958c61ffc0018260d29d966a60c2770d65fda5911fbd631eb9d21632bf007d5f5ac9b078e0c9eda7b1c71e
diff --git a/x11-drivers/xf86-video-freedreno/metadata.xml b/x11-drivers/xf86-video-freedreno/metadata.xml
new file mode 100644
index 000000000000..6cc3982431f8
--- /dev/null
+++ b/x11-drivers/xf86-video-freedreno/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.0.0.ebuild b/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.0.0.ebuild
new file mode 100644
index 000000000000..60860e55ab72
--- /dev/null
+++ b/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.0.0.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="Driver for Adreno mobile GPUs"
+KEYWORDS="arm"
+IUSE=""
+
+RDEPEND="x11-libs/libdrm[video_cards_freedreno]"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # Gentoo installs drm_mode.h to /usr/include/libdrm/
+ sed -i 's:drm/drm_mode.h:libdrm/drm_mode.h:' src/drmmode_display.c || die
+ xorg-2_src_prepare
+}
diff --git a/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.1.0.ebuild b/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.1.0.ebuild
new file mode 100644
index 000000000000..e82f9d253989
--- /dev/null
+++ b/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.1.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="Driver for Adreno mobile GPUs"
+KEYWORDS="~arm"
+IUSE=""
+
+RDEPEND=">=media-libs/mesa-10.2[xa]
+ virtual/libudev
+ >=x11-libs/libdrm-2.4.54[video_cards_freedreno]"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.3.0.ebuild b/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.3.0.ebuild
new file mode 100644
index 000000000000..917964650334
--- /dev/null
+++ b/x11-drivers/xf86-video-freedreno/xf86-video-freedreno-1.3.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="Driver for Adreno mobile GPUs"
+KEYWORDS="arm"
+IUSE=""
+
+RDEPEND=">=media-libs/mesa-10.2[xa]
+ virtual/libudev
+ >=x11-libs/libdrm-2.4.54[video_cards_freedreno]"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-geode/Manifest b/x11-drivers/xf86-video-geode/Manifest
new file mode 100644
index 000000000000..1384ad8069b6
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-geode-2.11.17.tar.bz2 680765 SHA256 07b4d42623e71e592b77c52a75cf230f8e711c8a0c1b26cecb06e9231d333c41 SHA512 d9252ee877c50a18dfb35fc138b1d58dc470c341b8464e2e112c36153a8c1405c7f7bdedfc60453b3dccac422948664a28964485577066f7563eb62f2eb0f202 WHIRLPOOL bcf70d58b2abd444459e1dbc5a7c0f7ab76c0f3f213e948c2c8fd5ae226676f7bbdf4e6022b79fe73899035346890849060c88efaf1363bab01ad726065442b6
diff --git a/x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include.patch b/x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include.patch
new file mode 100644
index 000000000000..d93bbab526c5
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include.patch
@@ -0,0 +1,23 @@
+From 9707a7a5eac25536a5150fc12d9ace52420b4d36 Mon Sep 17 00:00:00 2001
+From: Martin-Éric Racine <martin-eric.racine@iki.fi>
+Date: Sat, 08 Feb 2014 11:27:11 +0000
+Subject: Added conditional include to fix FTBFS on xserver 1.15 and up.
+
+Thanks to Maarten Lankhorst for the fix.
+---
+diff --git a/src/geode_dcon.c b/src/geode_dcon.c
+index 5580c96..c2b9c53 100644
+--- a/src/geode_dcon.c
++++ b/src/geode_dcon.c
+@@ -29,6 +29,9 @@
+
+ /* Includes that are used by all drivers */
+ #include <xf86.h>
++#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,0,0,0)
++#include <xf86Modes.h>
++#endif
+ #include <xf86_OSproc.h>
+ #include <compiler.h>
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include2.patch b/x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include2.patch
new file mode 100644
index 000000000000..1851c31a148d
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/files/xf86-video-geode-2.11.15-xf86Modes-include2.patch
@@ -0,0 +1,22 @@
+From 70b131d09b7d21df1d1ffcf6a4e50d3086924228 Mon Sep 17 00:00:00 2001
+From: Martin-Éric Racine <martin-eric.racine@iki.fi>
+Date: Sat, 08 Feb 2014 12:58:26 +0000
+Subject: No need to conditionalize the xf86Modes.h include.
+
+---
+diff --git a/src/geode_dcon.c b/src/geode_dcon.c
+index c2b9c53..5efd79e 100644
+--- a/src/geode_dcon.c
++++ b/src/geode_dcon.c
+@@ -29,9 +29,7 @@
+
+ /* Includes that are used by all drivers */
+ #include <xf86.h>
+-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,0,0,0)
+ #include <xf86Modes.h>
+-#endif
+ #include <xf86_OSproc.h>
+ #include <compiler.h>
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-geode/metadata.xml b/x11-drivers/xf86-video-geode/metadata.xml
new file mode 100644
index 000000000000..6634fd0793d3
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<maintainer>
+<email>leio@gentoo.org</email>
+</maintainer>
+<use>
+<flag name="ztv">Enable building the V4L2 ZTV driver</flag>
+</use>
+<longdescription lang="en">
+ X.Org driver for AMD Geode GX2 and Geode LX platforms.
+</longdescription>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-geode/xf86-video-geode-2.11.17.ebuild b/x11-drivers/xf86-video-geode/xf86-video-geode-2.11.17.ebuild
new file mode 100644
index 000000000000..ac69f96c197e
--- /dev/null
+++ b/x11-drivers/xf86-video-geode/xf86-video-geode-2.11.17.ebuild
@@ -0,0 +1,24 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="AMD Geode GX2 and LX video driver"
+
+KEYWORDS="x86"
+IUSE="ztv"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ ztv? (
+ sys-kernel/linux-headers
+ )"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable ztv)
+ )
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-glint/Manifest b/x11-drivers/xf86-video-glint/Manifest
new file mode 100644
index 000000000000..114cea0fea77
--- /dev/null
+++ b/x11-drivers/xf86-video-glint/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-glint-1.2.7.tar.bz2 397381 SHA256 9aa9689436fc78a71145d4caeaf63b0e80f9abd54e9b4a3066f62ee5b334c359 SHA512 e005998ce9a33de9b0ebf009d7600fff576b6dc79933b99f2e105028b8266af8b8bd414688b5f467295226a26311c599a4f4ab12b0b821f43a1d72566ce569c2 WHIRLPOOL ccf30dab0923e397849538a91c03068529cafe9b9c1e4736abb5a9d4b661359175e83784871926481fab0f7b9344eb3309775eef76e2b715d3b2654de74de5b0
+DIST xf86-video-glint-1.2.8.tar.bz2 395371 SHA256 657f883bb3a4e4278399eba73840862c3642706ae8b0a4798ec97a31b3524221 SHA512 ea8c566877a8ef6d7c08bec317da62f41ffa080ca76f06587a2bbb2a976966ca4138fae60ede757cf470222912c915f4361aa90513901c370eae335818f33468 WHIRLPOOL 28a6605a555fd317c9d18e0eef936051b305a37a5ad782a3ad550c9b324d15834c7742fcd7e34e76f383303a1c333044df43e9b3ef7f8451a462882bd23a405c
diff --git a/x11-drivers/xf86-video-glint/files/xf86-video-glint-1.2.8-remove-mibstore_h.patch b/x11-drivers/xf86-video-glint/files/xf86-video-glint-1.2.8-remove-mibstore_h.patch
new file mode 100644
index 000000000000..6bc5738c8023
--- /dev/null
+++ b/x11-drivers/xf86-video-glint/files/xf86-video-glint-1.2.8-remove-mibstore_h.patch
@@ -0,0 +1,30 @@
+From 073d5b0b392781bf4a6aa7f9e2dbe2ae51caed2c Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:38 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/glint_driver.c b/src/glint_driver.c
+index b6d20a9..aa78516 100644
+--- a/src/glint_driver.c
++++ b/src/glint_driver.c
+@@ -52,8 +52,6 @@
+ #include "compiler.h"
+ #include "mipointer.h"
+
+-#include "mibstore.h"
+-
+ #include "pm3_regs.h"
+ #include "glint_regs.h"
+ #include "IBM.h"
+@@ -2904,7 +2902,6 @@ GLINTScreenInit(SCREEN_INIT_ARGS_DECL)
+ }
+ }
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-glint/metadata.xml b/x11-drivers/xf86-video-glint/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-glint/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.7.ebuild b/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.7.ebuild
new file mode 100644
index 000000000000..a10406686876
--- /dev/null
+++ b/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.7.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="GLINT/Permedia video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/videoproto
+ x11-proto/xextproto
+ x11-proto/xf86dgaproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8-r1.ebuild b/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8-r1.ebuild
new file mode 100644
index 000000000000..27f84f7624e2
--- /dev/null
+++ b/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8-r1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="GLINT/Permedia video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/videoproto
+ x11-proto/xextproto
+ x11-proto/xf86dgaproto
+ x11-proto/xproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8.ebuild b/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8.ebuild
new file mode 100644
index 000000000000..529fca70a2e7
--- /dev/null
+++ b/x11-drivers/xf86-video-glint/xf86-video-glint-1.2.8.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="GLINT/Permedia video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/videoproto
+ x11-proto/xextproto
+ x11-proto/xf86dgaproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-i128/Manifest b/x11-drivers/xf86-video-i128/Manifest
new file mode 100644
index 000000000000..2d1f775a6df9
--- /dev/null
+++ b/x11-drivers/xf86-video-i128/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-i128-1.3.5.tar.bz2 306803 SHA256 3eedeb1e575e96b2ebebdf894c515e8543900aa3f9f85d10120b8240264333ea
+DIST xf86-video-i128-1.3.6.tar.bz2 324894 SHA256 f8827e4c988f90cf5a677554b30d61f0a07eb86d872478751cdc94dc17452b9c SHA512 688956107fe473941da9d22914dc1aa1889b8a1bb75678692d40630396eca5426a4506bb0a536c48b6ed7a2b580a80af5b8b5d3199e2b04d8f24c404f60d3c34 WHIRLPOOL 95e2803b688c3ca7f1f44c4314b10a22d68c7dd8424b1817c9341da1378e47e208cef7243d473910a33ae0f3aab12fcf1f1d83b4560ebe01ae250ba0d13a968b
diff --git a/x11-drivers/xf86-video-i128/files/xf86-video-i128-1.3.6-remove-mibstore_h.patch b/x11-drivers/xf86-video-i128/files/xf86-video-i128-1.3.6-remove-mibstore_h.patch
new file mode 100644
index 000000000000..b42a6c8f1f51
--- /dev/null
+++ b/x11-drivers/xf86-video-i128/files/xf86-video-i128-1.3.6-remove-mibstore_h.patch
@@ -0,0 +1,30 @@
+From c87753733a6e1f85d1d037dced0b47ce0cf41658 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:40 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/i128_driver.c b/src/i128_driver.c
+index a0f08c0..51a4135 100644
+--- a/src/i128_driver.c
++++ b/src/i128_driver.c
+@@ -50,8 +50,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+ #include "micmap.h"
+
+ #include "xf86DDC.h"
+@@ -1556,7 +1554,6 @@ I128ScreenInit(SCREEN_INIT_ARGS_DECL)
+ return FALSE;
+ }
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-i128/metadata.xml b/x11-drivers/xf86-video-i128/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-i128/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.5.ebuild b/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.5.ebuild
new file mode 100644
index 000000000000..05cde524ef5b
--- /dev/null
+++ b/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.5.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Number 9 I128 video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6-r1.ebuild b/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6-r1.ebuild
new file mode 100644
index 000000000000..fc89ddd962b3
--- /dev/null
+++ b/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="Number 9 I128 video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6.ebuild b/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6.ebuild
new file mode 100644
index 000000000000..05cde524ef5b
--- /dev/null
+++ b/x11-drivers/xf86-video-i128/xf86-video-i128-1.3.6.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Number 9 I128 video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-i740/Manifest b/x11-drivers/xf86-video-i740/Manifest
new file mode 100644
index 000000000000..a988a8996d0c
--- /dev/null
+++ b/x11-drivers/xf86-video-i740/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-i740-1.3.5.tar.bz2 321050 SHA256 1ce02dd0a11fbf6b43b8bca6663c67149d7d740c8985ae18bd956eddeaffe324 SHA512 7f477d7646e3b25a06eaa8a9e226a8955d6783152fe944bd12cd301b7e942b7e0dbfe49946c3d3dea9d2660ea91055909f5df68499434fda6c78b21bf4b9d827 WHIRLPOOL 6283b77a4f70b82b49afe0ddbee146ebb0416b17a912099bc1f8bdc6dbdfdefe9ee7bb299d1b6ec6899c97596103447c90328770ab77d3041b24a5670076767e
diff --git a/x11-drivers/xf86-video-i740/metadata.xml b/x11-drivers/xf86-video-i740/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-i740/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-i740/xf86-video-i740-1.3.5.ebuild b/x11-drivers/xf86-video-i740/xf86-video-i740-1.3.5.ebuild
new file mode 100644
index 000000000000..55e710e548ca
--- /dev/null
+++ b/x11-drivers/xf86-video-i740/xf86-video-i740-1.3.5.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Intel i740 video driver"
+
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-intel/Manifest b/x11-drivers/xf86-video-intel/Manifest
new file mode 100644
index 000000000000..32dbe23f7d1d
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/Manifest
@@ -0,0 +1,13 @@
+DIST xf86-video-intel-2.19.0.tar.bz2 1463260 SHA256 32133d61b14ce3b45b83a60e4ed8eb75159259d708f056144250aaeabf16e4bc SHA512 988f231570cdd7e5c60880472c8bee765def040addf1fa6e5bc9e8a8722b5500d4ae2b798383dc90f2ca3df439e230c4df2d7e3f7cb50341d2d3d38486520292 WHIRLPOOL a19605d2473e72fc4e81a7a327a9b8e9534bdfceca64b44a3d0fd62bf031c9ec10c7d12379b9ca327bde8bc90e15c73cee7ef2de71de00c92bc70969f2a91d37
+DIST xf86-video-intel-2.20.13.tar.bz2 1649369 SHA256 0151104b58ff3509ecd05ac4ee2c5d81a78506c97afbed511fed6b263060dce3 SHA512 4f70ba1e794d26f8cbbb52c4936cfc8cdf4f43a353d9f921bf519a02a0c7f1b1eec6b3aa706ee6fc333a89b152416b9526f5d951ddea23ed70400e975c59febe WHIRLPOOL 101dff2402c75d0a48243ce1e3ac11e529f2d26a8d81321ae9ec528b6d35a3ed7647c342a2cf60389a69d677c29798c84e3252932b64f905966ef5af695cffbf
+DIST xf86-video-intel-2.21.15.tar.bz2 1977431 SHA256 7d5a140f82a72fd1cbc8a664d66c3d4eca47ee240ca4927b8a98d7af6f65d6fc SHA512 ca9680716445d0e9ba1a5d87433455f7a5f558802b4d214d79496426dbfd3e598968f784b531de024df30fefcc114d6e40cc9c6da94604beb48cd4430bf9e491 WHIRLPOOL 352b114b1030d1fbe2d33f028e7c03be8b4a6a4b0e4cb4fd7c890dd4cc5594ebf1fd6477c9319c1e2ff5033fc3276fb9caa8d91d1d3ba6b0c2f1734b60d3efed
+DIST xf86-video-intel-2.9.1.tar.bz2 789001 SHA256 95347c88854c2b41c07ab3bcdfadd1b8d27fb181a20520f185892877eb8d9d76 SHA512 62a7c1852b2d0b89be93536e7852caf398fc743e11a12c5071baed5e767b29c382ff5eb9d6c3ab453fc4d94aa16245b607ef33b94198bf7c7626746772fcc290 WHIRLPOOL 7e61c5d1396829aa354c9fdfbe5a21723171390d86b3307a2a331061e128a9866408993410090fe5d607609d245c55843633730bc4521e9cb0ec478c8d6ede1c
+DIST xf86-video-intel-2.99.903.tar.bz2 1965343 SHA256 a7582d80962f6052fb72b570cce53249dce6e1291d2d7df4f0384f73692eb32e SHA512 e8eff894cbeaf92368df94fd5bb65b871019444c5162569bb5011c8829457dffb0e631d9f0eaa71f2f21c87df94a64fe2864f60dc15b0db220f359c2a4fbb3cd WHIRLPOOL 3087665bb22aa921c106e0674f25a849d7dbb693dc93e0bd48966220a14265570d7e83947a20be8f4f8f8a40e779c64ad13982883b04cb42f16a96fda4b0f11c
+DIST xf86-video-intel-2.99.905.tar.bz2 2013611 SHA256 5ccd5325eb470765416b7d673fcd389a8331315f274e0e781038a0793b94ad79 SHA512 e309f185bcf73ec2a122402023b74f5997f6fe79805db6413746176aac3ec43592c83b07571353836949594b0c286ec9d2d3e18806c3ea5d33d9cda69c68f6f4 WHIRLPOOL b1fe9e670c2d58431c1c83d00329f1a2907e8076c3c5357db6cfb5403f0532e569c57d538694903169a1c3fe751d367db09a20614ba4d6a64fb1d0c706b6370c
+DIST xf86-video-intel-2.99.906.tar.bz2 2029492 SHA256 2d9343ce0257f82612ab6cb4a18ebfdcb2bc76a226d8442b2f7f210cc4f63cd6 SHA512 03100462cae897e745136475a4a85053406d8bde40f0dc09401b17bc50c65e929f50bb425076d9fce63e28cf25ad6f7bf01515e319b139ecca1c0908b19db0a1 WHIRLPOOL d66ee09c00b1ceb5774855a0f53556fce2d549b651f0385250ad28e1184499f485dd7d55ee323da55aad644ad1afac643e20f0486da8718b98f5bb4e12598fc0
+DIST xf86-video-intel-2.99.907.tar.bz2 2059916 SHA256 d0b02255f0ff4baa863f762bef49707ce0b4094a267a26e32e4270abe141117b SHA512 401a24248d3f8f6b4ba23ffee5c4a082145fda9e17d1499574fc7b3448dafff07a9872cf878cba04ccbe2951d0527ef93d8ce8bc925ff72c7396d51998c3cac7 WHIRLPOOL e1cf2b1afa0563527ce84e9ee3dca6cc9292c83ac59d18ce9ac5ae598a79a312ede4e64398bcecaf8c13fb512d1f6d9344f6a5b567bb1893d4cc64ae9a42d0de
+DIST xf86-video-intel-2.99.909.tar.bz2 2074714 SHA256 7541187161ee379f07591e1d2655f51e2d9772d98b34e8f21d7159d28ce70f55 SHA512 74417ebbac1f19da2c8cc24f42f3a8a1a721acdf9b1cbfef33c0608fb2c24b5adc08ddeaec077eb5349ee8c5412c29ee33aa1d6ce4ebc3754ab7fdf71589e833 WHIRLPOOL 7336db0b7bb9b03874db5b72be309db9c27ef1ab414e8455863917d09500bde44d82c36c49fd72cc2e49e0487edd526e2975e228a7afd42c02f7a006740ca917
+DIST xf86-video-intel-2.99.910.tar.bz2 2077330 SHA256 203d46064449da0e23a111418dfb189422ba96ea08707167c8dee463e2d745b1 SHA512 c694a63c362627491c1c621087f4ab7173ceaf8655e8814dd11627b6cbede7e92e79da2e019db3ec3a90a488a4ef451e97d6cd961bae54a493b56a072d2b1852 WHIRLPOOL 1cbafa9e7f5665b7078fce113f80fdbfc92df12766c6cf248b8d45c8058c6515af36d59c37d739beba84311cec6a49650140f864661e3933ed060ad5eed6522a
+DIST xf86-video-intel-2.99.914.tar.bz2 2241205 SHA256 78a22e5efd460b790c634caaf1afbb756046dd890482e204bb0d179baad27e46 SHA512 65292be6c9b09ed52af9aa835cff472e47e8090a595d82c1f953e0c3900c62b83d230f42d8028f0a4a6405935a4a375175875f0af6d6921be19513aa1a8518d9 WHIRLPOOL e4694a18f54617a6e4653b94f10ed41600ab99d31b52a98392c299cef096ac6f1a9708ead3e3978be00d95ee3c5de3d36fc05e86ac0613bbf621f84a680f9525
+DIST xf86-video-intel-2.99.916.tar.bz2 2241651 SHA256 409a819f4ac3e7c9432dd4acafe4621bbb3702adb34b1ea942b2e6d7c71eed01 SHA512 f44d6d9763587faa9723c47ca5c9c99e2595b2190168ac7cc8ea1fd9d9697ba5ba8ab3b2968913fa291a2fc908170bd1cf3de425312d96d68de458d03c503af4 WHIRLPOOL 0be7a4b74383b450b896dbc569d9d78d1e7ebf45a7d91f62680221a77b2ea3d8ece702c52585a4449b515d7882917ce24a254e30838c03ca5c516b293ab8dc57
+DIST xf86-video-intel-2.99.917.tar.bz2 2259040 SHA256 00b781eea055582820a123c47b62411bdf6aabf4f03dc0568faec55faf9667c9 SHA512 cbf4d46ad1ad5e5587c0f1f620ff534ef0645270517b60056b9f03e83d8216e2f456de46352a06c37c0c46963cc4ed20b71b815b20ec1bf680ff046e535f580f WHIRLPOOL b26f1b303a27825120e1036f15493119e8869ebae74a2663204fe1ee63cf9fc217e593c469d6c33151a73c9ea6e9df88d0e3a0bb74ece5109b51593785fd4d7d
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.21.15-handle-updates-to-DamageUnregister-API.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.21.15-handle-updates-to-DamageUnregister-API.patch
new file mode 100644
index 000000000000..1dc79baea57b
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.21.15-handle-updates-to-DamageUnregister-API.patch
@@ -0,0 +1,24 @@
+From 524a45da56e2a052ffafa3887891caa90ba39f76 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat, 05 Oct 2013 17:42:24 +0000
+Subject: compat-api: Map changes of DamageUnregister API in 1.14.99.2
+
+Reported-by: Emmanuel Benisty <benisty.e@gmail.com>
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+---
+diff --git a/src/compat-api.h b/src/compat-api.h
+index 8eb46ef..244a486 100644
+--- a/src/compat-api.h
++++ b/src/compat-api.h
+@@ -162,4 +162,8 @@ static inline void FreePixmap(PixmapPtr pixmap)
+ if ((d)->pScreen->SourceValidate) (d)->pScreen->SourceValidate(d, x, y, w, h)
+ #endif
+
++#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
++#define DamageUnregister(d, dd) DamageUnregister(dd)
++#endif
++
+ #endif
+--
+cgit v0.9.0.2-2-gbebe
+
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.905-fix-randr.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.905-fix-randr.patch
new file mode 100644
index 000000000000..fc5c97ef3f0c
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.905-fix-randr.patch
@@ -0,0 +1,56 @@
+From 8e44b1f5543f6d36c33c743f1ba2143514f8afbf Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 24 Oct 2013 13:05:16 +0100
+Subject: [PATCH] sna: Fix canonical mode name to correctly use asprintf
+
+Whoops. Only the kernel sprintf() accepts NULL as a valid target string,
+not libc's.
+
+Reported-by: Jay Little <jaylittle@jaylittle.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70835
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+---
+ src/sna/sna_display.c | 23 ++++++-----------------
+ 1 file changed, 6 insertions(+), 17 deletions(-)
+
+diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
+index 7fcade6..3c39305 100644
+--- a/src/sna/sna_display.c
++++ b/src/sna/sna_display.c
+@@ -2095,27 +2095,16 @@ sna_output_panel_edid(xf86OutputPtr output, DisplayModePtr modes)
+ return xf86ModesAdd(modes, m);
+ }
+
+-static int _canonical_mode_name(DisplayModePtr mode, char *str)
+-{
+- return sprintf(str, "%dx%d%s",
+- mode->HDisplay, mode->VDisplay,
+- mode->Flags & V_INTERLACE ? "i" : "");
+-}
+-
+ static char *canonical_mode_name(DisplayModePtr mode)
+ {
+- char *str;
+- int len;
+-
+- len = _canonical_mode_name(mode, NULL);
+- if (len < 0)
+- return NULL;
++ char *str;
+
+- str = malloc(len + 1);
+- if (str != NULL)
+- _canonical_mode_name(mode, str);
++ if (asprintf(&str, "%dx%d%s",
++ mode->HDisplay, mode->VDisplay,
++ mode->Flags & V_INTERLACE ? "i" : "") < 0)
++ return NULL;
+
+- return str;
++ return str;
+ }
+
+ static DisplayModePtr
+--
+1.8.4.2
+
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.906-server-crash.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.906-server-crash.patch
new file mode 100644
index 000000000000..00c44b51e3af
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.906-server-crash.patch
@@ -0,0 +1,37 @@
+From 6e9a8c5ae2883ca21d117ac672dd8a55b3429dc1 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 14 Nov 2013 16:14:09 +0000
+Subject: sna: Add the missing braces around the conditional block
+
+Fixes regression from
+commit f3225fcb38686f3b9701725bf3a11ecf1c100c3f
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue Nov 5 08:38:22 2013 +0000
+
+ sna: Be move conservative with tiling sizes for older fenced gen
+
+Reported-by: Jay Little <jaylittle@jaylittle.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71605
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+---
+diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
+index 693fedc..63153b7 100644
+--- a/src/sna/sna_blt.c
++++ b/src/sna/sna_blt.c
+@@ -3285,12 +3285,13 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu,
+ !kgem_check_reloc(kgem, 2) ||
+ !kgem_check_many_bo_fenced(kgem, dst_bo, src_bo, NULL)) {
+ kgem_submit(kgem);
+- if (!kgem_check_many_bo_fenced(kgem, dst_bo, src_bo, NULL))
++ if (!kgem_check_many_bo_fenced(kgem, dst_bo, src_bo, NULL)) {
+ DBG(("%s: not enough room in aperture, fallback to tiling copy\n", __FUNCTION__));
+ return sna_tiling_blt_copy_boxes(sna, alu,
+ src_bo, src_dx, src_dy,
+ dst_bo, dst_dx, dst_dy,
+ bpp, box, nbox);
++ }
+ _kgem_set_mode(kgem, KGEM_BLT);
+ }
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.907-invalidation.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.907-invalidation.patch
new file mode 100644
index 000000000000..e78d5bf336b0
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.907-invalidation.patch
@@ -0,0 +1,46 @@
+From 4d8f78bc95f8dd36693f74365dbc3c442fbbf8a9 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 02 Jan 2014 15:01:38 +0000
+Subject: sna/gen7+: Emit invalidate between operations if rendering to source/mask
+
+Fixes regression from
+commit c79cb18407273dc7798618390bd0b7d69b0f80d6 [2.99.907]
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Wed Nov 20 11:17:20 2013 +0000
+
+ sna/gen7: Try to reduce flushes between primitive continuations
+
+Reported-by: Simon Munton <simon.j.munton@gmail.com>
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73208
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+---
+diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
+index 572e3e3..e45555b 100644
+--- a/src/sna/gen7_render.c
++++ b/src/sna/gen7_render.c
+@@ -1114,8 +1114,7 @@ gen7_emit_state(struct sna *sna,
+
+ need_stall = sna->render_state.gen7.surface_table != wm_binding_table;
+
+- need_invalidate = need_stall &&
+- (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo));
++ need_invalidate = kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo);
+ if (ALWAYS_INVALIDATE)
+ need_invalidate = true;
+
+diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
+index a8b4ea8..309398d 100644
+--- a/src/sna/gen8_render.c
++++ b/src/sna/gen8_render.c
+@@ -1130,8 +1130,7 @@ gen8_emit_state(struct sna *sna,
+
+ need_stall = sna->render_state.gen8.surface_table != wm_binding_table;
+
+- need_invalidate = need_stall &&
+- (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo));
++ need_invalidate = kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo);
+ if (ALWAYS_INVALIDATE)
+ need_invalidate = true;
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.911-sna-pixmap-migration.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.911-sna-pixmap-migration.patch
new file mode 100644
index 000000000000..a69e0a213270
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.911-sna-pixmap-migration.patch
@@ -0,0 +1,102 @@
+From 3310ee89c1f1a663de5f5b12b8125809a213996f Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Sat, 05 Apr 2014 11:18:31 +0000
+Subject: sna: Avoid discarding damage when applying WHOLE hint to pixmap migration
+
+Once again, we must be careful when promoting from a region to whole
+pixmap migration that we do not discard required damage.
+
+Fixes regression from
+commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a [2.99.911]
+Author: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu Feb 27 08:33:52 2014 +0000
+
+ sna: Avoid promoting region-to-whole migration and discarding damage
+
+Reported-by: gedgon@gmail.com
+Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77063
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+---
+diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
+index 0116d54..71ba34d 100644
+--- a/src/sna/sna_accel.c
++++ b/src/sna/sna_accel.c
+@@ -2500,7 +2500,10 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
+ flags |= MOVE_INPLACE_HINT;
+ }
+
+- if (flags & MOVE_WHOLE_HINT && priv->gpu_damage == NULL)
++ if ((flags & (MOVE_WHOLE_HINT | MOVE_READ)) == (MOVE_WHOLE_HINT | MOVE_READ))
++ return _sna_pixmap_move_to_cpu(pixmap, flags);
++
++ if (flags & MOVE_WHOLE_HINT && priv->gpu_damage == NULL && priv->cpu_damage == NULL)
+ return _sna_pixmap_move_to_cpu(pixmap, flags);
+
+ if (priv->gpu_damage == NULL &&
+@@ -2527,22 +2530,18 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
+ return _sna_pixmap_move_to_cpu(pixmap, flags);
+ }
+
+- if ((flags & MOVE_READ) == 0 &&
+- priv->gpu_damage &&
+- region_subsumes_damage(region, priv->gpu_damage)) {
+- DBG(("%s: region [(%d, %d), (%d, %d)] subsumes damage [(%d,%d), (%d, %d)]\n",
++ if (flags & MOVE_WHOLE_HINT) {
++ DBG(("%s: region (%d, %d), (%d, %d) marked with WHOLE hint, pixmap %dx%d\n",
+ __FUNCTION__,
+ region->extents.x1,
+ region->extents.y1,
+ region->extents.x2,
+ region->extents.y2,
+- priv->gpu_damage->extents.x1,
+- priv->gpu_damage->extents.y1,
+- priv->gpu_damage->extents.x2,
+- priv->gpu_damage->extents.y2));
++ pixmap->drawable.width,
++ pixmap->drawable.height));
+ if (dx | dy)
+ RegionTranslate(region, -dx, -dy);
+- return _sna_pixmap_move_to_cpu(pixmap, flags);
++ return _sna_pixmap_move_to_cpu(pixmap, flags | MOVE_READ);
+ }
+
+ if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, MOVE_READ)) {
+@@ -4471,17 +4470,19 @@ try_upload_tiled_x(PixmapPtr pixmap, RegionRec *region,
+ if (wedged(sna))
+ return false;
+
+- DBG(("%s: bo? %d, can map? %d\n", __FUNCTION__,
+- priv->gpu_bo != NULL,
+- priv->gpu_bo ? kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true) : 0));
+-
+ replaces = region->data == NULL &&
+ w >= pixmap->drawable.width &&
+ h >= pixmap->drawable.height;
+
++ DBG(("%s: bo? %d, can map? %d, replaces? %d\n", __FUNCTION__,
++ priv->gpu_bo != NULL,
++ priv->gpu_bo ? kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true) : 0,
++ replaces));
++
+ if (priv->gpu_bo && (replaces || priv->gpu_bo->proxy)) {
+ DBG(("%s: discarding cached upload proxy\n", __FUNCTION__));
+ sna_pixmap_free_gpu(sna, priv);
++ replaces = true; /* Mark it all GPU damaged afterwards */
+ }
+ assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL);
+
+@@ -4616,8 +4617,11 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
+ return true;
+
+ hint = MOVE_WRITE;
+- if (w == pixmap->drawable.width && h*stride > 4096)
++ if (w == pixmap->drawable.width && (h+1)*stride > 65536) {
++ DBG(("%s: large upload (%d bytes), marking WHOLE_HINT\n",
++ __FUNCTION__, h*stride));
+ hint |= MOVE_WHOLE_HINT;
++ }
+
+ if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, region, hint))
+ return false;
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.912-disable-dri3.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.912-disable-dri3.patch
new file mode 100644
index 000000000000..97780f8af8fa
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.912-disable-dri3.patch
@@ -0,0 +1,22 @@
+--- configure.old 2014-06-18 08:36:47.151142539 +0200
++++ configure 2014-06-18 09:05:13.568360179 +0200
+@@ -20769,7 +20769,7 @@
+ DRI3_LIBS=$pkg_cv_DRI3_LIBS
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+- DRI3=$DRI
++ DRI3=no
+ fi
+ fi
+ if test "x$DRI3" != "xno"; then
+@@ -20850,10 +20850,6 @@
+ $as_echo "#define HAVE_DRI3 1" >>confdefs.h
+
+ dri_msg="$dri_msg DRI3"
+-else
+- if test "x$DRI" = "xyes" -a "x$KMS" = "xyes"; then
+- as_fn_error $? "DRI3 requested but prerequisites not found" "$LINENO" 5
+- fi
+ fi
+
+ for ac_header in X11/extensions/dpmsconst.h
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch
new file mode 100644
index 000000000000..ea3aa30ed13c
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch
@@ -0,0 +1,65 @@
+From 7fe2b2948652443ff43d907855bd7a051d54d309 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 19 Mar 2015 23:14:17 +0000
+Subject: sna: Protect against ABI breakage in recent versions of libdrm
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/src/sna/kgem.c b/src/sna/kgem.c
+index 11f0828..6f16cba 100644
+--- a/src/sna/kgem.c
++++ b/src/sna/kgem.c
+@@ -182,6 +182,15 @@ struct local_i915_gem_caching {
+ #define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching)
+ #define LOCAL_IOCTL_I915_GEM_GET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_GET_CACHING, struct local_i915_gem_caching)
+
++struct local_i915_gem_mmap {
++ uint32_t handle;
++ uint32_t pad;
++ uint64_t offset;
++ uint64_t size;
++ uint64_t addr_ptr;
++};
++#define LOCAL_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct local_i915_gem_mmap)
++
+ struct local_i915_gem_mmap2 {
+ uint32_t handle;
+ uint32_t pad;
+@@ -514,15 +523,15 @@ retry_wc:
+
+ static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo)
+ {
+- struct drm_i915_gem_mmap mmap_arg;
++ struct local_i915_gem_mmap arg;
+ int err;
+
+ retry:
+- VG_CLEAR(mmap_arg);
+- mmap_arg.handle = bo->handle;
+- mmap_arg.offset = 0;
+- mmap_arg.size = bytes(bo);
+- if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))) {
++ VG_CLEAR(arg);
++ arg.handle = bo->handle;
++ arg.offset = 0;
++ arg.size = bytes(bo);
++ if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) {
+ assert(err != EINVAL);
+
+ if (__kgem_throttle_retire(kgem, 0))
+@@ -536,10 +545,10 @@ retry:
+ return NULL;
+ }
+
+- VG(VALGRIND_MAKE_MEM_DEFINED(mmap_arg.addr_ptr, bytes(bo)));
++ VG(VALGRIND_MAKE_MEM_DEFINED(arg.addr_ptr, bytes(bo)));
+
+ DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle));
+- return bo->map__cpu = (void *)(uintptr_t)mmap_arg.addr_ptr;
++ return bo->map__cpu = (void *)(uintptr_t)arg.addr_ptr;
+ }
+
+ static int gem_write(int fd, uint32_t handle,
+--
+cgit v0.10.2
+
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-sna-udev-fstat.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-sna-udev-fstat.patch
new file mode 100644
index 000000000000..7e276ac872fd
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-sna-udev-fstat.patch
@@ -0,0 +1,57 @@
+From 12af8a575d1518d40416f83195049157c3a062a5 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue, 24 Feb 2015 15:25:40 +0000
+Subject: sna: udev integration depends on fstat and sys/stat.h
+
+src/sna/sna_driver.c: In function 'sna_handle_uevents':
+src/sna/sna_driver.c:759:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
+
+Also take the opportunity to include udev support in the configure
+summary.
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/configure.ac b/configure.ac
+index 7476e2b..de3a4b3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -197,11 +197,15 @@ AC_ARG_ENABLE(udev,
+
+ if test "x$UDEV" != "xno"; then
+ PKG_CHECK_MODULES(UDEV, [libudev], [udev="yes"], [udev="no"])
++ AC_CHECK_HEADERS([sys/stat.h], [], [udev="no"])
+ if test "x$UDEV" = "xyes" -a "x$udev" != "xyes"; then
+ AC_MSG_ERROR([udev support requested but not found (libudev)])
+ fi
+ if test "x$udev" = "xyes"; then
+ AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
++ udev_msg=" yes"
++ else
++ udev_msg=" no"
+ fi
+ fi
+
+@@ -911,6 +915,7 @@ echo " Support for Kernel Mode Setting? $KMS"
+ echo " Support for legacy User Mode Setting (for i810)? $UMS"
+ echo " Support for Direct Rendering Infrastructure:$dri_msg"
+ echo " Support for Xv motion compensation (XvMC and libXvMC):$xvmc_msg"
++echo " Support for display hotplug notifications (udev):$udev_msg"
+ echo " Build additional tools and utilities?$tools_msg"
+ if test -n "$xp_msg"; then
+ echo " Experimental support:$xp_msg"
+diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
+index 8c0d0b5..bc20ef0 100644
+--- a/src/sna/sna_driver.c
++++ b/src/sna/sna_driver.c
+@@ -740,6 +740,8 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DECL)
+ }
+
+ #if HAVE_UDEV
++#include <sys/stat.h>
++
+ static void
+ sna_handle_uevents(int fd, void *closure)
+ {
+--
+cgit v0.10.2
+
diff --git a/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-uxa-udev-fstat.patch b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-uxa-udev-fstat.patch
new file mode 100644
index 000000000000..66793568d4e5
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/files/xf86-video-intel-2.99.917-uxa-udev-fstat.patch
@@ -0,0 +1,27 @@
+From 369ceec0e4910ba2c37736a59c55c0d6c26433bf Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue, 24 Feb 2015 15:25:40 +0000
+Subject: uxa: udev integration depends on fstat and sys/stat.h
+
+src/uxa/intel_driver.c: In function 'I830HandleUEvents':
+src/uxa/intel_driver.c:738:14: error: storage size of 's' isn't known
+src/uxa/intel_driver.c:746:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/src/uxa/intel_driver.c b/src/uxa/intel_driver.c
+index c554124..6e64b8c 100644
+--- a/src/uxa/intel_driver.c
++++ b/src/uxa/intel_driver.c
+@@ -728,6 +728,8 @@ intel_flush_callback(CallbackListPtr *list,
+ }
+
+ #if HAVE_UDEV
++#include <sys/stat.h>
++
+ static void
+ I830HandleUEvents(int fd, void *closure)
+ {
+--
+cgit v0.10.2
+
diff --git a/x11-drivers/xf86-video-intel/metadata.xml b/x11-drivers/xf86-video-intel/metadata.xml
new file mode 100644
index 000000000000..fd3227137901
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <use>
+ <flag name="glamor">Enable Glamor OpenGL 2D acceleration</flag>
+ <flag name="sna">Enable SandyBridge's New Acceleration (useful on all chipsets, not just SandyBridge)</flag>
+ <flag name="uxa">Enable UMA Acceleration Architecture</flag>
+ <flag name="xvmc">Enables X-Video Motion Compensation support</flag>
+ </use>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.19.0.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.19.0.ebuild
new file mode 100644
index 000000000000..9205a0ff745e
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.19.0.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="amd64 x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor sna"
+
+RDEPEND="<x11-base/xorg-server-1.13.49
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ >=x11-libs/pixman-0.24
+ x11-libs/xcb-util
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6"
+
+pkg_setup() {
+ linux-info_pkg_setup
+ xorg-2_pkg_setup
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ --enable-xvmc
+ )
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.20.13.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.20.13.ebuild
new file mode 100644
index 000000000000..0cde804a9b8e
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.20.13.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="amd64 x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="|| ( glamor sna uxa )"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.21.15.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.21.15.ebuild
new file mode 100644
index 000000000000..873a58270da6
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.21.15.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="amd64 x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="|| ( glamor sna uxa )"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+src_prepare() {
+ # wrong variable name, fix configure directly to avoid autoreconf
+ # see bug #490342
+ sed -e "s/DRI_CFLAGS/DRI1_CFLAGS/g" -i configure
+ # see bug #496682
+ epatch "${FILESDIR}/${PN}-2.21.15-handle-updates-to-DamageUnregister-API.patch"
+ xorg-2_src_prepare
+}
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.9.1.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.9.1.ebuild
new file mode 100644
index 000000000000..d407dbd55262
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.9.1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit x-modular
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~x86-fbsd"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.6
+ <x11-libs/libdrm-2.4.21
+ x11-libs/libpciaccess
+ x11-libs/libXext
+ x11-libs/libXfixes
+ x11-libs/libXvMC"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-1.99.3
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xineramaproto
+ x11-proto/xextproto
+ x11-proto/xproto
+ dri? ( x11-proto/xf86driproto
+ x11-proto/glproto )"
+
+pkg_setup() {
+ CONFIGURE_OPTIONS="$(use_enable dri)"
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.903.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.903.ebuild
new file mode 100644
index 000000000000..ad1f82d99634
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.903.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="|| ( glamor sna uxa )"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.905-r1.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.905-r1.ebuild
new file mode 100644
index 000000000000..69c515e9efd4
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.905-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-fix-randr.patch
+)
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.906.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.906.ebuild
new file mode 100644
index 000000000000..a504dc87f643
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.906.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-server-crash.patch
+)
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.907-r1.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.907-r1.ebuild
new file mode 100644
index 000000000000..21a111621e9f
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.907-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ x11-libs/glamor
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-invalidation.patch
+)
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.909.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.909.ebuild
new file mode 100644
index 000000000000..6b5314a0d23d
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.909.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ >=x11-libs/glamor-0.6.0
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.910.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.910.ebuild
new file mode 100644
index 000000000000..6b5314a0d23d
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.910.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? (
+ >=x11-libs/glamor-0.6.0
+ )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.914.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.914.ebuild
new file mode 100644
index 000000000000..f619eebc309b
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.914.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? ( || (
+ x11-base/xorg-server[glamor]
+ >=x11-libs/glamor-0.6.0
+ ) )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/dri3proto
+ x11-proto/presentproto
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ --disable-dri3
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.916.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.916.ebuild
new file mode 100644
index 000000000000..f619eebc309b
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.916.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug glamor +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+ glamor? ( uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ glamor? ( || (
+ x11-base/xorg-server[glamor]
+ >=x11-libs/glamor-0.6.0
+ ) )
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/dri3proto
+ x11-proto/presentproto
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable glamor)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ --disable-dri3
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r1.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r1.ebuild
new file mode 100644
index 000000000000..d1e257c5294e
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/dri3proto
+ x11-proto/presentproto
+ x11-proto/resourceproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-sna-udev-fstat.patch
+ "${FILESDIR}"/${P}-uxa-udev-fstat.patch
+)
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ --disable-dri3
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r2.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r2.ebuild
new file mode 100644
index 000000000000..99ae79770564
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917-r2.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="~amd64 ~x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/dri3proto
+ x11-proto/presentproto
+ x11-proto/resourceproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-sna-udev-fstat.patch
+ "${FILESDIR}"/${P}-uxa-udev-fstat.patch
+ "${FILESDIR}"/${P}-libdrm-kernel-4_0-crash.patch
+)
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ --disable-dri3
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917.ebuild b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917.ebuild
new file mode 100644
index 000000000000..4b5c53ea1391
--- /dev/null
+++ b/x11-drivers/xf86-video-intel/xf86-video-intel-2.99.917.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=dri
+inherit linux-info xorg-2
+
+DESCRIPTION="X.Org driver for Intel cards"
+
+KEYWORDS="amd64 x86 ~amd64-fbsd -x86-fbsd"
+IUSE="debug +sna +udev uxa xvmc"
+
+REQUIRED_USE="
+ || ( sna uxa )
+"
+
+RDEPEND="x11-libs/libXext
+ x11-libs/libXfixes
+ >=x11-libs/pixman-0.27.1
+ >=x11-libs/libdrm-2.4.29[video_cards_intel]
+ sna? (
+ >=x11-base/xorg-server-1.10
+ )
+ udev? (
+ virtual/udev
+ )
+ xvmc? (
+ x11-libs/libXvMC
+ >=x11-libs/libxcb-1.5
+ x11-libs/xcb-util
+ )
+"
+DEPEND="${RDEPEND}
+ >=x11-proto/dri2proto-2.6
+ x11-proto/dri3proto
+ x11-proto/presentproto
+ x11-proto/resourceproto"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable dri)
+ $(use_enable sna)
+ $(use_enable uxa)
+ $(use_enable udev)
+ $(use_enable xvmc)
+ --disable-dri3
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ if linux_config_exists \
+ && ! linux_chkconfig_present DRM_I915_KMS; then
+ echo
+ ewarn "This driver requires KMS support in your kernel"
+ ewarn " Device Drivers --->"
+ ewarn " Graphics support --->"
+ ewarn " Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->"
+ ewarn " <*> Intel 830M, 845G, 852GM, 855GM, 865G (i915 driver) --->"
+ ewarn " i915 driver"
+ ewarn " [*] Enable modesetting on intel by default"
+ echo
+ fi
+}
diff --git a/x11-drivers/xf86-video-ivtv/Manifest b/x11-drivers/xf86-video-ivtv/Manifest
new file mode 100644
index 000000000000..3fd43fde59be
--- /dev/null
+++ b/x11-drivers/xf86-video-ivtv/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-video-ivtv-1.1.2-r1.patch.tar.bz2 9418 SHA256 2623f51cce4724cebffc0a38738a9fa360be114a4d22cc3fb926e240cd034b91 SHA512 751e52d47853bee79fa80396f2e8fecaa2c02bc4b0a45703c7b0ee2b70915a1a55dcf70a29441bad566bcbc389250a1692c1ba16b84fe14c3cd7056460d3251f WHIRLPOOL d66cf37c7e47fb806a7c9e81b6989bf7f5b20f82b1e7b2fcc5a65ba559c09cabc5e9977147c9b00f26cff0638b24164f29a764b58aa481df4885e09fabdb64dd
+DIST xf86-video-ivtv-1.1.2-r2.patch.tar.bz2 9565 SHA256 22a2a8d7e17eecc2d4549f6a73080b071d9075f20230da01b21804b247ccb67e SHA512 5b96375ea885dec713b5321f6f6554c0bd9b047b76abd4cf4baa1605466c7ab7612802c43674166a6397f0fa6a6c81d31805923cc342c710184a895a919f1270 WHIRLPOOL e591ba8d9c7bb6afe4ae8aea41bd7a95e9c883a2afc2f2ef503d3d171b92903d720cf23bb44648b627c0807858fe2ed8000f7f55cc961da1b0df16a326c29dbe
+DIST xf86-video-ivtv-1.1.2.tar.gz 303046 SHA256 863f449ec9dc9b2a2a15c8305660267a3365c72fa2e805d1e311dddf2791c938 SHA512 d5decad6cbd1d09372a8393373608b9f07a673e8d8c1de08dc0188330861f9da3e221c0147e2da97f26d8344472e9cdbe30fa5c6386d0bb21b18f3e2f37930d7 WHIRLPOOL 597cc7a2c59aba99a5ececc150839b55d0ef98790fcd77c608dda0d1330672e0c731359e25a03920c9d66a75eb61e8518d3020766537878f6cdabfe3f2e3450c
diff --git a/x11-drivers/xf86-video-ivtv/metadata.xml b/x11-drivers/xf86-video-ivtv/metadata.xml
new file mode 100644
index 000000000000..34b683239a51
--- /dev/null
+++ b/x11-drivers/xf86-video-ivtv/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<maintainer>
+ <email>je_fro@gentoo.org</email>
+</maintainer>
+<longdescription lang="en">
+ X.Org driver for TV-out on ivtv cards
+</longdescription>
+</pkgmetadata>
+
diff --git a/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r1.ebuild b/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r1.ebuild
new file mode 100644
index 000000000000..41421ebf9f0e
--- /dev/null
+++ b/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r1.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for TV-out on ivtvdev cards"
+HOMEPAGE="http://ivtvdriver.org/"
+SRC_URI="http://dl.ivtvdriver.org/${PN}/${P}.tar.gz \
+ mirror://gentoo/${PF}.patch.tar.bz2"
+
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="<x11-base/xorg-server-1.12.49"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+
+ EPATCH_SOURCE="${WORKDIR}" \
+ EPATCH_FORCE="yes" \
+ EPATCH_SUFFIX="patch" \
+ xorg-2_src_prepare
+}
diff --git a/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r2.ebuild b/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r2.ebuild
new file mode 100644
index 000000000000..a33b7fc09726
--- /dev/null
+++ b/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2-r2.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for TV-out on ivtvdev cards"
+HOMEPAGE="http://ivtvdriver.org/"
+SRC_URI="http://dl.ivtvdriver.org/${PN}/${P}.tar.gz \
+ mirror://gentoo/${PF}.patch.tar.bz2"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+src_prepare() {
+
+ EPATCH_SOURCE="${WORKDIR}" \
+ EPATCH_FORCE="yes" \
+ EPATCH_SUFFIX="patch" \
+ xorg-2_src_prepare
+}
diff --git a/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2.ebuild b/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2.ebuild
new file mode 100644
index 000000000000..b0d1a865dff7
--- /dev/null
+++ b/x11-drivers/xf86-video-ivtv/xf86-video-ivtv-1.1.2.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for TV-out on ivtvdev cards"
+HOMEPAGE="http://ivtvdriver.org/"
+SRC_URI="http://dl.ivtvdriver.org/${PN}/${P}.tar.gz"
+
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE=""
+
+DEPEND="<x11-base/xorg-server-1.12.49"
+RDEPEND="${DEPEND}"
diff --git a/x11-drivers/xf86-video-mach64/Manifest b/x11-drivers/xf86-video-mach64/Manifest
new file mode 100644
index 000000000000..f527a60f9ead
--- /dev/null
+++ b/x11-drivers/xf86-video-mach64/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-mach64-6.9.5.tar.bz2 520883 SHA256 3e98985b6e044189efd42342862208f472881c25debf22230a1d54a96d71b41f SHA512 855b1a505c4309dd6accd0a2b371763fe98f510e0b6c680e2b2a1ce780e4ee6ea8eeeafb85fd22b879a25679b4c3f03a8216b2ea5797fbbc00fccd597fb7622d WHIRLPOOL 701bd7b6122eba011ecc08ea0e0f92313b9de49c383350616100a131e46b3d2aa032ba6c4b41ba005af890dc01b2ff2e7bb5c4395c24b264148a6645e07f2510
diff --git a/x11-drivers/xf86-video-mach64/metadata.xml b/x11-drivers/xf86-video-mach64/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-mach64/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-mach64/xf86-video-mach64-6.9.5.ebuild b/x11-drivers/xf86-video-mach64/xf86-video-mach64-6.9.5.ebuild
new file mode 100644
index 000000000000..37f279fd13e7
--- /dev/null
+++ b/x11-drivers/xf86-video-mach64/xf86-video-mach64-6.9.5.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI="dri"
+inherit xorg-2
+
+DESCRIPTION="ATI Mach64 video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.10
+ >=x11-libs/libpciaccess-0.12.901"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+
+ xorg-2_pkg_setup
+}
diff --git a/x11-drivers/xf86-video-mga/Manifest b/x11-drivers/xf86-video-mga/Manifest
new file mode 100644
index 000000000000..038225275959
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-video-mga-1.6.2.tar.bz2 446851 SHA256 3f89ce250eea93f0de890954687790e06c0bab9e3e303df393e8759a187eca6c SHA512 2c971f8d3fc3d12878eb3ff43d904a56894f04dfde28e91af7668879e82d87c6d9d1bd19cedcf2c9cfe39495fd3f44311a768c6402a7b853967c63222c28e4e7 WHIRLPOOL d28591de3e06057925278b5723d0c062220ca6ccb22f793e014386bbb3ecd06eb70daed1b131a64da58b7a8a059fe4103abe89fd1c35c787e0b88fdc471ee8a1
+DIST xf86-video-mga-1.6.3.tar.bz2 454763 SHA256 7704b1ea35098769787a9c93e903b827be97a99facfb1696aa5236a58ff1c7d7 SHA512 4e4e21021ac544d3d2119e731dda451638441f40b8ce469bcba1861237f5b2f2d7f85013852467c9e9c06aa0c1ce52798a0ad0c0f587b44f06b8d0e695bd4666 WHIRLPOOL d1df029ccef04275f8795f047cf5008c0fb6d21ebca774344aac713eac8d6e5031045ea8d4542e630e91863e2fd37bc88f0702fe52114d0c1f1473c6ac508828
+DIST xf86-video-mga-1.6.4.tar.bz2 475858 SHA256 48c6690b6751c76f53de64f8dbeaa9d6c62dbcfe890c768fd87167951247d44f SHA512 714bc477f7c72d640b045a4033fc49a7045ee239395f9aa8c622e9d4f5ca9098ba4ec28eaec5b839666eed37acb60c198d6ff606222c145c007fb320b52fff55 WHIRLPOOL 03bbfeab72d455717e0a81049f3fd06ca1fefe078f30c6680c4c82ed7de79d4cc6dc136df79de48faebadbca47acd61724f484f51e3f552059991c1fa63e6399
diff --git a/x11-drivers/xf86-video-mga/metadata.xml b/x11-drivers/xf86-video-mga/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.2.ebuild b/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.2.ebuild
new file mode 100644
index 000000000000..0124a01c4d6d
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.2.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="Matrox video driver"
+
+SLOT="0"
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS="$(use_enable dri)"
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.3.ebuild b/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.3.ebuild
new file mode 100644
index 000000000000..dcc05b3666be
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.3.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="Matrox video driver"
+
+SLOT="0"
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS="$(use_enable dri)"
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.4.ebuild b/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.4.ebuild
new file mode 100644
index 000000000000..3f617b202569
--- /dev/null
+++ b/x11-drivers/xf86-video-mga/xf86-video-mga-1.6.4.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="Matrox video driver"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS="$(use_enable dri)"
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-modesetting/Manifest b/x11-drivers/xf86-video-modesetting/Manifest
new file mode 100644
index 000000000000..e6948cd91049
--- /dev/null
+++ b/x11-drivers/xf86-video-modesetting/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-modesetting-0.8.1.tar.bz2 306379 SHA256 3ba8d8d7cb679497abc6486e2e843f8ea1582d830a27448ed4c90413e58312ca SHA512 1f18a90653a5e72f0285c7b4640051b63f7795e6c8ffb7e4055982c09ef5902c182657e4441292e8ebb42ef21cf730156b744603aa63bb8d803d8f5df55404b7 WHIRLPOOL 0e4fcea190fbbc0e8efd0a31799ede35b8b22378bd604ec5a3c9c498ff2acb765a2b2220c63482d92b6b4d73e2a87cacece98d9bcafbf0cf6fb759553707be86
+DIST xf86-video-modesetting-0.9.0.tar.bz2 304351 SHA256 90cf085573203dfadd48ea69bd694c4d04ccbe088b6855e9c85c34bb8a95d75c SHA512 0e581deb3f09e932475c1ebf1e5a69239f6e0ac4d37bcc25ee9bc30083c1285c4a5645df960c7bd7103584512eff4149463195a985f469bd24f52059fd487cec WHIRLPOOL 2bc99cf711a7ad15a0151608c56f9f57885743548d4716c7ba84463481f90d25dc79c8af4c1a657760283d08b7f65ad1ab34c29b66da50cfe0c5bbc3439261ab
diff --git a/x11-drivers/xf86-video-modesetting/metadata.xml b/x11-drivers/xf86-video-modesetting/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-modesetting/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.8.1.ebuild b/x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.8.1.ebuild
new file mode 100644
index 000000000000..89e330b215c1
--- /dev/null
+++ b/x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.8.1.ebuild
@@ -0,0 +1,12 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="Unaccelerated generic driver for kernel modesetting"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
diff --git a/x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.9.0.ebuild b/x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.9.0.ebuild
new file mode 100644
index 000000000000..c7e900043d46
--- /dev/null
+++ b/x11-drivers/xf86-video-modesetting/xf86-video-modesetting-0.9.0.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="Unaccelerated generic driver for kernel modesetting"
+
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-libs/libdrm-2.4.46"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-neomagic/Manifest b/x11-drivers/xf86-video-neomagic/Manifest
new file mode 100644
index 000000000000..bb0f1dc97905
--- /dev/null
+++ b/x11-drivers/xf86-video-neomagic/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-neomagic-1.2.9.tar.bz2 340789 SHA256 72f89396b10527549337cb72a7eafb1194cf140144f9236a94ad2becdf140bf2 SHA512 fc1fbb220110ae5aa8909f586a3a22ed0d4570b1e9f7577da7014c5e129d8cf04a8ea754e0f7fae5fc5d8e5671593f235656ce991f74fa828fd2b8f9c5e171e6 WHIRLPOOL 03d33a6720fd145557c80e67fb58861f61659721bb948fdad3b3441252c100e90bcd549a7adc3ae2bb229af581b345ad8cb31739ef0c6eeeb5e7ac778d1dea84
diff --git a/x11-drivers/xf86-video-neomagic/metadata.xml b/x11-drivers/xf86-video-neomagic/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-neomagic/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.9.ebuild b/x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.9.ebuild
new file mode 100644
index 000000000000..788c300b0569
--- /dev/null
+++ b/x11-drivers/xf86-video-neomagic/xf86-video-neomagic-1.2.9.ebuild
@@ -0,0 +1,10 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Neomagic video driver"
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
diff --git a/x11-drivers/xf86-video-newport/Manifest b/x11-drivers/xf86-video-newport/Manifest
new file mode 100644
index 000000000000..06f8d03226e7
--- /dev/null
+++ b/x11-drivers/xf86-video-newport/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-newport-0.2.3.tar.bz2 266377 RMD160 2726f707a073e6fbd8ec23bbc62c7159d9fddbd9 SHA1 018243071fbadb4fa28a6383465c71b2f5fb62e4 SHA256 e6caeb4f95adfd9d2046d24f5f3688092ea4e3fb63aa3d0675f6c697c8cf0270
+DIST xf86-video-newport-0.2.4.tar.bz2 308541 RMD160 fc1ae9c73495268691efe95f7cc9be3a28a64fba SHA1 666d3794833281bea24cb8015d9464753ba9885c SHA256 91cc41c6b17b068ed865c5d00b7662faaa1f7523ca449200abcd6539c4ad4ef9
diff --git a/x11-drivers/xf86-video-newport/metadata.xml b/x11-drivers/xf86-video-newport/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-newport/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-newport/xf86-video-newport-0.2.3.ebuild b/x11-drivers/xf86-video-newport/xf86-video-newport-0.2.3.ebuild
new file mode 100644
index 000000000000..240c2ddc7507
--- /dev/null
+++ b/x11-drivers/xf86-video-newport/xf86-video-newport-0.2.3.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Newport video driver"
+KEYWORDS="-* ~mips"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-newport/xf86-video-newport-0.2.4.ebuild b/x11-drivers/xf86-video-newport/xf86-video-newport-0.2.4.ebuild
new file mode 100644
index 000000000000..708bb41b6b06
--- /dev/null
+++ b/x11-drivers/xf86-video-newport/xf86-video-newport-0.2.4.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="Newport video driver"
+KEYWORDS="-* ~mips"
+IUSE=""
+
+RDEPEND=""
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-nouveau/Manifest b/x11-drivers/xf86-video-nouveau/Manifest
new file mode 100644
index 000000000000..9974468da326
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-nouveau-1.0.10.tar.bz2 580544 SHA256 c1bab3160bae96d485fc93a048d19775398aa85b407bac53020675f7e995db9d SHA512 461301e5e05cdf21197abe7d7c009d491aa7d455403a3976d0ad0cba05a8d43010440e60061f5d3bcfe6cfe6bd6c4c7723ed73a889459950b795ea895459b32b WHIRLPOOL 1600767973034ab914b8978f134afbee6d33220c8a798328fad5815a84c25aa6a47192289ecf0d949272251f2574627728594b6633900a9f21b40fa5dfba245c
+DIST xf86-video-nouveau-1.0.11.tar.bz2 582436 SHA256 f84fe2b2787f3ea9419eac3aa86462b929a551b3dbc4de550cc83b67f3216848 SHA512 4ceffc711798b98a5ee67d9df33d1a4f1d2b7d100605ea04b2e689debf745bc5a4f8907b602d1689ec6ed6400b2fc0ffe0eb0f7e7787bd2dd3cd5db1d14e90ee WHIRLPOOL fd201e7387cde4767c84c7be00cf3cff11fe542d079993369264b4fab090885050df51151aeef73153642666902437ad0876bc9544f6beb35ac5bfb6e19e9c97
diff --git a/x11-drivers/xf86-video-nouveau/files/xf86-video-nouveau-1.0.11-glamor-automagic.patch b/x11-drivers/xf86-video-nouveau/files/xf86-video-nouveau-1.0.11-glamor-automagic.patch
new file mode 100644
index 000000000000..310070f99eb7
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/files/xf86-video-nouveau-1.0.11-glamor-automagic.patch
@@ -0,0 +1,42 @@
+diff -ur a/configure.ac b/configure.ac
+--- a/configure.ac 2014-09-03 21:29:04.000000000 +0200
++++ b/configure.ac 2014-10-23 16:31:21.117695404 +0200
+@@ -140,17 +140,29 @@
+ #include "list.h"])
+ fi
+
+-AC_CHECK_HEADERS([glamor.h],[found_glamor_header=yes],[found_glamor_header=no],
+- [#include "xorg-server.h"])
+-AC_MSG_CHECKING([whether to include GLAMOR support])
+-if test "x$found_glamor_header" = xyes && pkg-config --exists "xorg-server >= 1.15.99.901"
+-then
+- AC_DEFINE(HAVE_GLAMOR, 1, [Build support for glamor acceleration])
+- AC_MSG_RESULT([yes])
+-else
+- AC_MSG_RESULT([no])
++AC_ARG_ENABLE(glamor,
++ AS_HELP_STRING([--enable-glamor],
++ [Enable glamor, a new GL-based acceleration [default=auto]]),
++ [GLAMOR="$enableval"],
++ [GLAMOR=auto])
++
++if test "x$GLAMOR" != "xno"; then
++ AC_CHECK_HEADERS([glamor.h],[found_glamor_header=yes],[found_glamor_header=no],
++ [#include "xorg-server.h"])
++ AC_MSG_CHECKING([whether to include GLAMOR support])
++ if test "x$found_glamor_header" = xyes && pkg-config --exists "xorg-server >= 1.15.99.901"
++ then
++ AC_DEFINE(HAVE_GLAMOR, 1, [Build support for glamor acceleration])
++ AC_MSG_RESULT([yes])
++ else
++ AC_MSG_RESULT([no])
++ if test "x$GLAMOR" != "xauto"; then
++ AC_MSG_ERROR([failed to find required Xorg headers for glamor])
++ fi
++ fi
+ fi
+
++
+ AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
diff --git a/x11-drivers/xf86-video-nouveau/metadata.xml b/x11-drivers/xf86-video-nouveau/metadata.xml
new file mode 100644
index 000000000000..b19c4dca8ea3
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<use>
+ <flag name="glamor">Enable Glamor OpenGL 2D acceleration</flag>
+</use>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10-r1.ebuild b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10-r1.ebuild
new file mode 100644
index 000000000000..3e8e28285f04
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10-r1.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+XORG_DRI="always"
+inherit xorg-2
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/git/nouveau/${PN}"
+ SRC_URI=""
+fi
+
+DESCRIPTION="Accelerated Open Source driver for nVidia cards"
+HOMEPAGE="http://nouveau.freedesktop.org/"
+
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE="udev"
+
+RDEPEND="udev? ( virtual/udev )
+ >=x11-libs/libdrm-2.4.34[video_cards_nouveau]"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ xorg-2_src_prepare
+
+ # There is no configure knob for this, so hack it.
+ use udev || export LIBUDEV_{CFLAGS,LIBS}=' '
+ sed -i \
+ -e "/LIBUDEV=/s:=.*:=$(usex udev):" \
+ configure || die
+}
diff --git a/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10.ebuild b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10.ebuild
new file mode 100644
index 000000000000..c2aa5996479d
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.10.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+XORG_DRI="always"
+inherit xorg-2
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/git/nouveau/${PN}"
+ SRC_URI=""
+fi
+
+DESCRIPTION="Accelerated Open Source driver for nVidia cards"
+HOMEPAGE="http://nouveau.freedesktop.org/"
+
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE=""
+
+RDEPEND=">=x11-libs/libdrm-2.4.34[video_cards_nouveau]"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.11.ebuild b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.11.ebuild
new file mode 100644
index 000000000000..310b82137edb
--- /dev/null
+++ b/x11-drivers/xf86-video-nouveau/xf86-video-nouveau-1.0.11.ebuild
@@ -0,0 +1,32 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+XORG_DRI="always"
+XORG_EAUTORECONF=yes
+inherit xorg-2
+
+if [[ ${PV} == 9999* ]]; then
+ EGIT_REPO_URI="git://anongit.freedesktop.org/git/nouveau/${PN}"
+ SRC_URI=""
+fi
+
+DESCRIPTION="Accelerated Open Source driver for nVidia cards"
+HOMEPAGE="http://nouveau.freedesktop.org/"
+
+KEYWORDS="amd64 ppc ppc64 x86"
+IUSE="glamor"
+
+RDEPEND=">=x11-libs/libdrm-2.4.34[video_cards_nouveau]
+ x11-base/xorg-server[glamor(-)?]"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-glamor-automagic.patch
+)
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS="$(use_enable glamor)"
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-nv/Manifest b/x11-drivers/xf86-video-nv/Manifest
new file mode 100644
index 000000000000..cb0904fee0a6
--- /dev/null
+++ b/x11-drivers/xf86-video-nv/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-nv-2.1.20.tar.bz2 396982 SHA256 8395f65501f16f9cbaae8f598b02c6f18e78f4d3d30a08cb8d547dc2e00c10bf SHA512 f7c3f00aa949bdffdcb180fa727204b1cdbbad560919e111c589f8614fd897186cdefe014714505aa4646419b4d8bb879eaca96fea032b56cc8c71ba7faa6373 WHIRLPOOL 77d18c82faaf1d969aa9cef6d81fcc0fda8fbb141094a1b05c1ad6edddb5cf2044280f1f0017a079abd9918be555eeffc9ed49750762601dcbcd14e66bfbc9ee
diff --git a/x11-drivers/xf86-video-nv/files/xf86-video-nv-2.1.20-remove-mibstore_h.patch b/x11-drivers/xf86-video-nv/files/xf86-video-nv-2.1.20-remove-mibstore_h.patch
new file mode 100644
index 000000000000..ef5a4f2d9d6b
--- /dev/null
+++ b/x11-drivers/xf86-video-nv/files/xf86-video-nv-2.1.20-remove-mibstore_h.patch
@@ -0,0 +1,81 @@
+From fc78fe98222b0204b8a2872a529763d6fe5048da Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:49 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/g80_driver.c b/src/g80_driver.c
+index cc4e197..719b96c 100644
+--- a/src/g80_driver.c
++++ b/src/g80_driver.c
+@@ -34,7 +34,6 @@
+ #include <xf86Resources.h>
+ #endif
+ #include <mipointer.h>
+-#include <mibstore.h>
+ #include <micmap.h>
+ #include <xf86cmap.h>
+ #include <fb.h>
+@@ -833,7 +832,6 @@ G80ScreenInit(SCREEN_INIT_ARGS_DECL)
+ }
+ }
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+diff --git a/src/nv_driver.c b/src/nv_driver.c
+index 6dad6e5..8f35334 100644
+--- a/src/nv_driver.c
++++ b/src/nv_driver.c
+@@ -2550,7 +2550,6 @@ NVScreenInit(SCREEN_INIT_ARGS_DECL)
+ if (!pNv->NoAccel)
+ NVAccelInit(pScreen);
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+diff --git a/src/nv_include.h b/src/nv_include.h
+index fb190bf..f174eef 100644
+--- a/src/nv_include.h
++++ b/src/nv_include.h
+@@ -24,9 +24,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+-
+ #include "micmap.h"
+
+ #include "xf86DDC.h"
+diff --git a/src/riva_driver.c b/src/riva_driver.c
+index e0667ef..759501e 100644
+--- a/src/riva_driver.c
++++ b/src/riva_driver.c
+@@ -1168,7 +1168,6 @@ RivaScreenInit(SCREEN_INIT_ARGS_DECL)
+ if (!pRiva->NoAccel)
+ RivaAccelInit(pScreen);
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+diff --git a/src/riva_include.h b/src/riva_include.h
+index f2c5302..c7aeef7 100644
+--- a/src/riva_include.h
++++ b/src/riva_include.h
+@@ -22,9 +22,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+-
+ #include "micmap.h"
+
+ #include "xf86DDC.h"
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-nv/metadata.xml b/x11-drivers/xf86-video-nv/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-nv/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-nv/xf86-video-nv-2.1.20-r1.ebuild b/x11-drivers/xf86-video-nv/xf86-video-nv-2.1.20-r1.ebuild
new file mode 100644
index 000000000000..a3c8c4690ef5
--- /dev/null
+++ b/x11-drivers/xf86-video-nv/xf86-video-nv-2.1.20-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Nvidia 2D only video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND="x11-base/xorg-server
+ >=x11-libs/libpciaccess-0.10.7"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-omap/Manifest b/x11-drivers/xf86-video-omap/Manifest
new file mode 100644
index 000000000000..2b479a3b884c
--- /dev/null
+++ b/x11-drivers/xf86-video-omap/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-omap-0.4.2.tar.bz2 310629 SHA256 1343fe5be6eeb375bbad0731685d05cb649faef773eba927645cef536bb206ff SHA512 9c3160af5dcd97463ef36ef6d24be1382466095b9df5c2946b74f1ba00671bd6c08dcfb52c6b6f7c72b97dbc5124b842c59448ecd7ada3c22da097ba55e4fb83 WHIRLPOOL 2621dfbe4f715875f0eb26d363947d6a4b574fa48b6d720e521196a8d72d9ec96d84c76e0eabd9810327d6210f349ee584a29f70312aff4c749708230d021424
+DIST xf86-video-omap-0.4.3.tar.bz2 316093 SHA256 db1e0e69fd4c4c8fdca5ef2cb0447bccd7518a718495876a6904bef57b39986d SHA512 278cbe478acc67a966a1c3080ada2a13458011fc0b50d122811da803d4e051a5827bcccd48517e1ed2f416da1d5fee062aa1c8796f152048c449594aed55b310 WHIRLPOOL 0db24e2aaeff75f6c3602f5def850111dbb171cf4c9453219c366639b9f7771a4f1cf41bd700e54a0124d1ded0d6069b87866fba70f101849d75c12708e3c9a0
diff --git a/x11-drivers/xf86-video-omap/metadata.xml b/x11-drivers/xf86-video-omap/metadata.xml
new file mode 100644
index 000000000000..48b24f0a1db6
--- /dev/null
+++ b/x11-drivers/xf86-video-omap/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<herd>arm</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-omap/xf86-video-omap-0.4.2.ebuild b/x11-drivers/xf86-video-omap/xf86-video-omap-0.4.2.ebuild
new file mode 100644
index 000000000000..7fc1624885d6
--- /dev/null
+++ b/x11-drivers/xf86-video-omap/xf86-video-omap-0.4.2.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="OMAP video driver"
+
+KEYWORDS="arm"
+
+RDEPEND=">=x11-base/xorg-server-1.3
+ >=x11-libs/libdrm-2.4.36[video_cards_omap]"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-omap/xf86-video-omap-0.4.3.ebuild b/x11-drivers/xf86-video-omap/xf86-video-omap-0.4.3.ebuild
new file mode 100644
index 000000000000..472debfd1a91
--- /dev/null
+++ b/x11-drivers/xf86-video-omap/xf86-video-omap-0.4.3.ebuild
@@ -0,0 +1,15 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="OMAP video driver"
+
+KEYWORDS="arm"
+
+RDEPEND=">=x11-base/xorg-server-1.3
+ >=x11-libs/libdrm-2.4.36[video_cards_omap]"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-omapfb/Manifest b/x11-drivers/xf86-video-omapfb/Manifest
new file mode 100644
index 000000000000..b9ffcfa49af2
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-omapfb_0.1.1.1-1.diff.gz 3116 SHA256 c4ea91003b4244563668a78603b28918df40629ef729515ba48d1dc923ef359c SHA512 cc463421b8a86a90234cf5a6352458d708f60fe77613bcc9099531651653efd9da11640199c792a3061f65930bc39bef90ec769a673cee27dd88a606c5fa652f WHIRLPOOL 73c4ef6c0bd67f46b25c794dbfa7ed318231b68d7dc8c4cae20397fc2ecd6610beeb77dc4a49394056d21d2a5a8954c0d9fea371e7f7547eb60f698dc3d8a95f
+DIST xf86-video-omapfb_0.1.1.1.orig.tar.gz 26835 SHA256 fe7e6e7739ecddc3b1663cbe08e7e889544a16e5e505d0dc48c79b2153208fbc SHA512 96f6ff1adc5c558e4957b32a0dee722553f6c9e4aac6f8b5ca77e58b6d7b33b910b207ffa27b6556b802ead4cacaa034cf822dccb979072171782a5a34b6f96d WHIRLPOOL 5524a3b3319de0d0de57a1dcc888c488b902357be93f685211b581b3e31c368a462c4a9ac78096b40974a9a98773220117086cd911e958c2a8444278d52744bc
diff --git a/x11-drivers/xf86-video-omapfb/files/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch b/x11-drivers/xf86-video-omapfb/files/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
new file mode 100644
index 000000000000..9fb01d438a1d
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
@@ -0,0 +1,41 @@
+From 8fb7d0f99d4afbb574b30cb4f1e66a8f89d94ad5 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 12:04:36 +0100
+Subject: [PATCH 1/6] Revert "Set a large CRTC upper limit to not prune larger
+ resolutions"
+
+Picture is garbled after switching resolutions, so revert it.
+Virtual size too big, revert the commit 9c4d7592dcb7dc20a48a6f941d9d94bd73d34153.
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-crtc.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
+index 9aaa52f..cbeff35 100644
+--- a/src/omapfb-crtc.c
++++ b/src/omapfb-crtc.c
+@@ -190,13 +190,13 @@ OMAPFBCRTCInit(ScrnInfoPtr pScrn)
+ * In practise, this doesn't seem to be supported.
+ * (no way to setup the overlay offset/base address)
+ */
+- /* FIXME: figure out what makes sense here. A known max resolution?
+- * framebuffer size?
+- */
+ xf86CrtcSetSizeRange(pScrn,
+- 8, 8, 2048, 2048);
++ 8, 8,
++ ofb->state_info.xres_virtual,
++ ofb->state_info.yres_virtual);
+
+ ofb->crtc = xf86CrtcCreate(pScrn, &OMAPFBCrtcFuncs);
++
+ }
+
+
+--
+1.8.0
+
diff --git a/x11-drivers/xf86-video-omapfb/files/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch b/x11-drivers/xf86-video-omapfb/files/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
new file mode 100644
index 000000000000..683a9898328b
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
@@ -0,0 +1,32 @@
+From 855c333ac0d16350f895f1d1b9391e9cbb0b6db4 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:27:20 +0100
+Subject: [PATCH 2/6] Revert "Set virtual size when configuring framebuffer"
+
+Virtual size too big, so revert it.
+
+This reverts commit 2653ef07883fbd1a5e7025f9300cf89b79ba429a.
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-crtc.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
+index cbeff35..9655db2 100644
+--- a/src/omapfb-crtc.c
++++ b/src/omapfb-crtc.c
+@@ -98,8 +98,6 @@ OMAPFBCrtcCommitChangeMode (xf86CrtcPtr crtc)
+ v = ofb->state_info;
+ v.xres = mode->HDisplay;
+ v.yres = mode->VDisplay;
+- v.xres_virtual = crtc->scrn->virtualX;
+- v.yres_virtual = crtc->scrn->virtualY;
+ v.activate = FB_ACTIVATE_NOW;
+ v.pixclock = KHZ2PICOS(mode->Clock ? mode->Clock : 56000);
+ v.left_margin = mode->HTotal - mode->HSyncEnd;
+--
+1.8.0
+
diff --git a/x11-drivers/xf86-video-omapfb/files/0003-force-plain-mode.patch b/x11-drivers/xf86-video-omapfb/files/0003-force-plain-mode.patch
new file mode 100644
index 000000000000..67ea7c1a5f5b
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/0003-force-plain-mode.patch
@@ -0,0 +1,31 @@
+From 252f44c072d3447a32127fc9afe5d0d40f3c510e Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:20:20 +0100
+Subject: [PATCH 3/6] force 'plain' mode
+
+The new DSS mode breaks XV, so force plain mode
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-driver.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 018e040..48aa09c 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -326,7 +326,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ OMAPFBProbeController(ofb->ctrl_name);
+
+ /* Do we have the DSS kernel API? */
+- if (stat(SYSFS_DSS_DIR, &st) == 0) {
++ if (0) { //stat(SYSFS_DSS_DIR, &st) == 0) {
+ ofb->dss = TRUE;
+ } else {
+ ofb->dss = FALSE;
+--
+1.8.0
+
diff --git a/x11-drivers/xf86-video-omapfb/files/0004-blacklist-tv-out.patch b/x11-drivers/xf86-video-omapfb/files/0004-blacklist-tv-out.patch
new file mode 100644
index 000000000000..b0ac9a44c8e8
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/0004-blacklist-tv-out.patch
@@ -0,0 +1,33 @@
+From cfa46b67f59115f6d8ef9414af60380749ff3eb3 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:21:12 +0100
+Subject: [PATCH 4/6] blacklist tv out
+
+The tv-out gets added last and the driver tries to reconfigure dvi to TV resolutions, which fails. so blacklist it
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-output-dss.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/omapfb-output-dss.c b/src/omapfb-output-dss.c
+index 6cc52de..83cb711 100644
+--- a/src/omapfb-output-dss.c
++++ b/src/omapfb-output-dss.c
+@@ -205,6 +205,10 @@ OMAPFBDSSOutputDetect (xf86OutputPtr output)
+ if(ofb->timings[idx][0] == '\0')
+ return XF86OutputStatusDisconnected;
+
++ // Hack to disable the tv out
++ if (strncmp(output->name, "tv", 2) == 0)
++ return XF86OutputStatusDisconnected;
++
+ return XF86OutputStatusConnected;
+ }
+
+--
+1.8.0
+
diff --git a/x11-drivers/xf86-video-omapfb/files/0005-Attempt-to-fix-VRFB.patch b/x11-drivers/xf86-video-omapfb/files/0005-Attempt-to-fix-VRFB.patch
new file mode 100644
index 000000000000..67b284023d30
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/0005-Attempt-to-fix-VRFB.patch
@@ -0,0 +1,325 @@
+From 8b1f697a60e35ab82fffdabfaefdb45e9a9df379 Mon Sep 17 00:00:00 2001
+From: Eino-Ville Talvala <talvala@stanford.edu>
+Date: Tue, 23 Aug 2011 18:37:01 +0200
+Subject: [PATCH 5/6] Attempt to fix VRFB
+
+Upstream-Status: Pending
+
+http://dominion.thruhere.net/git/cgit.cgi/xf86-video-omapfb/commit/?h=koen/fixups&id=6833fc9f795265e4943d248103fbaf3463b515d6
+
+Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/image-format-conversions.c | 4 +--
+ src/image-format-conversions.h | 2 +-
+ src/omapfb-driver.c | 28 +++++++++++++---
+ src/omapfb-xv-blizzard.c | 1 +
+ src/omapfb-xv-generic.c | 72 +++++++++++++++++++++++++++++++++---------
+ src/omapfb-xv.c | 3 ++
+ 6 files changed, 88 insertions(+), 22 deletions(-)
+
+diff --git a/src/image-format-conversions.c b/src/image-format-conversions.c
+index dcefa9b..d43427d 100644
+--- a/src/image-format-conversions.c
++++ b/src/image-format-conversions.c
+@@ -38,13 +38,13 @@
+ #include "image-format-conversions.h"
+
+ /* Basic line-based copy for packed formats */
+-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest)
++void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest)
+ {
+ int i;
+ int len = w * 2;
+ for (i = 0; i < h; i++)
+ {
+- memcpy(dest + i * len, src + i * stride, len);
++ memcpy(dest + i * dst_stride, src + i * src_stride, len);
+ }
+ }
+
+diff --git a/src/image-format-conversions.h b/src/image-format-conversions.h
+index 584896a..ba7caf2 100644
+--- a/src/image-format-conversions.h
++++ b/src/image-format-conversions.h
+@@ -27,7 +27,7 @@
+ #include <stdint.h>
+
+ /* Basic line-based copy for packed formats */
+-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest);
++void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest);
+
+ /* Basic C implementation of YV12/I420 to UYVY conversion */
+ void uv12_to_uyvy(int w, int h, int y_pitch, int uv_pitch, uint8_t *y_p, uint8_t *u_p, uint8_t *v_p, uint8_t *dest);
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 48aa09c..07989f5 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -66,6 +66,7 @@
+ #define OMAPFB_VERSION 1000
+ #define OMAPFB_DRIVER_NAME "OMAPFB"
+ #define OMAPFB_NAME "omapfb"
++#define ENFORCE_MODES
+
+ static Bool OMAPFBProbe(DriverPtr drv, int flags);
+ static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
+@@ -105,11 +106,13 @@ static SymTabRec OMAPFBChipsets[] = {
+ typedef enum {
+ OPTION_ACCELMETHOD,
+ OPTION_FB,
++ OPTION_ROTATE,
+ } FBDevOpts;
+
+ static const OptionInfoRec OMAPFBOptions[] = {
+ { OPTION_ACCELMETHOD, "AccelMethod", OPTV_STRING, {0}, FALSE },
+ { OPTION_FB, "fb", OPTV_STRING, {0}, FALSE },
++ { OPTION_ROTATE, "rotation", OPTV_STRING, {0}, FALSE },
+ { -1, NULL, OPTV_NONE, {0}, FALSE }
+ };
+
+@@ -286,6 +289,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ {
+ OMAPFBPtr ofb;
+ EntityInfoPtr pEnt;
++ char *rotate;
+ rgb zeros = { 0, 0, 0 };
+ struct stat st;
+
+@@ -379,6 +383,8 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ pScrn->progClock = TRUE;
+ pScrn->chipset = "omapfb";
+
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Rotate test version 0.02\n");
++
+ /* Start with configured virtual size */
+ pScrn->virtualX = pScrn->display->virtualX;
+ pScrn->virtualY = pScrn->display->virtualY;
+@@ -496,12 +502,21 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ ofb->CloseScreen = pScreen->CloseScreen;
+ pScreen->CloseScreen = OMAPFBCloseScreen;
+
++ /* Enforce the default mode (this is silly I guess) */
++#ifdef ENFORCE_MODES
++ //xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enforcing modes\n");
++ //set_mode(ofb, &ofb->default_mode);
++ //pScrn->displayWidth = ofb->fixed_info.line_length /
++ // (ofb->state_info.bits_per_pixel>>3); //ofb->state_info.xres;
++#endif
++
+ /* Map our framebuffer memory */
++ ofb->mem_info.size = ofb->fixed_info.line_length * ofb->state_info.yres;
+ ofb->fb = mmap (NULL, ofb->mem_info.size,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ofb->fd, 0);
+- if (ofb->fb == NULL) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed\n");
++ if (ofb->fb == MAP_FAILED) {
++ xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
+ return FALSE;
+ }
+
+@@ -578,8 +593,13 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ } else if (!ofb->dss) {
+
+ ofb->plane_info.enabled = 1;
+- ofb->plane_info.out_width = ofb->state_info.xres;
+- ofb->plane_info.out_height = ofb->state_info.yres;
++ if (ofb->state_info.rotate == 0 || ofb->state_info.rotate == 2) {
++ ofb->plane_info.out_width = ofb->state_info.xres;
++ ofb->plane_info.out_height = ofb->state_info.yres;
++ } else {
++ ofb->plane_info.out_width = ofb->state_info.yres;
++ ofb->plane_info.out_height = ofb->state_info.xres;
++ }
+
+ if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
+ xf86DrvMsg(scrnIndex, X_ERROR,
+diff --git a/src/omapfb-xv-blizzard.c b/src/omapfb-xv-blizzard.c
+index 406ffc6..b71d2aa 100644
+--- a/src/omapfb-xv-blizzard.c
++++ b/src/omapfb-xv-blizzard.c
+@@ -220,6 +220,7 @@ int OMAPFBXVPutImageBlizzard (ScrnInfoPtr pScrn,
+ packed_line_copy(src_w & ~3,
+ src_h & ~3,
+ ((src_w + 1) & ~1) * 2,
++ ofb->port->fixed_info.line_length,
+ (uint8_t*)buf,
+ (uint8_t*)ofb->port->fb);
+ break;
+diff --git a/src/omapfb-xv-generic.c b/src/omapfb-xv-generic.c
+index e6f89fe..b33f344 100644
+--- a/src/omapfb-xv-generic.c
++++ b/src/omapfb-xv-generic.c
+@@ -62,7 +62,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ {
+ OMAPFBPtr ofb = OMAPFB(pScrn);
+
+- /* The memory size is already set in OMAPFBXVQueryImageAttributes */
++ /* The memory size is already set before we get here */
+ if (ioctl(ofb->port->fd, OMAPFB_SETUP_MEM, &ofb->port->mem_info) != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Failed to allocate video plane memory\n");
+@@ -73,19 +73,20 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ ofb->port->fb = mmap (NULL, ofb->port->mem_info.size,
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ofb->port->fd, 0);
+- if (ofb->port->fb == NULL) {
++ if (ofb->port->fb == MAP_FAILED) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "Mapping video memory failed\n");
+ return XvBadAlloc;
+ }
+
+ /* Update the state info */
++ /* Let's not - it's bad
+ if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
+ {
+ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
+ return XvBadAlloc;
+ }
+-
++ */
+ return Success;
+ }
+
+@@ -93,6 +94,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
+ {
+ OMAPFBPtr ofb = OMAPFB(pScrn);
++ int ret;
+
+ if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
+ {
+@@ -104,6 +106,31 @@ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
+ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
+ return XvBadAlloc;
+ }
++ /* Changing rotation/nonstd flags can change the fixed info! */
++ if (ioctl (ofb->port->fd, FBIOGET_FSCREENINFO, &ofb->port->fixed_info))
++ {
++ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
++ return XvBadAlloc;
++ }
++ /* Correct fixed info requires recalculation of needed memory */
++ ofb->port->mem_info.size = ofb->port->fixed_info.line_length * ofb->port->state_info.yres;
++
++ /* Allocate buffer memory */
++ ret = OMAPXVAllocPlane(pScrn);
++ if (ret != Success)
++ return ret;
++
++ /* Workaround for reset of mode after memory allo */
++ if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
++ {
++ xf86Msg(X_ERROR, "%s: setting state info failed\n", __FUNCTION__);
++ return XvBadAlloc;
++ }
++ if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
++ {
++ xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
++ return XvBadAlloc;
++ }
+
+ if(ioctl(ofb->port->fd, OMAPFB_SETUP_PLANE,
+ &ofb->port->plane_info) != 0) {
+@@ -124,6 +151,8 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ DrawablePtr pDraw)
+ {
+ OMAPFBPtr ofb = OMAPFB(pScrn);
++ short drw_temp;
++ short rot_xres, rot_yres;
+
+ if (!ofb->port->plane_info.enabled
+ || ofb->port->update_window.x != src_x
+@@ -163,13 +192,6 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ return Success;
+ }
+
+- /* If we don't have the plane running, enable it */
+- if (!ofb->port->plane_info.enabled) {
+- ret = OMAPXVAllocPlane(pScrn);
+- if (ret != Success)
+- return ret;
+- }
+-
+ /* Set up the state info, xres and yres will be used for
+ * scaling to the values in the plane info struct
+ */
+@@ -179,12 +201,31 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ ofb->port->state_info.yres_virtual = 0;
+ ofb->port->state_info.xoffset = 0;
+ ofb->port->state_info.yoffset = 0;
+- ofb->port->state_info.rotate = 0;
++ //ofb->port->state_info.rotate = 0;
+ ofb->port->state_info.grayscale = 0;
+ ofb->port->state_info.activate = FB_ACTIVATE_NOW;
+ ofb->port->state_info.bits_per_pixel = 0;
+ ofb->port->state_info.nonstd = xv_to_omapfb_format(image);
+
++ /* Plane info does not rotate with state_info */
++ if (ofb->port->state_info.rotate == 1 ||
++ ofb->port->state_info.rotate == 3) {
++ drw_temp = drw_x;
++ drw_x = drw_y;
++ drw_y = drw_temp;
++
++ drw_temp = drw_w;
++ drw_w = drw_h;
++ drw_h = drw_temp;
++
++ rot_xres = ofb->port->state_info.yres;
++ rot_yres = ofb->port->state_info.xres;
++ } else {
++ rot_xres = ofb->port->state_info.xres;
++ rot_yres = ofb->port->state_info.yres;
++ }
++
++
+ /* Set up the video plane info */
+ ofb->port->plane_info.enabled = 1;
+ ofb->port->plane_info.pos_x = drw_x;
+@@ -193,13 +234,13 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ ofb->port->plane_info.out_height = drw_h & ~15;
+
+ /* Cap output to screen size */
+- if (ofb->port->plane_info.out_width > ofb->state_info.xres) {
++ if (ofb->port->plane_info.out_width > rot_xres) {
+ ofb->port->plane_info.pos_x = 0;
+- ofb->port->plane_info.out_width = ofb->state_info.xres;
++ ofb->port->plane_info.out_width = rot_xres;
+ }
+- if (ofb->port->plane_info.out_height > ofb->state_info.yres) {
++ if (ofb->port->plane_info.out_height > rot_yres) {
+ ofb->port->plane_info.pos_y = 0;
+- ofb->port->plane_info.out_height = ofb->state_info.yres;
++ ofb->port->plane_info.out_height = rot_yres;
+ }
+
+ ret = OMAPXVSetupVideoPlane(pScrn);
+@@ -223,6 +264,7 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ packed_line_copy(src_w & ~15,
+ src_h & ~15,
+ ((src_w + 1) & ~1) * 2,
++ ofb->port->fixed_info.line_length,
+ (uint8_t*)buf,
+ (uint8_t*)ofb->port->fb);
+ break;
+diff --git a/src/omapfb-xv.c b/src/omapfb-xv.c
+index 1df651e..0fee2c6 100644
+--- a/src/omapfb-xv.c
++++ b/src/omapfb-xv.c
+@@ -169,8 +169,11 @@ static int OMAPFBXVQueryImageAttributes (ScrnInfoPtr pScrn,
+ h = *height;
+
+ w = (w + 1) & ~1;
++
++ /* Can't calculate these here - don't know line length
+ ofb->port->mem_info.size = w << 1;
+ ofb->port->mem_info.size *= h;
++ */
+
+ return size;
+ }
+--
+1.8.0
+
diff --git a/x11-drivers/xf86-video-omapfb/files/0006-omapfb-port-to-new-xserver-video-API.patch b/x11-drivers/xf86-video-omapfb/files/0006-omapfb-port-to-new-xserver-video-API.patch
new file mode 100644
index 000000000000..d56729987ca8
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/0006-omapfb-port-to-new-xserver-video-API.patch
@@ -0,0 +1,272 @@
+From 803ecf2909949e6152f4a81b6cbb92a4430679ac Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 23 Nov 2012 00:31:06 +0100
+Subject: [PATCH 6/6] omapfb: port to new xserver video API
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/compat-api.h | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/omapfb-driver.c | 41 ++++++++++++-----------
+ 2 files changed, 118 insertions(+), 19 deletions(-)
+ create mode 100644 src/compat-api.h
+
+diff --git a/src/compat-api.h b/src/compat-api.h
+new file mode 100644
+index 0000000..b1591b1
+--- /dev/null
++++ b/src/compat-api.h
+@@ -0,0 +1,96 @@
++/*
++ * Copyright 2012 Red Hat, Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Author: Dave Airlie <airlied@redhat.com>
++ */
++
++/* this file provides API compat between server post 1.13 and pre it,
++ it should be reused inside as many drivers as possible */
++#ifndef COMPAT_API_H
++#define COMPAT_API_H
++
++#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
++#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
++#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
++#endif
++
++#ifndef XF86_HAS_SCRN_CONV
++#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
++#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
++#endif
++
++#ifndef XF86_SCRN_INTERFACE
++
++#define SCRN_ARG_TYPE int
++#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
++
++#define SCREEN_ARG_TYPE int
++#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
++
++#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
++
++#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
++#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
++
++#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
++#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
++
++#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
++
++#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
++
++#define FREE_SCREEN_ARGS_DECL int arg, int flags
++#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
++
++#define VT_FUNC_ARGS_DECL int arg, int flags
++#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
++
++#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
++#else
++#define SCRN_ARG_TYPE ScrnInfoPtr
++#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
++
++#define SCREEN_ARG_TYPE ScreenPtr
++#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
++
++#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
++
++#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
++#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
++
++#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
++#define CLOSE_SCREEN_ARGS pScreen
++
++#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
++#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
++
++#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
++#define FREE_SCREEN_ARGS(x) (x)
++
++#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
++#define VT_FUNC_ARGS(flags) pScrn
++
++#define XF86_ENABLEDISABLEFB_ARG(x) (x)
++
++#endif
++
++#endif
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 07989f5..486ffa4 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -44,6 +44,8 @@
+
+ #include "exa.h"
+
++#include "compat-api.h"
++
+ #ifdef HAVE_XEXTPROTO_71
+ #include <X11/extensions/dpmsconst.h>
+ #else
+@@ -70,10 +72,10 @@
+
+ static Bool OMAPFBProbe(DriverPtr drv, int flags);
+ static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
+-static Bool OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv);
+-static Bool OMAPFBEnterVT(int scrnIndex, int flags);
+-static void OMAPFBLeaveVT(int scrnIndex, int flags);
+-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
++static Bool OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL);
++static Bool OMAPFBEnterVT(VT_FUNC_ARGS_DECL);
++static void OMAPFBLeaveVT(VT_FUNC_ARGS_DECL);
++static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL);
+
+ static Bool
+ OMAPFBEnsureRec(ScrnInfoPtr pScrn)
+@@ -481,7 +483,7 @@ OMAPFBXvScreenInit(ScreenPtr pScreen)
+ }
+
+ static Bool
+-OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
++OMAPFBCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+ {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OMAPFBPtr ofb = OMAPFB(pScrn);
+@@ -490,11 +492,11 @@ OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
+
+ pScreen->CloseScreen = ofb->CloseScreen;
+
+- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
++ return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ }
+
+ static Bool
+-OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
++OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL)
+ {
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ OMAPFBPtr ofb = OMAPFB(pScrn);
+@@ -516,7 +518,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ PROT_READ | PROT_WRITE, MAP_SHARED,
+ ofb->fd, 0);
+ if (ofb->fb == MAP_FAILED) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
+ return FALSE;
+ }
+
+@@ -526,7 +528,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ /* Only support TrueColor for now */
+ if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
+ pScrn->rgbBits, pScrn->defaultVisual)) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "visual type setup failed"
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "visual type setup failed"
+ " for %d bits per pixel [1]\n",
+ pScrn->bitsPerPixel);
+ return FALSE;
+@@ -534,7 +536,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ /* Set up pixmap depth information */
+ if (!miSetPixmapDepths()) {
+- xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
++ xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
+ return FALSE;
+ }
+
+@@ -546,7 +548,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ pScrn->virtualY, pScrn->xDpi,
+ pScrn->yDpi, pScrn->displayWidth,
+ pScrn->bitsPerPixel)) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "fbScreenInit failed\n");
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbScreenInit failed\n");
+ return FALSE;
+ }
+
+@@ -567,7 +569,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ /* Initialize XRender fallbacks */
+ if (!fbPictureInit(pScreen, NULL, 0)) {
+- xf86DrvMsg(scrnIndex, X_ERROR, "fbPictureInit failed\n");
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbPictureInit failed\n");
+ return FALSE;
+ }
+
+@@ -579,7 +581,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+
+ /* Initialize default colormap */
+ if (!miCreateDefColormap(pScreen)) {
+- xf86DrvMsg(scrnIndex, X_ERROR,
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "creating default colormap failed\n");
+ return FALSE;
+ }
+@@ -589,7 +591,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ /* This is non-fatal since we might be running against older
+ * kernel driver in which case we only do basic 2D stuff...
+ */
+- xf86DrvMsg(scrnIndex, X_ERROR, "Reading plane info failed\n");
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Reading plane info failed\n");
+ } else if (!ofb->dss) {
+
+ ofb->plane_info.enabled = 1;
+@@ -602,7 +604,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ }
+
+ if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
+- xf86DrvMsg(scrnIndex, X_ERROR,
++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "%s: Plane setup failed: %s\n",
+ __FUNCTION__, strerror(errno));
+ return FALSE;
+@@ -645,9 +647,10 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ return TRUE;
+ }
+
+-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
++static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL)
+ {
+- return xf86SetSingleMode (xf86Screens[scrnIndex], mode, RR_Rotate_0);
++ SCRN_INFO_PTR(arg);
++ return xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
+ }
+
+ void
+@@ -699,14 +702,14 @@ OMAPFBPrintCapabilities(ScrnInfoPtr pScrn,
+ /*** Unimplemented: */
+
+ static Bool
+-OMAPFBEnterVT(int scrnIndex, int flags)
++OMAPFBEnterVT(VT_FUNC_ARGS_DECL)
+ {
+ xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
+ return TRUE;
+ }
+
+ static void
+-OMAPFBLeaveVT(int scrnIndex, int flags)
++OMAPFBLeaveVT(VT_FUNC_ARGS_DECL)
+ {
+ xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
+ }
+--
+1.8.0
+
diff --git a/x11-drivers/xf86-video-omapfb/files/xf86-video-omapfb-0.1.1-closescreen.patch b/x11-drivers/xf86-video-omapfb/files/xf86-video-omapfb-0.1.1-closescreen.patch
new file mode 100644
index 000000000000..e8a556059ba0
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/files/xf86-video-omapfb-0.1.1-closescreen.patch
@@ -0,0 +1,11 @@
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -441,7 +441,7 @@
+
+ pScreen->CloseScreen = ofb->CloseScreen;
+
+- return (*pScreen->CloseScreen)(scrnIndex, pScreen);
++ return (*pScreen->CloseScreen)(pScreen);
+ }
+
+ static Bool
diff --git a/x11-drivers/xf86-video-omapfb/metadata.xml b/x11-drivers/xf86-video-omapfb/metadata.xml
new file mode 100644
index 000000000000..5454528f2093
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>arm</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-omapfb/xf86-video-omapfb-0.1.1.1_p1.ebuild b/x11-drivers/xf86-video-omapfb/xf86-video-omapfb-0.1.1.1_p1.ebuild
new file mode 100644
index 000000000000..88d1a05e88b7
--- /dev/null
+++ b/x11-drivers/xf86-video-omapfb/xf86-video-omapfb-0.1.1.1_p1.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+XORG_EAUTORECONF="yes"
+
+inherit xorg-2
+
+MY_P="${P/_p*//}"
+MY_P_PATCH="${PN}_${PV/_p/-}"
+
+SRC_URI="mirror://debian/pool/main/x/${PN}/${PN}_${PV/_p*/}.orig.tar.gz
+ mirror://debian/pool/main/x/${PN}/${MY_P_PATCH}.diff.gz"
+HOMEPAGE="https://packages.debian.org/source/sid/xf86-video-omapfb"
+
+DESCRIPTION="X.org driver for TI OMAP framebuffers"
+KEYWORDS="-* arm"
+IUSE=""
+RDEPEND=""
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${WORKDIR}/${MY_P_PATCH}.diff"
+ epatch "${FILESDIR}"/000*.patch
+ xorg-2_src_prepare
+}
diff --git a/x11-drivers/xf86-video-openchrome/Manifest b/x11-drivers/xf86-video-openchrome/Manifest
new file mode 100644
index 000000000000..f83e4a52c9a3
--- /dev/null
+++ b/x11-drivers/xf86-video-openchrome/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-openchrome-0.3.3.tar.bz2 518705 SHA256 e49e2f1e5dac86408e5a74b87038cc4082d2c3fba4e0579823161991432412ed SHA512 ed1c30a6d92b804648de324d98ca61bd7887b4b97ed94e5b0c1f5abaf7d0dbb5ba1dc79e7c35a8cd76bff0d5b05594921bddc9007ef9ba00e72d0b9bd678de9e WHIRLPOOL d22b8a6ffaaad33a705a725abb018b9637097011f83682c10a6c72a8ffce29ae82341080a86d82203f00aad2fec9c94fda5065c9df7494a4fc858843292e75ab
diff --git a/x11-drivers/xf86-video-openchrome/files/xf86-video-openchrome-0.3.3-glibc-2.20.patch b/x11-drivers/xf86-video-openchrome/files/xf86-video-openchrome-0.3.3-glibc-2.20.patch
new file mode 100644
index 000000000000..7d96f8701a27
--- /dev/null
+++ b/x11-drivers/xf86-video-openchrome/files/xf86-video-openchrome-0.3.3-glibc-2.20.patch
@@ -0,0 +1,42 @@
+From 879f098cf8b8dc134569b9943f9665bfae17467e Mon Sep 17 00:00:00 2001
+From: Stefan Dirsch <sndirsch@suse.de>
+Date: Wed, 5 Nov 2014 11:29:37 +0100
+Subject: [PATCH] xf86.h cannot be included without first including
+ xorg-server.h.
+
+Without this the build fails on systems with the latest glibc,
+throwing this error:
+
+In file included from /usr/include/string.h:634:0,
+ from /usr/include/xorg/os.h:53,
+ from /usr/include/xorg/misc.h:115,
+ from /usr/include/xorg/xf86str.h:37,
+ from /usr/include/xorg/xf86.h:44,
+ from via_3d.h:28,
+ from via_3d.c:24:
+/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+
+This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h),
+causing os.h to redefine it.
+
+Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
+---
+ src/via_3d.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/via_3d.h b/src/via_3d.h
+index c33228e..15be0be 100644
+--- a/src/via_3d.h
++++ b/src/via_3d.h
+@@ -24,6 +24,7 @@
+ #ifndef VIA_3D_H
+ #define VIA_3D_H
+
++#include "xorg-server.h"
+ #include "xf86.h"
+ #include "via_dmabuffer.h"
+
+--
+1.8.4.5
+
diff --git a/x11-drivers/xf86-video-openchrome/metadata.xml b/x11-drivers/xf86-video-openchrome/metadata.xml
new file mode 100644
index 000000000000..8c3d909e870e
--- /dev/null
+++ b/x11-drivers/xf86-video-openchrome/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<use>
+<flag name="viaregtool">Install registers dumper tool</flag>
+</use>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-openchrome/xf86-video-openchrome-0.3.3.ebuild b/x11-drivers/xf86-video-openchrome/xf86-video-openchrome-0.3.3.ebuild
new file mode 100644
index 000000000000..d1af9ad354ed
--- /dev/null
+++ b/x11-drivers/xf86-video-openchrome/xf86-video-openchrome-0.3.3.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+XORG_DRI="always"
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for VIA/S3G cards"
+HOMEPAGE="http://www.freedesktop.org/wiki/Openchrome/"
+LICENSE="MIT"
+
+KEYWORDS="amd64 x86"
+IUSE="debug viaregtool"
+
+RDEPEND=">=x11-base/xorg-server-1.9"
+DEPEND="
+ ${RDEPEND}
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXv
+ x11-libs/libXvMC
+ x11-libs/libdrm
+"
+
+DOCS=( ChangeLog NEWS README )
+
+PATCHES=( "${FILESDIR}"/${P}-glibc-2.20.patch ) #526728
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable debug)
+ $(use_enable debug xv-debug)
+ $(use_enable viaregtool)
+ )
+ xorg-2_src_configure
+}
+
+pkg_postinst() {
+ xorg-2_pkg_postinst
+
+ elog "Supported chipsets:"
+ elog "CLE266 (VT3122), KM400/P4M800 (VT3205), K8M800 (VT3204),"
+ elog "PM800/PM880/CN400 (VT3259), VM800/CN700/P4M800Pro (VT3314),"
+ elog "CX700 (VT3324), P4M890 (VT3327), K8M890 (VT3336),"
+ elog "P4M900/VN896 (VT3364), VX800 (VT3353), VX855 (VT3409), VX900"
+ elog
+ elog "The driver name is 'openchrome', and this is what you need"
+ elog "to use in your xorg.conf (and not 'via')."
+ elog
+ elog "See the ChangeLog and release notes for more information."
+}
diff --git a/x11-drivers/xf86-video-opentegra/Manifest b/x11-drivers/xf86-video-opentegra/Manifest
new file mode 100644
index 000000000000..461924be31d3
--- /dev/null
+++ b/x11-drivers/xf86-video-opentegra/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-opentegra-0.7.0.tar.xz 254784 SHA256 282eb7fbd985a1bfc60e431dc83c9c2dc94e5c3be444678688002f67cd0fd2af SHA512 04676455721518cad81b1db06c9c643e9084bf8b241cc190285595b48927ce3c9e4cf28fab37ceb2d8873e5dfd00e5df1a708ae34aeb85e0e43165b190fc63f4 WHIRLPOOL a3cf01ace5f15455afd4a830c0f63ddbe263cf92e758cf46914e237b4ec7351722ef43d131e8ef74794828c6187c28bd9b5fee927781702893a36010e13f5147
diff --git a/x11-drivers/xf86-video-opentegra/metadata.xml b/x11-drivers/xf86-video-opentegra/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-opentegra/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-opentegra/xf86-video-opentegra-0.7.0.ebuild b/x11-drivers/xf86-video-opentegra/xf86-video-opentegra-0.7.0.ebuild
new file mode 100644
index 000000000000..110660713354
--- /dev/null
+++ b/x11-drivers/xf86-video-opentegra/xf86-video-opentegra-0.7.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="X.Org video driver for NVIDIA Tegra"
+
+SRC_URI="http://xorg.freedesktop.org/releases/individual/driver/${P}.tar.xz"
+KEYWORDS="arm"
+IUSE=""
+
+RDEPEND="x11-libs/libdrm[video_cards_tegra]
+ >=x11-base/xorg-server-1.13"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-qxl/Manifest b/x11-drivers/xf86-video-qxl/Manifest
new file mode 100644
index 000000000000..0ba41f5003e2
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-qxl-0.1.3.tar.bz2 479196 SHA256 75786637cbfe278de78d52baa5aab217dd29af1b8a1f8b12d0c3c2584b6bc88c SHA512 0826f72725f4220f8ed33f823412662eb3aa3c650987a04f1c82a26b1e85a06b949b2490cffc5357b2272a3c39f481475b92c8cf2ef2e9575cf1d9a1be702b6d WHIRLPOOL c7018dbc7ac3430d205620d8e114e99c2335468babde7f3ae1285020a8ce6b492375501b15cf4699db9ada8dd94c623ecfb59c89e034e116d50e56db4f5a0915
+DIST xf86-video-qxl-0.1.4.tar.bz2 487656 SHA256 e57ad22f0b1daf8979e722be0cc38d351bfcc2e41568edc566d2bade5a621105 SHA512 6ce518bb3ee9fce6066b492351c25a4a429edf7eff4ecbe9dc49fe5ee1f1d68586761624d2601f4bb6c4f4ddf7996f2fc8024707501b0de76ab6932bfe82c51d WHIRLPOOL 3dcce31b1cdfda33ca78e66b9c221b27e0073808f956e0c98460fb2979d8dedf84f45f4adbbed6114c26597e5e2bc1d6be4b46fce83d6afdef0be63d2d848549
diff --git a/x11-drivers/xf86-video-qxl/metadata.xml b/x11-drivers/xf86-video-qxl/metadata.xml
new file mode 100644
index 000000000000..7fd8b1eb5c3e
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+<use>
+<flag name="xspice">Build the xspice driver</flag>
+</use>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.3.ebuild b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.3.ebuild
new file mode 100644
index 000000000000..e7327ad3981e
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.3.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="QEMU QXL paravirt video driver"
+
+KEYWORDS="amd64 x86"
+IUSE="xspice"
+
+RDEPEND="xspice? ( app-emulation/spice )
+ x11-base/xorg-server[-minimal]
+ >=x11-libs/libdrm-2.4.46"
+DEPEND="${RDEPEND}
+ x11-proto/xf86dgaproto
+ >=app-emulation/spice-protocol-0.12.0"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable xspice)
+ )
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.4.ebuild b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.4.ebuild
new file mode 100644
index 000000000000..e3f20c41a9e1
--- /dev/null
+++ b/x11-drivers/xf86-video-qxl/xf86-video-qxl-0.1.4.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="QEMU QXL paravirt video driver"
+
+KEYWORDS="~amd64 ~x86"
+IUSE="xspice"
+
+RDEPEND="xspice? ( app-emulation/spice )
+ x11-base/xorg-server[-minimal]
+ >=x11-libs/libdrm-2.4.46"
+DEPEND="${RDEPEND}
+ x11-proto/xf86dgaproto
+ >=app-emulation/spice-protocol-0.12.0"
+
+src_configure() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable xspice)
+ )
+ xorg-2_src_configure
+}
diff --git a/x11-drivers/xf86-video-r128/Manifest b/x11-drivers/xf86-video-r128/Manifest
new file mode 100644
index 000000000000..91464040fd11
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-video-r128-6.10.0.tar.bz2 494884 SHA256 80d531a07168230a408b88809a5440cfd48f9098666d12702d0012148a0d353d SHA512 1221e4a8e744557356eb7fd05d950e857f60eeab5f81707542d1446a983701a68838ee165a511242c67fa4e974ced7d8af12002ec581c636065a8c95325146ed WHIRLPOOL e3414e15e89c2c7d0db4f9270835486d8e87a477dac5971931b409a09242b301449c0b511f7c535fbb6be0d0e13214163ef95af9b799b6d5978f373b55636283
+DIST xf86-video-r128-6.9.1.tar.bz2 470750 SHA256 8be3baa8d3b19e3a05f00a53bf35784e144dc2ad14c358f97870c072e634e44c SHA512 a1a4f171c3d6ecd935a485dfeacdc6c595f287b0227c2bd604a884295aef6e7eab92d5da8b9d2682f2c676d49bcabf92cb0a4f35c65494a580582ef9dd76f73e WHIRLPOOL 77d1f7381bb061ff8d665436b7cb7ada8f51ecff23c0946a0a27e77d5b0b725b19fbb0a61d03e56421644786402ec1ce2aafd6453ac95a6750497dd385e70113
+DIST xf86-video-r128-6.9.2.tar.bz2 462266 SHA256 8b2d295f1842d07304a75da1cfb9bf139b320a6539970eaf8d5ecc010cd36ee0 SHA512 7f8dc174ff8cff6d109a62610b255c3f3a99e6fbdc38373da3efb88a960a25fe3124dbdb6a9379de6b45edaedb3aae44a183a5604f80bbb488dbb98faebc2fb3 WHIRLPOOL 7d93884fc9e4da48fa6cbbd57208c945fa56905a33d1b96700e0084cc57b7e455732c50cc3204da9243e4ff2b401a2acfa559f0504d4fe83147ef536f276c805
diff --git a/x11-drivers/xf86-video-r128/metadata.xml b/x11-drivers/xf86-video-r128/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-r128/xf86-video-r128-6.10.0.ebuild b/x11-drivers/xf86-video-r128/xf86-video-r128-6.10.0.ebuild
new file mode 100644
index 000000000000..a4be560ce442
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/xf86-video-r128-6.10.0.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="ATI Rage128 video driver"
+
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.2"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+}
diff --git a/x11-drivers/xf86-video-r128/xf86-video-r128-6.9.1.ebuild b/x11-drivers/xf86-video-r128/xf86-video-r128-6.9.1.ebuild
new file mode 100644
index 000000000000..4dfa88ad0f84
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/xf86-video-r128-6.9.1.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="ATI Rage128 video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.2"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+}
diff --git a/x11-drivers/xf86-video-r128/xf86-video-r128-6.9.2.ebuild b/x11-drivers/xf86-video-r128/xf86-video-r128-6.9.2.ebuild
new file mode 100644
index 000000000000..fb70c9139e81
--- /dev/null
+++ b/x11-drivers/xf86-video-r128/xf86-video-r128-6.9.2.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="ATI Rage128 video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.2"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+}
diff --git a/x11-drivers/xf86-video-rendition/Manifest b/x11-drivers/xf86-video-rendition/Manifest
new file mode 100644
index 000000000000..ba8dcd6e7786
--- /dev/null
+++ b/x11-drivers/xf86-video-rendition/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-rendition-4.2.5.tar.bz2 356351 SHA256 39b5569338237de6e17b2a2c6be73ac6c405ee596079c41a7028cfd6e54134cb SHA512 203529e2a9c917362ac7c9b4247a9a0a4a7e1911bd022a26b00f467ec4cfd9ce742465aba29618cbfaa5ac5ff0b43e5a54f651e45e81aa950776685e4f74ba72 WHIRLPOOL f617c3ea75537fab46f1d7aaf11d7d0b2291d341a57cf15ca3e992abfa1ab280c5354b04f2cd3791d46a9e8e67c09345d02b3a039e864d6eff8ab99efeac79c0
diff --git a/x11-drivers/xf86-video-rendition/files/xf86-video-rendition-4.2.5-remove-mibstore_h.patch b/x11-drivers/xf86-video-rendition/files/xf86-video-rendition-4.2.5-remove-mibstore_h.patch
new file mode 100644
index 000000000000..77c4d34dea0a
--- /dev/null
+++ b/x11-drivers/xf86-video-rendition/files/xf86-video-rendition-4.2.5-remove-mibstore_h.patch
@@ -0,0 +1,35 @@
+From 3a3ee1c45e54a808947cc26ca11f0a5299571053 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:50 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/rendition.c b/src/rendition.c
+index 7c74f76..888bb4a 100644
+--- a/src/rendition.c
++++ b/src/rendition.c
+@@ -1173,7 +1173,6 @@ renditionScreenInit(SCREEN_INIT_ARGS_DECL)
+ fbPictureInit (pScreen, 0, 0);
+
+ xf86SetBlackWhitePixels(pScreen);
+- miInitializeBackingStore(pScreen);
+
+ /*********************************************************/
+ /* The actual setup of the driver-specific code */
+diff --git a/src/rendition.h b/src/rendition.h
+index f7f13d4..297117e 100644
+--- a/src/rendition.h
++++ b/src/rendition.h
+@@ -28,9 +28,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+-
+ /* All drivers using the mi colormap manipulation need this */
+ #include "micmap.h"
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-rendition/metadata.xml b/x11-drivers/xf86-video-rendition/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-rendition/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-rendition/xf86-video-rendition-4.2.5-r1.ebuild b/x11-drivers/xf86-video-rendition/xf86-video-rendition-4.2.5-r1.ebuild
new file mode 100644
index 000000000000..0985976ae35d
--- /dev/null
+++ b/x11-drivers/xf86-video-rendition/xf86-video-rendition-4.2.5-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Rendition video driver"
+KEYWORDS="alpha amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-s3/Manifest b/x11-drivers/xf86-video-s3/Manifest
new file mode 100644
index 000000000000..a4884fc1d3dd
--- /dev/null
+++ b/x11-drivers/xf86-video-s3/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-s3-0.6.5.tar.bz2 325582 SHA256 4778cd4f1d61490c3562f9be03664576f065fa3acf22fe0d0689212d7ea3ad39 SHA512 bd7d93008dae33b0b7943b2c81de5f39b1d8224ccebd0cdb9e8d22e7ea7fb0981adf6afd44e24162fa8a076d3e250f93316fd3a25cada2d65166a6bc4d13c267 WHIRLPOOL ccf8ee402ad18c229c890704177b72db80fbc651279bf1da6a3be40a7e71ba07903b5ef5fc05c6e4f5146f5517081aae421bb8ed13c161861bdf532895796bc0
diff --git a/x11-drivers/xf86-video-s3/files/xf86-video-s3-0.6.5-mibstore_h.patch b/x11-drivers/xf86-video-s3/files/xf86-video-s3-0.6.5-mibstore_h.patch
new file mode 100644
index 000000000000..95f20ca4b83f
--- /dev/null
+++ b/x11-drivers/xf86-video-s3/files/xf86-video-s3-0.6.5-mibstore_h.patch
@@ -0,0 +1,32 @@
+From ed0fbfd27609e897c42d7ab316481a9504746233 Mon Sep 17 00:00:00 2001
+From: Gaetan Nadon <memsize@videotron.ca>
+Date: Tue, 07 Jan 2014 21:28:58 +0000
+Subject: Remove mibstore.h
+
+As it was done in numerous other drivers. Fixes compile error.
+
+Tested-by: Trevor Woerner <trevor.woerner@linaro.org>
+Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+---
+diff --git a/src/s3_driver.c b/src/s3_driver.c
+index 61242ad..85763ba 100644
+--- a/src/s3_driver.c
++++ b/src/s3_driver.c
+@@ -52,7 +52,6 @@
+ #include "compiler.h"
+ #include "mipointer.h"
+ #include "micmap.h"
+-#include "mibstore.h"
+ #include "fb.h"
+ #include "inputstr.h"
+ #include "shadowfb.h"
+@@ -822,7 +821,6 @@ static Bool S3ScreenInit(SCREEN_INIT_ARGS_DECL)
+ fbPictureInit (pScreen, 0, 0);
+ S3DGAInit(pScreen);
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+
+ /* framebuffer manager setup */
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-s3/metadata.xml b/x11-drivers/xf86-video-s3/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-s3/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5-r1.ebuild b/x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5-r1.ebuild
new file mode 100644
index 000000000000..d57419e75605
--- /dev/null
+++ b/x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5-r1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for s3 cards"
+
+KEYWORDS="alpha amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5.ebuild b/x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5.ebuild
new file mode 100644
index 000000000000..fd8759021efd
--- /dev/null
+++ b/x11-drivers/xf86-video-s3/xf86-video-s3-0.6.5.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for s3 cards"
+
+KEYWORDS="alpha amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-s3virge/Manifest b/x11-drivers/xf86-video-s3virge/Manifest
new file mode 100644
index 000000000000..01f1b8f5e97f
--- /dev/null
+++ b/x11-drivers/xf86-video-s3virge/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-s3virge-1.10.6.tar.bz2 349790 SHA256 85e1f6bdd3f39d0348c53602f481b974c13fc752c94931882817751c8ec8363e SHA512 3de4806c42ec07767459e5ea703fd6106e4c8a90f67636f2d58d3a5745ae4beeafb51e1c8e09a74694dc246db4c7dd1c119c91d92b101be4db7b9c59d7f9e0ab WHIRLPOOL 7f17c87986d8151ac4e29f342de40230cc709d11067f9bd690f9992fae41bd1eef7b3419558eab2cf3556624a20038d326b02d9f2aaa5685061a35e572dec467
diff --git a/x11-drivers/xf86-video-s3virge/metadata.xml b/x11-drivers/xf86-video-s3virge/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-s3virge/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-s3virge/xf86-video-s3virge-1.10.6.ebuild b/x11-drivers/xf86-video-s3virge/xf86-video-s3virge-1.10.6.ebuild
new file mode 100644
index 000000000000..274fbcccd914
--- /dev/null
+++ b/x11-drivers/xf86-video-s3virge/xf86-video-s3virge-1.10.6.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="S3 ViRGE video driver"
+
+KEYWORDS="alpha amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-savage/Manifest b/x11-drivers/xf86-video-savage/Manifest
new file mode 100644
index 000000000000..f45b4888ac67
--- /dev/null
+++ b/x11-drivers/xf86-video-savage/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-savage-2.3.8.tar.bz2 418649 SHA256 fdcea4a86532bceb50095eaf0fe2f38bbfa160e98463b815f4b549eb9985fa63 SHA512 c0a8eb58bde2d3f28dbf4f1e2a6e6e8eb019d3e61cf40bab56a586d614cf3d2a09c0ac43962ae25becfa9489f0ba36a4dd1010b6f181ffe77d10fe0bb10f3127 WHIRLPOOL dde9f4b95a9aea7f3d668f937a15f97978863846a90b5fa52826aa389bfed6ccb0ea89ee9ca2cae30e915e2774bd76b7dc36fb1134e5e43a4d9db76ea7957673
diff --git a/x11-drivers/xf86-video-savage/metadata.xml b/x11-drivers/xf86-video-savage/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-savage/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-savage/xf86-video-savage-2.3.8.ebuild b/x11-drivers/xf86-video-savage/xf86-video-savage-2.3.8.ebuild
new file mode 100644
index 000000000000..3f9cb26e4e57
--- /dev/null
+++ b/x11-drivers/xf86-video-savage/xf86-video-savage-2.3.8.ebuild
@@ -0,0 +1,30 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="S3 Savage video driver"
+KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~amd64-fbsd ~x86-fbsd"
+
+IUSE="dri"
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ >=x11-proto/xextproto-7.0.99.1"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+ xorg-2_pkg_setup
+}
+
+pkg_postinst() {
+ if has_version ">=x11-base/xorg-server-1.12.99"; then
+ elog "Your X server no longer supports XAA, so xf86-video-savage will fall back"
+ elog "to shadowFB. Enable EXA in your X.org configuration to still have some 2D"
+ elog "acceleration. See \"man 4 savage\" for details."
+ fi
+}
diff --git a/x11-drivers/xf86-video-siliconmotion/Manifest b/x11-drivers/xf86-video-siliconmotion/Manifest
new file mode 100644
index 000000000000..43d42e5be968
--- /dev/null
+++ b/x11-drivers/xf86-video-siliconmotion/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-siliconmotion-1.7.8.tar.bz2 398928 SHA256 e9d449a9fd9e58b4e018447b6c64005f7874cffb1777e513ac9fc41a86071beb SHA512 8343982399737bbc09802ba17805b4111468d0241d4b2326ec32b237ca84e31dd02e4788c4e7fe508b032af9533765fb60ac8093877dc83f97709dc094bfa48e WHIRLPOOL cf880de7656f0f10f67b1a21a53e4c74ab8676c7a42827758281179fd6bca273a877a044d11f85936dcc8886665b53a29694eab994154ab6e01e4de7946279fe
diff --git a/x11-drivers/xf86-video-siliconmotion/metadata.xml b/x11-drivers/xf86-video-siliconmotion/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-siliconmotion/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.8.ebuild b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.8.ebuild
new file mode 100644
index 000000000000..451c820f2b51
--- /dev/null
+++ b/x11-drivers/xf86-video-siliconmotion/xf86-video-siliconmotion-1.7.8.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Silicon Motion video driver"
+
+KEYWORDS="amd64 ~mips x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-sis/Manifest b/x11-drivers/xf86-video-sis/Manifest
new file mode 100644
index 000000000000..aba0a6b8d7d8
--- /dev/null
+++ b/x11-drivers/xf86-video-sis/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-sis-0.10.7.tar.bz2 699499 SHA256 be2eb6acba081e88dabc5be9db379e3da89a4d4edeb68064f204bf343a411cd0 SHA512 095fd47803e8296ca3769b5c62e9399b6759023660c42b215b708dfed456e3cf2dad93b8abcb48887bd40e0d0b1435d4e1d711a721f5cb55bef4d7093ab387fa WHIRLPOOL 1e02d08750b8a274d834f3268df2ecc9d3949a960796f9b3669ec48050fd6d24a8ba9aac0f2bc4514ee654956cdc058d136363fbe111b8e25e21f370baead8ef
diff --git a/x11-drivers/xf86-video-sis/metadata.xml b/x11-drivers/xf86-video-sis/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-sis/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-sis/xf86-video-sis-0.10.7.ebuild b/x11-drivers/xf86-video-sis/xf86-video-sis-0.10.7.ebuild
new file mode 100644
index 000000000000..9de335400e3f
--- /dev/null
+++ b/x11-drivers/xf86-video-sis/xf86-video-sis-0.10.7.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+XORG_DRI=dri
+inherit xorg-2
+
+DESCRIPTION="SiS and XGI video driver"
+KEYWORDS="amd64 ia64 ppc x86 ~x86-fbsd"
+IUSE="dri"
+
+DEPEND=">=x11-proto/xf86dgaproto-2.1"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+}
diff --git a/x11-drivers/xf86-video-sisusb/Manifest b/x11-drivers/xf86-video-sisusb/Manifest
new file mode 100644
index 000000000000..cc5040210ead
--- /dev/null
+++ b/x11-drivers/xf86-video-sisusb/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-sisusb-0.9.5.tar.bz2 377439 SHA256 6508f0edcbbca978f97665953135fb564e988fed437a7c56611f8355bb4daa6b SHA512 dd244a98e8c825bb64dcc62822a369f4d563bacc05814d1957432ab8e12f586ee1489bd98512d60af059ed8c4247de259f1e22c26a008e1c8aad41e5bdc23a3c WHIRLPOOL f1a3ee9376bd5a32c36777200780016b08f00bda1dd404a9f213de30da9e857728f5e8a664cb930559d1d7fd74e55d2a4b66450e745d90ed789bcfb2f44a06d8
+DIST xf86-video-sisusb-0.9.6.tar.bz2 382112 SHA256 73dbef43c56a4ce1445c27ebac2ddc062c643c32ca6e2a4d095aea2185b9e046 SHA512 648121680982313af1fb4b1256694e2ec940c7d6176ec53a9c79c3f72ce600f59629e53651a579d825daef07205afc529c8100286867c584db7ec05d312e6fe1 WHIRLPOOL 55b7920d6f3b60ff26e0b07981058ef5d54d1a8efac1945a69a867f1e4f130024b47a202588cd9da8603b651a850ce5b950614a7652b6f264d0a543d9a90ed37
diff --git a/x11-drivers/xf86-video-sisusb/files/xf86-video-sisusb-0.9.6-remove-mibstore_h.patch b/x11-drivers/xf86-video-sisusb/files/xf86-video-sisusb-0.9.6-remove-mibstore_h.patch
new file mode 100644
index 000000000000..dc920dabdcd7
--- /dev/null
+++ b/x11-drivers/xf86-video-sisusb/files/xf86-video-sisusb-0.9.6-remove-mibstore_h.patch
@@ -0,0 +1,29 @@
+From 293d0902705c272b83432a955fb6a3c96dd6cea7 Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:54:52 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/sisusb_driver.c b/src/sisusb_driver.c
+index 539b9f1..0fdc8e9 100644
+--- a/src/sisusb_driver.c
++++ b/src/sisusb_driver.c
+@@ -39,7 +39,6 @@
+ #include "shadowfb.h"
+ #include "micmap.h"
+ #include "mipointer.h"
+-#include "mibstore.h"
+
+ #include "sisusb_regs.h"
+ #include "sisusb_dac.h"
+@@ -1907,7 +1906,6 @@ SISUSBScreenInit(SCREEN_INIT_ARGS_DECL)
+ /* Initialize the accelerators */
+ SiSUSBAccelInit(pScreen);
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+
+ /* NO SilkenMouse. Never. Ever. */
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-sisusb/metadata.xml b/x11-drivers/xf86-video-sisusb/metadata.xml
new file mode 100644
index 000000000000..3cb365e8431a
--- /dev/null
+++ b/x11-drivers/xf86-video-sisusb/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <maintainer>
+ <email>vapier@gentoo.org</email>
+ <name>Mike Frysinger</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.5.ebuild b/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.5.ebuild
new file mode 100644
index 000000000000..83eaf82c53ae
--- /dev/null
+++ b/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.5.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="SiS USB video driver"
+KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~sh ~sparc ~x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.6"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6-r1.ebuild b/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6-r1.ebuild
new file mode 100644
index 000000000000..42d30dfeeb81
--- /dev/null
+++ b/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6-r1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="SiS USB video driver"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 ~sh sparc x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.6"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6.ebuild b/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6.ebuild
new file mode 100644
index 000000000000..33dd63b5dd5a
--- /dev/null
+++ b/x11-drivers/xf86-video-sisusb/xf86-video-sisusb-0.9.6.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+inherit xorg-2
+
+DESCRIPTION="SiS USB video driver"
+KEYWORDS="alpha amd64 arm ia64 ppc ppc64 sh sparc x86"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.6"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-suncg14/Manifest b/x11-drivers/xf86-video-suncg14/Manifest
new file mode 100644
index 000000000000..32c2ddf1057d
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg14/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-suncg14-1.1.1.tar.bz2 226518 SHA256 cb43007920394b000be98ea0eac16a1cc16b4ca7ea8532b5d803a0c7574720d8
+DIST xf86-video-suncg14-1.1.2.tar.bz2 281915 SHA256 1caed923952458b729eeba111f12eda17512a27d4640b5c4bb2e51fba3924948 SHA512 685a2675114e471ff0bc82b4ce73a18e5486f03621db148f3a7ce828e9aa62682d7b0ed608da40773e264957bb420f3d8920ab352d10fb0452540986b6b7d72f WHIRLPOOL 67716b7e658168f7ed2172ccf89dee27af5c065078e6966fd6cd76219d2fcf7f400c4706584f1c1f06861470fcb62c4904fbee5a734d0e115ddf642f09d7301d
diff --git a/x11-drivers/xf86-video-suncg14/metadata.xml b/x11-drivers/xf86-video-suncg14/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg14/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.1.ebuild b/x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.1.ebuild
new file mode 100644
index 000000000000..488ba84d76dc
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="CG14 video driver"
+KEYWORDS="-* sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.2.ebuild b/x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.2.ebuild
new file mode 100644
index 000000000000..b55ee0df3431
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg14/xf86-video-suncg14-1.1.2.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="CG14 video driver"
+KEYWORDS="-* ~sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suncg3/Manifest b/x11-drivers/xf86-video-suncg3/Manifest
new file mode 100644
index 000000000000..173f9939c72e
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg3/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-suncg3-1.1.1.tar.bz2 225622 SHA256 d56fe98c34f2af1b6424e3fcaa22a31402a4b59d63679f0e5fdfb1d2ea878419
+DIST xf86-video-suncg3-1.1.2.tar.bz2 281012 SHA256 c7b97f90c480360e5f2c353fe72609e7fd1639219485685a5d3b41fd2522af96 SHA512 d4b658700a94716ab2253d672cbb64a13b4dc8571664c77db6770b96419031d73c5927d35692a2903e09fe3fc6802015328c3ec055e40a344be60d601fc03bad WHIRLPOOL cd42daa20f455cb811dc179e878eb5e010610643acef0123333f1c6048e274c094c23e65bbef4280eff99f4e7b5077e80cf71e1e5b9fd1a86817fec191608dd4
diff --git a/x11-drivers/xf86-video-suncg3/metadata.xml b/x11-drivers/xf86-video-suncg3/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg3/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.1.ebuild b/x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.1.ebuild
new file mode 100644
index 000000000000..90d715ef6569
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="CG3 video driver"
+KEYWORDS="-* sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.2.ebuild b/x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.2.ebuild
new file mode 100644
index 000000000000..cefb2fe64a39
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg3/xf86-video-suncg3-1.1.2.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="CG3 video driver"
+KEYWORDS="-* ~sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suncg6/Manifest b/x11-drivers/xf86-video-suncg6/Manifest
new file mode 100644
index 000000000000..c7601b999583
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg6/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-suncg6-1.1.1.tar.bz2 229111 SHA256 d1216c7c2be78d1dafad0cd46e464e9fa08f5e04544b76d9a0c547374c85801f
+DIST xf86-video-suncg6-1.1.2.tar.bz2 286663 SHA256 993e12e3fc75211aa46462656373f50f2a6f7978391fb3698d965401e6e3cf11 SHA512 d094d951dfa452b0089210a7a4e30a4e32c7af6198a2c956a4c0820fc8d491d3d556539e060ccba59c91289adc4e57d8f06c193790280e064bef4dd98cd5ce05 WHIRLPOOL e0ee4f473e581f23d2bd435655ab04502bbaf8883653573d9feeac9c7918effa5def1b6e54a1a1a093659e36297738b4806b75be972acd52b58243ba2c19e127
diff --git a/x11-drivers/xf86-video-suncg6/metadata.xml b/x11-drivers/xf86-video-suncg6/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg6/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.1.ebuild b/x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.1.ebuild
new file mode 100644
index 000000000000..a24a6462fb88
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="GX/Turbo GX video driver"
+KEYWORDS="-* sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.2.ebuild b/x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.2.ebuild
new file mode 100644
index 000000000000..7a35749fa821
--- /dev/null
+++ b/x11-drivers/xf86-video-suncg6/xf86-video-suncg6-1.1.2.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="GX/Turbo GX video driver"
+KEYWORDS="-* ~sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-sunffb/Manifest b/x11-drivers/xf86-video-sunffb/Manifest
new file mode 100644
index 000000000000..cc94dfa554fe
--- /dev/null
+++ b/x11-drivers/xf86-video-sunffb/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-sunffb-1.2.1.tar.bz2 283427 SHA256 fd377af6e366e8e3a77c8ff825a009138c8343c0007bbf070ad605a649577e11
+DIST xf86-video-sunffb-1.2.2.tar.bz2 334827 SHA256 fa545f2c10732c2b7b37e8891315b05e645aec21ba5e849f244d3ceee2b3e31f SHA512 a812cfdb43527e97993d1ce8b62324a5ee442c0bbf695d45582f10d7d428606ac9a546c80cd401e41e2f198c94fa84762ec4e545b53b8d1cb074bfb13ab45ff0 WHIRLPOOL 6a2b06b697a4270f656aa203d13749137778a043c7ee6bd41517be2e522a329318148a03a7e3f5c0cd2d1a8572a83e3d201a452b5bae61ab95f80c7abda6d144
diff --git a/x11-drivers/xf86-video-sunffb/files/xf86-video-sunffb-1.2.2-unbreak-when-xaa-is-not-present.patch b/x11-drivers/xf86-video-sunffb/files/xf86-video-sunffb-1.2.2-unbreak-when-xaa-is-not-present.patch
new file mode 100644
index 000000000000..83a7ca2b3e63
--- /dev/null
+++ b/x11-drivers/xf86-video-sunffb/files/xf86-video-sunffb-1.2.2-unbreak-when-xaa-is-not-present.patch
@@ -0,0 +1,32 @@
+From 181b60190c1f81fc9b9b5deb07d536b78f2536ab Mon Sep 17 00:00:00 2001
+From: Matthieu Herrb <matthieu.herrb@laas.fr>
+Date: Mon, 10 Jun 2013 19:51:08 +0000
+Subject: Unbreak when XAA is not present.
+
+Turn accel off if loading XAA fails.
+
+Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+diff --git a/src/ffb_driver.c b/src/ffb_driver.c
+index af13484..7f17d64 100644
+--- a/src/ffb_driver.c
++++ b/src/ffb_driver.c
+@@ -413,9 +413,12 @@ FFBPreInit(ScrnInfoPtr pScrn, int flags)
+ return FALSE;
+ }
+
+- if (xf86LoadSubModule(pScrn, "xaa") == NULL) {
+- FFBFreeRec(pScrn);
+- return FALSE;
++ if (!pFfb->NoAccel) {
++ if (xf86LoadSubModule(pScrn, "xaa") == NULL) {
++ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
++ "Loading XAA failed, acceleration disabled\n");
++ pFfb->NoAccel = TRUE;
++ }
+ }
+
+ if (pFfb->HWCursor && xf86LoadSubModule(pScrn, "ramdac") == NULL) {
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-sunffb/metadata.xml b/x11-drivers/xf86-video-sunffb/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-sunffb/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.1.ebuild b/x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.1.ebuild
new file mode 100644
index 000000000000..193b5f77843a
--- /dev/null
+++ b/x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit x-modular
+
+DESCRIPTION="SUNFFB video driver"
+
+KEYWORDS="-* sparc"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xextproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.2-r1.ebuild b/x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.2-r1.ebuild
new file mode 100644
index 000000000000..5b76c3ead29f
--- /dev/null
+++ b/x11-drivers/xf86-video-sunffb/xf86-video-sunffb-1.2.2-r1.ebuild
@@ -0,0 +1,19 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit xorg-2
+
+DESCRIPTION="SUNFFB video driver"
+
+KEYWORDS="-* ~sparc"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-unbreak-when-xaa-is-not-present.patch
+)
diff --git a/x11-drivers/xf86-video-sunleo/Manifest b/x11-drivers/xf86-video-sunleo/Manifest
new file mode 100644
index 000000000000..f0b1c9705e91
--- /dev/null
+++ b/x11-drivers/xf86-video-sunleo/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-sunleo-1.2.0.tar.bz2 243593 SHA256 b315be97197020ae352efe48e9bcd13a572c3a03b2a4d598e89157a897746e06
+DIST xf86-video-sunleo-1.2.1.tar.bz2 289383 SHA256 1ace84e14edbbf76728d61af7b1440a461ddf22f1dba0f025879d286311f491d SHA512 52f1578dba4f77e2d999ea2017325df6ac324d60ec2e62677ef9a900aabb183650bcd0923b5a0a1cd7c13c9e80c8a47223b96be651e5a5ecb635654f3eb67af1 WHIRLPOOL f61d1d9c6fb2364eafd9b930dc8c1dfb89f466812ebe77b4844d7ff36605514dfea51b9497a030fb4dffaa7cc691ed2724b105cdac91c8d64a8108ba090fb7ea
diff --git a/x11-drivers/xf86-video-sunleo/metadata.xml b/x11-drivers/xf86-video-sunleo/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-sunleo/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.0.ebuild b/x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.0.ebuild
new file mode 100644
index 000000000000..276d64943d56
--- /dev/null
+++ b/x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="Leo video driver"
+KEYWORDS="-* sparc"
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.1.ebuild b/x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.1.ebuild
new file mode 100644
index 000000000000..b2a24a28ba85
--- /dev/null
+++ b/x11-drivers/xf86-video-sunleo/xf86-video-sunleo-1.2.1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="Leo video driver"
+KEYWORDS="-* ~sparc"
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suntcx/Manifest b/x11-drivers/xf86-video-suntcx/Manifest
new file mode 100644
index 000000000000..3e49e50cc1a7
--- /dev/null
+++ b/x11-drivers/xf86-video-suntcx/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-suntcx-1.1.1.tar.bz2 228572 SHA256 543115c4b3a8603dcc9d7a3030c9e7ce20baf6e3976d92ff951cfea80b54981e
+DIST xf86-video-suntcx-1.1.2.tar.bz2 285544 SHA256 b422740b97ce094994c4c67bae425a5f8234a76d4fad336c6a663f489e1d3777 SHA512 c7fa5959694e21fe4613d09eff3666eaca3f25a507b9e6c3efc537bd02aa35fb8633a381d01e5ea243dc38782e616558502c181e9116a0240cf6f196e26a20bd WHIRLPOOL 3d1895499ca1428d390167ebeb488daf5c7e0c6c139d6fc044e5b94d0480acdc24c613e3db1016966468a2ecc6bc820ec40392d90143934b9e65dee4b5fe8d23
diff --git a/x11-drivers/xf86-video-suntcx/metadata.xml b/x11-drivers/xf86-video-suntcx/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-suntcx/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.1.ebuild b/x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.1.ebuild
new file mode 100644
index 000000000000..fd85674d5ef0
--- /dev/null
+++ b/x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="TCX video driver"
+KEYWORDS="-* sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.2.ebuild b/x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.2.ebuild
new file mode 100644
index 000000000000..0b9793a41914
--- /dev/null
+++ b/x11-drivers/xf86-video-suntcx/xf86-video-suntcx-1.1.2.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+#SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="TCX video driver"
+KEYWORDS="-* ~sparc"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-tdfx/Manifest b/x11-drivers/xf86-video-tdfx/Manifest
new file mode 100644
index 000000000000..b3349cafd888
--- /dev/null
+++ b/x11-drivers/xf86-video-tdfx/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-tdfx-1.4.6.tar.bz2 368300 SHA256 3a8a88867c40ad61f1c9a09ffd7ac64102fa821685855d50ce66c7603dcc6d37 SHA512 d47421000f7aaeabcd13700c39a0a869c2967e6e1d02526cc348155415ac62064f61bbc5416c75b7e44a55fa9124a9feabbe6008d43c41a2305c1a0c842f384c WHIRLPOOL 4fb37d85b797baa802e1a67bdb7216c06401a1ef701f27fcb705ab500546bb3a90a8e2a2a917cc727f93369d086c2a49be222e2caa3e0e3b3cf569eb3c5de1ef
diff --git a/x11-drivers/xf86-video-tdfx/metadata.xml b/x11-drivers/xf86-video-tdfx/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-tdfx/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-tdfx/xf86-video-tdfx-1.4.6.ebuild b/x11-drivers/xf86-video-tdfx/xf86-video-tdfx-1.4.6.ebuild
new file mode 100644
index 000000000000..5c72f983edfd
--- /dev/null
+++ b/x11-drivers/xf86-video-tdfx/xf86-video-tdfx-1.4.6.ebuild
@@ -0,0 +1,21 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+XORG_DRI=dri
+
+inherit xorg-2
+
+DESCRIPTION="3Dfx video driver"
+KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~x86-fbsd"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+pkg_setup() {
+ XORG_CONFIGURE_OPTIONS=(
+ $(use_enable dri)
+ )
+}
diff --git a/x11-drivers/xf86-video-tga/Manifest b/x11-drivers/xf86-video-tga/Manifest
new file mode 100644
index 000000000000..298a728f0ada
--- /dev/null
+++ b/x11-drivers/xf86-video-tga/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-tga-1.2.2.tar.bz2 318943 SHA256 2023818000200eb50a59476e36d59b07a361b110e73b1d9cc526beb669306131 SHA512 38d0f61e0384400187b8a02d8ddc8b08edf2485448d9fcc941b5cc20bfc15f46d7f665b98365227b42b029dc92d76da9efcf8e934bcf382765657a0b54d1d231 WHIRLPOOL 3b977a17cfc4b7f1ba8bb470b6426268266d2a18b15e4404547b52d7753e60501cc7f928e80745ff08428fe5a1951b8203dac0f60528b16dd7e6da6c0cf8099d
diff --git a/x11-drivers/xf86-video-tga/files/xf86-video-tga-1.2.2-remove-mibstore_h.patch b/x11-drivers/xf86-video-tga/files/xf86-video-tga-1.2.2-remove-mibstore_h.patch
new file mode 100644
index 000000000000..811444147578
--- /dev/null
+++ b/x11-drivers/xf86-video-tga/files/xf86-video-tga-1.2.2-remove-mibstore_h.patch
@@ -0,0 +1,42 @@
+From b7022db0559cd1b6cd3eb6b5abf6896a607b478d Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:55:00 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/tga_accel.c b/src/tga_accel.c
+index 35af1a4..b414df5 100644
+--- a/src/tga_accel.c
++++ b/src/tga_accel.c
+@@ -37,7 +37,6 @@
+ #include "xf86cmap.h"
+ #include "mipointer.h"
+
+-#include "mibstore.h"
+ #include "miline.h"
+
+ #include "tga_regs.h"
+diff --git a/src/tga_driver.c b/src/tga_driver.c
+index dd4f3e6..90d2660 100644
+--- a/src/tga_driver.c
++++ b/src/tga_driver.c
+@@ -46,8 +46,6 @@
+
+ /* software cursor */
+ #include "mipointer.h"
+-/* backing store */
+-#include "mibstore.h"
+
+ /* #include "mibank.h" */
+ /* colormap manipulation */
+@@ -1451,7 +1449,6 @@ TGAScreenInit(SCREEN_INIT_ARGS_DECL)
+
+ fbPictureInit (pScreen, 0, 0);
+
+- miInitializeBackingStore(pScreen);
+ xf86SetBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-tga/metadata.xml b/x11-drivers/xf86-video-tga/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-tga/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2-r1.ebuild b/x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2-r1.ebuild
new file mode 100644
index 000000000000..737282dc23ce
--- /dev/null
+++ b/x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2-r1.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for tga cards"
+KEYWORDS="alpha amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/xf86dgaproto"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2.ebuild b/x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2.ebuild
new file mode 100644
index 000000000000..a6a587f8aea3
--- /dev/null
+++ b/x11-drivers/xf86-video-tga/xf86-video-tga-1.2.2.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="X.Org driver for tga cards"
+KEYWORDS="alpha amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/xf86dgaproto"
diff --git a/x11-drivers/xf86-video-trident/Manifest b/x11-drivers/xf86-video-trident/Manifest
new file mode 100644
index 000000000000..82b1c1d775b3
--- /dev/null
+++ b/x11-drivers/xf86-video-trident/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-trident-1.3.7.tar.bz2 376898 SHA256 ecd518de627a0d49e17c158bfc72ab657386c6907c91ef89fa09332558e413ae SHA512 39c3dac36095fa5103b9e3af8a6ffce9a42bb79d5d1c7e0c990badc2e469b9af96ca009a041fa892af972bc38ec19e8d014fb90da392bbd0ae8892b9c1fe0064 WHIRLPOOL 3cddf3400b91073db4aea5b35096207e5655dbfe681bd3be1ab0cd43cb285633bac4d488548b1dc260badc69c1f3429e88e6a4c5ad78b67feeda1764bd0cb3d6
diff --git a/x11-drivers/xf86-video-trident/metadata.xml b/x11-drivers/xf86-video-trident/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-trident/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-trident/xf86-video-trident-1.3.7.ebuild b/x11-drivers/xf86-video-trident/xf86-video-trident-1.3.7.ebuild
new file mode 100644
index 000000000000..fa1cb65a738b
--- /dev/null
+++ b/x11-drivers/xf86-video-trident/xf86-video-trident-1.3.7.ebuild
@@ -0,0 +1,13 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Trident video driver"
+KEYWORDS="amd64 ia64 ppc x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-tseng/Manifest b/x11-drivers/xf86-video-tseng/Manifest
new file mode 100644
index 000000000000..4fd11da24996
--- /dev/null
+++ b/x11-drivers/xf86-video-tseng/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-tseng-1.2.5.tar.bz2 330575 SHA256 c06dc5205f627e5afc795ecfa75e18d2d1db4e1f1f195fd017dad60854407819 SHA512 6e0010b24d5b97ade00ef80fda5ea91bce3a9ce07881551e84ac552ba49336905b62f062c656c72ea3097a0bec1517ec5038aa5766f8424e5f81d67dc777480c WHIRLPOOL 5462561a42e410dbef9f482485af69efe759930567a16656cbfc1477bf499953548d6bafd1111bf168ef3f557a5d6e37ab87b87a3610939d0df90d2f64572f2c
diff --git a/x11-drivers/xf86-video-tseng/files/xf86-video-tseng-1.2.5-remove-mibstore_h.patch b/x11-drivers/xf86-video-tseng/files/xf86-video-tseng-1.2.5-remove-mibstore_h.patch
new file mode 100644
index 000000000000..88f9cc570128
--- /dev/null
+++ b/x11-drivers/xf86-video-tseng/files/xf86-video-tseng-1.2.5-remove-mibstore_h.patch
@@ -0,0 +1,31 @@
+From d2d5c8437e401181f56804cc68594c4831a0983d Mon Sep 17 00:00:00 2001
+From: Adam Jackson <ajax@redhat.com>
+Date: Tue, 25 Sep 2012 12:55:02 +0000
+Subject: Remove mibstore.h
+
+Signed-off-by: Adam Jackson <ajax@redhat.com>
+---
+diff --git a/src/tseng_driver.c b/src/tseng_driver.c
+index ffafb19..0db62e5 100644
+--- a/src/tseng_driver.c
++++ b/src/tseng_driver.c
+@@ -39,9 +39,6 @@
+ /* All drivers initialising the SW cursor need this */
+ #include "mipointer.h"
+
+-/* All drivers implementing backing store need this */
+-#include "mibstore.h"
+-
+ #include "fb.h"
+
+ #if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
+@@ -1453,7 +1450,6 @@ TsengScreenInit(SCREEN_INIT_ARGS_DECL)
+ }
+ }
+
+- miInitializeBackingStore(pScreen);
+ xf86SetSilkenMouse(pScreen);
+ /* Initialise cursor functions */
+ miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-tseng/metadata.xml b/x11-drivers/xf86-video-tseng/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-tseng/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-tseng/xf86-video-tseng-1.2.5-r1.ebuild b/x11-drivers/xf86-video-tseng/xf86-video-tseng-1.2.5-r1.ebuild
new file mode 100644
index 000000000000..473422311ad1
--- /dev/null
+++ b/x11-drivers/xf86-video-tseng/xf86-video-tseng-1.2.5-r1.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Tseng Labs video driver"
+KEYWORDS="amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-remove-mibstore_h.patch
+)
diff --git a/x11-drivers/xf86-video-v4l/Manifest b/x11-drivers/xf86-video-v4l/Manifest
new file mode 100644
index 000000000000..91f6c8683bf6
--- /dev/null
+++ b/x11-drivers/xf86-video-v4l/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-v4l-0.2.0.tar.bz2 244063 RMD160 d0fe462e98802e0b60b1689800b9b3f4d3d2a6cd SHA1 7f2212c529a5bcc34f67858a9d0167a0d4848aaa SHA256 cbff9120fbad900cbdc7ac535d04984e7b491d69a8eb0b371e30ae07cb61925d
diff --git a/x11-drivers/xf86-video-v4l/metadata.xml b/x11-drivers/xf86-video-v4l/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-v4l/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-v4l/xf86-video-v4l-0.2.0.ebuild b/x11-drivers/xf86-video-v4l/xf86-video-v4l-0.2.0.ebuild
new file mode 100644
index 000000000000..72bc1188da69
--- /dev/null
+++ b/x11-drivers/xf86-video-v4l/xf86-video-v4l-0.2.0.ebuild
@@ -0,0 +1,17 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# Must be before x-modular eclass is inherited
+# SNAPSHOT="yes"
+
+inherit x-modular
+
+DESCRIPTION="video4linux driver"
+KEYWORDS="alpha amd64 arm ia64 ~mips ppc ppc64 sh sparc x86"
+IUSE=""
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/randrproto
+ x11-proto/videoproto
+ x11-proto/xproto"
diff --git a/x11-drivers/xf86-video-vesa/Manifest b/x11-drivers/xf86-video-vesa/Manifest
new file mode 100644
index 000000000000..2c9d5384c720
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/Manifest
@@ -0,0 +1,2 @@
+DIST xf86-video-vesa-2.3.3.tar.bz2 300571 SHA256 ce8b75e5a40e9dae76f2ac9e2880f7f73a848653ca2eed5880f52dc2c0d3aef8 SHA512 1e3768e757e889bb8707ce76cc6f54eb3beaf7d5b34750a0e7262612ae300e4cd42985b7cbcd72462b14c8d73945a22cec70ca6a52017491de41715d2ecbaca8 WHIRLPOOL bde9e1666c9aedf414d823fb08d5d8af97255e613895fd9b58b851587810542f5a57f71207385f6c77034a7fefc04bcd1a52e53810bf380565e5ac272fb02f3b
+DIST xf86-video-vesa-2.3.4.tar.bz2 285675 SHA256 7bddf4d879dd6f67088ecb203a31e12334aab980174bd0909930a21f32e251c1 SHA512 5a01c295a03f367281f49bb186a003a91da3aa4cff7c37ef3fb83889b595f641745899c62e4c0954a1daf4b18bd0e1bcbbe1b87d2863d1ce71feffa1744e892d WHIRLPOOL 7fed34f328e34afd3d97ed95952f33671bf8b91dfff5eb6a4629c84c440724da79625fe997fbc4aa80f0f98b43ce65909cc481a53ca0292fbfe9e31f9dd98475
diff --git a/x11-drivers/xf86-video-vesa/metadata.xml b/x11-drivers/xf86-video-vesa/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.3.ebuild b/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.3.ebuild
new file mode 100644
index 000000000000..0463d3108a27
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.3.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Generic VESA video driver"
+KEYWORDS="-* alpha amd64 ia64 x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99
+ >=x11-libs/libpciaccess-0.12.901"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.4.ebuild b/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.4.ebuild
new file mode 100644
index 000000000000..efbc29a71ee8
--- /dev/null
+++ b/x11-drivers/xf86-video-vesa/xf86-video-vesa-2.3.4.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+inherit xorg-2
+
+DESCRIPTION="Generic VESA video driver"
+KEYWORDS="-* ~alpha ~amd64 ~ia64 ~x86 ~amd64-fbsd ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.6
+ >=x11-libs/libpciaccess-0.12.901"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-virtualbox/Manifest b/x11-drivers/xf86-video-virtualbox/Manifest
new file mode 100644
index 000000000000..4fdb49ac069a
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/Manifest
@@ -0,0 +1,3 @@
+DIST VirtualBox-4.3.28.tar.bz2 100092002 SHA256 e157ab76d1958ae2c56b2a3875194fbff3de82486ad0e30032fd5bd772297c31 SHA512 b6e849a1420515b6dbda8cee0ab64940dd93296ec58cde76676ac257ff3dad0459aa1fd0bda7e1d0abc751d2d59f055465b198a546fdbb4e70e934a78654a8fc WHIRLPOOL 1b739f1f989032e07829a23ffadadd49e31109d70b0effbc44126a48a165218ff3ebafa576fa0e4f2af76a404033b60e5c9804ac43db5dd3024f1eca25ca70da
+DIST VirtualBox-4.3.30.tar.bz2 97428942 SHA256 ea9569ec16cd6202ee61bcadb2506d31ac12fd343adb91565773a05eaaea9a36 SHA512 d0817335cf4bd196da93b91ede6bc9e48ca0d471166ab2790dbf508a4574e4ace54a86053932abf3b4e804c583e80a713d2ab2e556dc15bee6ef3a62f88b95fc WHIRLPOOL 47cbd702e83cc737e04b5862cc6c52e32be244dc1dc0145f582f57b2f19bb898f0f4b200576a28f10a3290691f1ffd43c256e8c8eb5545a9723be8eefca88a38
+DIST VirtualBox-5.0.0.tar.bz2 109816664 SHA256 bb71356c8f82012c9b5ae16e12302eb111c71ae7b063ada7688fbfa8aa10c2f7 SHA512 c9557820fa04215b1b7905babfab340a01ad2cf733a18462fc608f8db5d0aa908e9ec0d92b3c77075e8a1322c10c92f58f8f14608aa3480052ca730ebd507636 WHIRLPOOL 7cda1523e0cd2851cbea5bb7a202963bac67cc6af29d0ec9a706dcec53746e50e6c85ccea014604eca9558ccaa45e9d2ce05b2eb64dbb54a7edac5f538634134
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-2.2.0-enable-opengl.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-2.2.0-enable-opengl.patch
new file mode 100644
index 000000000000..ad66ff20401d
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-2.2.0-enable-opengl.patch
@@ -0,0 +1,13 @@
+--- configure.orig 2009-04-11 19:30:06.000000000 +0200
++++ configure 2009-04-11 20:46:05.000000000 +0200
+@@ -1955,8 +1955,8 @@
+ HEADLESS=1
+ WITH_SDL=0
+ WITH_SDL_TTF=0
+- WITH_X11=0
+- WITH_OPENGL=0
++ WITH_X11=1
++ WITH_OPENGL=1
+ WITH_QT4=0
+ ;;
+ --ose)
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-localconfig b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-localconfig
new file mode 100644
index 000000000000..535c3f914adf
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-localconfig
@@ -0,0 +1,30 @@
+# -*- Makefile -*-
+#
+# Overwrite some default kBuild settings
+#
+
+#
+# Copyright (C) 2006-2008 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+# don't build testcases to save time, they are not needed for the package
+VBOX_WITH_TESTCASES :=
+VBOX_WITH_TESTSUITE :=
+
+KBUILD_MSG_STYLE := brief
+
+## paths, origin, hardening
+VBOX_WITH_HARDENING := 2
+VBOX_WITH_ORIGIN :=
+VBOX_ONLY_ADDITIONS := 1
+
+TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.release =
+TEMPLATE_VBOXGUESTR3XORGMOD_LDFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_LDFLAGS)
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-vboxvideo_drm.makefile b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-vboxvideo_drm.makefile
new file mode 100755
index 000000000000..a09e58c0075b
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3-vboxvideo_drm.makefile
@@ -0,0 +1,240 @@
+#
+# VirtualBox Guest Additions Module Makefile.
+#
+# (For 2.6.x this file must be 'Makefile'!)
+#
+# Copyright (C) 2006-2007 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License (GPL) as published by the Free Software
+# Foundation, in version 2 as it comes in the "COPYING" file of the
+# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
+# Clara, CA 95054 USA or visit http://www.sun.com if you need
+# additional information or have any questions.
+#
+
+## @todo We must make this into a common template *soon*.
+
+#
+# First, figure out which architecture we're targeting and the build type.
+# (We have to support basic cross building (ARCH=i386|x86_64).)
+# While at it, warn about BUILD_* vars found to help with user problems.
+#
+ifeq ($(filter-out x86_64 amd64 AMD64,$(shell uname -m)),)
+ BUILD_TARGET_ARCH_DEF := amd64
+else
+ BUILD_TARGET_ARCH_DEF := x86
+endif
+ifneq ($(filter-out amd64 x86,$(BUILD_TARGET_ARCH)),)
+ $(warning Ignoring unknown BUILD_TARGET_ARCH value '$(BUILD_TARGET_ARCH)'.)
+ BUILD_TARGET_ARCH :=
+endif
+ifeq ($(BUILD_TARGET_ARCH),)
+ ifeq ($(ARCH),x86_64)
+ BUILD_TARGET_ARCH := amd64
+ else
+ ifeq ($(ARCH),i386)
+ BUILD_TARGET_ARCH := x86
+ else
+ BUILD_TARGET_ARCH := $(BUILD_TARGET_ARCH_DEF)
+ endif
+ endif
+else
+ ifneq ($(BUILD_TARGET_ARCH),$(BUILD_TARGET_ARCH_DEF))
+ $(warning Using BUILD_TARGET_ARCH='$(BUILD_TARGET_ARCH)' from the $(origin BUILD_TARGET_ARCH).)
+ endif
+endif
+
+ifneq ($(filter-out release profile debug strict,$(BUILD_TYPE)),)
+ $(warning Ignoring unknown BUILD_TYPE value '$(BUILD_TYPE)'.)
+ BUILD_TYPE :=
+endif
+ifeq ($(BUILD_TYPE),)
+ BUILD_TYPE := release
+else
+ ifneq ($(BUILD_TYPE),release)
+ $(warning Using BUILD_TYPE='$(BUILD_TYPE)' from the $(origin BUILD_TYPE).)
+ endif
+endif
+
+EXTRA_CFLAGS = -fshort-wchar
+
+ifneq ($(MAKECMDGOALS),clean)
+
+ifeq ($(KERNELRELEASE),)
+
+ #
+ # building from this directory
+ #
+
+ # kernel base directory
+ ifndef KERN_DIR
+ KERN_DIR := /lib/modules/$(shell uname -r)/build
+ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+ KERN_DIR := /usr/src/linux
+ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+ $(error Error: unable to find the sources of your current Linux kernel. \
+ Specify KERN_DIR=<directory> and run Make again)
+ endif
+ $(warning Warning: using /usr/src/linux as the source directory of your \
+ Linux kernel. If this is not correct, specify \
+ KERN_DIR=<directory> and run Make again.)
+ endif
+ else
+ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
+ $(error Error: KERN_DIR does not point to a directory)
+ endif
+ endif
+
+ # includes
+ ifndef KERN_INCL
+ KERN_INCL = $(KERN_DIR)/include
+ endif
+ ifneq ($(shell if test -d $(KERN_INCL); then echo yes; fi),yes)
+ $(error Error: unable to find the include directory for your current Linux \
+ kernel. Specify KERN_INCL=<directory> and run Make again)
+ endif
+
+ # module install dir.
+ ifneq ($(filter install install_rpm,$(MAKECMDGOALS)),)
+ ifndef MODULE_DIR
+ MODULE_DIR_TST := /lib/modules/$(shell uname -r)
+ ifeq ($(shell if test -d $(MODULE_DIR_TST); then echo yes; fi),yes)
+ MODULE_DIR := $(MODULE_DIR_TST)/misc
+ else
+ $(error Unable to find the folder to install the DRM driver to)
+ endif
+ endif # MODULE_DIR unspecified
+ endif
+
+ # guess kernel version (24 or 26)
+ ifeq ($(shell if grep '"2\.4\.' $(KERN_INCL)/linux/version.h > /dev/null; then echo yes; fi),yes)
+ KERN_VERSION := 24
+ else
+ KERN_VERSION := 26
+ endif
+
+else # neq($(KERNELRELEASE),)
+
+ #
+ # building from kbuild (make -C <kernel_directory> M=`pwd`)
+ #
+
+ # guess kernel version (24 or 26)
+ ifeq ($(shell if echo "$(VERSION).$(PATCHLEVEL)." | grep '2\.4\.' > /dev/null; then echo yes; fi),yes)
+ KERN_VERSION := 24
+ else
+ KERN_VERSION := 26
+ endif
+
+endif # neq($(KERNELRELEASE),)
+
+# debug - show guesses.
+ifdef DEBUG
+$(warning dbg: KERN_DIR = $(KERN_DIR))
+$(warning dbg: KERN_INCL = $(KERN_INCL))
+$(warning dbg: MODULE_DIR = $(MODULE_DIR))
+$(warning dbg: KERN_VERSION = $(KERN_VERSION))
+endif
+
+KBUILD_VERBOSE ?= 1
+
+#
+# Compiler options
+#
+ifndef INCL
+ INCL := $(addprefix -I,$(KERN_INCL) $(EXTRA_INCL))
+ ifndef KBUILD_EXTMOD
+ KBUILD_EXTMOD := $(shell pwd)
+ endif
+ INCL += $(addprefix -I$(KBUILD_EXTMOD),/ /include /r0drv/linux)
+ export INCL
+endif
+KFLAGS := -D__KERNEL__ -DMODULE -DRT_OS_LINUX -DIN_RING0 -DIN_RT_R0 \
+ -DIN_SUP_R0 -DVBOX -DVBOX_WITH_HGCM -DLOG_TO_BACKDOOR -DIN_MODULE \
+ -DIN_GUEST_R0
+ifeq ($(BUILD_TARGET_ARCH),amd64)
+ KFLAGS += -DRT_ARCH_AMD64 -DVBOX_WITH_64_BITS_GUESTS
+else
+ KFLAGS += -DRT_ARCH_X86
+endif
+ifeq ($(BUILD_TYPE),debug)
+KFLAGS += -DDEBUG
+endif
+
+# override is required by the Debian guys
+override MODULE = vboxvideo
+OBJS = vboxvideo_drm.o
+
+ifeq ($(KERN_VERSION), 24)
+#
+# 2.4
+#
+
+CFLAGS := -O2 -DVBOX_LINUX_2_4 $(INCL) $(KFLAGS) $(KDEBUG)
+MODULE_EXT := o
+
+# 2.4 Module linking
+$(MODULE).o: $(OBJS)
+ $(LD) -o $@ -r $(OBJS)
+
+.PHONY: $(MODULE)
+all: $(MODULE)
+$(MODULE): $(MODULE).o
+
+else
+#
+# 2.6 and later
+#
+
+MODULE_EXT := ko
+
+$(MODULE)-y := $(OBJS)
+
+# special hack for Fedora Core 6 2.6.18 (fc6), rhel5 2.6.18 (el5),
+# ClarkConnect 4.3 (cc4) and ClarkConnect 5 (v5)
+ifeq ($(KERNELRELEASE),)
+ KFLAGS += $(foreach inc,$(KERN_INCL),\
+ $(if $(wildcard $(inc)/linux/utsrelease.h),\
+ $(if $(shell grep '"2.6.18.*fc6.*"' $(inc)/linux/utsrelease.h; \
+ grep '"2.6.18.*el5.*"' $(inc)/linux/utsrelease.h; \
+ grep '"2.6.18.*v5.*"' $(inc)/linux/utsrelease.h; \
+ grep '"2.6.18.*cc4.*"' $(inc)/linux/utsrelease.h),\
+ -DKERNEL_FC6,),))
+else
+ KFLAGS += $(if $(shell echo "$(KERNELRELEASE)"|grep '2.6.18.*fc6.*';\
+ echo "$(KERNELRELEASE)"|grep '2.6.18.*el5.*';\
+ echo "$(KERNELRELEASE)"|grep '2.6.18.*v5.*';\
+ echo "$(KERNELRELEASE)"|grep '2.6.18.*cc4.*'),\
+ -DKERNEL_FC6,)
+endif
+
+# build defs
+EXTRA_CFLAGS += $(INCL) $(KFLAGS) $(KDEBUG)
+
+all: $(MODULE)
+
+obj-m += $(MODULE).o
+
+$(MODULE):
+ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $(KERN_DIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) modules
+
+endif
+
+install: $(MODULE)
+ @mkdir -p $(MODULE_DIR); \
+ install -m 0664 -o root -g root $(MODULE).$(MODULE_EXT) $(MODULE_DIR); \
+ PATH="$(PATH):/bin:/sbin" depmod -ae;
+
+endif # eq($(MAKECMDGOALS),clean)
+
+# important: Don't remove Module.symvers! DKMS does 'make clean' before building ...
+clean:
+ for f in . linux r0drv r0drv/linux; do rm -f $$f/*.o $$f/.*.cmd $$f/.*.flags; done
+ rm -rf .vboxvideo* .tmp_ver* vboxvideo.* Modules.symvers modules.order
+
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3.2.8-mesa-check.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3.2.8-mesa-check.patch
new file mode 100644
index 000000000000..6813a1744695
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-3.2.8-mesa-check.patch
@@ -0,0 +1,36 @@
+--- configure
++++ configure
+@@ -1225,10 +1225,7 @@
+ XCloseDisplay(dpy);
+ }
+ EOF
+- [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
+- if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
+- log_success "found"
+- fi
++ test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs
+ }
+
+
+@@ -1382,21 +1379,6 @@
+ #include <GL/glu.h>
+ extern "C" int main(void)
+ {
+- Display *dpy;
+- int major, minor;
+-
+- dpy = XOpenDisplay(NULL);
+- if (dpy)
+- {
+- Bool glx_version = glXQueryVersion(dpy, &major, &minor);
+- XCloseDisplay(dpy);
+- if (glx_version)
+- {
+- printf("found version %u.%u, OK.\n", major, minor);
+- return 0;
+- }
+- }
+- printf("found (inactive), OK.\n");
+ return 0;
+ }
+ EOF
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-makeself-check.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-makeself-check.patch
new file mode 100644
index 000000000000..e1fcb8c2f471
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-makeself-check.patch
@@ -0,0 +1,10 @@
+--- VirtualBox-4.0.0_OSE/configure
++++ VirtualBox-4.0.0_OSE/configure
+@@ -2527,7 +2527,6 @@
+ check_compiler_h
+ [ "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
+ # tools/common/makeself*
+- [ $OSE -ge 1 ] && check_makeself
+ fi
+
+ [ -n "$SETUP_WINE" ] && setup_wine
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-mkisofs-check.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-mkisofs-check.patch
new file mode 100644
index 000000000000..8b0d59123f54
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4-mkisofs-check.patch
@@ -0,0 +1,10 @@
+--- VirtualBox-4.0.0_OSE/configure
++++ VirtualBox-4.0.0_OSE/configure
+@@ -2499,7 +2499,6 @@
+ # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
+ # [ "$OS" != "darwin" ] && check_yasm
+ [ "$OS" != "darwin" ] && check_xsltproc
+-[ "$OS" != "darwin" ] && check_mkisofs
+
+ # the libraries
+ [ "$OS" != "darwin" ] && check_pthread
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.6-link-lazy.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.6-link-lazy.patch
new file mode 100644
index 000000000000..1dd6e46f112f
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.6-link-lazy.patch
@@ -0,0 +1,17 @@
+2012-02-26 Magnus Granberg <zorry@gentoo.org>
+
+ #394757
+ * Config.kmk TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux add -Wl,-z,lazy
+
+diff -Naurw a/Config.kmk b/Config.kmk
+--- a/Config.kmk 2013-12-18 16:05:32.000000000 +0000
++++ b/Config.kmk 2014-01-11 15:46:48.950785377 +0000
+@@ -4997,7 +4997,7 @@
+ endif
+ TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS := $(filter-out $(VBOX_GCC_pipe) $(VBOX_GCC_Wextra) $(VBOX_GCC_Wno-missing-field-initializers) $(VBOX_GCC_fdiagnostics-show-option) $(VBOX_GCC_Wno-delete-non-virtual-dtor) $(VBOX_GCC_Wno-variadic-macros) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden),$(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS)) -pipe
+ TEMPLATE_VBOXGUESTR3EXE_CFLAGS := $(TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS)
+- TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux := $(filter-out $(VBOX_GCC_ORIGIN_OPT) $(VBOX_LD_as_needed),$(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux))
++ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux := $(filter-out $(VBOX_GCC_ORIGIN_OPT) $(VBOX_LD_as_needed),$(TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux)) -Wl,-z,lazy
+ endif
+ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
+ endif
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.8-vboxvideo_compilefixes.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.8-vboxvideo_compilefixes.patch
new file mode 100644
index 000000000000..23be8a5cb666
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-4.3.8-vboxvideo_compilefixes.patch
@@ -0,0 +1,31 @@
+--- VirtualBox-4.3.8/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
++++ VirtualBox-4.3.8/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
+@@ -105,7 +105,6 @@
+ #define VBOX_NAME "VBoxVideo"
+ #define VBOX_DRIVER_NAME "vboxvideo"
+
+-#ifdef VBOX_DRI_OLD
+ /* DRI support */
+ #define _XF86DRI_SERVER_
+ /* Hack to work around a libdrm header which is broken on Solaris */
+@@ -120,7 +119,6 @@
+ /* For some reason this is not in the header files. */
+ extern void GlxSetVisualConfigs(int nconfigs, __GLXvisualConfig *configs,
+ void **configprivs);
+-#endif
+
+ #define VBOX_VIDEO_MAJOR 1
+ #define VBOX_VIDEO_MINOR 0
+@@ -191,12 +189,10 @@
+ Bool fAnyX;
+ #ifdef VBOX_DRI
+ Bool useDRI;
+-#ifdef VBOX_DRI_OLD
+ int cVisualConfigs;
+ __GLXvisualConfig *pVisualConfigs;
+ DRIInfoRec *pDRIInfo;
+ int drmFD;
+-# endif
+ #endif
+ } VBOXRec, *VBOXPtr;
+
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5-localconfig b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5-localconfig
new file mode 100644
index 000000000000..aee5ec1ea83a
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5-localconfig
@@ -0,0 +1,30 @@
+# -*- Makefile -*-
+#
+# Overwrite some default kBuild settings
+#
+
+#
+# Copyright (C) 2006-2008 Sun Microsystems, Inc.
+#
+# This file is part of VirtualBox Open Source Edition (OSE), as
+# available from http://www.virtualbox.org. This file is free software;
+# you can redistribute it and/or modify it under the terms of the GNU
+# General Public License as published by the Free Software Foundation,
+# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
+# distribution. VirtualBox OSE is distributed in the hope that it will
+# be useful, but WITHOUT ANY WARRANTY of any kind.
+#
+
+# don't build testcases to save time, they are not needed for the package
+VBOX_WITH_TESTCASES :=
+VBOX_WITH_VALIDATIONKIT :=
+
+KBUILD_MSG_STYLE := brief
+
+## paths, origin, hardening
+VBOX_WITH_HARDENING := 2
+VBOX_WITH_ORIGIN :=
+VBOX_ONLY_ADDITIONS := 1
+
+TEMPLATE_VBOXGUESTR3XF86MOD_LDFLAGS.release =
+TEMPLATE_VBOXGUESTR3XORGMOD_LDFLAGS = $(TEMPLATE_VBOXGUESTR3DLL_LDFLAGS)
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.0_beta3-configure_checks.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.0_beta3-configure_checks.patch
new file mode 100644
index 000000000000..92f8a182e34d
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-5.0.0_beta3-configure_checks.patch
@@ -0,0 +1,52 @@
+--- VirtualBox-5.0.0_BETA3/configure
++++ VirtualBox-5.0.0_BETA3/configure
+@@ -1258,10 +1258,7 @@
+ XCloseDisplay(dpy);
+ }
+ EOF
+- [ -n "$INCX11" ] && I_INCX11=`prefix_I "$INCX11"`
+- if test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs; then
+- log_success "found"
+- fi
++ test_compile "$LIBX11 $I_INCX11" Xlibs Xlibs
+ }
+
+
+@@ -1415,21 +1412,6 @@
+ #include <GL/glu.h>
+ extern "C" int main(void)
+ {
+- Display *dpy;
+- int major, minor;
+-
+- dpy = XOpenDisplay(NULL);
+- if (dpy)
+- {
+- Bool glx_version = glXQueryVersion(dpy, &major, &minor);
+- XCloseDisplay(dpy);
+- if (glx_version)
+- {
+- printf("found version %u.%u, OK.\n", major, minor);
+- return 0;
+- }
+- }
+- printf("found (inactive), OK.\n");
+ return 0;
+ }
+ EOF
+@@ -2706,7 +2688,6 @@
+ # don't check for yasm for the time beeing as 0.40 and 0.50 both have known bugs
+ # [ "$OS" != "darwin" ] && check_yasm
+ [ "$OS" != "darwin" ] && check_xsltproc
+- [ "$OS" != "darwin" ] && check_mkisofs
+ fi
+
+ # the libraries
+@@ -2774,7 +2755,6 @@
+ check_compiler_h
+ [ $ONLY_ADDITIONS -eq 0 -a "$BUILD_MACHINE" = "amd64" -a $WITH_VMMRAW -eq 1 ] && check_32bit
+ # tools/common/makeself*
+- [ $OSE -ge 1 ] && check_makeself
+ fi
+
+ [ -n "$SETUP_WINE" ] && setup_wine
diff --git a/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-link-lazy.patch b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-link-lazy.patch
new file mode 100644
index 000000000000..081d4eb36224
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/files/xf86-video-virtualbox-link-lazy.patch
@@ -0,0 +1,16 @@
+2012-02-26 Magnus Granberg <zorry@gentoo.org>
+
+ #394757
+ * Config.kmk TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux add -Wl,-z,lazy
+
+--- Config.kmk 2011-12-19 13:58:30.000000000 +0100
++++ Config.kmk 2012-02-26 12:40:07.497810044 +0100
+@@ -4429,7 +4429,7 @@ else # the gcc guys
+ TEMPLATE_VBOXGUESTR3EXE_TOOL := $(subst GXX,GCC,$(TEMPLATE_VBOXR3EXE_TOOL))
+ TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fno-exceptions
+ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(filter-out '$(VBOX_GCC_RPATH_OPT)%,$(TEMPLATE_VBOXR3EXE_LDFLAGS))
+- TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux))
++ TEMPLATE_VBOXGUESTR3EXE_LDFLAGS.linux = $(filter-out $(VBOX_GCC_ORIGIN_OPT),$(TEMPLATE_VBOXR3EXE_LDFLAGS.linux)) -Wl,-z,lazy
+ endif
+ TEMPLATE_VBOXGUESTR3EXE_INST = $(INST_ADDITIONS)
+ TEMPLATE_VBOXGUESTR3EXE_DEFS := $(filter-out $(ARCH_BITS_DEFS), $(TEMPLATE_VBOXR3EXE_DEFS)) IN_GUEST IN_GUEST_R3 IN_RT_R3 $(VBOX_GC_ARCH_BITS_DEFS)
diff --git a/x11-drivers/xf86-video-virtualbox/metadata.xml b/x11-drivers/xf86-video-virtualbox/metadata.xml
new file mode 100644
index 000000000000..67c990ef325f
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>polynomial-c@gentoo.org</email>
+ <name>Lars Wendler</name>
+</maintainer>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.28.ebuild b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.28.ebuild
new file mode 100644
index 000000000000..8976e65c74cf
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.28.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils linux-mod multilib python-single-r1 versionator toolchain-funcs
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+DESCRIPTION="VirtualBox video driver"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.7:=[-minimal]
+ x11-libs/libXcomposite"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ ${PYTHON_DEPS}
+ >=dev-lang/yasm-0.6.2
+ sys-power/iasl
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/resourceproto
+ x11-proto/scrnsaverproto
+ x11-proto/xextproto
+ x11-proto/xineramaproto
+ x11-proto/xproto
+ x11-libs/libXdmcp
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXfixes
+ x11-libs/libXext
+ dri? ( x11-proto/xf86driproto
+ >=x11-libs/libdrm-2.4.5 )"
+
+REQUIRED_USE=( "${PYTHON_REQUIRED_USE}" )
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxvideo(misc:${WORKDIR}/vboxvideo_drm:${WORKDIR}/vboxvideo_drm)"
+
+S="${WORKDIR}/${MY_P}"
+
+QA_TEXTRELS_x86="usr/lib/VBoxOGL.so"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
+
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Prepare the vboxvideo_drm sources and Makefile in ${WORKDIR}
+ cp -a "${S}"/src/VBox/Additions/linux/drm "${WORKDIR}/vboxvideo_drm" \
+ || die "cannot copy vboxvideo_drm directory"
+ cp "${FILESDIR}/${PN}-3-vboxvideo_drm.makefile" \
+ "${WORKDIR}/vboxvideo_drm/Makefile" \
+ || die "cannot copy vboxvideo_drm Makefile"
+
+ # stupid new header references...
+ for vboxheader in {product,version}-generated.h ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/vboxvideo_drm/${vboxheader}"
+ done
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-3-localconfig" LocalConfig.kmk || die
+
+ # Ugly hack to build the opengl part of the video driver
+ epatch "${FILESDIR}/${PN}-2.2.0-enable-opengl.patch"
+
+ # unset useless/problematic checks in configure
+ epatch "${FILESDIR}/${PN}-3.2.8-mesa-check.patch" \
+ "${FILESDIR}/${PN}-4-makeself-check.patch" \
+ "${FILESDIR}/${PN}-4-mkisofs-check.patch"
+
+ # Patch to link with lazy on hardened #394757
+ if gcc-specs-now ; then
+ epatch "${FILESDIR}/${PN}-4.3.6-link-lazy.patch"
+ fi
+}
+
+src_configure() {
+ # build the user-space tools, warnings are harmless
+ local cmd=(
+ ./configure
+ --nofatal
+ --disable-xpcom
+ --disable-sdl-ttf
+ --disable-pulse
+ --disable-alsa
+ --with-gcc="$(tc-getCC)"
+ --with-g++="$(tc-getCXX)"
+ --target-arch=${ARCH}
+ --with-linux="${KV_OUT_DIR}"
+ --build-headless
+ )
+ echo "${cmd[@]}"
+ "${cmd[@]}" || die "configure failed"
+ source ./env.sh
+ export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
+}
+
+src_compile() {
+ for each in /src/VBox/{Runtime,Additions/common/VBoxGuestLib} \
+ /src/VBox/{GuestHost/OpenGL,Additions/x11/x11stubs,Additions/common/crOpenGL} \
+ /src/VBox/Additions/x11/vboxvideo ; do
+ cd "${S}"${each} || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ VBOX_USE_SYSTEM_XORG_HEADERS=1 \
+ KBUILD_PATH="${S}/kBuild" \
+ KBUILD_VERBOSE=2
+ done
+
+ if use dri ; then
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+ fi
+}
+
+src_install() {
+ if use dri; then
+ linux-mod_src_install
+ fi
+
+ cd "${S}/out/linux.${ARCH}/release/bin/additions"
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ newins vboxvideo_drv_system.so vboxvideo_drv.so
+
+ # Guest OpenGL driver
+ insinto /usr/$(get_libdir)
+ doins -r VBoxOGL*
+
+ if use dri ; then
+ dosym /usr/$(get_libdir)/VBoxOGL.so \
+ /usr/$(get_libdir)/dri/vboxvideo_dri.so
+ fi
+}
+
+pkg_postinst() {
+ elog "You need to edit the file /etc/X11/xorg.conf and set:"
+ elog ""
+ elog " Driver \"vboxvideo\""
+ elog ""
+ elog "in the Graphics device section (Section \"Device\")"
+ elog ""
+ if use dri; then
+ elog "To use the kernel drm video driver, please add:"
+ elog "\"vboxvideo\" to:"
+ if has_version sys-apps/openrc ; then
+ elog "/etc/conf.d/modules"
+ else
+ elog "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
+ fi
+ elog ""
+ fi
+}
diff --git a/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.30.ebuild b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.30.ebuild
new file mode 100644
index 000000000000..8b829441f62c
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-4.3.30.ebuild
@@ -0,0 +1,173 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils linux-mod multilib python-single-r1 versionator toolchain-funcs
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+DESCRIPTION="VirtualBox video driver"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.7:=[-minimal]
+ x11-libs/libXcomposite"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ ${PYTHON_DEPS}
+ >=dev-lang/yasm-0.6.2
+ sys-power/iasl
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/resourceproto
+ x11-proto/scrnsaverproto
+ x11-proto/xextproto
+ x11-proto/xineramaproto
+ x11-proto/xproto
+ x11-libs/libXdmcp
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXfixes
+ x11-libs/libXext
+ dri? ( x11-proto/xf86driproto
+ >=x11-libs/libdrm-2.4.5 )"
+
+REQUIRED_USE=( "${PYTHON_REQUIRED_USE}" )
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxvideo(misc:${WORKDIR}/vboxvideo_drm:${WORKDIR}/vboxvideo_drm)"
+
+S="${WORKDIR}/${MY_P}"
+
+QA_TEXTRELS_x86="usr/lib/VBoxOGL.so"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
+
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Prepare the vboxvideo_drm sources and Makefile in ${WORKDIR}
+ cp -a "${S}"/src/VBox/Additions/linux/drm "${WORKDIR}/vboxvideo_drm" \
+ || die "cannot copy vboxvideo_drm directory"
+ cp "${FILESDIR}/${PN}-3-vboxvideo_drm.makefile" \
+ "${WORKDIR}/vboxvideo_drm/Makefile" \
+ || die "cannot copy vboxvideo_drm Makefile"
+
+ # stupid new header references...
+ for vboxheader in {product,version}-generated.h ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/vboxvideo_drm/${vboxheader}"
+ done
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-3-localconfig" LocalConfig.kmk || die
+
+ # Ugly hack to build the opengl part of the video driver
+ epatch "${FILESDIR}/${PN}-2.2.0-enable-opengl.patch"
+
+ # unset useless/problematic checks in configure
+ epatch "${FILESDIR}/${PN}-3.2.8-mesa-check.patch" \
+ "${FILESDIR}/${PN}-4-makeself-check.patch" \
+ "${FILESDIR}/${PN}-4-mkisofs-check.patch"
+
+ # Patch to link with lazy on hardened #394757
+ if gcc-specs-now ; then
+ epatch "${FILESDIR}/${PN}-4.3.6-link-lazy.patch"
+ fi
+}
+
+src_configure() {
+ # build the user-space tools, warnings are harmless
+ local cmd=(
+ ./configure
+ --nofatal
+ --disable-xpcom
+ --disable-sdl-ttf
+ --disable-pulse
+ --disable-alsa
+ --with-gcc="$(tc-getCC)"
+ --with-g++="$(tc-getCXX)"
+ --target-arch=${ARCH}
+ --with-linux="${KV_OUT_DIR}"
+ --build-headless
+ )
+ echo "${cmd[@]}"
+ "${cmd[@]}" || die "configure failed"
+ source ./env.sh
+ export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
+}
+
+src_compile() {
+ for each in /src/VBox/{Runtime,Additions/common/VBoxGuestLib} \
+ /src/VBox/{GuestHost/OpenGL,Additions/x11/x11stubs,Additions/common/crOpenGL} \
+ /src/VBox/Additions/x11/vboxvideo ; do
+ cd "${S}"${each} || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ VBOX_USE_SYSTEM_XORG_HEADERS=1 \
+ KBUILD_PATH="${S}/kBuild" \
+ KBUILD_VERBOSE=2
+ done
+
+ if use dri ; then
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+ fi
+}
+
+src_install() {
+ if use dri; then
+ linux-mod_src_install
+ fi
+
+ cd "${S}/out/linux.${ARCH}/release/bin/additions"
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ newins vboxvideo_drv_system.so vboxvideo_drv.so
+
+ # Guest OpenGL driver
+ insinto /usr/$(get_libdir)
+ doins -r VBoxOGL*
+
+ if use dri ; then
+ dosym /usr/$(get_libdir)/VBoxOGL.so \
+ /usr/$(get_libdir)/dri/vboxvideo_dri.so
+ fi
+}
+
+pkg_postinst() {
+ elog "You need to edit the file /etc/X11/xorg.conf and set:"
+ elog ""
+ elog " Driver \"vboxvideo\""
+ elog ""
+ elog "in the Graphics device section (Section \"Device\")"
+ elog ""
+ if use dri; then
+ elog "To use the kernel drm video driver, please add:"
+ elog "\"vboxvideo\" to:"
+ if has_version sys-apps/openrc ; then
+ elog "/etc/conf.d/modules"
+ else
+ elog "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
+ fi
+ elog ""
+ fi
+}
diff --git a/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.0.ebuild b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.0.ebuild
new file mode 100644
index 000000000000..f250ea436c5f
--- /dev/null
+++ b/x11-drivers/xf86-video-virtualbox/xf86-video-virtualbox-5.0.0.ebuild
@@ -0,0 +1,171 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+inherit eutils linux-mod multilib python-single-r1 versionator toolchain-funcs
+
+MY_PV="${PV/beta/BETA}"
+MY_PV="${MY_PV/rc/RC}"
+MY_P=VirtualBox-${MY_PV}
+DESCRIPTION="VirtualBox video driver"
+HOMEPAGE="http://www.virtualbox.org/"
+SRC_URI="http://download.virtualbox.org/virtualbox/${MY_PV}/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dri"
+
+RDEPEND=">=x11-base/xorg-server-1.7:=[-minimal]
+ x11-libs/libXcomposite"
+DEPEND="${RDEPEND}
+ >=dev-util/kbuild-0.1.9998_pre20131130
+ ${PYTHON_DEPS}
+ >=dev-lang/yasm-0.6.2
+ sys-power/iasl
+ x11-proto/fontsproto
+ x11-proto/randrproto
+ x11-proto/renderproto
+ x11-proto/resourceproto
+ x11-proto/scrnsaverproto
+ x11-proto/xextproto
+ x11-proto/xineramaproto
+ x11-proto/xproto
+ x11-libs/libXdmcp
+ x11-libs/libXau
+ x11-libs/libX11
+ x11-libs/libXfixes
+ x11-libs/libXext
+ dri? ( x11-proto/xf86driproto
+ >=x11-libs/libdrm-2.4.5 )"
+
+REQUIRED_USE=( "${PYTHON_REQUIRED_USE}" )
+
+BUILD_TARGETS="all"
+BUILD_TARGET_ARCH="${ARCH}"
+MODULE_NAMES="vboxvideo(misc:${WORKDIR}/vboxvideo_drm:${WORKDIR}/vboxvideo_drm)"
+
+S="${WORKDIR}/${MY_P}"
+
+QA_TEXTRELS_x86="usr/lib/VBoxOGL.so"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERN_DIR=${KV_OUT_DIR} KERNOUT=${KV_OUT_DIR}"
+
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ # Prepare the vboxvideo_drm sources and Makefile in ${WORKDIR}
+ cp -a "${S}"/src/VBox/Additions/linux/drm "${WORKDIR}/vboxvideo_drm" \
+ || die "cannot copy vboxvideo_drm directory"
+ cp "${FILESDIR}/${PN}-3-vboxvideo_drm.makefile" \
+ "${WORKDIR}/vboxvideo_drm/Makefile" \
+ || die "cannot copy vboxvideo_drm Makefile"
+
+ # stupid new header references...
+ for vboxheader in {product,version}-generated.h ; do
+ ln -sf "${S}"/out/linux.${ARCH}/release/${vboxheader} \
+ "${WORKDIR}/vboxvideo_drm/${vboxheader}"
+ done
+
+ # Remove shipped binaries (kBuild,yasm), see bug #232775
+ rm -rf kBuild/bin tools
+
+ # Disable things unused or splitted into separate ebuilds
+ cp "${FILESDIR}/${PN}-5-localconfig" LocalConfig.kmk || die
+
+ # Ugly hack to build the opengl part of the video driver
+ epatch "${FILESDIR}/${PN}-2.2.0-enable-opengl.patch"
+
+ # unset useless/problematic checks in configure
+ epatch "${FILESDIR}/${PN}-5.0.0_beta3-configure_checks.patch"
+
+ # Patch to link with lazy on hardened #394757
+ if gcc-specs-now ; then
+ epatch "${FILESDIR}/${PN}-4.3.6-link-lazy.patch"
+ fi
+}
+
+src_configure() {
+ # build the user-space tools, warnings are harmless
+ local cmd=(
+ ./configure
+ --nofatal
+ --disable-xpcom
+ --disable-sdl-ttf
+ --disable-pulse
+ --disable-alsa
+ --with-gcc="$(tc-getCC)"
+ --with-g++="$(tc-getCXX)"
+ --target-arch=${ARCH}
+ --with-linux="${KV_OUT_DIR}"
+ --build-headless
+ )
+ echo "${cmd[@]}"
+ "${cmd[@]}" || die "configure failed"
+ source ./env.sh
+ export VBOX_GCC_OPT="${CFLAGS} ${CPPFLAGS}"
+}
+
+src_compile() {
+ for each in /src/VBox/{Runtime,Additions/common/VBoxGuestLib} \
+ /src/VBox/{GuestHost/OpenGL,Additions/x11/x11stubs,Additions/common/crOpenGL} \
+ /src/VBox/Additions/x11/vboxvideo ; do
+ cd "${S}"${each} || die
+ MAKE="kmk" \
+ emake TOOL_YASM_AS=yasm \
+ VBOX_USE_SYSTEM_XORG_HEADERS=1 \
+ KBUILD_PATH="${S}/kBuild" \
+ KBUILD_VERBOSE=2
+ done
+
+ if use dri ; then
+ # Now creating the kernel modules. We must do this _after_
+ # we compiled the user-space tools as we need two of the
+ # automatically generated header files. (>=3.2.0)
+ linux-mod_src_compile
+ fi
+}
+
+src_install() {
+ if use dri; then
+ linux-mod_src_install
+ fi
+
+ cd "${S}/out/linux.${ARCH}/release/bin/additions"
+ insinto /usr/$(get_libdir)/xorg/modules/drivers
+ newins vboxvideo_drv_system.so vboxvideo_drv.so
+
+ # Guest OpenGL driver
+ insinto /usr/$(get_libdir)
+ doins -r VBoxOGL*
+
+ if use dri ; then
+ dosym /usr/$(get_libdir)/VBoxOGL.so \
+ /usr/$(get_libdir)/dri/vboxvideo_dri.so
+ fi
+}
+
+pkg_postinst() {
+ elog "You need to edit the file /etc/X11/xorg.conf and set:"
+ elog ""
+ elog " Driver \"vboxvideo\""
+ elog ""
+ elog "in the Graphics device section (Section \"Device\")"
+ elog ""
+ if use dri; then
+ elog "To use the kernel drm video driver, please add:"
+ elog "\"vboxvideo\" to:"
+ if has_version sys-apps/openrc ; then
+ elog "/etc/conf.d/modules"
+ else
+ elog "/etc/modules.autoload.d/kernel-${KV_MAJOR}.${KV_MINOR}"
+ fi
+ elog ""
+ fi
+}
diff --git a/x11-drivers/xf86-video-vmware/Manifest b/x11-drivers/xf86-video-vmware/Manifest
new file mode 100644
index 000000000000..4323265214e7
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/Manifest
@@ -0,0 +1,3 @@
+DIST xf86-video-vmware-13.0.1.tar.bz2 432401 SHA256 802dda415c22412edad6c3df44fe18a06e91d0f8456d9a58bac0d340fdf8fe3d SHA512 2faf5fd524dffd2cd89a8b5a06b5470acbc51c3ee4f48bafc425b8e9c7c76d294201651cfb8c1d104c313885108e22abb6da736de1f3dbcf134a0926158ed147 WHIRLPOOL c52cb2a65f243a3cbe70da5f007aa0af97cf32e576b8bb6a400374d775edaab78ccf9ac341f94fc4bd95a2cf58672adce4462b079d889338f0b5ea93a8cd4252
+DIST xf86-video-vmware-13.0.2.tar.bz2 438773 SHA256 c8ba3d2cead3620dba2cbf5defb7f1759b2b96f4fe209f4bf6976832b6763c54 SHA512 18d6867c0bd497d9f2aeb96d04b26fa0e3af1d37ae7628d19a8c1e829ef1df825371225c68e140d4d65097fa53178e6f1a7d3e371a623c9ef6cd98cccc0f826c WHIRLPOOL e6083ce2248442bba2ca3447fe3e50d3b2df5e28d3116f3b1caf9a76036c8a6269341b08bf37b02d4253738daeab4aec15bc6cfa893ebde914c6be301fa58fdf
+DIST xf86-video-vmware-13.1.0.tar.bz2 459255 SHA256 3c1d244e4b1b77e92126957965cdc9fb82de4c215c0706a3a8aaff6939e4a0cc SHA512 43d6a15e40896c793e49a1670b937e417271baff15b737b6b8cd3845bb7d2fc6354bf53cb40350caf0e7aac1e005a0fb2c9c80ce25690678b79e8e48f05f1de0 WHIRLPOOL c637dafa0d93ef49c475b68f81aa2422b896450dee0f187c58ed2cc475c9406d69241b11a6d19d239a42c330acd41d7c7228c0b0484b30b96b33750bba0d870d
diff --git a/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-damageunregister.patch b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-damageunregister.patch
new file mode 100644
index 000000000000..0b2a8e6869b3
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-damageunregister.patch
@@ -0,0 +1,38 @@
+From e26dec8f5278df74a102493bf6d2d8444dab5d6d Mon Sep 17 00:00:00 2001
+From: Gaetan Nadon <memsize@videotron.ca>
+Date: Mon, 28 Oct 2013 22:21:29 +0000
+Subject: vmwgfx: handle changes of DamageUnregister API in 1.14.99.2
+
+Fix is inspired from the intel driver.
+
+Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
+Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
+---
+diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
+index fd80682..346e7f4 100644
+--- a/vmwgfx/vmwgfx_saa.c
++++ b/vmwgfx/vmwgfx_saa.c
+@@ -26,6 +26,7 @@
+ */
+
+ #include <xorg-server.h>
++#include <xorgVersion.h>
+ #include <mi.h>
+ #include <fb.h>
+ #include <xf86drmMode.h>
+@@ -76,7 +77,12 @@ vmwgfx_pixmap_remove_damage(PixmapPtr pixmap)
+ if (!spix->damage || vpix->hw || vpix->gmr || vpix->malloc)
+ return;
+
++#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
++ DamageUnregister(spix->damage);
++#else
+ DamageUnregister(&pixmap->drawable, spix->damage);
++#endif
++
+ DamageDestroy(spix->damage);
+ spix->damage = NULL;
+ }
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xa-compat-2.patch b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xa-compat-2.patch
new file mode 100644
index 000000000000..15f603c3c569
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xa-compat-2.patch
@@ -0,0 +1,26 @@
+From 93228f3dd3355a25583d22dbb96791678b93be3e Mon Sep 17 00:00:00 2001
+From: Thomas Hellstrom <thellstrom@vmware.com>
+Date: Wed, 11 Dec 2013 14:54:02 +0000
+Subject: vmwgfx: Really allow XA version 2.
+
+When XA starts to correctly advertise version 2, we didn't allow it.
+Fix this.
+
+Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
+---
+diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
+index 6301c29..4e28097 100644
+--- a/vmwgfx/vmwgfx_driver.c
++++ b/vmwgfx/vmwgfx_driver.c
+@@ -79,7 +79,7 @@ typedef uint8_t uint8;
+
+ #define XA_VERSION_MINOR_REQUIRED 0
+ #define XA_VERSION_MAJOR_REQUIRED 1
+-#define XA_VERSION_MAJOR_COMPAT 1
++#define XA_VERSION_MAJOR_COMPAT 2
+
+ #define DRM_VERSION_MAJOR_REQUIRED 2
+ #define DRM_VERSION_MINOR_REQUIRED 3
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xatracker-2.patch b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xatracker-2.patch
new file mode 100644
index 000000000000..9435f06ddd7b
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.1-xatracker-2.patch
@@ -0,0 +1,179 @@
+From 0945bea5fc32eacb7bf42639efbd45dcd43e7ab5 Mon Sep 17 00:00:00 2001
+From: Rob Clark <robdclark@gmail.com>
+Date: Mon, 10 Jun 2013 17:31:31 +0000
+Subject: vmwgfx: update for XA API changes
+
+Signed-off-by: Rob Clark <robdclark@gmail.com>
+Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
+Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
+Tested-by: Jakob Bornecrantz <jakob@vmware.com>
+---
+diff --git a/configure.ac b/configure.ac
+index 0631bcc..dccfb27 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -118,7 +118,7 @@ if test x$BUILD_VMWGFX = xyes; then
+ PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no])
+ fi
+ if test x$BUILD_VMWGFX = xyes; then
+- PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],[],[BUILD_VMWGFX=no])
++ PKG_CHECK_MODULES([XATRACKER], [xatracker >= 2.0.0],[],[BUILD_VMWGFX=no])
+ fi
+
+ DRIVER_NAME=vmware
+diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c
+index 7de0772..2f007f0 100644
+--- a/vmwgfx/vmwgfx_dri2.c
++++ b/vmwgfx/vmwgfx_dri2.c
+@@ -201,7 +201,8 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr buffer, unsigned int for
+ }
+
+ private->srf = srf;
+- if (xa_surface_handle(srf, &buffer->name, &buffer->pitch) != 0)
++ if (xa_surface_handle(srf, xa_handle_type_shared,
++ &buffer->name, &buffer->pitch) != 0)
+ return FALSE;
+
+ buffer->cpp = xa_format_depth(xa_surface_format(srf)) / 8;
+@@ -222,7 +223,7 @@ dri2_do_destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer)
+ struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(private->pPixmap);
+
+ if (--private->refcount == 0 && srf) {
+- xa_surface_destroy(srf);
++ xa_surface_unref(srf);
+ }
+
+ /*
+diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
+index 7863ba2..3002285 100644
+--- a/vmwgfx/vmwgfx_driver.c
++++ b/vmwgfx/vmwgfx_driver.c
+@@ -617,7 +617,8 @@ vmwgfx_scanout_present(ScreenPtr pScreen, int drm_fd,
+ return FALSE;
+ }
+
+- if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0) {
++ if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
++ &handle, &dummy) != 0) {
+ LogMessage(X_ERROR, "Could not get present surface handle.\n");
+ return FALSE;
+ }
+diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
+index 63df3a1..ed3c1ee 100644
+--- a/vmwgfx/vmwgfx_saa.c
++++ b/vmwgfx/vmwgfx_saa.c
+@@ -140,7 +140,7 @@ vmwgfx_pixmap_free_storage(struct vmwgfx_saa_pixmap *vpix)
+ vpix->malloc = NULL;
+ }
+ if (!(vpix->backing & VMWGFX_PIX_SURFACE) && vpix->hw) {
+- xa_surface_destroy(vpix->hw);
++ xa_surface_unref(vpix->hw);
+ vpix->hw = NULL;
+ }
+ if (!(vpix->backing & VMWGFX_PIX_GMR) && vpix->gmr) {
+@@ -286,7 +286,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
+ if (vpix->gmr && vsaa->can_optimize_dma) {
+ uint32_t handle, dummy;
+
+- if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
++ if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
++ &handle, &dummy) != 0)
+ goto out_err;
+ if (vmwgfx_dma(0, 0, reg, vpix->gmr, pixmap->devKind, handle,
+ to_hw) != 0)
+@@ -305,6 +306,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
+ (int) to_hw,
+ (struct xa_box *) REGION_RECTS(reg),
+ REGION_NUM_RECTS(reg));
++ if (to_hw)
++ xa_context_flush(vsaa->xa_ctx);
+ if (vpix->gmr)
+ vmwgfx_dmabuf_unmap(vpix->gmr);
+ if (ret)
+@@ -441,7 +444,7 @@ vmwgfx_hw_kill(struct vmwgfx_saa *vsaa,
+ &spix->dirty_hw))
+ return FALSE;
+
+- xa_surface_destroy(vpix->hw);
++ xa_surface_unref(vpix->hw);
+ vpix->hw = NULL;
+
+ /*
+@@ -683,7 +686,8 @@ vmwgfx_present_prepare(struct vmwgfx_saa *vsaa,
+
+ (void) pScreen;
+ if (src_vpix == dst_vpix || !src_vpix->hw ||
+- xa_surface_handle(src_vpix->hw, &vsaa->src_handle, &dummy) != 0)
++ xa_surface_handle(src_vpix->hw, xa_handle_type_shared,
++ &vsaa->src_handle, &dummy) != 0)
+ return FALSE;
+
+ REGION_NULL(pScreen, &vsaa->present_region);
+@@ -784,7 +788,7 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
+ return TRUE;
+
+ out_no_damage:
+- xa_surface_destroy(hw);
++ xa_surface_unref(hw);
+ return FALSE;
+ }
+
+@@ -929,6 +933,7 @@ vmwgfx_copy_prepare(struct saa_driver *driver,
+
+ if (!vmwgfx_hw_validate(src_pixmap, src_reg)) {
+ xa_copy_done(vsaa->xa_ctx);
++ xa_context_flush(vsaa->xa_ctx);
+ return FALSE;
+ }
+
+@@ -1029,6 +1034,7 @@ vmwgfx_copy_done(struct saa_driver *driver)
+ return;
+ }
+ xa_copy_done(vsaa->xa_ctx);
++ xa_context_flush(vsaa->xa_ctx);
+ }
+
+ static Bool
+@@ -1175,6 +1181,7 @@ vmwgfx_composite_done(struct saa_driver *driver)
+ struct vmwgfx_saa *vsaa = to_vmwgfx_saa(driver);
+
+ xa_composite_done(vsaa->xa_ctx);
++ xa_context_flush(vsaa->xa_ctx);
+ }
+
+ static void
+@@ -1436,7 +1443,8 @@ vmwgfx_scanout_ref(struct vmwgfx_screen_entry *entry)
+ */
+ if (!vmwgfx_hw_accel_validate(pixmap, 0, XA_FLAG_SCANOUT, 0, NULL))
+ goto out_err;
+- if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
++ if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
++ &handle, &dummy) != 0)
+ goto out_err;
+ depth = xa_format_depth(xa_surface_format(vpix->hw));
+
+diff --git a/vmwgfx/vmwgfx_tex_video.c b/vmwgfx/vmwgfx_tex_video.c
+index 449266b..2971ed7 100644
+--- a/vmwgfx/vmwgfx_tex_video.c
++++ b/vmwgfx/vmwgfx_tex_video.c
+@@ -199,7 +199,7 @@ stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown)
+
+ for (i=0; i<3; ++i) {
+ if (priv->yuv[i]) {
+- xa_surface_destroy(priv->yuv[i]);
++ xa_surface_unref(priv->yuv[i]);
+ priv->yuv[i] = NULL;
+ }
+ for (j=0; j<2; ++j) {
+@@ -539,7 +539,8 @@ copy_packed_data(ScrnInfoPtr pScrn,
+ REGION_RESET(pScrn->pScreen, &reg, &box);
+ }
+
+- if (xa_surface_handle(srf, &handle, &stride) != 0) {
++ if (xa_surface_handle(srf, xa_handle_type_shared,
++ &handle, &stride) != 0) {
+ ret = BadAlloc;
+ break;
+ }
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.2-fix-includes.patch b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.2-fix-includes.patch
new file mode 100644
index 000000000000..434cb679f761
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/files/xf86-video-vmware-13.0.2-fix-includes.patch
@@ -0,0 +1,41 @@
+From 4664412d7a5266d2b392957406b34abc5db95e48 Mon Sep 17 00:00:00 2001
+From: Stefan Dirsch <sndirsch@suse.de>
+Date: Tue, 7 Oct 2014 11:29:32 +0200
+Subject: xf86xv.h cannot be included without first including xorg-server.h.
+
+Without this the build fails on systems with the latest glibc,
+throwing this error:
+
+In file included from /usr/include/string.h:634:0,
+ from /usr/include/xorg/os.h:53,
+ from /usr/include/xorg/misc.h:115,
+ from /usr/include/xorg/screenint.h:50,
+ from /usr/include/xorg/scrnintstr.h:50,
+ from /usr/include/xorg/xvdix.h:55,
+ from /usr/include/xorg/xf86xv.h:32,
+ from vmwgfx_overlay.c:38:
+/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+strndup(const char *str, size_t n);
+
+This is caused by HAVE_STRNDUP not being set (it is set from xorg-server.h),
+causing os.h to redefine it.
+
+Signed-off-by: Stefan Dirsch <sndirsch@suse.de>
+Reviewed-by: Daniel Stone <daniels@collabora.com>
+Acked-by: Thomas Hellstrom <thellstrom@vmware.com>
+
+diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
+index ef1d541..2b05b0e 100644
+--- a/vmwgfx/vmwgfx_overlay.c
++++ b/vmwgfx/vmwgfx_overlay.c
+@@ -35,6 +35,7 @@
+ */
+
+
++#include "xorg-server.h"
+ #include "xf86xv.h"
+ #include "fourcc.h"
+ #define debug_printf(...)
+--
+cgit v0.10.2
+
diff --git a/x11-drivers/xf86-video-vmware/metadata.xml b/x11-drivers/xf86-video-vmware/metadata.xml
new file mode 100644
index 000000000000..8a4ab6d163db
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>x11</herd>
+ <maintainer>
+ <email>dev-zero@gentoo.org</email>
+ <name>Tiziano Müller</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.1-r1.ebuild b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.1-r1.ebuild
new file mode 100644
index 000000000000..7d3079caa9e5
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.1-r1.ebuild
@@ -0,0 +1,23 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+XORG_EAUTORECONF=yes
+inherit xorg-2
+
+DESCRIPTION="VMware SVGA video driver"
+KEYWORDS="amd64 x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="x11-libs/libdrm[libkms,video_cards_vmware]
+ >=media-libs/mesa-10[xa]"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-damageunregister.patch
+ "${FILESDIR}"/${P}-xatracker-2.patch
+ "${FILESDIR}"/${P}-xa-compat-2.patch
+)
diff --git a/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.2.ebuild b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.2.ebuild
new file mode 100644
index 000000000000..b5fcaa7c9ee3
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.0.2.ebuild
@@ -0,0 +1,18 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="VMware SVGA video driver"
+KEYWORDS="~amd64 ~x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="x11-libs/libdrm[libkms,video_cards_vmware]
+ media-libs/mesa[xa]"
+DEPEND="${RDEPEND}"
+
+PATCHES=( "${FILESDIR}"/${PN}-13.0.2-fix-includes.patch )
diff --git a/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.1.0.ebuild b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.1.0.ebuild
new file mode 100644
index 000000000000..fa12177fbe0a
--- /dev/null
+++ b/x11-drivers/xf86-video-vmware/xf86-video-vmware-13.1.0.ebuild
@@ -0,0 +1,16 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+XORG_DRI=always
+inherit xorg-2
+
+DESCRIPTION="VMware SVGA video driver"
+KEYWORDS="amd64 x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND="x11-libs/libdrm[libkms,video_cards_vmware]
+ media-libs/mesa[xa]"
+DEPEND="${RDEPEND}"
diff --git a/x11-drivers/xf86-video-voodoo/Manifest b/x11-drivers/xf86-video-voodoo/Manifest
new file mode 100644
index 000000000000..e6478275da66
--- /dev/null
+++ b/x11-drivers/xf86-video-voodoo/Manifest
@@ -0,0 +1 @@
+DIST xf86-video-voodoo-1.2.5.tar.bz2 305489 SHA256 9e3eb8a3fdcc60ce4f7c37649188cfa67dcf25cda3a85d8027588458bb3fd7e8 SHA512 371d606abf3d682aa1e42bfce89dabd70bcb0bba3709d63bf34ffb4a364e16422fcd56104ffc4f85cd9a8795f31b7884ff5edac5e7d3f609b4c948180e0e8e10 WHIRLPOOL 112a57d85f6cabb1954dd79ef7088bf3dbf415452986e5e5cb4c0cb45aa2f20e75d4d8cb2d39778b59079b23b3edaf691b6aa0736811ce7628ab7f394337d947
diff --git a/x11-drivers/xf86-video-voodoo/metadata.xml b/x11-drivers/xf86-video-voodoo/metadata.xml
new file mode 100644
index 000000000000..01c4c004e735
--- /dev/null
+++ b/x11-drivers/xf86-video-voodoo/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>x11</herd>
+</pkgmetadata>
diff --git a/x11-drivers/xf86-video-voodoo/xf86-video-voodoo-1.2.5.ebuild b/x11-drivers/xf86-video-voodoo/xf86-video-voodoo-1.2.5.ebuild
new file mode 100644
index 000000000000..2917b2f9bffa
--- /dev/null
+++ b/x11-drivers/xf86-video-voodoo/xf86-video-voodoo-1.2.5.ebuild
@@ -0,0 +1,14 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+inherit xorg-2
+
+DESCRIPTION="Voodoo video driver"
+KEYWORDS="alpha amd64 ia64 ppc sparc x86 ~x86-fbsd"
+IUSE=""
+
+RDEPEND=">=x11-base/xorg-server-1.0.99"
+DEPEND="${RDEPEND}
+ x11-proto/xf86dgaproto"