summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2005-08-10 05:17:10 +0000
committerDonnie Berkholz <dberkholz@gentoo.org>2005-08-10 05:17:10 +0000
commit6c8c4e1c52a117c85c4555ccc46d6abe470baed6 (patch)
treebf9e25ca140703698ad8ec73bf293cab2e6bfc60 /media-libs
parentRemove this package. (diff)
downloadhistorical-6c8c4e1c52a117c85c4555ccc46d6abe470baed6.tar.gz
historical-6c8c4e1c52a117c85c4555ccc46d6abe470baed6.tar.bz2
historical-6c8c4e1c52a117c85c4555ccc46d6abe470baed6.zip
Add for modular X.
Package-Manager: portage-2.0.51.22-r2
Diffstat (limited to 'media-libs')
-rw-r--r--media-libs/mesa/ChangeLog12
-rw-r--r--media-libs/mesa/Manifest9
-rw-r--r--media-libs/mesa/files/digest-mesa-6.3.1.12
-rw-r--r--media-libs/mesa/files/fix-xthreads-location.patch55
-rw-r--r--media-libs/mesa/files/lib/libGL.la32
-rw-r--r--media-libs/mesa/files/lib/libGLU.la32
-rw-r--r--media-libs/mesa/files/lib/libOSMesa.la32
-rw-r--r--media-libs/mesa/files/use-xthreads.patch227
-rw-r--r--media-libs/mesa/mesa-6.3.1.1.ebuild155
9 files changed, 553 insertions, 3 deletions
diff --git a/media-libs/mesa/ChangeLog b/media-libs/mesa/ChangeLog
index 45496701eae1..ef78788141d5 100644
--- a/media-libs/mesa/ChangeLog
+++ b/media-libs/mesa/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for media-libs/mesa
-# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.8 2004/06/24 23:16:28 agriffis Exp $
+# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/ChangeLog,v 1.9 2005/08/10 05:17:10 spyderous Exp $
+
+*mesa-6.3.1.1 (10 Aug 2005)
+
+ 10 Aug 2005; Donnie Berkholz <spyderous@gentoo.org>;
+ +files/fix-xthreads-location.patch, +files/lib/libGL.la,
+ +files/lib/libGLU.la, +files/lib/libOSMesa.la, +files/use-xthreads.patch,
+ +mesa-6.3.1.1.ebuild:
+ Add for modular X.
07 Jun 2004; Aron Griffis <agriffis@gentoo.org> mesa-3.5.ebuild:
Fix use invocation
diff --git a/media-libs/mesa/Manifest b/media-libs/mesa/Manifest
index fbf606f9c455..96357ee178c1 100644
--- a/media-libs/mesa/Manifest
+++ b/media-libs/mesa/Manifest
@@ -1,3 +1,10 @@
+MD5 630a706997d3f291df76b1b4fd0aef5b ChangeLog 1395
MD5 0abead5c87cc76886c353584531ebeee mesa-3.5.ebuild 2639
-MD5 e2cf65a01b6cc7524146ff9dbebc01c6 ChangeLog 1129
+MD5 d126c2b9e9413b9d82c709dcd42e729d mesa-6.3.1.1.ebuild 4192
MD5 bd741113cc51a6779eae0abc0a539364 files/digest-mesa-3.5 131
+MD5 327ad9473f146d09e0d0bd9198bb6a99 files/digest-mesa-6.3.1.1 129
+MD5 14a7882e4e2dc41b7ef845dc11bd9a0c files/fix-xthreads-location.patch 1718
+MD5 de65b33347d4dd56da17835ab42daf9a files/use-xthreads.patch 8355
+MD5 f0ebdc72043e76ad7eddc4ad91349927 files/lib/libGL.la 763
+MD5 9abdd26694e6f1d7bd93193f900acc6c files/lib/libGLU.la 752
+MD5 0883c9996cac1056781bdcd2aab60e66 files/lib/libOSMesa.la 765
diff --git a/media-libs/mesa/files/digest-mesa-6.3.1.1 b/media-libs/mesa/files/digest-mesa-6.3.1.1
new file mode 100644
index 000000000000..fd2bb869cadf
--- /dev/null
+++ b/media-libs/mesa/files/digest-mesa-6.3.1.1
@@ -0,0 +1,2 @@
+MD5 9e05f987ec79f6374457bea343b063c2 Mesa-6.3.1.1.tar.gz 6379711
+MD5 34cdd11cc3d1786754439c7910d8cb38 libdrm-1.0.1.tar.gz 396571
diff --git a/media-libs/mesa/files/fix-xthreads-location.patch b/media-libs/mesa/files/fix-xthreads-location.patch
new file mode 100644
index 000000000000..f5b3664c4017
--- /dev/null
+++ b/media-libs/mesa/files/fix-xthreads-location.patch
@@ -0,0 +1,55 @@
+CVSROOT: /cvs/mesa
+Module name: Mesa
+Repository: Mesa/src/glx/x11/
+Changes by: idr@gabe. 05/08/01 09:30:24
+
+Log message:
+ Fix build problems related to finding Xthreads.h.
+
+Modified files:
+ Mesa/src/glx/x11/:
+ glxclient.h glxext.c
+
+ Revision Changes Path
+ 1.12 +1 -1 Mesa/src/glx/x11/glxclient.h
+ http://cvs.freedesktop.org/mesa/Mesa/src/glx/x11/glxclient.h
+ 1.15 +0 -5 Mesa/src/glx/x11/glxext.c
+ http://cvs.freedesktop.org/mesa/Mesa/src/glx/x11/glxext.c
+
+Index: src/glx/x11/glxclient.h
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/glx/x11/glxclient.h,v
+retrieving revision 1.11
+retrieving revision 1.12
+diff -u -b -B -r1.11 -r1.12
+--- Mesa-6.3.1.1/src/glx/x11/glxclient.h 29 Jul 2005 17:30:18 -0000 1.11
++++ Mesa-6.3.1.1/src/glx/x11/glxclient.h 1 Aug 2005 16:30:24 -0000 1.12
+@@ -61,7 +61,7 @@
+ #include "glapitable.h"
+ #include "glxextensions.h"
+ #if defined( XTHREADS )
+-# include "Xthreads.h"
++# include <X11/Xthreads.h>
+ #elif defined( PTHREADS )
+ # include <pthread.h>
+ #endif
+Index: src/glx/x11/glxext.c
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/glx/x11/glxext.c,v
+retrieving revision 1.14
+retrieving revision 1.15
+diff -u -b -B -r1.14 -r1.15
+--- Mesa-6.3.1.1/src/glx/x11/glxext.c 26 Jul 2005 22:53:38 -0000 1.14
++++ Mesa-6.3.1.1/src/glx/x11/glxext.c 1 Aug 2005 16:30:24 -0000 1.15
+@@ -51,11 +51,6 @@
+ #include <assert.h>
+ #include "indirect_init.h"
+ #include "glapi.h"
+-#ifdef XTHREADS
+-# include "Xthreads.h"
+-#elif defined(PTHREADS)
+-# include <pthread.h>
+-#endif
+ #include "glxextensions.h"
+ #include "glcontextmodes.h"
+ #include "glheader.h"
diff --git a/media-libs/mesa/files/lib/libGL.la b/media-libs/mesa/files/lib/libGL.la
new file mode 100644
index 000000000000..1a773c25f0be
--- /dev/null
+++ b/media-libs/mesa/files/lib/libGL.la
@@ -0,0 +1,32 @@
+# libGL.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.4 (1.920 2001/04/24 23:26:18)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libGL.so.1'
+
+# Names of this library.
+library_names='libGL.so.1.2 libGL.so.1 libGL.so'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -L/usr/lib -lSM -lICE -lXmu -lXt -lXext -lXi -lX11 -ldl -lpthread '
+
+# Version information for libGL.
+current=3
+age=2
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib/opengl/xorg-x11/lib'
diff --git a/media-libs/mesa/files/lib/libGLU.la b/media-libs/mesa/files/lib/libGLU.la
new file mode 100644
index 000000000000..cc76b4b191bb
--- /dev/null
+++ b/media-libs/mesa/files/lib/libGLU.la
@@ -0,0 +1,32 @@
+# libGLU.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.4 (1.920 2001/04/24 23:26:18)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libGLU.so.1'
+
+# Names of this library.
+library_names='libGLU.so.1.3 libGLU.so.1 libGLU.so'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -L/usr/lib -lGL -lSM -lICE -lXmu -lXt -lXext -lXi -lX11 -ldl -lpthread '
+
+# Version information for libGLU.
+current=4
+age=3
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib'
diff --git a/media-libs/mesa/files/lib/libOSMesa.la b/media-libs/mesa/files/lib/libOSMesa.la
new file mode 100644
index 000000000000..a5ce6e72218c
--- /dev/null
+++ b/media-libs/mesa/files/lib/libOSMesa.la
@@ -0,0 +1,32 @@
+# libOSMesa.la - a libtool library file
+# Generated by ltmain.sh - GNU libtool 1.4 (1.920 2001/04/24 23:26:18)
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='libOSMesa.so.3'
+
+# Names of this library.
+library_names='libOSMesa.so.3.3 libOSMesa.so.3 libOSMesa.so'
+
+# The name of the static archive.
+old_library=''
+
+# Libraries that this one depends upon.
+dependency_libs=' -L/usr/lib -lGL -lSM -lICE -lXmu -lXt -lXext -lXi -lX11 -ldl -lpthread '
+
+# Version information for libOSMesa.
+current=4
+age=3
+revision=0
+
+# Is this an already installed library?
+installed=yes
+
+# Files to dlopen/dlpreopen
+dlopen=''
+dlpreopen=''
+
+# Directory that this library needs to be installed in:
+libdir='/usr/lib'
diff --git a/media-libs/mesa/files/use-xthreads.patch b/media-libs/mesa/files/use-xthreads.patch
new file mode 100644
index 000000000000..5d595eccc776
--- /dev/null
+++ b/media-libs/mesa/files/use-xthreads.patch
@@ -0,0 +1,227 @@
+CVSROOT: /cvs/mesa
+Module name: Mesa
+Repository: Mesa/src/mesa/x86-64/
+Changes by: idr@gabe. 05/08/03 16:05:26
+
+Log message:
+ Convert all instances of XTHREADS to USE_XTHREADS. This fixes one of
+ serveral things that are broken when building on a system with X.org 7.0rc0
+ installed.
+
+Modified files:
+ Mesa/src/glx/x11/:
+ glxclient.h glxext.c
+ Mesa/src/mesa/x86/:
+ glapi_x86.S
+ Mesa/src/mesa/glapi/:
+ gl_x86-64_asm.py gl_x86_asm.py glthread.c glthread.h
+ Mesa/src/mesa/x86-64/:
+ glapi_x86-64.S
+
+ Revision Changes Path
+ 1.13 +4 -4 Mesa/src/glx/x11/glxclient.h
+ http://cvs.freedesktop.org/mesa/Mesa/src/glx/x11/glxclient.h
+ 1.16 +2 -2 Mesa/src/glx/x11/glxext.c
+ http://cvs.freedesktop.org/mesa/Mesa/src/glx/x11/glxext.c
+ 1.55 +1 -1 Mesa/src/mesa/x86/glapi_x86.S
+ http://cvs.freedesktop.org/mesa/Mesa/src/mesa/x86/glapi_x86.S
+ 1.2 +1 -1 Mesa/src/mesa/glapi/gl_x86-64_asm.py
+ http://cvs.freedesktop.org/mesa/Mesa/src/mesa/glapi/gl_x86-64_asm.py
+ 1.14 +1 -1 Mesa/src/mesa/glapi/gl_x86_asm.py
+ http://cvs.freedesktop.org/mesa/Mesa/src/mesa/glapi/gl_x86_asm.py
+ 1.12 +1 -1 Mesa/src/mesa/glapi/glthread.c
+ http://cvs.freedesktop.org/mesa/Mesa/src/mesa/glapi/glthread.c
+ 1.21 +3 -3 Mesa/src/mesa/glapi/glthread.h
+ http://cvs.freedesktop.org/mesa/Mesa/src/mesa/glapi/glthread.h
+ 1.2 +1 -1 Mesa/src/mesa/x86-64/glapi_x86-64.S
+ http://cvs.freedesktop.org/mesa/Mesa/src/mesa/x86-64/glapi_x86-64.S
+
+Index: src/glx/x11/glxclient.h
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/glx/x11/glxclient.h,v
+retrieving revision 1.12
+retrieving revision 1.13
+diff -u -b -B -r1.12 -r1.13
+--- Mesa-6.3.1.1/src/glx/x11/glxclient.h 1 Aug 2005 16:30:24 -0000 1.12
++++ Mesa-6.3.1.1/src/glx/x11/glxclient.h 3 Aug 2005 23:05:25 -0000 1.13
+@@ -60,7 +60,7 @@
+ #include "GL/internal/glcore.h"
+ #include "glapitable.h"
+ #include "glxextensions.h"
+-#if defined( XTHREADS )
++#if defined( USE_XTHREADS )
+ # include <X11/Xthreads.h>
+ #elif defined( PTHREADS )
+ # include <pthread.h>
+@@ -547,7 +547,7 @@
+ extern int __glXDebug;
+
+ /* This is per-thread storage in an MT environment */
+-#if defined( XTHREADS ) || defined( PTHREADS )
++#if defined( USE_XTHREADS ) || defined( PTHREADS )
+
+ extern void __glXSetCurrentContext(__GLXcontext *c);
+
+@@ -570,14 +570,14 @@
+ #define __glXGetCurrentContext() __glXcurrentContext
+ #define __glXSetCurrentContext(gc) __glXcurrentContext = gc
+
+-#endif /* defined( XTHREADS ) || defined( PTHREADS ) */
++#endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */
+
+
+ /*
+ ** Global lock for all threads in this address space using the GLX
+ ** extension
+ */
+-#if defined( XTHREADS )
++#if defined( USE_XTHREADS )
+ extern xmutex_rec __glXmutex;
+ #define __glXLock() xmutex_lock(&__glXmutex)
+ #define __glXUnlock() xmutex_unlock(&__glXmutex)
+Index: src/glx/x11/glxext.c
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/glx/x11/glxext.c,v
+retrieving revision 1.15
+retrieving revision 1.16
+diff -u -b -B -r1.15 -r1.16
+--- Mesa-6.3.1.1/src/glx/x11/glxext.c 1 Aug 2005 16:30:24 -0000 1.15
++++ Mesa-6.3.1.1/src/glx/x11/glxext.c 3 Aug 2005 23:05:25 -0000 1.16
+@@ -145,7 +145,7 @@
+ * Current context management and locking
+ */
+
+-#if defined( XTHREADS )
++#if defined( USE_XTHREADS )
+
+ /* thread safe */
+ static GLboolean TSDinitialized = GL_FALSE;
+@@ -1106,7 +1106,7 @@
+ XEDataObject dataObj;
+ int major, minor;
+
+-#if defined(XTHREADS)
++#if defined(USE_XTHREADS)
+ {
+ static int firstCall = 1;
+ if (firstCall) {
+Index: src/mesa/glapi/gl_x86-64_asm.py
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/mesa/glapi/gl_x86-64_asm.py,v
+retrieving revision 1.1
+retrieving revision 1.2
+diff -u -b -B -r1.1 -r1.2
+--- Mesa-6.3.1.1/src/mesa/glapi/gl_x86-64_asm.py 2 Jul 2005 08:29:58 -0000 1.1
++++ Mesa-6.3.1.1/src/mesa/glapi/gl_x86-64_asm.py 3 Aug 2005 23:05:25 -0000 1.2
+@@ -127,7 +127,7 @@
+ print '# define HIDDEN(x)'
+ print '#endif'
+ print ''
+- print '#if defined(PTHREADS) || defined(XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
++ print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
+ print '# define THREADS'
+ print '#endif'
+ print ''
+Index: src/mesa/glapi/gl_x86_asm.py
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/mesa/glapi/gl_x86_asm.py,v
+retrieving revision 1.13
+retrieving revision 1.14
+diff -u -b -B -r1.13 -r1.14
+--- Mesa-6.3.1.1/src/mesa/glapi/gl_x86_asm.py 21 Jun 2005 23:42:44 -0000 1.13
++++ Mesa-6.3.1.1/src/mesa/glapi/gl_x86_asm.py 3 Aug 2005 23:05:25 -0000 1.14
+@@ -86,7 +86,7 @@
+ print '#define GLOBL_FN(x) GLOBL x'
+ print '#endif'
+ print ''
+- print '#if defined(PTHREADS) || defined(XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
++ print '#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)'
+ print '# define THREADS'
+ print '#endif'
+ print ''
+Index: src/mesa/glapi/glthread.c
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/mesa/glapi/glthread.c,v
+retrieving revision 1.11
+retrieving revision 1.12
+diff -u -b -B -r1.11 -r1.12
+--- Mesa-6.3.1.1/src/mesa/glapi/glthread.c 5 Jun 2003 00:50:40 -0000 1.11
++++ Mesa-6.3.1.1/src/mesa/glapi/glthread.c 3 Aug 2005 23:05:25 -0000 1.12
+@@ -242,7 +242,7 @@
+ * XFree86 has its own thread wrapper, Xthreads.h
+ * We wrap it again for GL.
+ */
+-#ifdef XTHREADS
++#ifdef USE_XTHREADS
+
+ unsigned long
+ _glthread_GetID(void)
+Index: src/mesa/glapi/glthread.h
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/mesa/glapi/glthread.h,v
+retrieving revision 1.20
+retrieving revision 1.21
+diff -u -b -B -r1.20 -r1.21
+--- Mesa-6.3.1.1/src/mesa/glapi/glthread.h 18 Jul 2005 12:31:26 -0000 1.20
++++ Mesa-6.3.1.1/src/mesa/glapi/glthread.h 3 Aug 2005 23:05:25 -0000 1.21
+@@ -65,7 +65,7 @@
+
+
+ #if (defined(PTHREADS) || defined(SOLARIS_THREADS) ||\
+- defined(WIN32_THREADS) || defined(XTHREADS) || defined(BEOS_THREADS)) \
++ defined(WIN32_THREADS) || defined(USE_XTHREADS) || defined(BEOS_THREADS)) \
+ && !defined(THREADS)
+ # define THREADS
+ #endif
+@@ -193,7 +193,7 @@
+ * XFree86 has its own thread wrapper, Xthreads.h
+ * We wrap it again for GL.
+ */
+-#ifdef XTHREADS
++#ifdef USE_XTHREADS
+ #include <X11/Xthreads.h>
+
+ typedef struct {
+@@ -225,7 +225,7 @@
+ #define _glthread_UNLOCK_MUTEX(name) \
+ (void) xmutex_unlock(&(name))
+
+-#endif /* XTHREADS */
++#endif /* USE_XTHREADS */
+
+
+
+Index: src/mesa/x86/glapi_x86.S
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/mesa/x86/glapi_x86.S,v
+retrieving revision 1.54
+retrieving revision 1.55
+diff -u -b -B -r1.54 -r1.55
+--- Mesa-6.3.1.1/src/mesa/x86/glapi_x86.S 21 Jun 2005 23:42:44 -0000 1.54
++++ Mesa-6.3.1.1/src/mesa/x86/glapi_x86.S 3 Aug 2005 23:05:25 -0000 1.55
+@@ -63,7 +63,7 @@
+ #define GLOBL_FN(x) GLOBL x
+ #endif
+
+-#if defined(PTHREADS) || defined(XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
++#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
+ # define THREADS
+ #endif
+
+Index: src/mesa/x86-64/glapi_x86-64.S
+===================================================================
+RCS file: /cvs/mesa/Mesa/src/mesa/x86-64/glapi_x86-64.S,v
+retrieving revision 1.1
+retrieving revision 1.2
+diff -u -b -B -r1.1 -r1.2
+--- Mesa-6.3.1.1/src/mesa/x86-64/glapi_x86-64.S 2 Jul 2005 08:29:58 -0000 1.1
++++ Mesa-6.3.1.1/src/mesa/x86-64/glapi_x86-64.S 3 Aug 2005 23:05:25 -0000 1.2
+@@ -35,7 +35,7 @@
+ # define HIDDEN(x)
+ #endif
+
+-#if defined(PTHREADS) || defined(XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
++#if defined(PTHREADS) || defined(USE_XTHREADS) || defined(SOLARIS_THREADS) || defined(WIN32_THREADS) || defined(BEOS_THREADS)
+ # define THREADS
+ #endif
+
diff --git a/media-libs/mesa/mesa-6.3.1.1.ebuild b/media-libs/mesa/mesa-6.3.1.1.ebuild
new file mode 100644
index 000000000000..f8bdf821ffd1
--- /dev/null
+++ b/media-libs/mesa/mesa-6.3.1.1.ebuild
@@ -0,0 +1,155 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-libs/mesa/mesa-6.3.1.1.ebuild,v 1.1 2005/08/10 05:17:10 spyderous Exp $
+
+inherit eutils toolchain-funcs
+
+OPENGL_DIR="xorg-x11"
+
+LIBDRM_PV="1.0.1"
+LIBDRM_P="libdrm-${LIBDRM_PV}"
+
+MY_PN=${PN/m/M}
+MY_P=${MY_PN}-${PV}
+DESCRIPTION="OpenGL-like graphic library for Linux"
+HOMEPAGE="http://mesa3d.sourceforge.net/"
+SRC_URI="http://xorg.freedesktop.org/extras/${MY_P}.tar.gz
+ http://xorg.freedesktop.org/extras/${LIBDRM_P}.tar.gz"
+LICENSE="LGPL-2"
+SLOT="0"
+KEYWORDS="~x86"
+IUSE="motif"
+
+RDEPEND="dev-libs/expat
+ x11-libs/libX11
+ x11-libs/libXext
+ x11-libs/libXxf86vm
+ x11-libs/libXi
+ x11-libs/libXmu
+ >=x11-base/opengl-update-2.2.0
+ motif? ( virtual/motif )"
+DEPEND="${RDEPEND}
+ x11-misc/makedepend"
+
+PROVIDE="virtual/opengl virtual/glu"
+
+S="${WORKDIR}/${MY_P}"
+
+# Think about: ggi, svga, fbcon, no-X configs
+
+pkg_setup() {
+ if use x86; then
+ CONFIG="linux-dri-x86"
+ # amd64 people need to look at this file to deal with lib64 issues, unless
+ # they're fine with hardcoded lib64.
+ elif use amd64; then
+ CONFIG="linux-dri-x86-64"
+ elif use ppc; then
+ CONFIG="linux-dri-ppc"
+ else
+ CONFIG="linux-dri"
+ fi
+}
+
+src_unpack() {
+ HOSTCONF="${S}/configs/${CONFIG}"
+
+ unpack ${A}
+ cd ${S}
+
+ epatch ${FILESDIR}/fix-xthreads-location.patch
+ epatch ${FILESDIR}/use-xthreads.patch
+
+ # Set up linux-dri configs
+ echo "OPT_FLAGS = ${CFLAGS}" >> ${HOSTCONF}
+ echo "CC = $(tc-getCC)" >> ${HOSTCONF}
+ echo "CXX = $(tc-getCXX)" >> ${HOSTCONF}
+ echo "DRM_SOURCE_PATH=\$(TOP)/../${LIBDRM_P}" >> ${HOSTCONF}
+
+ # Removed glut, since we have separate freeglut/glut ebuilds
+ echo "SRC_DIRS = glx/x11 mesa glu glw" >> ${HOSTCONF}
+
+ # Documented in configs/default
+ if use motif; then
+ # Add -lXm
+ echo "GLW_LIB_DEPS = -L$(LIB_DIR) -l$(GL_LIB) $(EXTRA_LIB_PATH) -lXt -lX11 -lXm" >> ${HOSTCONF}
+ # Add GLwMDrawA.c
+ echo "GLW_SOURCES = GLwDrawA.c GLwMDrawA.c" >> ${HOSTCONF}
+ fi
+}
+
+src_compile() {
+ make ${CONFIG} || die "Build failed"
+}
+
+src_install() {
+ dodir /usr
+ make DESTDIR=${D}/usr install || die "Installation failed"
+ dynamic_libgl_install
+
+ # Install libtool archives
+ insinto /usr/$(get_libdir)
+ # (#67729) Needs to be lib, not $(get_libdir)
+ doins ${FILESDIR}/lib/*.la
+
+ # Create the two-number versioned libs (.so.#.#), since only .so.# and
+ # .so.#.#.# were made
+ dosym libGLU.so.1.3.060301 /usr/lib/libGLU.so.1.3
+ dosym libGLw.so.1.0.0 /usr/lib/libGLw.so.1.0
+ dosym libOSMesa.so.6.3.060301 /usr/lib/libOSMesa.so.6.3
+
+ # Figure out why libGL.so.1.5 is built (directfb), and why it's linked to
+ # as the default libGL.so.1
+}
+
+pkg_preinst() {
+ dynamic_libgl_preinst
+}
+
+pkg_postinst() {
+ switch_opengl_implem
+}
+
+dynamic_libgl_install() {
+ # next section is to setup the dynamic libGL stuff
+ 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.so* \
+ ${D}/usr/$(get_libdir)/libGL.la \
+ ${D}/usr/$(get_libdir)/libGL.a; do
+ if [ -f ${x} -o -L ${x} ]; then
+ # libGL.a cause problems with tuxracer, etc
+ mv -f ${x} ${D}/usr/$(get_libdir)/opengl/${OPENGL_DIR}/lib
+ fi
+ done
+ # glext.h added for #54984
+ 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
+ fi
+ done
+ eend 0
+}
+
+dynamic_libgl_preinst() {
+ # clean the dynamic libGL stuff's home to ensure
+ # we don't have stale libs floating around
+ if [ -d ${ROOT}/usr/$(get_libdir)/opengl/${PN} ]; then
+ rm -rf ${ROOT}/usr/$(get_libdir)/opengl/${PN}/*
+ fi
+
+ # make sure we do not have any stale files lying around
+ # that could break things. Check old and new locations.
+ rm -f ${ROOT}/usr/X11R6/$(get_libdir)/libGL\.* \
+ ${ROOT}/usr/$(get_libdir)/libGL\.*
+}
+
+switch_opengl_implem() {
+ # Switch to the xorg implementation.
+ # Use new opengl-update that will not reset user selected
+ # OpenGL interface ...
+ echo
+ local opengl_implem="$(${ROOT}/usr/sbin/opengl-update --get-implementation)"
+ ${ROOT}/usr/sbin/opengl-update --use-old ${OPENGL_DIR}
+}