summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@gentoo.org>2009-12-22 13:50:34 +0000
committerNirbheek Chauhan <nirbheek@gentoo.org>2009-12-22 13:50:34 +0000
commit0624255bce420e2f28d40e9d6a72a9d05559c6d8 (patch)
tree75fe6c76ff165ce300510ca10174bd9d5ee5bcef /media-libs
parentVersion bump #297819 by Alon Bar-Lev. (diff)
downloadhistorical-0624255bce420e2f28d40e9d6a72a9d05559c6d8.tar.gz
historical-0624255bce420e2f28d40e9d6a72a9d05559c6d8.tar.bz2
historical-0624255bce420e2f28d40e9d6a72a9d05559c6d8.zip
Bump to 7.6.1 (with a patch to fix bug 297891) and 7.7 (fixes bug 297807)
Package-Manager: portage-2.1.7.15/cvs/Linux i686
Diffstat (limited to 'media-libs')
-rw-r--r--media-libs/mesa/ChangeLog10
-rw-r--r--media-libs/mesa/Manifest7
-rw-r--r--media-libs/mesa/files/0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch33
-rw-r--r--media-libs/mesa/mesa-7.6.1.ebuild245
-rw-r--r--media-libs/mesa/mesa-7.7.ebuild237
5 files changed, 530 insertions, 2 deletions
diff --git a/media-libs/mesa/ChangeLog b/media-libs/mesa/ChangeLog
index 0aaf74044452..0f2995ef37f0 100644
--- a/media-libs/mesa/ChangeLog
+++ b/media-libs/mesa/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for media-libs/mesa
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.248 2009/12/16 18:16:36 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.249 2009/12/22 13:50:33 nirbheek Exp $
+
+*mesa-7.7 (22 Dec 2009)
+*mesa-7.6.1 (22 Dec 2009)
+
+ 22 Dec 2009; Nirbheek Chauhan <nirbheek@gentoo.org>
+ +files/0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch,
+ +mesa-7.6.1.ebuild, +mesa-7.7.ebuild:
+ Bump to 7.6.1 (with a patch to fix bug 297891) and 7.7 (fixes bug 297807)
16 Dec 2009; Tomáš Chvátal <scarabeus@gentoo.org> mesa-7.7_rc3.ebuild:
Fix S location.
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index beaffbfc12b9..3dcf81b593f4 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,12 +1,17 @@
+AUX 0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch 1135 RMD160 55c85bcf2ae92c9039f4394c07271863d5fb8c69 SHA1 4c29e61a096bcda471dc4ceb68712f937c1f08f8 SHA256 0c494b66f452d38e0012a5604da50e74779cd0e10c3e7408d797cd1f1ab0fc62
AUX lib/libGL.la 729 RMD160 b89950051dfa9d02824eb0b15858855016f92dcc SHA1 32c0aabf00f1590aa7aeca75955b80a04c6c7f15 SHA256 f5e62da033bfb72a56d6290d6030df4d5f687acea456a8f31a765c0c4f532606
AUX lib/libGLU.la 743 RMD160 34e3adc8e0422a5477a9eaa0fee141e577afeee4 SHA1 c131df3a61b7f193e8a8cea3feeb1f9ff0f1ea7d SHA256 0a8efb7cd557598607ede88af6442574a6999689ddbb7f0f3cbaf53734bfa284
DIST MesaLib-7.5.1.tar.bz2 4382803 RMD160 bccf6f52fce3b3c7ac6525444f907e3c2fe790c2 SHA1 26171fb4de23a21431861d6663203e400df45bf7 SHA256 48f21e5a91a82fa9fb6d0bc5ae72d9d9cc1824429dcfc759cfcc1a44e3e1440a
DIST MesaLib-7.5.2.tar.bz2 4387185 RMD160 0dc74e90afc08bde5b5e714bfb966d5b0750d84e SHA1 582141f8d28267f208c4747bd80689e32cdd6f32 SHA256 8b232fd2e7d8de5e4778f27ef11f7ff8c42c3815efc92144215734378b55e1ad
DIST MesaLib-7.6.1-rc4.tar.bz2 4885566 RMD160 4c97c12b3c032909003d2ca5e5576c4368c416bc SHA1 8f774dd1d5e5bdf0b0c2b2a204070b5328684944 SHA256 e48f21be6f80c7f74684cfeab20cc3e0c5f7d0854439b247a6ea8313e2fd6cf6
+DIST MesaLib-7.6.1.tar.bz2 4886995 RMD160 c2bea0898ecfe72a05e64f9021400147ae3e9d6b SHA1 6d99fca5f362d51a95401b4392542eb222e3d0f8 SHA256 701f0e4cb85d6298181651b780d1c0a439fadd02aad29ee6623fc05588bb8d44
DIST MesaLib-7.7-rc3.tar.bz2 4999841 RMD160 9fbeebfc2bb03de0a36c1c73260113fdc6057891 SHA1 228bc2cdc7a96ee2007562657138a5dfae80622b SHA256 e0abf5372ae8df14f457471f8e7451a8758310b28fbb08bcd2315385fac6a614
+DIST MesaLib-7.7.tar.bz2 5000637 RMD160 7edcba70e4e9bb1c6724c43e916c6e4c3e90c0dc SHA1 dc104df86f1cf777dac0bdbe8fd0a43c37918b66 SHA256 6252d7d4190b47f70d0e4ec0edbd5a70f2261c5f6e66859e5fd2572c1df6357a
EBUILD mesa-7.5.1.ebuild 7692 RMD160 cfbc21986990627d9a99e27d57500eeee2f4008a SHA1 d040934dbfc2824ca24dbd3318b049d9a3bd7ca7 SHA256 c107a62f56db25fcf4e23c0045d562231dbc9c9ff921c9679f66c70be879006f
EBUILD mesa-7.5.2.ebuild 7697 RMD160 f41d89991113673e35d28299db32975b3735df86 SHA1 c42c692bae5247ada8c2cb309aaa523ceb654057 SHA256 daa2116edc01a6e56b203f552d6cd51f085193bcba06bff625368e0c6609f9dc
+EBUILD mesa-7.6.1.ebuild 6578 RMD160 baa8791f9d7afee3e1d9b3d615eb00c4858a14a8 SHA1 2e87a9195a62e20487bf24736b7eaa2b75558f91 SHA256 d858bdbf7e73c757a5bfe2de97e0191b3c3cd0fe82ff1bf45f2ab5785c9ede7a
EBUILD mesa-7.6.1_rc4.ebuild 6414 RMD160 28a61eae35a5f7abdb157a7f2dabb39ebc076185 SHA1 2f42a36e69c4674f61c35d04c6f3d1524c9c1831 SHA256 e29540da763c067dca72c9998f995f31cc60cfd8b2a4f2da47104914c28bc3f0
+EBUILD mesa-7.7.ebuild 6309 RMD160 e07c15365b1748c705d21331838ecf6521e1ead2 SHA1 b7522cc87bf61c1e1c2b02e05308dc7dbae574bf SHA256 b67b91363192cc3fed2f7af0e957824d114709a12874d3bdd11092941fb24f78
EBUILD mesa-7.7_rc3.ebuild 6287 RMD160 bd39ae900b90b831cbbbd0bdb781cbdba6f606b2 SHA1 85e927936ea50afaa2997cd116911012236f3820 SHA256 4c29116f5bdd4a77eed3fff9a26d5069f8108497b2c219b1de1e85b2f9aa5d3d
-MISC ChangeLog 44201 RMD160 d7218cda49c1264e3030c831fcec0cf913d790dd SHA1 14f71663ae6bad6ab7975cd9045bbc46d9e39d2c SHA256 a379ea174531950e25843fedac942ed2dad4ed01c8e45c9567af0d82f4c16fc4
+MISC ChangeLog 44485 RMD160 e7792617418947e5906d33a543fb005bd2f1b809 SHA1 3cc4511229ed5f8deca933b3178c6d62dff75cfc SHA256 0fb4fe62d4490edcd50137a076677fe25909aad92cbe96f3d60856f8233d9e4e
MISC metadata.xml 344 RMD160 2a7cf045329a3141e5ae1396b497ca0e98a1888b SHA1 b730806d6fa2db3bada9e66dd6b93b9e40d6dfea SHA256 849997a7912f4428382a3bdc6b6b6bdb2928048a274fa865b3c89cd3e89e6dde
diff --git a/media-libs/mesa/files/0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch b/media-libs/mesa/files/0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch
new file mode 100644
index 000000000000..b76725f6a077
--- /dev/null
+++ b/media-libs/mesa/files/0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch
@@ -0,0 +1,33 @@
+From 8a1f239ca9ccb61cd6713d1138e24492c84163c5 Mon Sep 17 00:00:00 2001
+From: Jakob Bornecrantz <jakob@vmware.com>
+Date: Tue, 27 Oct 2009 17:35:06 +0100
+Subject: [PATCH] st/xorg: Adopt to new dirty clip rect type
+
+---
+ src/gallium/state_trackers/xorg/xorg_driver.c | 9 +++++----
+ 1 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
+index 847647c..26cf2dd 100644
+--- a/src/gallium/state_trackers/xorg/xorg_driver.c
++++ b/src/gallium/state_trackers/xorg/xorg_driver.c
+@@ -484,11 +484,12 @@ static void xorgBlockHandler(int i, pointer blockData, pointer pTimeout,
+ BoxPtr rect = REGION_RECTS(dirty);
+ int i;
+
++ /* XXX no need for copy? */
+ for (i = 0; i < num_cliprects; i++, rect++) {
+- clip[i].x = rect->x1;
+- clip[i].y = rect->y1;
+- clip[i].width = rect->x2 - rect->x1;
+- clip[i].height = rect->y2 - rect->y1;
++ clip[i].x1 = rect->x1;
++ clip[i].y1 = rect->y1;
++ clip[i].x2 = rect->x2;
++ clip[i].y2 = rect->y2;
+ }
+
+ /* TODO query connector property to see if this is needed */
+--
+1.6.4.4
+
diff --git a/media-libs/mesa/mesa-7.6.1.ebuild b/media-libs/mesa/mesa-7.6.1.ebuild
new file mode 100644
index 000000000000..d519748293cf
--- /dev/null
+++ b/media-libs/mesa/mesa-7.6.1.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-7.6.1.ebuild,v 1.1 2009/12/22 13:50:33 nirbheek Exp $
+
+EAPI="2"
+
+EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
+
+if [[ ${PV} = 9999* ]]; then
+ GIT_ECLASS="git"
+ EXPERIMENTAL="true"
+ IUSE_VIDEO_CARDS_UNSTABLE="video_cards_nouveau"
+fi
+
+inherit autotools multilib flag-o-matic ${GIT_ECLASS} portability
+
+OPENGL_DIR="xorg-x11"
+
+MY_PN="${PN/m/M}"
+MY_P="${MY_PN}-${PV/_*/}"
+MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
+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="ftp://ftp.freedesktop.org/pub/mesa/${PV/_rc*/}/${MY_SRC_P}.tar.bz2
+ ${SRC_PATCHES}"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+
+IUSE_VIDEO_CARDS="${IUSE_VIDEO_CARDS_UNSTABLE}
+ video_cards_intel
+ video_cards_mach64
+ video_cards_mga
+ video_cards_none
+ video_cards_r128
+ video_cards_radeon
+ video_cards_radeonhd
+ video_cards_s3virge
+ video_cards_savage
+ video_cards_sis
+ video_cards_sunffb
+ video_cards_tdfx
+ video_cards_trident
+ video_cards_via"
+IUSE="${IUSE_VIDEO_CARDS}
+ debug gallium motif +nptl pic +xcb kernel_FreeBSD"
+
+# 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
+ >=app-admin/eselect-opengl-1.1.1-r2
+ dev-libs/expat
+ >=x11-libs/libdrm-2.4.17
+ x11-libs/libICE
+ x11-libs/libX11[xcb?]
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXxf86vm
+ motif? ( x11-libs/openmotif )
+"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ x11-misc/makedepend
+ >=x11-proto/dri2proto-1.99.3
+ >=x11-proto/glproto-1.4.8
+ x11-proto/inputproto
+ >=x11-proto/xextproto-7.0.99.1
+ x11-proto/xf86driproto
+ x11-proto/xf86vidmodeproto
+"
+
+S="${WORKDIR}/${MY_P}"
+
+# Think about: ggi, svga, fbcon, no-X configs
+
+pkg_setup() {
+ # gcc 4.2 has buggy ivopts
+ if [[ $(gcc-version) = "4.2" ]]; then
+ append-flags -fno-ivopts
+ fi
+
+ # recommended by upstream
+ append-flags -ffast-math
+}
+
+src_unpack() {
+ [[ $PV = 9999* ]] && git_src_unpack || unpack ${A}
+}
+
+src_prepare() {
+ # apply patches
+ if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
+ EPATCH_FORCE="yes" \
+ EPATCH_SOURCE="${WORKDIR}/patches" \
+ EPATCH_SUFFIX="patch" \
+ epatch
+ fi
+
+ # The drmClip interface changed with libdrm-2.4.17
+ # bug 297891 (patch from upstream git)
+ epatch "${FILESDIR}/0001-st-xorg-Adopt-to-new-dirty-clip-rect-type.patch"
+
+ # FreeBSD 6.* doesn't have posix_memalign().
+ [[ ${CHOST} == *-freebsd6.* ]] && \
+ sed -i -e "s/-DHAVE_POSIX_MEMALIGN//" configure.ac
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf r600
+
+ # Configurable DRI drivers
+ driver_enable swrast
+ driver_enable video_cards_intel i810 i915 i965
+ driver_enable video_cards_mach64 mach64
+ driver_enable video_cards_mga mga
+ driver_enable video_cards_r128 r128
+ # ATI has two implementations as video_cards
+ driver_enable video_cards_radeon radeon r200 r300 r600
+ driver_enable video_cards_radeonhd r300 r600
+ driver_enable video_cards_s3virge s3v
+ driver_enable video_cards_savage savage
+ driver_enable video_cards_sis sis
+ driver_enable video_cards_sunffb ffb
+ driver_enable video_cards_tdfx tdfx
+ driver_enable video_cards_trident trident
+ driver_enable video_cards_via unichrome
+
+ # all live (experimental) stuff is wrapped around with experimental variable
+ # so the users cant get to this parts even with enabled useflags (downgrade
+ # from live to stable for example)
+ if [[ -n ${EXPERIMENTAL} ]]; then
+ # nouveau works only with gallium
+ use gallium && myconf="${myconf} $(use_enable video_cards_nouveau gallium-nouveau)"
+ if use video_cards_nouveau && ! use gallium ; then
+ elog "Nouveau driver is available only via gallium interface."
+ elog "Enable gallium useflag if you want to use nouveau."
+ echo
+ fi
+ fi
+
+ myconf="${myconf} $(use_enable gallium)"
+ if use gallium; then
+ elog "Warning gallium interface is highly experimental so use"
+ elog "it only if you feel really really brave."
+ elog
+ elog "Intel: works only i915."
+ elog "Nouveau: only available implementation, so no other choice"
+ elog "Radeon: implementation up to the r500."
+ echo
+ myconf="${myconf}
+ --with-state-trackers=glx,dri,egl,xorg
+ $(use_enable video_cards_nouveau gallium-nouveau)
+ $(use_enable video_cards_intel gallium-intel)"
+ if ! use video_cards_radeon && ! use video_cards_radeonhd; then
+ myconf="${myconf} --disable-gallium-radeon"
+ else
+ myconf="${myconf} --enable-gallium-radeon"
+ fi
+ fi
+
+ # Deactivate assembly code for pic build
+ myconf="${myconf} $(use_enable !pic asm)"
+
+ # --with-driver=dri|xlib|osmesa ; might get changed later to something
+ # else than dri
+ econf \
+ --with-driver=dri \
+ --disable-glut \
+ --without-demos \
+ $(use_enable debug) \
+ $(use_enable motif glw) \
+ $(use_enable motif) \
+ $(use_enable nptl glx-tls) \
+ $(use_enable xcb) \
+ --with-dri-drivers=${DRI_DRIVERS} \
+ ${myconf}
+}
+
+src_install() {
+ dodir /usr
+ emake DESTDIR="${D}" install || die "Installation failed"
+
+ # Remove redundant headers
+ # GLUT thing
+ rm -f "${D}"/usr/include/GL/glut*.h || die "Removing glut include failed."
+ # Glew includes
+ rm -f "${D}"/usr/include/GL/{glew,glxew,wglew}.h \
+ || die "Removing glew includes failed."
+
+ # 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"
+ dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/{lib,extensions,include}
+ local x
+ for x in "${D}"/usr/$(get_libdir)/libGL.{la,a,so*}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/lib \
+ || die "Failed to move ${x}"
+ fi
+ done
+ for x in "${D}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/include \
+ || die "Failed to move ${x}"
+ fi
+ done
+ eend $?
+}
+
+pkg_postinst() {
+ # Switch to the xorg implementation.
+ echo
+ eselect opengl set --use-old ${OPENGL_DIR}
+}
+
+# $1 - VIDEO_CARDS flag
+# other args - names of DRI drivers to enable
+driver_enable() {
+ case $# in
+ # for enabling unconditionally
+ 1)
+ DRI_DRIVERS="${DRI_DRIVERS},$1"
+ ;;
+ *)
+ if use $1; then
+ shift
+ for i in $@; do
+ DRI_DRIVERS="${DRI_DRIVERS},${i}"
+ done
+ fi
+ ;;
+ esac
+}
diff --git a/media-libs/mesa/mesa-7.7.ebuild b/media-libs/mesa/mesa-7.7.ebuild
new file mode 100644
index 000000000000..64ccf01f0c26
--- /dev/null
+++ b/media-libs/mesa/mesa-7.7.ebuild
@@ -0,0 +1,237 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-7.7.ebuild,v 1.1 2009/12/22 13:50:33 nirbheek Exp $
+
+EAPI="2"
+
+EGIT_REPO_URI="git://anongit.freedesktop.org/mesa/mesa"
+
+if [[ ${PV} = 9999* ]]; then
+ GIT_ECLASS="git"
+ EXPERIMENTAL="true"
+ IUSE_VIDEO_CARDS_UNSTABLE="video_cards_nouveau"
+fi
+
+inherit autotools multilib flag-o-matic ${GIT_ECLASS} portability
+
+OPENGL_DIR="xorg-x11"
+
+MY_PN="${PN/m/M}"
+MY_P="${MY_PN}-${PV/_*}"
+MY_SRC_P="${MY_PN}Lib-${PV/_/-}"
+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="ftp://ftp.freedesktop.org/pub/mesa/${PV/_rc*/}/${MY_SRC_P}.tar.bz2
+ ${SRC_PATCHES}"
+fi
+
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd"
+
+IUSE_VIDEO_CARDS="${IUSE_VIDEO_CARDS_UNSTABLE}
+ video_cards_intel
+ video_cards_mach64
+ video_cards_mga
+ video_cards_none
+ video_cards_r128
+ video_cards_radeon
+ video_cards_radeonhd
+ video_cards_savage
+ video_cards_sis
+ video_cards_sunffb
+ video_cards_tdfx
+ video_cards_via"
+IUSE="${IUSE_VIDEO_CARDS}
+ debug gallium motif +nptl pic +xcb kernel_FreeBSD"
+
+# 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
+ >=app-admin/eselect-opengl-1.1.1-r2
+ dev-libs/expat
+ >=x11-libs/libdrm-2.4.17
+ x11-libs/libICE
+ x11-libs/libX11[xcb?]
+ x11-libs/libXdamage
+ x11-libs/libXext
+ x11-libs/libXi
+ x11-libs/libXmu
+ x11-libs/libXxf86vm
+ motif? ( x11-libs/openmotif )
+"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig
+ x11-misc/makedepend
+ >=x11-proto/dri2proto-1.99.3
+ >=x11-proto/glproto-1.4.8
+ x11-proto/inputproto
+ >=x11-proto/xextproto-7.0.99.1
+ x11-proto/xf86driproto
+ x11-proto/xf86vidmodeproto
+"
+
+S="${WORKDIR}/${MY_P}"
+
+# Think about: ggi, svga, fbcon, no-X configs
+
+pkg_setup() {
+ # gcc 4.2 has buggy ivopts
+ if [[ $(gcc-version) = "4.2" ]]; then
+ append-flags -fno-ivopts
+ fi
+
+ # recommended by upstream
+ append-flags -ffast-math
+}
+
+src_unpack() {
+ [[ $PV = 9999* ]] && git_src_unpack || unpack ${A}
+}
+
+src_prepare() {
+ # apply patches
+ if [[ ${PV} != 9999* && -n ${SRC_PATCHES} ]]; then
+ EPATCH_FORCE="yes" \
+ EPATCH_SOURCE="${WORKDIR}/patches" \
+ EPATCH_SUFFIX="patch" \
+ epatch
+ fi
+ # FreeBSD 6.* doesn't have posix_memalign().
+ [[ ${CHOST} == *-freebsd6.* ]] && \
+ sed -i -e "s/-DHAVE_POSIX_MEMALIGN//" configure.ac
+
+ eautoreconf
+}
+
+src_configure() {
+ local myconf r600
+
+ # Configurable DRI drivers
+ driver_enable swrast
+ driver_enable video_cards_intel i810 i915 i965
+ driver_enable video_cards_mach64 mach64
+ driver_enable video_cards_mga mga
+ driver_enable video_cards_r128 r128
+ # ATI has two implementations as video_cards
+ driver_enable video_cards_radeon radeon r200 r300 r600
+ driver_enable video_cards_radeonhd r300 r600
+ driver_enable video_cards_savage savage
+ driver_enable video_cards_sis sis
+ driver_enable video_cards_sunffb ffb
+ driver_enable video_cards_tdfx tdfx
+ driver_enable video_cards_via unichrome
+
+ # all live (experimental) stuff is wrapped around with experimental variable
+ # so the users cant get to this parts even with enabled useflags (downgrade
+ # from live to stable for example)
+ if [[ -n ${EXPERIMENTAL} ]]; then
+ # nouveau works only with gallium
+ use gallium && myconf="${myconf} $(use_enable video_cards_nouveau gallium-nouveau)"
+ if use video_cards_nouveau && ! use gallium ; then
+ elog "Nouveau driver is available only via gallium interface."
+ elog "Enable gallium useflag if you want to use nouveau."
+ echo
+ fi
+ fi
+
+ myconf="${myconf} $(use_enable gallium)"
+ if use gallium; then
+ elog "Warning gallium interface is highly experimental so use"
+ elog "it only if you feel really really brave."
+ elog
+ elog "Intel: works only i915."
+ elog "Nouveau: only available implementation, so no other choice"
+ elog "Radeon: implementation up to the r500."
+ echo
+ myconf="${myconf}
+ --with-state-trackers=glx,dri,egl,xorg
+ $(use_enable video_cards_nouveau gallium-nouveau)
+ $(use_enable video_cards_intel gallium-intel)"
+ if ! use video_cards_radeon && ! use video_cards_radeonhd; then
+ myconf="${myconf} --disable-gallium-radeon"
+ else
+ myconf="${myconf} --enable-gallium-radeon"
+ fi
+ fi
+
+ # Deactivate assembly code for pic build
+ myconf="${myconf} $(use_enable !pic asm)"
+
+ # --with-driver=dri|xlib|osmesa ; might get changed later to something
+ # else than dri
+ econf \
+ --with-driver=dri \
+ --disable-glut \
+ --without-demos \
+ $(use_enable debug) \
+ $(use_enable motif glw) \
+ $(use_enable motif) \
+ $(use_enable nptl glx-tls) \
+ $(use_enable xcb) \
+ --disable-gallium-svga \
+ --with-dri-drivers=${DRI_DRIVERS} \
+ ${myconf}
+}
+
+src_install() {
+ dodir /usr
+ emake DESTDIR="${D}" install || die "Installation failed"
+
+ # Remove redundant headers
+ # GLUT thing
+ rm -f "${D}"/usr/include/GL/glut*.h || die "Removing glut include failed."
+ # Glew includes
+ rm -f "${D}"/usr/include/GL/{glew,glxew,wglew}.h \
+ || die "Removing glew includes failed."
+
+ # 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"
+ dodir /usr/$(get_libdir)/opengl/${OPENGL_DIR}/{lib,extensions,include}
+ local x
+ for x in "${D}"/usr/$(get_libdir)/libGL.{la,a,so*}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/lib \
+ || die "Failed to move ${x}"
+ fi
+ done
+ for x in "${D}"/usr/include/GL/{gl.h,glx.h,glext.h,glxext.h}; do
+ if [ -f ${x} -o -L ${x} ]; then
+ mv -f ${x} "${D}"/usr/$(get_libdir)/opengl/${OPENGL_DIR}/include \
+ || die "Failed to move ${x}"
+ fi
+ done
+ eend $?
+}
+
+pkg_postinst() {
+ # Switch to the xorg implementation.
+ echo
+ eselect opengl set --use-old ${OPENGL_DIR}
+}
+
+# $1 - VIDEO_CARDS flag
+# other args - names of DRI drivers to enable
+driver_enable() {
+ case $# in
+ # for enabling unconditionally
+ 1)
+ DRI_DRIVERS="${DRI_DRIVERS},$1"
+ ;;
+ *)
+ if use $1; then
+ shift
+ for i in $@; do
+ DRI_DRIVERS="${DRI_DRIVERS},${i}"
+ done
+ fi
+ ;;
+ esac
+}