summaryrefslogtreecommitdiff
path: root/x11-drivers/ati-userspace
diff options
context:
space:
mode:
Diffstat (limited to 'x11-drivers/ati-userspace')
-rw-r--r--x11-drivers/ati-userspace/Manifest57
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-11.10.ebuild384
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-11.11.ebuild412
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-11.12.ebuild412
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-11.6.ebuild386
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-11.8.ebuild398
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-11.9.ebuild398
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.1-r1.ebuild414
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.10.ebuild433
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.2.ebuild414
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.3.ebuild416
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.4.ebuild416
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.6.ebuild430
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.6_beta_pre897.ebuild430
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-12.8.ebuild426
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-13.1.ebuild481
-rw-r--r--x11-drivers/ati-userspace/ati-userspace-13.4.ebuild487
-rw-r--r--x11-drivers/ati-userspace/files/amd-drivers-3.2.7.1.patch19
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-12.2-redefine-WARN.patch42
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch27
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-2.6.33.patch140
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-2.6.34.patch10
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-2.6.35-and-newer.patch11
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-2.6.36.patch26
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-2.6.37.patch11
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-2.6.38.patch59
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-CVE-2010-3081-fix.patch60
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-do_mmap.patch50
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-fix_compilation-bug-297322.patch25
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-kernel-3.8-acpihandle.patch15
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-old_rsp.patch24
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-vm-reserverd.patch12
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-x32_something_something.patch13
-rw-r--r--x11-drivers/ati-userspace/files/ati-drivers-xen.patch62
-rw-r--r--x11-drivers/ati-userspace/files/ati-powermode-opt-path-2.patch42
-rw-r--r--x11-drivers/ati-userspace/files/ati-powermode-opt-path-3.patch40
-rw-r--r--x11-drivers/ati-userspace/files/atieventsd.init20
-rw-r--r--x11-drivers/ati-userspace/files/const-notifier-block.patch25
-rw-r--r--x11-drivers/ati-userspace/files/kernel/2.6.31-fglrx_find_task_by_vpid.patch19
-rw-r--r--x11-drivers/ati-userspace/files/kernel/2.6.32-9.11-fix_compilation.patch37
-rw-r--r--x11-drivers/ati-userspace/files/switchlibGL61
41 files changed, 7644 insertions, 0 deletions
diff --git a/x11-drivers/ati-userspace/Manifest b/x11-drivers/ati-userspace/Manifest
new file mode 100644
index 00000000..86cbffe8
--- /dev/null
+++ b/x11-drivers/ati-userspace/Manifest
@@ -0,0 +1,57 @@
+AUX amd-drivers-3.2.7.1.patch 560 SHA256 7cc315754a47fbda6bf36bcee01780da7c19535c4f6ec1cccc556e9a7b32d263 SHA512 bcdc89e7a7148f5eb5450364298de6fb95dcad0d3c8d7091e9236d4f4b9cff0be24d59e8ed4ccdde0c8e94985ab8b4e7d5848e1e0e7102c699edb9230dbe57ce WHIRLPOOL 85ef893cd8bffa0d41b99eccd8b6e1ed713f69cc683dee52268ea0d6bc6fd4a77b3fdab31dd1e35ec3bbd21b399725286289c9fb3a276eff3922c1f8cf0746a2
+AUX ati-drivers-12.2-redefine-WARN.patch 1316 SHA256 f7d8ad3307823925cf8b4c6540db17a51553e48dd008793fc026803bb2aa1ced SHA512 1ee5f7fb5dc629f186754dc83a7d718a6a8acda836dadb2b87bd616c424db0aba067fb833d966cf79425ad78d94ab3f7c4014bbe2356f394630b0761625e74ab WHIRLPOOL 75987965689042342a923d4542a3f1b5eb4ba8ce3fc1ede82be8aeffaa2154a0dc75c507a4772bc00ef510eee7f4b47a51a2ea43aadce6e742e842e348c15b40
+AUX ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch 799 SHA256 0001fa7f2c3e15ec315f6c963dd428b682778c129250941a849577b8b3293e36 SHA512 a7ae5e7017c9b5a68d112d9a77df40ada722b06aff0cc31147713bfbce2419f9ca8c22b40398ab8b80c86427ff086a5617fb6de93d540af54365c7039cdcfe0f WHIRLPOOL 809c5bf8f0b0381af6a8549c36fcd00e75ff2f571f21cef3f2dec9ea823c65c29db28373b7145f39b9ed2cad234ec3c063407fb7a12260cfe1fe62eb67b5780d
+AUX ati-drivers-2.6.33.patch 3888 SHA256 88c242d50e9e158b5cdfe8de49abb49deb9f7d4fd4a3e014b9092a5eaa58332c SHA512 20d94e258766dff4b18ef26bee66f415b8975bbbae8dd4bfd2d7354538302c571747d5d672d3cdd1fd97bb4ce8e24756ab9afc7ebd55e9f7f19e3acee8bfaff1 WHIRLPOOL d7d753fa4a1c3f9432cf151a3ea524173036462c7850dc9309a8097bba61237194970e99d735f9efebf43253fc626e7b9ab1e69f95919fa76b2b60bf98696d61
+AUX ati-drivers-2.6.34.patch 358 SHA256 b6da2f0ad829a14b7e50d4ff2bab493ce45a2f4493bc558e28122c4fe7d4032c SHA512 a9329d3696d99395667a0b022fa64c1d4c35caeb144c9e08404613febe525d8e286ec36332232b0072bcf46e9380aa04fb01d010028ff0de8cb7aa530c91768e WHIRLPOOL cff3dab1b4b27bf99bc3861377849ecb5824228eeffb8a02fc0c2b2246b6a585443aaac7ef10a561ea9ac8d2ff00af378e2412dfafc62816fb9ab3f2515b8d71
+AUX ati-drivers-2.6.35-and-newer.patch 434 SHA256 6a962e79bfd01cd35488dc946c4e0056b5734c15711b6cb9e28c6fadc92d6bb4 SHA512 2a2d0bc62d946ac765a321cf0ab6c6d595622fc57426678f12c8c116f9f8f472e180f8349632ed725c612830f27af4f48180634555c3c7462ce8e59989c295f3 WHIRLPOOL cc2c87578729ade8268394084bde899ae1690a4c8720f4e4b6bb5c3778d896af434440a2993d87bf5a6d445757fdd86384344e4616e167122cc1d526705ad093
+AUX ati-drivers-2.6.36.patch 876 SHA256 00ffca26787d4c2cab6848cf0bec043e6c099c60738aebacb2148e920738fcb6 SHA512 2ee3a5b342aa13a64e033c0de109afa4330d85db440177804f24a3ed27a112719f688d8ad9b353d5b7c49ebb5a8944c397c0da552a59d33e12a8f3cb8493616c WHIRLPOOL c6b1937ec94e06d99b8c15b5d9c66b028d9171e21cc6d059f4e2ca571a88f6adb2d8cbbb7901e662d7e26a8c4c4e4835f6f4d49d43a72c627c4e2584c9f5c1f9
+AUX ati-drivers-2.6.37.patch 431 SHA256 fffd3d39f16fa57df020b2fddf17466a3633b7eac58dffa70525137010cc7ed6 SHA512 aac1a3cbbb333c5801c46a5e3c8b838c3f56cfbb68b851f8d3b89b383233e9b75aee0960b92bb4907665d14b97d8b8e3158a6ad2a0a92f1b8fab8a41766865fb WHIRLPOOL 2ef2cfa85c561572698bff4ed6bee1e2ac0ff9ffe30b802fc901bd0787837d77318c10acf14bf653da0e087ccf9492dcb07fd60c0e0173abf48d5e337b450ebc
+AUX ati-drivers-2.6.38.patch 1988 SHA256 32dcafbe0d584a36839b358acc777b2f2953e8d472f48722debb430f523ec11e SHA512 667623cae54669a736422511880936e6148105bc88e74b235db8c888148d0888cbe4bcd84d0344aa256cdf948796f85a39be686e66b0d2bac3375c4dfe4b5554 WHIRLPOOL b4b2de630be27741c2b9d645913aa73ec992adaa71f82f21b5ea748be5f9d6316e1b3fd11f8709ba6a87ef9ebffe4c7c9c1d6890a7f4011bd01b0792c993c83c
+AUX ati-drivers-CVE-2010-3081-fix.patch 2730 SHA256 bbace941d6e1e399b7ab46affe1887edb9a38892ccc2a498017146b838818afc SHA512 56b0aec0344788cf50765284f879fe804226fc930f43efaa0c8d536e0e3164ce3d9218236977fcca3499a5b199bd57e1e5c9d92c77a2658a75d82f47586e9082 WHIRLPOOL da473efb8149f8de43987c842d0214978eb08bbd6b3060cfec1fed50152501e5f10dbe02743d9e61888790f2e9fcecd6c0aa96d3ff9b6e48348885df14398fbe
+AUX ati-drivers-do_mmap.patch 1405 SHA256 3fc9bae50d25d3bfe76a3a1e89c8d025674a4cb9afd16d3a5d8b3c25a66f536d SHA512 1a2f8fe7f2506037d6d158e5c2efffa39c503566284d8f516cb2d84db546eced24df5dcb8d74ac84911589efb4547d7f8610d78ad29703f9ed0a9890576c51b7 WHIRLPOOL 86daa957d7569b26fdf92929e5b04a32379af067a208628eab1a4541fdebfb51fa4bfedeec63f4685c6258adcba2ddc4223b69dca329ecbebd4ba13167f66f82
+AUX ati-drivers-fix_compilation-bug-297322.patch 1114 SHA256 edbfc56eec848389c3dfdd94362322de41027b9813128d2d4f8e476d1d8581e3 SHA512 c2c4674ff63b05c4f5f007c64f70ebfd4bf6ba1a82938f06647d9683315105e3cee77716eed1efdd599177457164e339145ed0d51f2bbd7ad1f383dbb64634cd WHIRLPOOL bd3aa26fb333850ac0a5b554ab7cd5ac583ef9f277d6ada64d27dcfef0f1fe5174f67e04f8e951275fcfe449a80d2701c3a1d85e65ac55ef5665144924b2b127
+AUX ati-drivers-kernel-3.8-acpihandle.patch 717 SHA256 f7012bbc1d27a4d9207f8ba78256684a74b917311f525d3b061c11caefad2846 SHA512 a064ad1ebbb1010349c22d6fd6a4a3715df3d7087353a70199957b5c1c325b533b21c3f004567362a834faa0d8f169296ef996765d47439fdad4109a0d01f85c WHIRLPOOL e0eb93cd367f9e6e1848c3c3301c914f783865eb5d6c11a27a334624ee84cf7ee99073a6a2ff69014c8b920a51933573bf1224f53ea64c2666968f93ca922003
+AUX ati-drivers-old_rsp.patch 989 SHA256 dd222de89b515046c6cbfef172a3ec8d4bc48664799b3bbfff648091c6d54b49 SHA512 b86a230f126950d309b899ab3445154cf38cb8127b7686d0a467df6d3561a1785747e9522c00b55a294961c1157fe41833a5a85d4737775ae68bdb4099b0ee37 WHIRLPOOL cd06422ee90587c5c7485074b03ccaaef921134c721c0d0f6f678a9c968aae6417523c77d6dfcccc856cb5d125579197cd3c6a5b1c8557ce621784eabd0c43fa
+AUX ati-drivers-vm-reserverd.patch 408 SHA256 61128444938f94f911325b6cac810d3cb3614d0002758e48ba976b678414df30 SHA512 34cd4705f632b1493eac756538eb21fe0e090f78cf92cde7c2a7094a8fc8134ee6d5dd24c6bb9ad18c8ef46dd1d5505ae12d43032265cd4ade03793f277fe4c2 WHIRLPOOL 5a1a98145576b20bdd2e80e5f7f9a2b9bab02942a9fb83814d73d17f1bfec690ee0cd2ccfdf418f297e75432d8fcee8164a1d179eeb5bc716e1becf96bb373f1
+AUX ati-drivers-x32_something_something.patch 486 SHA256 9eb114a797089fca3693420305a6b668c4d7a16a722d5faa53dd904bba1b4c07 SHA512 157884244a49748c897a2eca1a46bf40631042d15af85c2b2f49bc3c3c48f5638dec815a4e9c67ee2c8b88cc15b7f71e9fe4d9bfebf5444bb169542048f66499 WHIRLPOOL f7583d7df16c9eb608aff2330b4bd55ede34986e6f3cf63aa4cb2c77dcfade7c499f1b4cef95fdc8e6ab28d7bb5544a80703bcf5a41eae6b90ca8830b6fdd888
+AUX ati-drivers-xen.patch 1994 SHA256 514dad9629fc689ec0344875a29d713f9d8de7ccbb0a22a2b80ede11bbbc6c58 SHA512 28eeaeea4589a5d87759e318abcf4f8d8e9b2fb3e289f76001cc17f8e515135aa023a424a0149240ad64fcf7721d15864c7218c30c3a097240c800384991e77f WHIRLPOOL 0f0965808d4270e8421d87575ffb1e51a2e095c746e7f536bb091b03287543d176f582976bfec51a5b9eb14c2e3a04c126b23447a6eb39f6e90eb76eda42236d
+AUX ati-powermode-opt-path-2.patch 1634 SHA256 e7749e04a3aa24132b13d0c694563a45c0d38e238f7412a75bd89aa9f9e9ead1 SHA512 7fc91789157d6211726d26be066e3984871eb579c77c422bde27f489f72215e66dbfb5d477ea6882d46ed6d0c63b9f01fdd5ee196fd6a2809bfc3ca22badc859 WHIRLPOOL a3d6f9335c748192a65bb3493a1dd2f604ef6b1270760908bb541d10ac9c4eb8009d7d5fb145b37c6fbfc1512a70ecda3c79f6f56396f8424f072fb92059e0a2
+AUX ati-powermode-opt-path-3.patch 1471 SHA256 35e73fef3d8e39714e8d6e73afaa7b205505db3bdd65c364e7ea02fdc0cb3055 SHA512 0e17026847062117993ba6115942d16421f6b9943afd57913c96e7550b0e49f3ed10e06bc98f9db1a5ba4af7c42dae6b55a332a97e73d48dba7f61ed0ad35ad4 WHIRLPOOL 39861d10d307e537549ed0c7967e18ad3ef658af66396f5491d1f2e13ab13e8b8e252d4c14b5ab616ff5aad69a599cf3b32accedd51438021d50cc074fa296a8
+AUX atieventsd.init 533 SHA256 20010ebc5cb286149f3c4c9c099b6470463ccdb8fd47cea054b783dc2ad1fff3 SHA512 9f8990bb5619f99524e0759a1c4b41b0b2c081c6eecb3916ab60df8e6b59d99e3615af61e0ba5b71d003ccaaf41e2143237b26f36f64f00a47e0fe94f83473dd WHIRLPOOL 21979818a19bc27e3527958c66bf45654df4a307862897530bc02be6616f45ee210590a9d1bcab84336c6061482034010efbb251770bfaf023f20ffae8212ecd
+AUX const-notifier-block.patch 878 SHA256 cd73f5e15d9521a989d8cd9b7e3b252406e7b89fdfc129fd2d470f0bc86e8457 SHA512 1b84cb85ce903d80ad50a0e2d53509016625d1ede070e18b800408d486dc89d5283d801d6449eb81ee25a7adffbd0094b57a301842364e1fb58cc6bf9623e5b4 WHIRLPOOL ee9785d250632cd8843a5995f36442ff6abec2d5a7158f3604a6bc147c7db251608b9484c3ac95376c4cc6b6a15f6682675bd011eb6a193a073ba873e17a9872
+AUX kernel/2.6.31-fglrx_find_task_by_vpid.patch 581 SHA256 4e95b588e894cfb89270168cd771c67bf270c805f30481fceebe47aac3f36980 SHA512 e65f31db60cd99c99dfba95c2f2fe0ee5f434092e7218dbdf6a727e3ffaab3d511541aa1ab64a53589d6fc89023c45d972708c0bd925840fa568f0d7f6faa512 WHIRLPOOL ee1061bff86a5711474eaea8b1b8a2cad5ff02e9a093e197af9a55e9b2dc33ed6bf38dfe02afec4f910250a241900049dd3986c65e95f98991a46549cb37c343
+AUX kernel/2.6.32-9.11-fix_compilation.patch 1434 SHA256 bd2df542c237d0570c3c75c0251514bbf8b67f3ceb40e734916ea53c75c189b7 SHA512 6676ba917616324e58a8df498cd2611523a38e2dfb5ea5683580951d3a39b2cc0040e00bc2238d1ef94f009e1771a6dddb2c02988d8af9aae6373f717ab9234b WHIRLPOOL 605bf802feede69c43a515b3b289c181c50b2f176028c7d170c41dd641bd5efed7d0ccad668d21a3d7c5c5c0f6418e317ba6c723e773269d063afb8990bae95b
+AUX switchlibGL 1349 SHA256 a4aa2107fdb903da77fea432bc809a1155e213db460fdec72fd1c3c7cc0d13a0 SHA512 51d2912aa6ec2002b096c0483be69650d682feec54486ed5226b91988bc1516f718c71d9f58a2b28e0dbc512c0300ea271f9a97885776dd045fe324f1549b85d WHIRLPOOL d335ea9c57a28f8450423089bbf798da77cc72fff6bad1221989412808abcd6bcb7afa41aa2b04231feff3dac6eaaff58a7595173e53b6cf0f5d3d591997b43d
+DIST amd-catalyst-13.4-linux-x86.x86_64.zip 122588023 SHA256 ebec78c7f78db3601d1c97116a6823076a7765318e16d88b619ebc80d4c6d1d5 SHA512 ce012f46527ee0073f658e97dd793954930b934b96be9e1c6cd1d344e7734ef81949b484701d5e7e1ebb221f46b5a617f4efb4445e42c06ac0a8b4eca76463fc WHIRLPOOL cb0f7af6d0474c3d521c5785bab49d76da7e09e1ddd02dc0e72b70b5afdb2bd1e07d4a4115a755f213718e7c32c816697d993b73706d58be68fa043aef1ad551
+DIST amd-driver-installer-12-1-x86.x86_64.run 106085279 SHA256 8d76700e0db68f74f735808ee7fd446cb5072734ba6ec03f2dd82c05ebfdc81d
+DIST amd-driver-installer-12-2-x86.x86_64.run 107213014 SHA256 054796cbf2d99e4b545d062ce8eabfd973e74e2e21a159092816238b001618fd
+DIST amd-driver-installer-12-3-x86.x86_64.run 108029053 SHA256 5f90c7e472ca0095efc16097ac7bcda846be0e980cc4d3e588cc4089efe8fb57 SHA512 5c5380dfcebacb7c4d7f0e6ffc5d26955f155266577c903bd4b4fc9d9bf5f241e6e13dc7ee14e14c96e9e0ad19d7d6680609978cfa1c5c4ec2f5d50881a43ee0 WHIRLPOOL 5e179a0ef89520dea6a5d249f4c55bd58310769131edc82babfb66c9ce946511effe7a32e883ba30a9bc40a3e6dc8194b57cbbfe0cb2593bec463de7816612f1
+DIST amd-driver-installer-12-4-x86.x86_64.run 108360519 SHA256 7f3ba3d96eba30fc09aec03ba72f5482d3b192bb0ea63a5e7b79454b053cb63c SHA512 fe466df547a05efb37b0dd1c685f819ceb51af83acefd65f2e500ab9165feac841d4b07afc32dc26391762963e929624e55115c0f505acb78289540baaadcfb5 WHIRLPOOL 7aa8817e75943977b753a93015a7d1e0f7a95383e6aaae7317da29eb07caa520a5376b2ab80e7caded543939d3c9428b80d915d5ba3d8377068349189890729c
+DIST amd-driver-installer-12-6-x86.x86_64.run 106660241 SHA256 b5c6070dc75e9296d0f04e7e0b3c6697f6c21872d50b1dcf4d7b3b0ab7ce7155
+DIST amd-driver-installer-12-8-x86.x86_64.zip 105413213 SHA256 62525173b2b7602aa4e7e46a109204d0f349abfbb135c86d03db5cd57642bb41
+DIST amd-driver-installer-12.6-legacy-x86.x86_64.zip 106888385 SHA256 5353a3f874d31f0fde46c390ce17cc2f27875156dbf3e7c20b5cca494a058102
+DIST amd-driver-installer-catalyst-12.10-x86.x86_64.zip 111686672 SHA256 ca2a097324687245801b3350316880d706c82f43684839dcf7f86f55141d835d SHA512 cef8a1f822d2a9bd81cf85c1410b75d400808946443c2bf95281f7c2cbcf376ac423199f41125825ed6639eaacd14ea688acc5c5b164186a4715b62ed6f5fb63 WHIRLPOOL 2186151882d9ba69af2a39a0a4dbb26adbff87fe69a90c40798e2390c44ce100e8d71f03c0c86e3a8be5d3429f98f3c107578aa5508b6fb983ca4235e0de8f74
+DIST amd-driver-installer-catalyst-13.1-linux-x86.x86_64.zip 114850263 SHA256 67898a922b6b58f25a276a144f16b19014f79c39e4d44d8d2883a467d31e34ad SHA512 30763ab7f47ac22c5b5055495e2d8ae6cc2c8e5ce711fa389f1145a48da2799020c2b8cbf082759d93628017860c39d69337f42ce21b78e1d60c9eda32096df9 WHIRLPOOL ee5dc85a89bc56858ef1c2bcdc6cbfde7e2f9e5675d209c1f6db877e0104cc536f1e18139f0b991a064b14b231a982770eef47368ea281067d62647b4c5365a5
+DIST ati-driver-installer-11-10-x86.x86_64.run 77926379 SHA256 a245e0305051313767fef1be88693702fccfb3f11c18a98f61c233af17e85f9e
+DIST ati-driver-installer-11-11-x86.x86_64.run 97090080 SHA256 fcd51cdc0c7572d443f5ce54576888f09efaced10b12ccf9fa775c81eaade013
+DIST ati-driver-installer-11-12-x86.x86_64.run 99618112 SHA256 0179d1f0425036e50b637e5153b0c64b25836d09e9d22bc50edfbdf6aed32b42
+DIST ati-driver-installer-11-6-x86.x86_64.run 75503458 SHA256 3dbb7cf1a5493588d872eb29b7376eb5db3913c4f35d631c3183d168eed1f67f
+DIST ati-driver-installer-11-8-x86.x86_64.run 75754239 SHA256 71e0194daef7a50c6d0d3b5712b05375a003d452e39c754278336c3811a2acdf
+DIST ati-driver-installer-11-9-x86.x86_64.run 76564617 SHA256 d9ad9c8e0bd250ac41c39d9b8e9f77efc82631f4bebacb82ddde982a86530d56
+DIST xvba-sdk-0.74-404001.tar.gz 583847 SHA256 731a2c489f2fb5d7318c1976061b26c1057a696f46d09dcf55fbada97fed17eb SHA512 aa1dd52b59eeeabd026d8b76e3b75eaf02587ef286438ba28884afeef5a5efaf50283b5ee4f5b81b12cf79cb4ec77c9a235a886b29fb7cdf850c9779f4b07b35 WHIRLPOOL 69917b746d353a884512e97b9d9a9b89e6f51add3119e69ddd119d51c0c3f2820b93a449fe42bd76d671dc505f92bf25b7f2c5868b33768fc68a19596e460951
+EBUILD ati-userspace-11.10.ebuild 11808 SHA256 059b1b3e10aaacb0ffe885ba70f5fa02d2545e89d19822b0780e75a1320aaaec SHA512 675a0f714e8e711783a58a985711c79583f818a82a7a6b376c4a95939e11565ec47ca70dcaf5358c6858ea759178a37d09a754afd1022a1295c51a47e750226b WHIRLPOOL 0caeafe4b7713184287f6646ac40b8e87157078e106bc9c86088d411238113511d9235c1a6dd45825391b3b14073fe5fd3f671f37975f3c8ed04545f79ac90a1
+EBUILD ati-userspace-11.11.ebuild 12763 SHA256 037611b73fe20c860bb83583e2ce3a074d01f62b7dc4e76035d8bdbf041cbe47 SHA512 ae16bea39a77a7084d5de78d3a6f39a9cc6717e839c07782e2b7306f0bb6711496413b11094bb31b6c471ae8280ff11bc076cf883d6c3f35ab5763f8bea459c0 WHIRLPOOL 1126de31e5fe44cb74cf753088405fff8c94506f97985702b5d74bad0e61d9367dd982676637b6934c85d76f42ae8c798830f8fb9985c67c1ef9f2728ecdc69f
+EBUILD ati-userspace-11.12.ebuild 12763 SHA256 037611b73fe20c860bb83583e2ce3a074d01f62b7dc4e76035d8bdbf041cbe47 SHA512 ae16bea39a77a7084d5de78d3a6f39a9cc6717e839c07782e2b7306f0bb6711496413b11094bb31b6c471ae8280ff11bc076cf883d6c3f35ab5763f8bea459c0 WHIRLPOOL 1126de31e5fe44cb74cf753088405fff8c94506f97985702b5d74bad0e61d9367dd982676637b6934c85d76f42ae8c798830f8fb9985c67c1ef9f2728ecdc69f
+EBUILD ati-userspace-11.6.ebuild 11866 SHA256 093f6ee56546dc837d73acb6c4e07dfac8f70af81bb914d608e4917f462ad58c SHA512 86bd9e91aa32e091b6633315ad954f3bb277aabd6ebee14b730d426f0121c2315ce51ef9d1ca19f72121f374affa100b237a3f08495a8d6b6d8974287676e43d WHIRLPOOL 2dd3a009805d6aec3c1d7d968457f447b9d8393581a6cd795c5ca7deab565497c92c318be9759ba881763e41865a18ff846b5ef596550c3755074f7a335a18a5
+EBUILD ati-userspace-11.8.ebuild 12248 SHA256 3e31c77d138ae1c1fcee0984f50dfd801816e57945af8a53b134c45da9ba3273 SHA512 3ad402cfb8fcdf243ecf7c2fe3e91a23aaa89dec17a42aef78768efcd7edf570a3cf226ffa8d4e89c670a2428669fb01bb712a090784d14df60c3edc5ea30a45 WHIRLPOOL 2f0f6a1f7c372ebe51c832c9ec04bba8fc08f48e103e949c2fd53b96b880c758289fccfba3fb7348f0419de0642e1c4046642662258b16189e00a3c8e9a0ae22
+EBUILD ati-userspace-11.9.ebuild 12248 SHA256 3e31c77d138ae1c1fcee0984f50dfd801816e57945af8a53b134c45da9ba3273 SHA512 3ad402cfb8fcdf243ecf7c2fe3e91a23aaa89dec17a42aef78768efcd7edf570a3cf226ffa8d4e89c670a2428669fb01bb712a090784d14df60c3edc5ea30a45 WHIRLPOOL 2f0f6a1f7c372ebe51c832c9ec04bba8fc08f48e103e949c2fd53b96b880c758289fccfba3fb7348f0419de0642e1c4046642662258b16189e00a3c8e9a0ae22
+EBUILD ati-userspace-12.1-r1.ebuild 12946 SHA256 cc51e10c26ec57f8399ebf20f39d0c0eaa1fbb34afb5c02d2e1f51835bfbdf43 SHA512 bb73937dd1287c4d359caebf9b1646bacd57e69d539220dc3971a0d7c7525795dc07b1b77eecd363d2e9cb6ba16a1db29f7c7b58f18d272053e5792a6a08f8a6 WHIRLPOOL 724ea9b5e3493aaa820fc4fe9c134e27a3198e05dcd178a92da249d5205c1164a45ba43f2a02c48cc6f4afd29a129ac1f81e6cd3e1c220d0d8770f761092ed3d
+EBUILD ati-userspace-12.10.ebuild 13651 SHA256 77f0538fa3ad51a69c3c1d832a2c97b7057b4cb9440860dd8def788277629cf3 SHA512 8fdc8fee7d86c14e5856a6532858a7ff8f5c6ebaebb77625ae5a4e8e8943b3089232b830eb7ae11b722d79c9ddd309d7e7fbef511293cacfc47e89fd09d508ce WHIRLPOOL d8f583a3c714d158da4c1671b0ece3926d0ead7d4e7073dfcf69a3199ed33d775a162380c7fb1fd8c5ea737598bb74442c328932da6ee683bff015302a82a6a7
+EBUILD ati-userspace-12.2.ebuild 12956 SHA256 2f139619c3b0b5c8fbc96a1d498cd4d397e6cb07f6e8a4947a4f0f53cfe729af SHA512 82f13dba5644cf1902b039a98ba03cd28b6886a115286728490c56f12c7d6612d4404c8e53cea68f4a3ed37f4c213dba97077468a3685cbb3edde00c2e658a4b WHIRLPOOL 22e1583d5471cc3cff01a22ec417df249b790e7b3268b676f6f5a7eb743c4e80b3d67348f79fd7b98a8813b348667ad1dd7aba226a0d401457ec738ca72104d4
+EBUILD ati-userspace-12.3.ebuild 13069 SHA256 2a4b17bd81ae4a92e07a8194230157c05f016fb9bbc4ef971b4c6a0724356f08 SHA512 8ca699d5a0fc202324758419ddd20cd6c7cdfe201b3ff440781ec6d7687057ab582779fd0626e194f6ba2d6ba412b197092bb98d4189a54739486a8c1fdda42f WHIRLPOOL 8ea5c455498fa15538f30840b51cc4fefa8df4fa27c4c5144088448a56c35f2834970244431638dd0a390bf291f70692cbc3a74ea435fecd5afbec7eaca00250
+EBUILD ati-userspace-12.4.ebuild 13069 SHA256 2a4b17bd81ae4a92e07a8194230157c05f016fb9bbc4ef971b4c6a0724356f08 SHA512 8ca699d5a0fc202324758419ddd20cd6c7cdfe201b3ff440781ec6d7687057ab582779fd0626e194f6ba2d6ba412b197092bb98d4189a54739486a8c1fdda42f WHIRLPOOL 8ea5c455498fa15538f30840b51cc4fefa8df4fa27c4c5144088448a56c35f2834970244431638dd0a390bf291f70692cbc3a74ea435fecd5afbec7eaca00250
+EBUILD ati-userspace-12.6.ebuild 13587 SHA256 1597a0dff6118a2c843612064c10a094fd3fd8fec54cac3965e48cc4b398ac94 SHA512 e8bd9e520eaccac0ed9033f7f43263efde627ebc56d567f9a7c83b615231b2b3bc949ce1bc0511c8fc41b4322ac17d864e47ae1ac176a2b0c2935f2d4cdababf WHIRLPOOL f79371d4d4d515ff32455858513cedbd7bd164e15bf82a1c27732808410ecae0599d8b70cf0d0115984958c74fea4c149fd804e69032eefc8a7346f5cc946e9f
+EBUILD ati-userspace-12.6_beta_pre897.ebuild 13630 SHA256 f9785fcebeeba1d4c9cc5efcd033267d86488cafe9c52d3f2dbf85d30fc8863f SHA512 6c69e081d93484c5e97590976e815f1f589c34095f2c2fc9268a75ae23dc7c8c6476c52af04ecaf64668bbc99055095f58d4741c59a6a8d41d3eeff16807b48a WHIRLPOOL cc7622637493300f61b6d648cc1fe502b9fcf78d9a50b5547a45aeeabeb07bffcd323139de237cce9079a4f4b34c5940cd0a0a4ada1b987db28c61932a2b2c2a
+EBUILD ati-userspace-12.8.ebuild 13535 SHA256 e9b7219aa54947e7def64a4a6ecb92d75ac6d3d8c0f2c96fb77ff7f2b35a2072 SHA512 95750fa9c5005c209f1489c99c6dfcdbf87decd4ba075822f6006dde29f27d8c473f7dd2ea3f92a7584142e2c9492fbd02471bf7d939322eff1f6b1e87a2f109 WHIRLPOOL 8e2b08f65c0d0e78c9b661b98eeb212ed9f0ab2cd501890bba2dc55362392a209f76f280761bd08e5d2d98572dd5753987737497cbe33a7d657c5bf45bcccfeb
+EBUILD ati-userspace-13.1.ebuild 15655 SHA256 8e3258c7d020ae22444159176076be1efb7f0719b53d1ffa188e38e0255862d7 SHA512 3057cb158f5268f0b1e60e4237519762de9d6d1ee682d73c0ba9d2e63196f6fc3633accff84c8384a078395a3571a0cfb7c31611308f838e366b9fc7dc8e80ee WHIRLPOOL 84be01a881793efe7a9376895a8dbc748233db99c89811bcbf6d33a4131a9c8b3dfaaa96a9d08340ac5f47cc114794491e1bda9e0af06101da6b9e33347c988d
+EBUILD ati-userspace-13.4.ebuild 15983 SHA256 59682a2bf9df19da0ea6d7a41706f501ec50afa7433bcfb61009f612692020dd SHA512 e3e2d18c8bdeec66cdfc307ce506d7bed51e676ab00a4eec5c098ac384e2c25bfb74ac9f9d15bcb8a3992643d0089b664c407d9f11e0ed7756078dd00d0d6219 WHIRLPOOL 1d7fa1cf20ff6e6264a83f438cdc5fed4ce1983f3785ca2d714ba97a22cc80df6158b500b6e9b8114c9a966a2e9e2b659ead4e8c43abb5cac3b46f92105dc8db
diff --git a/x11-drivers/ati-userspace/ati-userspace-11.10.ebuild b/x11-drivers/ati-userspace/ati-userspace-11.10.ebuild
new file mode 100644
index 00000000..97f73d32
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-11.10.ebuild
@@ -0,0 +1,384 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://ati.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.10.99
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? ( app-emulation/emul-linux-x86-opengl )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ app-misc/pax-utils
+ app-portage/portage-utils
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ 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
+"
+
+pkg_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ # 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,atiogl.xml,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/*
+
+ # 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"
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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 libraries
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+pkg_postinst() {
+ elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "You will have to source /etc/profile (or logout and back in) for dri"
+ elog "to work, unless you previously had ati-drivers installed."
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-11.11.ebuild b/x11-drivers/ati-userspace/ati-userspace-11.11.ebuild
new file mode 100644
index 00000000..14f897db
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-11.11.ebuild
@@ -0,0 +1,412 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://ati.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib opencl"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.11.49
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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\)\?/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/libOpenCL.so.1
+"
+
+pkg_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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 opencl && 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,atiogl.xml,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+ # OpenCL
+ if use opencl ; then
+ insinto /etc/OpenCL/vendors/
+ if [[ "${ABI}" == "amd64" ]] ; then
+ doins "${ARCH_DIR}"/etc/OpenCL/vendors/amdocl64.icd || die "doins failed"
+ else
+ doins "${ARCH_DIR}"/etc/OpenCL/vendors/amdocl32.icd || die "doins failed"
+ fi
+ fi
+
+ # 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/*
+
+ # 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"
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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)
+ if use opencl ; then
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/lib*.so*
+ else
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+ fi
+
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+pkg_postinst() {
+ elog "To switch to ATI 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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-11.12.ebuild b/x11-drivers/ati-userspace/ati-userspace-11.12.ebuild
new file mode 100644
index 00000000..14f897db
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-11.12.ebuild
@@ -0,0 +1,412 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://ati.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib opencl"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.11.49
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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\)\?/libamdocl\(32\|64\)\?.so
+ usr/lib\(32\|64\)\?/libOpenCL.so.1
+"
+
+pkg_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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 opencl && 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,atiogl.xml,signature,amdpcsdb.default}
+ doexe ${FOLDER_PREFIX}etc/ati/authatieventsd.sh
+ # OpenCL
+ if use opencl ; then
+ insinto /etc/OpenCL/vendors/
+ if [[ "${ABI}" == "amd64" ]] ; then
+ doins "${ARCH_DIR}"/etc/OpenCL/vendors/amdocl64.icd || die "doins failed"
+ else
+ doins "${ARCH_DIR}"/etc/OpenCL/vendors/amdocl32.icd || die "doins failed"
+ fi
+ fi
+
+ # 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/*
+
+ # 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"
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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)
+ if use opencl ; then
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/lib*.so*
+ else
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+ fi
+
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+pkg_postinst() {
+ elog "To switch to ATI 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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-11.6.ebuild b/x11-drivers/ati-userspace/ati-userspace-11.6.ebuild
new file mode 100644
index 00000000..94046c53
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-11.6.ebuild
@@ -0,0 +1,386 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://ati.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.10.99
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? ( app-emulation/emul-linux-x86-opengl )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ app-portage/portage-utils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ 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
+"
+
+pkg_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ # 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,atiogl.xml,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/*
+
+ # 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
+ local alllibdir="$(get_libdir)"
+ use multilib && alllibdir="lib64 lib32"
+ for libdir in ${alllibdir}
+ do
+ dosym /usr/${libdir}/opengl/xorg-x11/lib/libGL.so.1.2 \
+ /usr/${libdir}/fglrx/libGL.so.1.2
+ dosym ./libGL.so.1.2 /usr/${libdir}/fglrx/fglrx-libGL.so.1.2
+
+ # Fixup xvba-video compilation
+ dosym libXvBAW.so.1.0 /usr/${libdir}/libXvBAW.so
+ done
+
+}
+
+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"
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ 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
+ # PowerXpress stuff
+ dosym /usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2 \
+ ${ATI_ROOT}/lib/FGL.renamed.libGL.so.1.2
+ dosym ./libGL.so.1.2 ${ATI_ROOT}/lib/fglrx-libGL.so.1.2
+
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ # PowerXpress stuff
+ dosym /usr/$(get_libdir)/opengl/xorg-x11/extensions/libglx.so \
+ ${ATI_ROOT}/extensions/FGL.renamed.libglx.so
+ dosym fglrx-libglx.so ${ATI_ROOT}/extensions/libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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 libraries
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ 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}"
+}
+
+pkg_postinst() {
+ elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "You will have to source /etc/profile (or logout and back in) for dri"
+ elog "to work, unless you previously had ati-drivers installed."
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-11.8.ebuild b/x11-drivers/ati-userspace/ati-userspace-11.8.ebuild
new file mode 100644
index 00000000..f38ceffa
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-11.8.ebuild
@@ -0,0 +1,398 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://ati.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.10.99
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? ( app-emulation/emul-linux-x86-opengl )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ app-misc/pax-utils
+ app-portage/portage-utils
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ 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
+"
+
+pkg_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ # 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,atiogl.xml,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/*
+
+ # 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
+ local alllibdir="$(get_libdir)"
+ use multilib && alllibdir="lib64 lib32"
+ for libdir in ${alllibdir}
+ do
+ dosym /usr/${libdir}/opengl/xorg-x11/lib/libGL.so.1.2 \
+ /usr/${libdir}/fglrx/libGL.so.1.2
+ dosym ./libGL.so.1.2 /usr/${libdir}/fglrx/fglrx-libGL.so.1.2
+
+ # Fixup xvba-video compilation
+ dosym libXvBAW.so.1.0 /usr/${libdir}/libXvBAW.so
+ done
+
+}
+
+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"
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ 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
+ # PowerXpress stuff
+ dosym /usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2 \
+ ${ATI_ROOT}/lib/FGL.renamed.libGL.so.1.2
+ dosym ./libGL.so.1.2 ${ATI_ROOT}/lib/fglrx-libGL.so.1.2
+
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ # PowerXpress stuff
+ dosym /usr/$(get_libdir)/opengl/xorg-x11/extensions/libglx.so \
+ ${ATI_ROOT}/extensions/FGL.renamed.libglx.so
+ dosym fglrx-libglx.so ${ATI_ROOT}/extensions/libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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 libraries
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+pkg_postinst() {
+ elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "You will have to source /etc/profile (or logout and back in) for dri"
+ elog "to work, unless you previously had ati-drivers installed."
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-11.9.ebuild b/x11-drivers/ati-userspace/ati-userspace-11.9.ebuild
new file mode 100644
index 00000000..f38ceffa
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-11.9.ebuild
@@ -0,0 +1,398 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://ati.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/ati-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.10.99
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? ( app-emulation/emul-linux-x86-opengl )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ app-misc/pax-utils
+ app-portage/portage-utils
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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
+"
+
+QA_DT_HASH="
+ opt/bin/amdcccle
+ opt/bin/aticonfig
+ opt/bin/atiodcli
+ opt/bin/atiode
+ opt/bin/fglrxinfo
+ opt/sbin/atieventsd
+ 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
+"
+
+pkg_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch || die "Failed to epatch powermode-opt-path-2.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ # 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,atiogl.xml,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/*
+
+ # 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
+ local alllibdir="$(get_libdir)"
+ use multilib && alllibdir="lib64 lib32"
+ for libdir in ${alllibdir}
+ do
+ dosym /usr/${libdir}/opengl/xorg-x11/lib/libGL.so.1.2 \
+ /usr/${libdir}/fglrx/libGL.so.1.2
+ dosym ./libGL.so.1.2 /usr/${libdir}/fglrx/fglrx-libGL.so.1.2
+
+ # Fixup xvba-video compilation
+ dosym libXvBAW.so.1.0 /usr/${libdir}/libXvBAW.so
+ done
+
+}
+
+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"
+ else
+ local EX_BASE_DIR="${BASE_DIR}"
+ local pkglibdir=lib
+ local MY_ARCH_DIR="${S}/arch/x86"
+ 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
+ # PowerXpress stuff
+ dosym /usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2 \
+ ${ATI_ROOT}/lib/FGL.renamed.libGL.so.1.2
+ dosym ./libGL.so.1.2 ${ATI_ROOT}/lib/fglrx-libGL.so.1.2
+
+ exeinto ${ATI_ROOT}/extensions
+ doexe "${EX_BASE_DIR}"/usr/X11R6/${pkglibdir}/modules/extensions/fglrx/fglrx-libglx.so
+ # PowerXpress stuff
+ dosym /usr/$(get_libdir)/opengl/xorg-x11/extensions/libglx.so \
+ ${ATI_ROOT}/extensions/FGL.renamed.libglx.so
+ dosym fglrx-libglx.so ${ATI_ROOT}/extensions/libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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 libraries
+ exeinto /usr/$(get_libdir)
+ doexe "${MY_ARCH_DIR}"/usr/${pkglibdir}/libati*.so*
+
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+pkg_postinst() {
+ elog "To switch to ATI OpenGL, run \"eselect opengl set ati\""
+ elog "To change your xorg.conf you can use the bundled \"aticonfig\""
+ elog
+ elog "You will have to source /etc/profile (or logout and back in) for dri"
+ elog "to work, unless you previously had ati-drivers installed."
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.1-r1.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.1-r1.ebuild
new file mode 100644
index 00000000..3993df43
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.1-r1.ebuild
@@ -0,0 +1,414 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.11.49
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.10.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.10.ebuild
new file mode 100644
index 00000000..e27131b3
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.10.ebuild
@@ -0,0 +1,433 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+MY_V=( $(get_version_components) )
+#RUN="${WORKDIR}/amd-driver-installer-9.00-x86.x86_64.run"
+SRC_URI="http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-${PV}-x86.x86_64.zip"
+FOLDER_PREFIX="common/"
+IUSE="debug multilib x-multilib static-libs"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+RESTRICT="bindist"
+
+RDEPEND="<=x11-base/xorg-server-1.12.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x-multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst
+ sys-apps/findutils
+ app-misc/pax-utils"
+
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ ${A} =~ .*\.tar\.gz ]]; then
+ unpack ${A}
+ else
+ #please note, RUN may be insanely assigned at top near SRC_URI
+ if [[ ${A} =~ .*\.zip ]]; then
+ unpack ${A}
+ [[ -z "$RUN" ]] && RUN="${S}/${A/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${A}"
+ fi
+ sh ${RUN} --extract "${S}" 2>&1 > /dev/null || die
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+
+ # Get rid of watermark. Oldest known reference:
+ # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
+ ebegin "Disabling watermark"
+ driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
+ sed -i "s/${x}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
+ done
+ eend $? || die "Disabling watermark failed"
+}
+
+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() {
+ # 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 && 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
+
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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"
+
+ # Required by upstream AMD
+ touch "${D}/etc/ati/atiapfuser.blb" || die
+ insinto /etc/ati
+ doins "${FOLDER_PREFIX}etc/ati/atiapfxx.blb"
+}
+
+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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.2.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.2.ebuild
new file mode 100644
index 00000000..e0460995
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.2.ebuild
@@ -0,0 +1,414 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.11.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.3.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.3.ebuild
new file mode 100644
index 00000000..7d0cf802
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.3.ebuild
@@ -0,0 +1,416 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib static-libs"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.11.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.4.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.4.ebuild
new file mode 100644
index 00000000..7d0cf802
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.4.ebuild
@@ -0,0 +1,416 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+# 8.ble will be used for beta releases.
+if [[ $(get_major_version) -gt 8 ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib static-libs"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+
+RDEPEND="<=x11-base/xorg-server-1.11.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ $(get_major_version) -gt 8 ]]; then
+ # Switching to a standard way to extract the files since otherwise no signature file
+ # would be created
+ local src="${DISTDIR}/${A}"
+ sh "${src}" --extract "${S}" 2&>1 /dev/null
+ else
+ unpack ${A}
+ fi
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+}
+
+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() {
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.6.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.6.ebuild
new file mode 100644
index 00000000..2637daac
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.6.ebuild
@@ -0,0 +1,430 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+MY_V=( $(get_version_components) )
+if [[ ${MY_V[2]} != beta ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib static-libs"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+RESTRICT="bindist"
+
+RDEPEND="<=x11-base/xorg-server-1.12.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ ${MY_V[2]} == beta ]]; then
+ unpack ${A}
+ RUN="${S}/${A/%.zip/.run}"
+ else
+ RUN="${DISTDIR}/${A}"
+ fi
+ sh ${RUN} --extract "${S}" # 2>&1 > /dev/null || die
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+
+ # Get rid of watermark. Oldest known reference:
+ # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
+ ebegin "Disabling watermark"
+ driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
+ sed -i "s/${x}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
+ done
+ eend $? || die "Disabling watermark failed"
+}
+
+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() {
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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"
+
+ # Required by upstream AMD
+ touch "${D}/etc/ati/atiapfuser.blb" || die
+ insinto /etc/ati
+ doins "${FOLDER_PREFIX}etc/ati/atiapfxx.blb"
+}
+
+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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.6_beta_pre897.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.6_beta_pre897.ebuild
new file mode 100644
index 00000000..97cf89c6
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.6_beta_pre897.ebuild
@@ -0,0 +1,430 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+MY_V=( $(get_version_components) )
+if [[ ${MY_V[2]} != beta ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.run"
+ FOLDER_PREFIX="common/"
+else
+ #SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ SRC_URI="http://www2.ati.com/drivers/legacy/amd-driver-installer-12.6-legacy-x86.x86_64.zip"
+ FOLDER_PREFIX="common/"
+fi
+IUSE="debug multilib static-libs"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+RESTRICT="bindist"
+
+RDEPEND="<=x11-base/xorg-server-1.12.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ if [[ ${MY_V[2]} == beta ]]; then
+ unpack ${A}
+ RUN=${A/%.zip/.run}
+ else
+ RUN=${A}
+ fi
+ sh "${S}"/${RUN} --extract "${S}" 2>&1 > /dev/null || die \
+ 'unpack failed'
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+
+ # Get rid of watermark. Oldest known reference:
+ # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
+ ebegin "Disabling watermark"
+ driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
+ sed -i "s/${x}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
+ done
+ eend $? || die "Disabling watermark failed"
+}
+
+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() {
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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"
+
+ # Required by upstream AMD
+ touch "${D}/etc/ati/atiapfuser.blb" || die
+}
+
+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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-12.8.ebuild b/x11-drivers/ati-userspace/ati-userspace-12.8.ebuild
new file mode 100644
index 00000000..ab6501fc
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-12.8.ebuild
@@ -0,0 +1,426 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="AMD X11 drivers for radeon r600 (HD Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+MY_V=( $(get_version_components) )
+if [[ ${MY_V[2]} != beta ]]; then
+ ATI_URL="http://www2.ati.com/drivers/linux/"
+ SRC_URI="${ATI_URL}/amd-driver-installer-${PV/./-}-x86.x86_64.zip"
+ FOLDER_PREFIX="common/"
+else
+ SRC_URI="https://launchpad.net/ubuntu/natty/+source/fglrx-installer/2:${PV}-0ubuntu1/+files/fglrx-installer_${PV}.orig.tar.gz"
+ FOLDER_PREFIX=""
+fi
+IUSE="debug multilib x-multilib static-libs"
+
+LICENSE="AMD GPL-2 as-is"
+KEYWORDS="~amd64 ~x86"
+SLOT="1"
+RESTRICT="bindist"
+
+RDEPEND="<=x11-base/xorg-server-1.12.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x-multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+DEPEND="${RDEPEND}
+ sys-apps/findutils
+ x11-proto/inputproto
+ x11-proto/xf86miscproto
+ x11-proto/xf86vidmodeproto
+ x11-proto/xineramaproto
+ x11-libs/libXtst"
+
+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
+"
+
+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_setup() {
+ # 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
+}
+
+src_unpack() {
+ unpack ${A}
+ RUN="${S}/"*.run
+ sh ${RUN} --extract "${S}" # 2>&1 > /dev/null || die
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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-2.patch
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+
+ # Get rid of watermark. Oldest known reference:
+ # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
+ ebegin "Disabling watermark"
+ driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
+ sed -i "s/${x}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
+ done
+ eend $? || die "Disabling watermark failed"
+}
+
+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() {
+ # 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 && 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
+
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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"
+
+ # Required by upstream AMD
+ touch "${D}/etc/ati/atiapfuser.blb" || die
+ insinto /etc/ati
+ doins "${FOLDER_PREFIX}etc/ati/atiapfxx.blb"
+}
+
+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
+ # PowerXpress stuff
+ mv "${D}"/${ATI_ROOT}/extensions/{fglrx-,}libglx.so
+
+ # lib.
+ exeinto /usr/$(get_libdir)
+ # Everything except for the libGL.so installed in src_install-libs.
+ 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##*/}
+ ## let's keep also this alternative way ;)
+ #dosym ${soname} /usr/$(get_libdir)/${soname%.[0-9]}
+ dosym ${soname} /usr/$(get_libdir)/$(scanelf -qF "#f%S" ${so})
+ done
+
+ #remove static libs if not wanted
+ use static-libs || rm -rf "${D}"/usr/$(get_libdir)/libfglrx_dm.a
+}
+
+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"
+
+ "${ROOT}"/usr/bin/eselect opengl set --use-old ati
+ "${ROOT}"/usr/bin/eselect opencl set --use-old amd
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-13.1.ebuild b/x11-drivers/ati-userspace/ati-userspace-13.1.ebuild
new file mode 100644
index 00000000..ee860be4
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-13.1.ebuild
@@ -0,0 +1,481 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs versionator
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+MY_V=( $(get_version_components) )
+#RUN="${WORKDIR}/amd-driver-installer-9.00-x86.x86_64.run"
+DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-driver-installer-catalyst-${PV}-linux-x86.x86_64.zip"
+XVBA_SDK_URI="http://developer.amd.com.php53-23.ord1-1.websitetestlink.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz"
+SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}"
+FOLDER_PREFIX="common/"
+IUSE="debug multilib x-multilib static-libs disable-watermark"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+SLOT="1"
+RESTRICT="bindist"
+
+RDEPEND="<=x11-base/xorg-server-1.13.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x-multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+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
+"
+
+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_setup() {
+ # 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 supports only graphic cards based on"
+ elog "Evergreen chipset and newer."
+ elog "This represent 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 reffer 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}
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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 linux-3.7
+ # https://bugs.gentoo.org/show_bug.cgi?id=438516
+ epatch "${FILESDIR}/ati-drivers-vm-reserverd.patch"
+
+ # compile fix for AGP-less kernel, bug #435322
+ epatch "${FILESDIR}"/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
+
+ # Use ACPI_DEVICE_HANDLE wrapper to make driver build on linux-3.8
+ # see https://bugs.gentoo.org/show_bug.cgi?id=448216
+ epatch "${FILESDIR}/ati-drivers-kernel-3.8-acpihandle.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+
+ if use disable-watermark; then
+ ebegin "Disabling watermark"
+ driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
+ sed -i "s/${x/x5b/\x5b}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
+ done
+ eend $? || die "Disabling watermark failed"
+ fi
+}
+
+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_test() { :; } # no tests present
+
+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 && 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
+
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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
+}
+
+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
+
+ "${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-2.20.3"; then
+ ewarn "It is reported that xf86-video-intel-2.20.3 and later cause 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."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/ati-userspace-13.4.ebuild b/x11-drivers/ati-userspace/ati-userspace-13.4.ebuild
new file mode 100644
index 00000000..82d348e4
--- /dev/null
+++ b/x11-drivers/ati-userspace/ati-userspace-13.4.ebuild
@@ -0,0 +1,487 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils multilib toolchain-funcs versionator pax-utils
+
+DESCRIPTION="Ati precompiled drivers for Radeon Evergreen (HD5000 Series) and newer chipsets"
+HOMEPAGE="http://www.amd.com"
+MY_V=( $(get_version_components) )
+#RUN="${WORKDIR}/amd-driver-installer-9.00-x86.x86_64.run"
+SLOT="1"
+[[ "${MY_V[2]}" =~ beta.* ]] && BETADIR="beta/" || BETADIR="linux/"
+if [[ legacy != ${SLOT} ]]; then
+ DRIVERS_URI="http://www2.ati.com/drivers/${BETADIR}amd-catalyst-${PV/_beta/-beta}-linux-x86.x86_64.zip"
+else
+ DRIVERS_URI="http://www2.ati.com/drivers/legacy/amd-driver-installer-catalyst-$(get_version_component_range 1-2)-$(get_version_component_range 3)-legacy-linux-x86.x86_64.zip"
+fi
+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 multilib x-multilib static-libs +disable-watermark pax_kernel"
+
+LICENSE="AMD GPL-2 QPL-1.0"
+KEYWORDS="-* ~amd64 ~x86"
+RESTRICT="bindist test"
+
+RDEPEND="<=x11-base/xorg-server-1.13.49[-minimal]
+ !x11-drivers/ati-drivers:0
+ !x11-apps/ati-drivers-extra
+ >=app-admin/eselect-opengl-1.0.7
+ app-admin/eselect-opencl
+ sys-power/acpid
+ x11-apps/xauth
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXinerama
+ x11-libs/libXrandr
+ x11-libs/libXrender
+ x-multilib? (
+ app-emulation/emul-linux-x86-opengl
+ app-emulation/emul-linux-x86-xlibs
+ )
+ !<x11-drivers/ati-userspace-${PV}
+ !>x11-drivers/ati-userspace-${PV}"
+
+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
+"
+
+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_setup() {
+ # 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 information 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}
+}
+
+src_prepare() {
+ # 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"
+
+ # amdcccle is shipped separately
+ rm "${ARCH_DIR}"/usr/X11R6/bin/amdcccle || die "cannot rm 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 "sed 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, https://bugs.gentoo.org/show_bug.cgi?id=454870
+ use pax_kernel && epatch "${FILESDIR}/const-notifier-block.patch"
+
+ cd "${S}"
+ mkdir extra || die "mkdir failed"
+ cd extra
+ unpack ./../${FOLDER_PREFIX}usr/src/ati/fglrx_sample_source.tgz
+
+ # Get rid of watermark. Oldest known reference:
+ # http://phoronix.com/forums/showthread.php?19875-Unsupported-Hardware-watermark
+ if use disable-watermark; then
+ ebegin "Disabling watermark"
+ driver="${MY_BASE_DIR}"/usr/X11R6/${PKG_LIBDIR}/modules/drivers/fglrx_drv.so
+ for x in $(objdump -d ${driver}|awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
+ sed -i "s/${x/x5b/\x5b}/\x90\x90\x90\x90\x90/g" ${driver} || break 1
+ done
+ eend $? || die "Disabling watermark failed"
+ fi
+}
+
+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_test() { :; } # no tests present
+
+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 && 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
+
+ # 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
+ 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,atiogl.xml,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/*
+
+ # 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
+
+ "${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-2.20.3"; then
+ ewarn "It is reported that xf86-video-intel-2.20.3 and later cause 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."
+ ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000"
+ fi
+}
+
+pkg_prerm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
+
+pkg_postrm() {
+ "${ROOT}"/usr/bin/eselect opengl set --use-old xorg-x11
+}
diff --git a/x11-drivers/ati-userspace/files/amd-drivers-3.2.7.1.patch b/x11-drivers/ati-userspace/files/amd-drivers-3.2.7.1.patch
new file mode 100644
index 00000000..104c8788
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/amd-drivers-3.2.7.1.patch
@@ -0,0 +1,19 @@
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -5797,10 +5797,16 @@ void ATI_API_CALL KCL_fpu_begin(void)
+ #ifdef CONFIG_X86_64
+ kernel_fpu_begin();
+ #else
++#ifndef TS_USEDFPU
++ preempt_disable();
++ if (__thread_has_fpu(current))
++ __save_init_fpu(current);
++#else
+ struct thread_info *cur_task = current_thread_info();
+ preempt_disable();
+ if (cur_task->status & TS_USEDFPU)
+ __save_init_fpu(cur_task->task);
++#endif
+ else
+ clts();
+ #endif
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-12.2-redefine-WARN.patch b/x11-drivers/ati-userspace/files/ati-drivers-12.2-redefine-WARN.patch
new file mode 100644
index 00000000..f4fab432
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-12.2-redefine-WARN.patch
@@ -0,0 +1,42 @@
+--- common/lib/modules/fglrx/build_mod/kcl_debug.h.orig 2012-03-08 19:30:38.195025328 +0100
++++ common/lib/modules/fglrx/build_mod/kcl_debug.h 2012-03-08 19:31:24.976024507 +0100
+@@ -85,8 +85,8 @@
+ #ifdef ERROR
+ #undef ERROR
+ #endif
+-#ifdef WARN
+-#undef WARN
++#ifdef AMD_WARN
++#undef AMD_WARN
+ #endif
+ #ifdef INFO
+ #undef INFO
+@@ -122,7 +122,7 @@
+ {
+ SPECIAL = 0,
+ ERROR ,
+- WARN ,
++ AMD_WARN ,
+ INFO ,
+ INFOEX,
+ TRACE,
+@@ -160,7 +160,7 @@
+ }log_map;
+
+
+-#define DEFAULT_LOG_LEVEL ((U08)(___BIT(INFO) | ___BIT(INFOEX) |___BIT(ERROR) |___BIT(WARN) | ___BIT(TRACE)| ___BIT(SPECIAL) ))
++#define DEFAULT_LOG_LEVEL ((U08)(___BIT(INFO) | ___BIT(INFOEX) |___BIT(ERROR) |___BIT(AMD_WARN) | ___BIT(TRACE)| ___BIT(SPECIAL) ))
+ #define INFO_LOG_LEVEL ((U08)(___BIT(INFO) | ___BIT(INFOEX)))
+ extern const log_map module_log_map[];
+ extern const module_map module_type_map[];
+--- common/lib/modules/fglrx/build_mod/kcl_debug.c.orig 2012-03-08 19:36:18.244019310 +0100
++++ common/lib/modules/fglrx/build_mod/kcl_debug.c 2012-03-08 19:36:36.197018973 +0100
+@@ -69,7 +69,7 @@
+ {
+ {SPECIAL , 'S'},
+ {ERROR , 'E'},
+- {WARN , 'W'},
++ {AMD_WARN , 'W'},
+ {INFO , 'I'},
+ {INFOEX , 'X'},
+ {TRACE , 'T'},
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch b/x11-drivers/ati-userspace/files/ati-drivers-12.9-KCL_AGP_FindCapsRegisters-stub.patch
new file mode 100644
index 00000000..0ea461b8
--- /dev/null
+++ b/x11-drivers/ati-userspace/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-userspace/files/ati-drivers-2.6.33.patch b/x11-drivers/ati-userspace/files/ati-drivers-2.6.33.patch
new file mode 100644
index 00000000..85f9aff7
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-2.6.33.patch
@@ -0,0 +1,140 @@
+--- work.orig/common/lib/modules/fglrx/build_mod/drmP.h
++++ work/common/lib/modules/fglrx/build_mod/drmP.h
+@@ -42,7 +42,11 @@
+ * can build the DRM (part of PI DRI). 4/21/2000 S + B */
+ #include <asm/current.h>
+ #endif /* __alpha__ */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/module.h>
+ #include <linux/kernel.h>
+ #include <linux/miscdevice.h>
+--- work.orig/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ work/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -28,7 +28,11 @@
+ #error Kernel versions older than 2.6.0 are no longer supported by this module.
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+
+ #if !defined(CONFIG_X86)
+ #if !defined(CONFIG_X86_PC)
+@@ -163,8 +167,12 @@
+
+ // For 2.6.18 or higher, the UTS_RELEASE is defined in the linux/utsrelease.h.
+ #ifndef UTS_RELEASE
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/utsrelease.h>
++#else
+ #include <linux/utsrelease.h>
+ #endif
++#endif
+
+ #if defined(__i386__)
+ #ifndef do_div
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_acpi.c
++++ work/common/lib/modules/fglrx/build_mod/kcl_acpi.c
+@@ -15,7 +15,11 @@
+ ****************************************************************************/
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/acpi.h>
+
+ #include "kcl_config.h"
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_agp.c
++++ work/common/lib/modules/fglrx/build_mod/kcl_agp.c
+@@ -31,7 +31,11 @@
+ */
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/pci.h>
+ #include <linux/agp_backend.h>
+ #include <linux/string.h>
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_io.c
++++ work/common/lib/modules/fglrx/build_mod/kcl_io.c
+@@ -37,7 +37,11 @@
+ */
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/poll.h>
+ #include <linux/signal.h>
+ #include <asm/io.h>
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_osconfig.h
++++ work/common/lib/modules/fglrx/build_mod/kcl_osconfig.h
+@@ -20,7 +20,11 @@
+ #define KCL_OSCONFIG_H
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+
+ // Choose modern way to call 32-on-64 IOCTLs if configured in the kernel
+ #if defined(CONFIG_COMPAT) && LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_pci.c
++++ work/common/lib/modules/fglrx/build_mod/kcl_pci.c
+@@ -31,7 +31,11 @@
+ */
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/pci.h>
+
+ #include "kcl_config.h"
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_str.c
++++ work/common/lib/modules/fglrx/build_mod/kcl_str.c
+@@ -30,7 +30,12 @@
+ *
+ */
+
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/string.h>
+ #include <linux/module.h>
+
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_wait.c
++++ work/common/lib/modules/fglrx/build_mod/kcl_wait.c
+@@ -31,7 +31,11 @@
+ */
+
+ #include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
++#include <generated/autoconf.h>
++#else
+ #include <linux/autoconf.h>
++#endif
+ #include <linux/wait.h>
+ #include <linux/highmem.h>
+ #include <linux/sched.h>
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-2.6.34.patch b/x11-drivers/ati-userspace/files/ati-drivers-2.6.34.patch
new file mode 100644
index 00000000..1993d134
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-2.6.34.patch
@@ -0,0 +1,10 @@
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_wait.c 2010-04-13 20:02:46.494496561 +0200
++++ work/common/lib/modules/fglrx/build_mod/kcl_wait.c 2010-04-13 19:52:00.054563389 +0200
+@@ -39,6 +39,7 @@
+ #include <linux/wait.h>
+ #include <linux/highmem.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+
+ #include "kcl_config.h"
+ #include "kcl_wait.h"
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-2.6.35-and-newer.patch b/x11-drivers/ati-userspace/files/ati-drivers-2.6.35-and-newer.patch
new file mode 100644
index 00000000..e1703f34
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-2.6.35-and-newer.patch
@@ -0,0 +1,11 @@
+--- work.orig/common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2010-09-19 11:45:04.922760268 +0200
++++ work/common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2010-09-19 12:04:29.092812959 +0200
+@@ -193,7 +193,7 @@ void ATI_API_CALL KCL_IOCTL_UnregisterCo
+ */
+ void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
+ {
+- return compat_alloc_user_space(size);
++ return arch_compat_alloc_user_space(size);
+ }
+
+ #endif // __x86_64__
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-2.6.36.patch b/x11-drivers/ati-userspace/files/ati-drivers-2.6.36.patch
new file mode 100644
index 00000000..5f8f5845
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-2.6.36.patch
@@ -0,0 +1,26 @@
+--- work.orig/common/lib/modules/fglrx/build_mod/firegl_public.c 2010-08-20 21:51:48.000000000 +0200
++++ work/common/lib/modules/fglrx/build_mod/firegl_public.c 2010-08-20 23:46:37.000000000 +0200
+@@ -320,7 +320,11 @@
+ return firegl_release((KCL_IO_FILE_Handle)filp);
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
++int ip_firegl_ioctl(struct file* filp, unsigned int cmd, unsigned long arg)
++#else
+ int ip_firegl_ioctl(struct inode* inode, struct file* filp, unsigned int cmd, unsigned long arg)
++#endif
+ {
+ return firegl_ioctl((KCL_IO_FILE_Handle)filp, cmd, arg);
+ }
+@@ -407,7 +411,11 @@
+ #endif
+ open: ip_firegl_open,
+ release: ip_firegl_release,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
++ unlocked_ioctl: ip_firegl_ioctl,
++#else
+ ioctl: ip_firegl_ioctl,
++#endif
+ mmap: ip_firegl_mmap,
+
+ write: ip_firegl_write,
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-2.6.37.patch b/x11-drivers/ati-userspace/files/ati-drivers-2.6.37.patch
new file mode 100644
index 00000000..75522b41
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-2.6.37.patch
@@ -0,0 +1,11 @@
+--- work.orig/common/lib/modules/fglrx/build_mod/firegl_public.c 2010-08-20 21:51:48.000000000 +0200
++++ work/common/lib/modules/fglrx/build_mod/firegl_public.c 2010-08-20 23:46:37.000000000 +0200
+@@ -5094,7 +5094,7 @@
+ unsigned int ATI_API_CALL KAS_Mutex_Initialize(void* hMutex)
+ {
+ kasMutex_t* mutex_obj = (kasMutex_t*)hMutex;
+- init_MUTEX(&(mutex_obj->mutex));
++ sema_init(&(mutex_obj->mutex),1);
+ return 1;
+ }
+
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-2.6.38.patch b/x11-drivers/ati-userspace/files/ati-drivers-2.6.38.patch
new file mode 100644
index 00000000..1ecafece
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-2.6.38.patch
@@ -0,0 +1,59 @@
+Description: Add Linux 2.6.38 support
+ The following commit renamed acquire_console_sem to console_lock and
+ release_console_sem to console_unlock on the Linux kernel:
+ http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=ac751efa6a0d70f2c9daef5c7e3a92270f5c2dff
+Author: Miguel Colon <debian.micove@gmail.com>
+Forwarded: no
+Last-Update: 2011-02-01
+
+--- fglrx-driver-11-1.orig/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ fglrx-driver-11-1/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -850,7 +850,12 @@ static int fglrx_pci_suspend(struct pci_
+ * happen much less frequent then without this workaround.
+ */
+ if (state == PM_EVENT_SUSPEND)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
++ console_lock();
++#else
+ acquire_console_sem();
++#endif
++
+
+ if (firegl_cail_powerdown(privdev, state))
+ ret = -EIO;
+@@ -872,7 +877,11 @@ static int fglrx_pci_suspend(struct pci_
+ }
+
+ if (state == PM_EVENT_SUSPEND)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
++ console_unlock();
++#else
+ release_console_sem();
++#endif
+
+ KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, ret, NULL);
+
+@@ -896,7 +905,11 @@ static int fglrx_pci_resume(struct pci_d
+ if (PMSG_EVENT(pdev->dev.power.power_state) == 0) return 0;
+
+ if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
++ console_lock();
++#else
+ acquire_console_sem();
++#endif
+
+ #ifdef FIREGL_USWC_SUPPORT
+ // Restore the PAT after resuming from S3 or S4.
+@@ -921,7 +934,11 @@ static int fglrx_pci_resume(struct pci_d
+ firegl_cail_powerup(privdev);
+
+ if (PMSG_EVENT(pdev->dev.power.power_state) == PM_EVENT_SUSPEND)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
++ console_unlock();
++#else
+ release_console_sem();
++#endif
+
+ PMSG_EVENT(pdev->dev.power.power_state) = 0;
+ KCL_DEBUG_TRACEOUT(FN_FIREGL_ACPI, 0, NULL);
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-CVE-2010-3081-fix.patch b/x11-drivers/ati-userspace/files/ati-drivers-CVE-2010-3081-fix.patch
new file mode 100644
index 00000000..5a71da10
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-CVE-2010-3081-fix.patch
@@ -0,0 +1,60 @@
+/****************************************************************************
+ * *
+ * Copyright 1999-2005 ATI Technologies Inc., Markham, Ontario, CANADA. *
+ * All Rights Reserved. *
+ * *
+ * Your use and or redistribution of this software in source and \ or *
+ * binary form, with or without modification, is subject to: (i) your *
+ * ongoing acceptance of and compliance with the terms and conditions of *
+ * the ATI Technologies Inc. software End User License Agreement; and (ii) *
+ * your inclusion of this notice in any version of this software that you *
+ * use or redistribute. A copy of the ATI Technologies Inc. software End *
+ * User License Agreement is included with this software and is also *
+ * available by contacting ATI Technologies Inc. at http://www.ati.com *
+ * *
+ ****************************************************************************/
+
+--- common/lib/modules/fglrx/build_mod/kcl_ioctl.c.orig 2010-09-01 16:05:31.000000000 +0200
++++ common/lib/modules/fglrx/build_mod/kcl_ioctl.c 2010-09-23 01:41:46.711844303 +0200
+@@ -35,6 +35,9 @@
+
+ #ifdef __x86_64__
+ # include "asm/compat.h"
++# if ARCH_COMPAT_ALLOC_USER_SPACE
++# include "linux/compat.h"
++# endif
+ # if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+ # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12)
+ # include "linux/ioctl32.h"
+@@ -193,7 +196,20 @@
+ */
+ void* ATI_API_CALL KCL_IOCTL_AllocUserSpace32(long size)
+ {
+- return compat_alloc_user_space(size);
++ void __user *ptr;
++
++ /* If size would occupy more than half of the entire compat space... */
++ if (unlikely(size > (((compat_uptr_t)~0) >> 1)))
++ return NULL;
++#if ARCH_COMPAT_ALLOC_USER_SPACE
++ ptr = arch_compat_alloc_user_space(size);
++#else
++ ptr = compat_alloc_user_space(size);
++#endif
++ if (unlikely(!access_ok(VERIFY_WRITE, ptr, size)))
++ return NULL;
++
++ return ptr;
+ }
+
+ #endif // __x86_64__
+--- common/lib/modules/fglrx/build_mod/2.6.x/Makefile.orig 2010-09-01 16:05:31.000000000 +0200
++++ common/lib/modules/fglrx/build_mod/2.6.x/Makefile 2010-09-23 01:47:46.533415019 +0200
+@@ -66,6 +66,7 @@
+ -DFGL_GART_RESERVED_SLOT \
+ -DFGL_LINUX253P1_VMA_API \
+ -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \
++ -DARCH_COMPAT_ALLOC_USER_SPACE=$(ARCH_COMPAT_ALLOC_USER_SPACE) \
+
+ ifeq ($(KERNELRELEASE),)
+ # on first call from remote location we get into this path
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-do_mmap.patch b/x11-drivers/ati-userspace/files/ati-drivers-do_mmap.patch
new file mode 100644
index 00000000..04248eb7
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-do_mmap.patch
@@ -0,0 +1,50 @@
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-06-15 18:30:13.483762070 +0200
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-06-17 17:47:36.543041869 +0200
+@@ -2106,6 +2106,12 @@
+ }
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
++# define NO_DO_MMAP
++# define do_mmap(a,b,c,d,e,f) vm_mmap(a, b, c, d, e, f)
++# define do_munmap(a,b,c) vm_munmap(b, c)
++#endif
++
+ unsigned long ATI_API_CALL KCL_MEM_AllocLinearAddrInterval(
+ KCL_IO_FILE_Handle file,
+ unsigned long addr,
+@@ -2117,10 +2123,13 @@
+
+ flags = MAP_SHARED;
+ prot = PROT_READ|PROT_WRITE;
+-
++#ifdef NO_DO_MMAP
++ vaddr = (void *) vm_mmap(file, 0, len, prot, flags, pgoff);
++#else
+ down_write(&current->mm->mmap_sem);
+ vaddr = (void *) do_mmap(file, 0, len, prot, flags, pgoff);
+ up_write(&current->mm->mmap_sem);
++#endif
+ if (IS_ERR(vaddr))
+ return 0;
+ else
+@@ -2131,7 +2140,9 @@
+ {
+ int retcode = 0;
+
++#ifndef NO_DO_MMAP
+ down_write(&current->mm->mmap_sem);
++#endif
+ #ifdef FGL_LINUX_RHEL_MUNMAP_API
+ retcode = do_munmap(current->mm,
+ addr,
+@@ -2142,7 +2153,9 @@
+ addr,
+ len);
+ #endif
++#ifndef NO_DO_MMAP
+ up_write(&current->mm->mmap_sem);
++#endif
+ return retcode;
+ }
+
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-fix_compilation-bug-297322.patch b/x11-drivers/ati-userspace/files/ati-drivers-fix_compilation-bug-297322.patch
new file mode 100644
index 00000000..e2af915a
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-fix_compilation-bug-297322.patch
@@ -0,0 +1,25 @@
+--- common/lib/modules/fglrx/build_mod/firegl_public.c
++++ common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -1441,7 +1441,9 @@
+ todo !!!
+ #endif
+
+-unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old,
++void __cmpxchg_wrong_size(void) {}
++
++unsigned long ATI_API_CALL __ke__cmpxchg(volatile unsigned long *ptr, unsigned long old,
+ unsigned long new, int size)
+ {
+ #ifndef __HAVE_ARCH_CMPXCHG
+--- common/lib/modules/fglrx/build_mod/firegl_public.h
++++ common/lib/modules/fglrx/build_mod/firegl_public.h
+@@ -441,7 +441,8 @@
+ extern void ATI_API_CALL KCL_SIGNAL_BlockAll(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask);
+ extern void ATI_API_CALL KCL_SIGNAL_UnblockAll(void);
+
+-extern unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old,
++extern void __cmpxchg_wrong_size(void);
++extern unsigned long ATI_API_CALL __ke__cmpxchg(volatile unsigned long *ptr, unsigned long old,
+ unsigned long new, int size);
+
+ #define __ke_cmpxchg(ptr,o,n) \
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-kernel-3.8-acpihandle.patch b/x11-drivers/ati-userspace/files/ati-drivers-kernel-3.8-acpihandle.patch
new file mode 100644
index 00000000..bdff4fb7
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-kernel-3.8-acpihandle.patch
@@ -0,0 +1,15 @@
+--- common/lib/modules/fglrx/build_mod/kcl_acpi.c 2012-07-04 21:43:47.000000000 +0200
++++ common/lib/modules/fglrx/build_mod/kcl_acpi.c.new 2012-12-23 11:25:38.000000000 +0100
+@@ -775,11 +775,7 @@
+ unsigned int ATI_API_CALL KCL_ACPI_GetHandles(kcl_match_info_t *pInfo)
+ {
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12)
+- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,19)
+- pInfo->video_handle = pInfo->pcidev->dev.archdata.acpi_handle;
+- #else
+- pInfo->video_handle = pInfo->pcidev->dev.firmware_data;
+- #endif
++ pInfo->video_handle = DEVICE_ACPI_HANDLE(&pInfo->pcidev->dev);
+ if ( pInfo->video_handle &&
+ (KCL_ACPI_videoDevice(pInfo->video_handle) != KCL_ACPI_OK) )
+ {
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-old_rsp.patch b/x11-drivers/ati-userspace/files/ati-drivers-old_rsp.patch
new file mode 100644
index 00000000..0456bd6b
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-old_rsp.patch
@@ -0,0 +1,24 @@
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-05-26 18:33:25.044695179 +0200
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2012-05-26 18:28:39.692699095 +0200
+@@ -4154,7 +4154,7 @@
+ {
+ unsigned int p;
+ KCL_DEBUG5(FN_FIREGL_KAS, "%d\n", level_init);
+- for_each_cpu_mask(p, cpu_possible_map)
++ for_each_possible_cpu(p)
+ {
+ KCL_DEBUG1(FN_FIREGL_KAS,"Setting initial execution level for CPU # %d\n", p);
+ preempt_disable();
+--- 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); \ No newline at end of file
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-vm-reserverd.patch b/x11-drivers/ati-userspace/files/ati-drivers-vm-reserverd.patch
new file mode 100644
index 00000000..08045a65
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-vm-reserverd.patch
@@ -0,0 +1,12 @@
+--- common/lib/modules/fglrx/build_mod/firegl_public.c 2012-10-18 00:29:21.778369464 +0200
++++ common/lib/modules/fglrx/build_mod/firegl_public.c.new 2012-10-18 00:30:39.647416026 +0200
+@@ -222,6 +222,10 @@
+ #define preempt_enable()
+ #endif
+
++#ifndef VM_RESERVED
++#define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP)
++#endif
++
+ // ============================================================
+ /* globals */
diff --git a/x11-drivers/ati-userspace/files/ati-drivers-x32_something_something.patch b/x11-drivers/ati-userspace/files/ati-drivers-x32_something_something.patch
new file mode 100644
index 00000000..d37c1191
--- /dev/null
+++ b/x11-drivers/ati-userspace/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-userspace/files/ati-drivers-xen.patch b/x11-drivers/ati-userspace/files/ati-drivers-xen.patch
new file mode 100644
index 00000000..a1b88df7
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-drivers-xen.patch
@@ -0,0 +1,62 @@
+--- common/lib/modules/fglrx/build_mod/firegl_public.c 2008-12-09 15:17:27.000000000 +0000
++++ common/lib/modules/fglrx/build_mod/firegl_public.c 2008-12-09 15:12:34.000000000 +0000
+@@ -31,6 +31,9 @@
+ #include <linux/autoconf.h>
+
+ #if !defined(CONFIG_X86_PC)
++#if !defined(CONFIG_X86_PC_XEN)
++#if !defined(CONFIG_X86_XEN)
++#if !defined(CONFIG_X86_64_XEN)
+ #if !defined(CONFIG_X86_64)
+ #if !defined(CONFIG_X86_VOYAGER)
+ #if !defined(CONFIG_X86_NUMAQ)
+@@ -47,6 +50,9 @@
+ #endif
+ #endif
+ #endif
++#endif
++#endif
++#endif
+
+ /* The dirty-page-tracking patch included in NLD 9 SMP kernels defines
+ * a static inline function that uses a GPL-only symbol in a header
+--- common/lib/modules/fglrx/build_mod/firegl_public.h 2008-12-09 15:17:27.000000000 +0000
++++ common/lib/modules/fglrx/build_mod/firegl_public.h 2008-12-09 15:15:45.000000000 +0000
+@@ -30,9 +30,13 @@
+ #endif
+
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
+-
++#ifdef CONFIG_XEN
++#define REMAP_PAGE_RANGE_FN io_remap_pfn_range
++#define REMAP_PAGE_RANGE_STR "io_remap_pfn_range"
++#else
+ #define REMAP_PAGE_RANGE_FN remap_pfn_range
+ #define REMAP_PAGE_RANGE_STR "remap_pfn_range"
++#endif
+ #define REMAP_PAGE_RANGE_OFF(offset) ((offset) >> PAGE_SHIFT)
+
+ #else /* LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,9) */
+@@ -43,13 +47,21 @@
+
+ #endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9) */
+
++#ifdef CONFIG_XEN
++#define REMAP_PAGE_RANGE(vma,offset) \
++ REMAP_PAGE_RANGE_FN((vma), \
++ (vma)->vm_start, \
++ REMAP_PAGE_RANGE_OFF(offset), \
++ (vma)->vm_end - (vma)->vm_start, \
++ (vma)->vm_page_prot)
++#else
+ #define REMAP_PAGE_RANGE(vma,offset) \
+ REMAP_PAGE_RANGE_FN(FGL_VMA_API_PASS \
+ (vma)->vm_start, \
+ REMAP_PAGE_RANGE_OFF(offset), \
+ (vma)->vm_end - (vma)->vm_start, \
+ (vma)->vm_page_prot)
+-
++#endif
+
+ /* Page table macros */
+
diff --git a/x11-drivers/ati-userspace/files/ati-powermode-opt-path-2.patch b/x11-drivers/ati-userspace/files/ati-powermode-opt-path-2.patch
new file mode 100644
index 00000000..f5a35a30
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/ati-powermode-opt-path-2.patch
@@ -0,0 +1,42 @@
+diff -ur common.orig/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh
+--- common.orig/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh 2006-07-28 04:22:36.000000000 +0100
++++ common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh 2006-08-04 12:19:42.000000000 +0100
+@@ -4,6 +4,8 @@
+ # Control script for ACPI lid state and AC adapter state
+ #
+
++aticonfig='/opt/bin/aticonfig'
++
+ getXuser() {
+ user=`finger| 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"
+ 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=$($aticonfig --lsp | grep 'default state' | cut -c 3)"
+ fi
+ fi
+
diff --git a/x11-drivers/ati-userspace/files/ati-powermode-opt-path-3.patch b/x11-drivers/ati-userspace/files/ati-powermode-opt-path-3.patch
new file mode 100644
index 00000000..106e67ee
--- /dev/null
+++ b/x11-drivers/ati-userspace/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-userspace/files/atieventsd.init b/x11-drivers/ati-userspace/files/atieventsd.init
new file mode 100644
index 00000000..73139ce3
--- /dev/null
+++ b/x11-drivers/ati-userspace/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
+# $Header: /var/cvsroot/gentoo-x86/x11-drivers/ati-drivers/files/atieventsd.init,v 1.3 2007/05/18 23:58:01 marienz Exp $
+
+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-userspace/files/const-notifier-block.patch b/x11-drivers/ati-userspace/files/const-notifier-block.patch
new file mode 100644
index 00000000..ba1fdb2b
--- /dev/null
+++ b/x11-drivers/ati-userspace/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-userspace/files/kernel/2.6.31-fglrx_find_task_by_vpid.patch b/x11-drivers/ati-userspace/files/kernel/2.6.31-fglrx_find_task_by_vpid.patch
new file mode 100644
index 00000000..1d4e030b
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/kernel/2.6.31-fglrx_find_task_by_vpid.patch
@@ -0,0 +1,19 @@
+--- common/lib/modules/fglrx/build_mod/firegl_public.c.orig 2009-09-10 20:14:10.302938534 +0200
++++ common/lib/modules/fglrx/build_mod/firegl_public.c 2009-09-10 20:16:21.828943780 +0200
+@@ -183,6 +183,7 @@
+ #include <linux/string.h>
+ #include <linux/gfp.h>
+ #include <linux/swap.h>
++#include <linux/pid.h>
+
+ #include "firegl_public.h"
+ #include "kcl_osconfig.h"
+@@ -1315,7 +1316,7 @@
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
+ p = find_task_by_pid( pid );
+ #else
+- p = find_task_by_vpid( pid );
++ p = pid_task( pid, PIDTYPE_PID );
+ #endif
+ if (p)
+ {
diff --git a/x11-drivers/ati-userspace/files/kernel/2.6.32-9.11-fix_compilation.patch b/x11-drivers/ati-userspace/files/kernel/2.6.32-9.11-fix_compilation.patch
new file mode 100644
index 00000000..38519d76
--- /dev/null
+++ b/x11-drivers/ati-userspace/files/kernel/2.6.32-9.11-fix_compilation.patch
@@ -0,0 +1,37 @@
+--- work/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ work.new/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -1441,7 +1441,9 @@
+ todo !!!
+ #endif
+
+-unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old,
++void __cmpxchg_wrong_size(void) {}
++
++unsigned long ATI_API_CALL __ke__cmpxchg(volatile unsigned long *ptr, unsigned long old,
+ unsigned long new, int size)
+ {
+ #ifndef __HAVE_ARCH_CMPXCHG
+--- work/common/lib/modules/fglrx/build_mod/firegl_public.h
++++ work.new/common/lib/modules/fglrx/build_mod/firegl_public.h
+@@ -441,7 +441,8 @@
+ extern void ATI_API_CALL KCL_SIGNAL_BlockAll(int (*notifier)(void *priv), void *pPriv, __ke_sigset_t *pSigMask);
+ extern void ATI_API_CALL KCL_SIGNAL_UnblockAll(void);
+
+-extern unsigned long ATI_API_CALL __ke__cmpxchg(volatile void *ptr, unsigned long old,
++extern void __cmpxchg_wrong_size(void);
++extern unsigned long ATI_API_CALL __ke__cmpxchg(volatile unsigned long *ptr, unsigned long old,
+ unsigned long new, int size);
+
+ #define __ke_cmpxchg(ptr,o,n) \
+--- work/common/lib/modules/fglrx/build_mod/kcl_io.c
++++ work.new/common/lib/modules/fglrx/build_mod/kcl_io.c
+@@ -37,8 +37,9 @@
+ */
+
+ #include <linux/version.h>
+ #include <linux/autoconf.h>
+ #include <linux/poll.h>
++#include <linux/signal.h>
+ #include <asm/io.h>
+
+ #include "kcl_config.h"
diff --git a/x11-drivers/ati-userspace/files/switchlibGL b/x11-drivers/ati-userspace/files/switchlibGL
new file mode 100644
index 00000000..a6aa4fce
--- /dev/null
+++ b/x11-drivers/ati-userspace/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