summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>2013-06-19 15:32:50 +0000
committerChí-Thanh Christopher Nguyễn <chithanh@gentoo.org>2013-06-19 15:32:50 +0000
commitfe1de9bcb17148459b9a06a5688a2e0fdae1c453 (patch)
tree0b5698793d7dd8dbbe81e91630ff04beea53c0f7 /media-libs/mesa
parentInitial commit, import of alexxy's ebuild from thhe x11 overlay. (diff)
downloadhistorical-fe1de9bcb17148459b9a06a5688a2e0fdae1c453.tar.gz
historical-fe1de9bcb17148459b9a06a5688a2e0fdae1c453.tar.bz2
historical-fe1de9bcb17148459b9a06a5688a2e0fdae1c453.zip
New snapshot. Add opencl support, bug #439018.
Package-Manager: portage-2.1.12.2/cvs/Linux x86_64
Diffstat (limited to 'media-libs/mesa')
-rw-r--r--media-libs/mesa/ChangeLog8
-rw-r--r--media-libs/mesa/Manifest26
-rw-r--r--media-libs/mesa/mesa-9.2_pre20130619.ebuild463
-rw-r--r--media-libs/mesa/metadata.xml1
4 files changed, 475 insertions, 23 deletions
diff --git a/media-libs/mesa/ChangeLog b/media-libs/mesa/ChangeLog
index 6a403ce7fd84..dfb8f5a9c2cd 100644
--- a/media-libs/mesa/ChangeLog
+++ b/media-libs/mesa/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for media-libs/mesa
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.487 2013/06/09 16:00:08 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.488 2013/06/19 15:32:40 chithanh Exp $
+
+*mesa-9.2_pre20130619 (19 Jun 2013)
+
+ 19 Jun 2013; Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org>
+ +mesa-9.2_pre20130619.ebuild, metadata.xml:
+ New snapshot. Add opencl support, bug #439018.
09 Jun 2013; Agostino Sarubbo <ago@gentoo.org> mesa-9.1.2-r1.ebuild:
Stable for sh, wrt bug #463430
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index 63b491b17927..32078b183b98 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,6 +1,3 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA512
-
AUX eselect-mesa.conf.7.10 1670 SHA256 3ff15cedc353feeb2da450533c2ea2efc33ed1c8434a7b3037999c4965907149 SHA512 c62679e2427b6e922a7c04dec7afe1eddb4f8ba255735479338ebaf6da7db4ad7c6c916a3cf62da8bf8d2c0ceb60b6d591f8e878d4add9b7f63ff8121bb610a2 WHIRLPOOL 5d3522f8715ab62c9a1b4a96031db63734a98bb9e8a1cc722d20e018e7eedb3ffac92bb7c727bff1f58e216476b0e20552373b8155a51954f3d9af704e830782
AUX eselect-mesa.conf.7.11 1670 SHA256 448d08e97e931563aa2e33f22feeaf911caf9a2eb9fd7b446485311d1dcc1225 SHA512 0a8178006f64d2f2d41f0f1ffbceab959ad66ac9142e2f74b593405041ade112b68fbabd54915c21dbf6bd7e3564499e6f76c348e8af632d751409b070420481 WHIRLPOOL 5df8041475f506ed544afb4b7ce94a31b4974c6cd26fd5054a6c29dda26cbec1694d60b68e975106d0797ff857764a39ec820da000e454be34181112b201ae36
AUX eselect-mesa.conf.8.0.1 1622 SHA256 a7a4306084885dc624304a8893ca4f5645f7f1fe31322f9fb663e5a103f69221 SHA512 58eacf1304ebaa0116ea3c53fafdddb8c94738e31daad8546ac33b46dc51b81a6bccb48c167afe792c7fd41ca5054d8e66123f524b0623ad3e603ed4872f9dc4 WHIRLPOOL 7af55e3cb9448f4b3b4c463443e078a5559588371767e10b5890918d84bfeb16797f11ffabf9aaa205db70c550c5dfc18fe709b3a2e00746d93d4bf4944124b1
@@ -28,6 +25,7 @@ DIST mesa-9.1-gentoo-patches-03.tar.bz2 2416 SHA256 0d149d6f414c3b632e6903a11aee
DIST mesa-9.1-gentoo-patches-05.tar.bz2 3301 SHA256 975ff594dc1eb2aa46f8079b3bd3e2e34d08c47c6c76c66ece6c967c40278d63 SHA512 5f4393d09108d520130e7bc5e0513a73581b16682ad9826f7828a1aa052ca0f2841f9b1fcae43cc108f0ba6c54ae131504603f2e422ca3b71aceb337019a2256 WHIRLPOOL 6e640d2d660e9dd669497f378810c12913e64a2623a66a31e73cdf3e55a3d71c94a039f7e3c4ab8aaf23720ab85e7dbf7649cac7d64ab9cd5ff2f24840d31b02
DIST mesa-9.2_pre20130515.tar.xz 4880352 SHA256 bf563bbc93f03e4912268d403c040c4213f7ab4b4628198400d90f13dc84945c SHA512 a98c03fd3801dbfef1551821a9e837731dfce75158fd852d3ae8313dd5e38da3977b603d287e8128caa84518aec0a46104fd643338f60797572397177489fd85 WHIRLPOOL 7bbaba58fec30e55d050e7a7ea08a479d4ccc3befa6ca4bb2532134000eac45079fe5aae293b36c02d1ae5b7398fd6e0ad0cb3be759596c6321e76eae498b6b4
DIST mesa-9.2_pre20130528.tar.xz 4891152 SHA256 46f37afb32ed6c05bd624af830353b2288380e08499d30c09fd551e5df38c447 SHA512 d32385b09a59325c97eb92ce2d5c8413a45ee835aaf8134c18790d53fd679f303a52622629cc558a228f3fe1f19cd382dd97a524881a59ca03c2616c54b40886 WHIRLPOOL 91e8631ed85c85c2077920f9f6cb4befb809c5b246ea3f37966b29f0aedd408dbd7f2cb149262fbd415be6c5f8fd5e091b679d7e5dafb3e8991009301368af26
+DIST mesa-9.2_pre20130619.tar.xz 4997368 SHA256 8c67352d253bac00ba0e190960f50d7c9012111e03ed8d2bba4f0ce45b3a7552 SHA512 90ecb2b60424542546d8e61af8b433e918af518c4c460f51d287961e4178ebb0b46e16e035d9b2a6e50a3f3d3071b7125387694d41f50e09347a60e303b467c6 WHIRLPOOL 14b2d9f77de70e2cd7f26cc8d2a1160f244c709184c5987363fc2de18abf14b3bdf7a5b5e059c41e477b09b451ed60e0d4fd66fe3b15d42d536e73345b9a85c4
EBUILD mesa-7.10.3.ebuild 9838 SHA256 f88db0ff29bc43c9f51249306a3fc0eae5f6209b7bdff15cae8d0286906e4811 SHA512 4ab516b5150eb4e1dd4845c92c1e0473c4343cfd00627a8ee4061e391e5419de4e5229b57b2443d8ae38bc7a3cb51819d3628b7c7aeab35bd70d08e2009c6435 WHIRLPOOL 6a55bf7e5f09b18df524923f263db04c55f61714696ce3981a145b0d61e06cd2b94e83b94b6aa359dbafea381e2c58a4f5f4e3fa9515876967c3ab609e3db116
EBUILD mesa-7.11.2.ebuild 9988 SHA256 e50e8ef022edd0a19b6463be04be8bd2e91859bf4c064003681faeb94ab2e438 SHA512 936df08a1fbfddcf13c33a9c2cf762644d0b8fc18136fa59840b5c50657ba2177397b6ee53329a3009abb8270e7c725011231fc45724b158cba078899705cc27 WHIRLPOOL 594f01c08f8488054a1ce886e518b2feec0b542914289193967b64d77cacb8c5664d4225408c353e26eec6655107be53071370a04cfa0ddef33775f93fe5b55d
EBUILD mesa-8.0.4-r1.ebuild 10866 SHA256 5c32dea8910a194a5f68fd6cbbd67a2b2228d4b8d9566e4e69fe843c1a4e24c8 SHA512 81cbf5cf54519d725054466315284bc00bf1d66b12f32449c10f97f6f3d10fbbc7209929103982e8c438376d438093e52a4ee19ea7f8e3bc026bafbf3e355893 WHIRLPOOL 0b6c6e9d4f9ed99684f3a9113eefee06e0af0832350dd6a664dc723703178047611404081fcf968322e5e34cb3d724bf5cdba9dc2fca43ff1e941b14395141cc
@@ -41,22 +39,6 @@ EBUILD mesa-9.1.3.ebuild 11018 SHA256 2f0d8172e8862399edbadd91bf79c6459f838c2c15
EBUILD mesa-9.1.ebuild 10988 SHA256 97e819e9c0b614157c773b9d0209ff66b1a3af4a28a7437f4eb5b1feb44e981f SHA512 71c1654787e4b6cdc925eea13901687c8ca7333766c629e236ba3deb46eb0ff063dc8621a0d3fe164f5d3b80381efaa2ff8ccf40268b4ca346da115d903a1516 WHIRLPOOL b6e8fe21ed317b23e24b2c9e2693820906e74c3593f1b1d0f9f65cb3154a2d6dac96555616be629be8ad3a059ea955198703fa91c1dfb676187bae173351f8a9
EBUILD mesa-9.2_pre20130515.ebuild 11022 SHA256 8a6c728eb4814762511c095133693c67e6cdb4d8a660df1ff3c6eef117baf412 SHA512 c48bdeedf222ce0478456272747711fcb8093f0163638018e7d211413d6e2d16c152dc5234cb3ff778ba6426f9596c53722a175ae754f152121a77bdb0a7ea89 WHIRLPOOL 97853466baa061a6a291aca8ec09bed14dd9c29c5c70f2341f5af1dd3d1605cbd861ea1eca86028429bbe1122318dc2936cd4dc406fdabbb7d8739b9df8903e5
EBUILD mesa-9.2_pre20130528.ebuild 11245 SHA256 40ec0bbef3d3aac874f786e87171715405dd58bb5ba89676fee15e9ddb3cce1f SHA512 61324c495002d3bee89896946eb311ab9a10da7cefd30df5376b8a3c64dfec2b91ab707c20647e27207fefc1aa5c9d50d810b78549c27a6513a23eb2e890fb1a WHIRLPOOL c34865dfefd3c46bd1000552832a1e6766ab6b721cf2a20099ca29d4791c5b28b9f5f7e1fcbc69e05848b78b3027358f1fba1e8d6bc2341127eec006ff3cacd0
-MISC ChangeLog 78821 SHA256 88b8d7458ad209601ba4253ad121e6c8d90e17515ec757d6fb1f3b39122556e3 SHA512 cbeca0df3422471b23f52d5b8ba1d4f2883ae9f24e0902d9dd2c7894b2b84968ed8a8e14352a97758cf5a5c679d649d83c74a36e493782598c200687a48a438a WHIRLPOOL d0e5b29cd14a27f4e7d80bb2d05456c3d38866451e5d02ba7be0833206bcd76aa8e3a40c19e1057fc6446017d6018e59eb71c8c73b461933397a7cd36d00ed08
-MISC metadata.xml 1986 SHA256 7a518f3eb77d4b51d4dc5c5cd347bebdc2c849e43d17d1057afeae6be2dc13ad SHA512 1dccfd236b8b8e39560d5056281e774979cd8e2299623b34c2e0f0d9e1ae84906932cfbc0ab15bdd1effc1d82cb484ca4d23acf7cd8d849a33a82f9ee2c60b90 WHIRLPOOL 14e19a3782775f7ca600526f1bf852ed55e328585b7e095a8ab239697ca351f812bf914205166faf714420d179ac7e36b6d1b10fe74188a028c580d40640e31c
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.19 (GNU/Linux)
-
-iQIcBAEBCgAGBQJRtKXbAAoJELp701BxlEWfz38QAJbn3mQ386nYaw3vbYyh2d+i
-/ZelWs8/mSeCRL5vFkab4cJVq5XIdhl6e+NZTSEahYT6d7CKAgjMY9VUt8OZ9vxe
-sqPySu7zgtxZZhS8LTzGTWUsDhoR2CCzVClnup2zPu0pJ+4MNlf66GRrFz4EIu+S
-7ziqfCamFfjtb/2y4qwrB8mHOH3JxB6U0P1FxBSeC/GDq3QpXVWMmv/C0tNxpX82
-ZVmtXOxhp7aYjhAZm2AxiA692FtVdFtLMvx/Qs1go16CvGW/spwVsKNB3au5U417
-gFoR4FZLbaxs+kyxUwoUnCJ9Ha8Wjtt3wkjA07z/Dgv68eTyL/7eMJ7KZLXupOs/
-kyGdg6s5G7PnbMfjaxn/LwB8OZSjYODl39XNvSzc0mn6c2IJaFPRUXmEB2WTswnS
-dCeC4dYyBvFHk9QKCIGEn6x9TK8NDTfrqzRyv1NlwW3UqcRnQcdBFDOWncCtl6Oj
-aBVyZLrpkGbeRZP/FjF1ZokM7YaYOPcOPIS+8OiET76vEw+6GWxjEIO6oA85g0EX
-gTJIq58Z94EG6Iak8zIHqkJC7Ccese1zP1peL1AVg646YKDK+SHjKHpuEuq6Wc/S
-aI9Dam11Lx5C/I4a+v44eOH2/IWUy7lIeZUldM6UK2/FFfq9pFH8IEs8Vkn8zfU7
-nB01bqgdVwJHQXJbNozB
-=QtaU
------END PGP SIGNATURE-----
+EBUILD mesa-9.2_pre20130619.ebuild 12223 SHA256 844742d4b2c985737dc1a3b5fb0e2780de7e15be5a8c05c2e126813b924dc97c SHA512 11beddd4541a2cb627439464a34be9725d42d2d842069d185a7bb1f1baa34fa47127e08cdcab44d366ef0dd62169fcc2fe1719cef3916923852553ea64ebf6fb WHIRLPOOL d6edaf61bebe8d5ad03c5339b0e51f56d2c522e8b4fb1dece8e1c908ca8187e984df51dae6e13f03fd573e9f1925f4b4282ab3ef3e947ea00be9a7d4ae3f508b
+MISC ChangeLog 79028 SHA256 117fac082c7839b989309074b994a735d420d0a4e8f11c12e57749a05357d35a SHA512 05f714c311017b3b1c655b8cf7caf4ab899d1c9afef2d88f95a2468304568bab37dc0d923e6fef085769359e3289ddd3b9ce45aa7f91515ae4229c795e7a093f WHIRLPOOL 90e0a0a31c44730b2453dc3bb4e0830bef4cce5a7e4eb243c60ee3c633c1b179a61ce992dc3755eeaab8d79fc25387328f11104f90642db1f09f61aac6331ab1
+MISC metadata.xml 2062 SHA256 ff16fa963c95af756ccd96b5bfb746d5c812085f1749281d8a739f5367d57918 SHA512 5a592c8417c253a55f636e98a4cb0a59f7678dd48a1a4a2886fff376f6596ae70c693810cfc20096d06b8e163d2fbd21909cd37ad6cfa5c3897bf3543e27e777 WHIRLPOOL 5fcd8ff3c0471330a3a8f3f1f536f8a5e88ecda43375b6d23a8e358494c56f8cb6a36260012b9506b4126e9efb5653cee8e91aa746e4a27902a0343745b5310e
diff --git a/media-libs/mesa/mesa-9.2_pre20130619.ebuild b/media-libs/mesa/mesa-9.2_pre20130619.ebuild
new file mode 100644
index 000000000000..30818ecd3c3f
--- /dev/null
+++ b/media-libs/mesa/mesa-9.2_pre20130619.ebuild
@@ -0,0 +1,463 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-9.2_pre20130619.ebuild,v 1.1 2013/06/19 15:32:40 chithanh Exp $
+
+EAPI=5
+
+EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
+
+if [[ ${PV} = 9999* ]]; then
+ GIT_ECLASS="git-2"
+ EXPERIMENTAL="true"
+fi
+
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit base autotools multilib flag-o-matic python-single-r1 toolchain-funcs ${GIT_ECLASS}
+
+OPENGL_DIR="xorg-x11"
+
+MY_PN="${PN/m/M}"
+MY_P="${MY_PN}-${PV/_/-}"
+MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
+
+FOLDER="${PV/_rc*/}"
+
+DESCRIPTION="OpenGL-like graphic library for Linux"
+HOMEPAGE="http://mesa3d.sourceforge.net/"
+
+#SRC_PATCHES="mirror://gentoo/${P}-gentoo-patches-01.tar.bz2"
+if [[ $PV = 9999* ]]; then
+ SRC_URI="${SRC_PATCHES}"
+else
+ SRC_URI="mirror://gentoo/${P}.tar.xz
+ ${SRC_PATCHES}"
+fi
+
+# The code is MIT/X11.
+# GLES[2]/gl[2]{,ext,platform}.h are SGI-B-2.0
+LICENSE="MIT SGI-B-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+
+INTEL_CARDS="i915 i965 ilo intel"
+RADEON_CARDS="r100 r200 r300 r600 radeon radeonsi"
+VIDEO_CARDS="${INTEL_CARDS} ${RADEON_CARDS} freedreno nouveau vmware"
+for card in ${VIDEO_CARDS}; do
+ IUSE_VIDEO_CARDS+=" video_cards_${card}"
+done
+
+IUSE="${IUSE_VIDEO_CARDS}
+ bindist +classic debug +egl +gallium gbm gles1 gles2 +llvm +nptl opencl
+ openvg osmesa pax_kernel pic r600-llvm-compiler selinux +shared-glapi vdpau
+ wayland xvmc xa xorg kernel_FreeBSD"
+
+REQUIRED_USE="
+ llvm? ( gallium )
+ openvg? ( egl gallium )
+ opencl? ( gallium r600-llvm-compiler )
+ gbm? ( shared-glapi )
+ gles1? ( egl )
+ gles2? ( egl )
+ r600-llvm-compiler? ( gallium llvm || ( video_cards_r600 video_cards_radeon ) )
+ wayland? ( egl )
+ xa? ( gallium )
+ xorg? ( gallium )
+ video_cards_freedreno? ( gallium )
+ video_cards_intel? ( || ( classic gallium ) )
+ video_cards_i915? ( || ( classic gallium ) )
+ video_cards_i965? ( classic )
+ video_cards_ilo? ( gallium )
+ video_cards_nouveau? ( || ( classic gallium ) )
+ video_cards_radeon? ( || ( classic gallium ) )
+ video_cards_r100? ( classic )
+ video_cards_r200? ( classic )
+ video_cards_r300? ( gallium )
+ video_cards_r600? ( gallium )
+ video_cards_radeonsi? ( gallium llvm )
+ video_cards_vmware? ( gallium )
+"
+
+LIBDRM_DEPSTRING=">=x11-libs/libdrm-2.4.45"
+# keep correct libdrm and dri2proto dep
+# keep blocks in rdepend for binpkg
+RDEPEND="
+ !<x11-base/xorg-server-1.7
+ !<=x11-proto/xf86driproto-2.0.3
+ classic? ( app-admin/eselect-mesa )
+ gallium? ( app-admin/eselect-mesa )
+ >=app-admin/eselect-opengl-1.2.7
+ dev-libs/expat
+ gbm? ( virtual/udev )
+ >=x11-libs/libX11-1.3.99.901
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ >=x11-libs/libxcb-1.8.1
+ opencl? (
+ app-admin/eselect-opencl
+ dev-libs/libclc
+ )
+ vdpau? ( >=x11-libs/libvdpau-0.4.1 )
+ wayland? ( >=dev-libs/wayland-1.0.3 )
+ xorg? (
+ x11-base/xorg-server:=
+ x11-libs/libdrm[libkms]
+ )
+ xvmc? ( >=x11-libs/libXvMC-1.0.6 )
+ ${LIBDRM_DEPSTRING}[video_cards_freedreno?,video_cards_nouveau?,video_cards_vmware?]
+"
+for card in ${INTEL_CARDS}; do
+ RDEPEND="${RDEPEND}
+ video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_intel] )
+ "
+done
+
+for card in ${RADEON_CARDS}; do
+ RDEPEND="${RDEPEND}
+ video_cards_${card}? ( ${LIBDRM_DEPSTRING}[video_cards_radeon] )
+ "
+done
+
+DEPEND="${RDEPEND}
+ llvm? (
+ >=sys-devel/llvm-2.9
+ r600-llvm-compiler? ( sys-devel/llvm[video_cards_radeon] )
+ video_cards_radeonsi? ( sys-devel/llvm[video_cards_radeon] )
+ )
+ opencl? (
+ >=sys-devel/llvm-3.3[video_cards_radeon]
+ >=sys-devel/clang-3.3
+ >=sys-devel/gcc-4.6
+ )
+ ${PYTHON_DEPS}
+ dev-libs/libxml2[python,${PYTHON_USEDEP}]
+ sys-devel/bison
+ sys-devel/flex
+ virtual/pkgconfig
+ >=x11-proto/dri2proto-2.6
+ >=x11-proto/glproto-1.4.15-r1
+ >=x11-proto/xextproto-7.0.99.1
+ x11-proto/xf86driproto
+ x11-proto/xf86vidmodeproto
+"
+
+S="${WORKDIR}/${MY_P}"
+
+# It is slow without texrels, if someone wants slow
+# mesa without texrels +pic use is worth the shot
+QA_EXECSTACK="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
+QA_WX_LOAD="usr/lib*/opengl/xorg-x11/lib/libGL.so*"
+
+# Think about: ggi, fbcon, no-X configs
+
+pkg_setup() {
+ # workaround toc-issue wrt #386545
+ use ppc64 && append-flags -mminimal-toc
+
+ python-single-r1_pkg_setup
+}
+
+src_unpack() {
+ default
+ [[ $PV = 9999* ]] && git-2_src_unpack
+ mv "${WORKDIR}"/${PN}-* "${WORKDIR}/${MY_P}" || die
+}
+
+src_prepare() {
+ # apply patches
+ if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
+ EPATCH_FORCE="yes" \
+ EPATCH_SOURCE="${WORKDIR}/patches" \
+ EPATCH_SUFFIX="patch" \
+ epatch
+ fi
+
+ # relax the requirement that r300 must have llvm, bug 380303
+ epatch "${FILESDIR}"/${PN}-8.1-dont-require-llvm-for-r300.patch
+
+ # fix for hardened pax_kernel, bug 240956
+ [[ ${PV} != 9999* ]] && epatch "${FILESDIR}"/glx_ro_text_segm.patch
+
+ # Solaris needs some recent POSIX stuff in our case
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ sed -i -e "s/-DSVR4/-D_POSIX_C_SOURCE=200112L/" configure.ac || die
+ fi
+
+ # Tests fail against python-3, bug #407887
+ sed -i 's|/usr/bin/env python|/usr/bin/env python2|' src/glsl/tests/compare_ir || die
+
+ base_src_prepare
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf
+
+ if use classic; then
+ # Configurable DRI drivers
+ driver_enable swrast
+
+ # Intel code
+ driver_enable video_cards_i915 i915
+ driver_enable video_cards_i965 i965
+ if ! use video_cards_i915 && \
+ ! use video_cards_i965; then
+ driver_enable video_cards_intel i915 i965
+ fi
+
+ # Nouveau code
+ driver_enable video_cards_nouveau nouveau
+
+ # ATI code
+ driver_enable video_cards_r100 radeon
+ driver_enable video_cards_r200 r200
+ if ! use video_cards_r100 && \
+ ! use video_cards_r200; then
+ driver_enable video_cards_radeon radeon r200
+ fi
+ fi
+
+ if use egl; then
+ myconf+="
+ --with-egl-platforms=x11$(use wayland && echo ",wayland")$(use gbm && echo ",drm")
+ $(use_enable gallium gallium-egl)
+ "
+ fi
+
+ if use gallium; then
+ myconf+="
+ $(use_enable llvm gallium-llvm)
+ $(use_enable openvg)
+ $(use_enable r600-llvm-compiler)
+ $(use_enable vdpau)
+ $(use_enable xvmc)
+ "
+ gallium_enable swrast
+ gallium_enable video_cards_vmware svga
+ gallium_enable video_cards_nouveau nouveau
+ gallium_enable video_cards_i915 i915
+ gallium_enable video_cards_ilo ilo
+ if ! use video_cards_i915 && \
+ ! use video_cards_i965; then
+ gallium_enable video_cards_intel i915
+ fi
+
+ gallium_enable video_cards_r300 r300
+ gallium_enable video_cards_r600 r600
+ gallium_enable video_cards_radeonsi radeonsi
+ if ! use video_cards_r300 && \
+ ! use video_cards_r600; then
+ gallium_enable video_cards_radeon r300 r600
+ fi
+
+ gallium_enable video_cards_freedreno freedreno
+ # opencl stuff
+ if use opencl; then
+ myconf+="
+ $(use_enable opencl)
+ --with-opencl-libdir="${EPREFIX}/usr/$(get_libdir)/OpenCL/vendors/mesa"
+ --with-clang-libdir="${EPREFIX}/usr/$(get_libdir)"
+ "
+ fi
+ fi
+
+ # x86 hardened pax_kernel needs glx-rts, bug 240956
+ if use pax_kernel; then
+ myconf+="
+ $(use_enable x86 glx-rts)
+ "
+ fi
+
+ # build fails with BSD indent, bug #428112
+ use userland_GNU || export INDENT=cat
+
+ econf \
+ --enable-dri \
+ --enable-glx \
+ $(use_enable !bindist texture-float) \
+ $(use_enable debug) \
+ $(use_enable egl) \
+ $(use_enable gbm) \
+ $(use_enable gles1) \
+ $(use_enable gles2) \
+ $(use_enable nptl glx-tls) \
+ $(use_enable osmesa) \
+ $(use_enable !pic asm) \
+ $(use_enable shared-glapi) \
+ $(use_enable xa) \
+ $(use_enable xorg) \
+ --with-dri-drivers=${DRI_DRIVERS} \
+ --with-gallium-drivers=${GALLIUM_DRIVERS} \
+ PYTHON2="${PYTHON}" \
+ ${myconf}
+}
+
+src_install() {
+ base_src_install
+
+ find "${ED}" -name '*.la' -exec rm -f {} + || die
+
+ if use !bindist; then
+ dodoc docs/patents.txt
+ fi
+
+ # Install config file for eselect mesa
+ insinto /usr/share/mesa
+ newins "${FILESDIR}/eselect-mesa.conf.9.2" eselect-mesa.conf
+
+ # Move libGL and others from /usr/lib to /usr/lib/opengl/blah/lib
+ # because user can eselect desired GL provider.
+ ebegin "Moving libGL and friends for dynamic switching"
+ local x
+ local gl_dir="/usr/$(get_libdir)/opengl/${OPENGL_DIR}/"
+ dodir ${gl_dir}/{lib,extensions,include/GL}
+ for x in "${ED}"/usr/$(get_libdir)/lib{EGL,GL*,OpenVG}.{la,a,so*}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f "${x}" "${ED}${gl_dir}"/lib \
+ || die "Failed to move ${x}"
+ fi
+ done
+ for x in "${ED}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f "${x}" "${ED}${gl_dir}"/include/GL \
+ || die "Failed to move ${x}"
+ fi
+ done
+ for x in "${ED}"/usr/include/{EGL,GLES*,VG,KHR}; do
+ if [ -d ${x} ]; then
+ mv -f "${x}" "${ED}${gl_dir}"/include \
+ || die "Failed to move ${x}"
+ fi
+ done
+ eend $?
+
+ if use classic || use gallium; then
+ ebegin "Moving DRI/Gallium drivers for dynamic switching"
+ local gallium_drivers=( i915_dri.so i965_dri.so r300_dri.so r600_dri.so swrast_dri.so )
+ keepdir /usr/$(get_libdir)/dri
+ dodir /usr/$(get_libdir)/mesa
+ for x in ${gallium_drivers[@]}; do
+ if [ -f "${S}/$(get_libdir)/gallium/${x}" ]; then
+ mv -f "${ED}/usr/$(get_libdir)/dri/${x}" "${ED}/usr/$(get_libdir)/dri/${x/_dri.so/g_dri.so}" \
+ || die "Failed to move ${x}"
+ insinto "/usr/$(get_libdir)/dri/"
+ if [ -f "${S}/$(get_libdir)/${x}" ]; then
+ insopts -m0755
+ doins "${S}/$(get_libdir)/${x}"
+ fi
+ fi
+ done
+ for x in "${ED}"/usr/$(get_libdir)/dri/*.so; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f "${x}" "${x/dri/mesa}" \
+ || die "Failed to move ${x}"
+ fi
+ done
+ pushd "${ED}"/usr/$(get_libdir)/dri || die "pushd failed"
+ ln -s ../mesa/*.so . || die "Creating symlink failed"
+ # remove symlinks to drivers known to eselect
+ for x in ${gallium_drivers[@]}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ rm "${x}" || die "Failed to remove ${x}"
+ fi
+ done
+ popd
+ eend $?
+ fi
+ if use opencl; then
+ ebegin "Moving Gallium/Clover OpenCL implementation for dynamic switching"
+ local cl_dir="/usr/$(get_libdir)/OpenCL/vendors/mesa"
+ dodir ${cl_dir}/{lib,include}
+ if [ -f "${ED}/usr/$(get_libdir)/libOpenCL.so" ]; then
+ mv -f "${ED}"/usr/$(get_libdir)/libOpenCL.so* \
+ "${ED}"${cl_dir}
+ fi
+ if [ -f "${ED}/usr/include/CL/opencl.h" ]; then
+ mv -f "${ED}"/usr/include/CL \
+ "${ED}"${cl_dir}/include
+ fi
+ eend $?
+ fi
+}
+
+pkg_postinst() {
+ # Switch to the xorg implementation.
+ echo
+ eselect opengl set --use-old ${OPENGL_DIR}
+
+ # switch to xorg-x11 and back if necessary, bug #374647 comment 11
+ OLD_IMPLEM="$(eselect opengl show)"
+ if [[ ${OPENGL_DIR}x != ${OLD_IMPLEM}x ]]; then
+ eselect opengl set ${OPENGL_DIR}
+ eselect opengl set ${OLD_IMPLEM}
+ fi
+
+ # Select classic/gallium drivers
+ if use classic || use gallium; then
+ eselect mesa set --auto
+ fi
+
+ # Switch to mesa opencl
+ if use opencl; then
+ eselect opencl set --use-old ${PN}
+ fi
+
+ # warn about patent encumbered texture-float
+ if use !bindist; then
+ elog "USE=\"bindist\" was not set. Potentially patent encumbered code was"
+ elog "enabled. Please see patents.txt for an explanation."
+ fi
+
+ local using_radeon r_flag
+ for r_flag in ${RADEON_CARDS}; do
+ if use video_cards_${r_flag}; then
+ using_radeon=1
+ break
+ fi
+ done
+
+ if [[ ${using_radeon} = 1 ]] && ! has_version media-libs/libtxc_dxtn; then
+ elog "Note that in order to have full S3TC support, it is necessary to install"
+ elog "media-libs/libtxc_dxtn as well. This may be necessary to get nice"
+ elog "textures in some apps, and some others even require this to run."
+ fi
+}
+
+# $1 - VIDEO_CARDS flag
+# other args - names of DRI drivers to enable
+# TODO: avoid code duplication for a more elegant implementation
+driver_enable() {
+ case $# in
+ # for enabling unconditionally
+ 1)
+ DRI_DRIVERS+=",$1"
+ ;;
+ *)
+ if use $1; then
+ shift
+ for i in $@; do
+ DRI_DRIVERS+=",${i}"
+ done
+ fi
+ ;;
+ esac
+}
+
+gallium_enable() {
+ case $# in
+ # for enabling unconditionally
+ 1)
+ GALLIUM_DRIVERS+=",$1"
+ ;;
+ *)
+ if use $1; then
+ shift
+ for i in $@; do
+ GALLIUM_DRIVERS+=",${i}"
+ done
+ fi
+ ;;
+ esac
+}
diff --git a/media-libs/mesa/metadata.xml b/media-libs/mesa/metadata.xml
index bbfeb8e79cb3..14515069c13e 100644
--- a/media-libs/mesa/metadata.xml
+++ b/media-libs/mesa/metadata.xml
@@ -13,6 +13,7 @@
<flag name='gles1'>Enable GLESv1 support.</flag>
<flag name='gles2'>Enable GLESv2 support.</flag>
<flag name='llvm'>Enable LLVM backend for Gallium3D.</flag>
+ <flag name='opencl'>Enable the Clover Gallium OpenCL state tracker.</flag>
<flag name='openvg'>Enable the OpenVG 2D acceleration API for Gallium3D.</flag>
<flag name='osmesa'>Build the Mesa library for off-screen rendering.</flag>
<flag name='pax_kernel'>Enable if the user plans to run the package under a pax enabled hardened kernel</flag>