summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <eradicator@gentoo.org>2005-02-08 10:09:12 +0000
committerJeremy Huddleston <eradicator@gentoo.org>2005-02-08 10:09:12 +0000
commit48b59c4315dd539de3a119baa561913e80498692 (patch)
tree774654e092533a016d43d4eca189daa2c39c0129 /x11-base/opengl-update
parentVersion bump, security fix. Bug #81075. (diff)
downloadhistorical-48b59c4315dd539de3a119baa561913e80498692.tar.gz
historical-48b59c4315dd539de3a119baa561913e80498692.tar.bz2
historical-48b59c4315dd539de3a119baa561913e80498692.zip
Version bump does major code cleanup and adds --prefix and --dst-prefix options to close bug #55212.
Package-Manager: portage-2.0.51.16
Diffstat (limited to 'x11-base/opengl-update')
-rw-r--r--x11-base/opengl-update/ChangeLog10
-rw-r--r--x11-base/opengl-update/Manifest12
-rw-r--r--x11-base/opengl-update/files/digest-opengl-update-2.1_pre72
-rw-r--r--x11-base/opengl-update/files/opengl-update-2.1_pre5300
-rw-r--r--x11-base/opengl-update/files/opengl-update-2.1_pre7341
-rw-r--r--x11-base/opengl-update/opengl-update-2.1_pre7.ebuild75
6 files changed, 434 insertions, 306 deletions
diff --git a/x11-base/opengl-update/ChangeLog b/x11-base/opengl-update/ChangeLog
index a184932e677a..1f2812213861 100644
--- a/x11-base/opengl-update/ChangeLog
+++ b/x11-base/opengl-update/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for x11-base/opengl-update
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/x11-base/opengl-update/ChangeLog,v 1.68 2005/02/07 08:51:15 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/x11-base/opengl-update/ChangeLog,v 1.69 2005/02/08 10:09:12 eradicator Exp $
+
+*opengl-update-2.1_pre7 (08 Feb 2005)
+
+ 08 Feb 2005; Jeremy Huddleston <eradicator@gentoo.org>
+ -files/opengl-update-2.1_pre5, +files/opengl-update-2.1_pre7,
+ +opengl-update-2.1_pre7.ebuild:
+ Version bump does major code cleanup and adds --prefix and --dst-prefix
+ options to close bug #55212.
*opengl-update-2.1_pre6 (07 Feb 2005)
diff --git a/x11-base/opengl-update/Manifest b/x11-base/opengl-update/Manifest
index ac696899138e..b380c0ca975b 100644
--- a/x11-base/opengl-update/Manifest
+++ b/x11-base/opengl-update/Manifest
@@ -1,7 +1,7 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-MD5 d4f1a44829bd90d8eaff423322bbcceb ChangeLog 12346
+MD5 cd60188816ac6ea5bbb63b0be85f6093 ChangeLog 12646
MD5 f4a810bc95a74e27b27973e4e948a937 metadata.xml 358
MD5 5b48e832f6c2794525ab473968ad7071 opengl-update-1.5.ebuild 525
MD5 4e8eebd835dbf4f24182d7cce7af8ab7 opengl-update-1.7.2.ebuild 541
@@ -10,6 +10,7 @@ MD5 1a24f101a73042eef1bc8ded313b9984 opengl-update-2.0_pre4-r1.ebuild 1740
MD5 763f994c2b49a6c6ba2c418ab334617c opengl-update-2.1_pre4.ebuild 2184
MD5 c4bd3ca5f011edc8adfaff3f32c0babd opengl-update-2.0_pre5.ebuild 1741
MD5 7b9e65256ce455a4a4ae0c3933e31e61 opengl-update-2.1_pre6.ebuild 2439
+MD5 b20e96250e63f098e35868d5d4865916 opengl-update-2.1_pre7.ebuild 2439
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-opengl-update-1.5 0
MD5 d41d8cd98f00b204e9800998ecf8427e files/digest-opengl-update-1.7.2 0
MD5 745fdf145b2e08f0c996a3ca40b1ca16 files/digest-opengl-update-1.8.2 64
@@ -22,13 +23,14 @@ MD5 b31a661444c7d54a6782b9e075f6744a files/opengl-update-2.1_pre4 7624
MD5 745fdf145b2e08f0c996a3ca40b1ca16 files/digest-opengl-update-2.1_pre4 64
MD5 745fdf145b2e08f0c996a3ca40b1ca16 files/digest-opengl-update-2.0_pre5 64
MD5 f21996de10b91b58cced8fbcc6c44792 files/opengl-update-2.0_pre5 9738
-MD5 7c98968a3936fdf1261644a33baee368 files/opengl-update-2.1_pre5 7792
MD5 cf5944150fa11c202f013103cd362c9b files/opengl-update-2.1_pre6 7792
MD5 bbec0e16e4f45a464cec5b4feeecaa9b files/digest-opengl-update-2.1_pre6 116
+MD5 a3191c8989b8d00551856a0dc822452f files/opengl-update-2.1_pre7 8856
+MD5 bbec0e16e4f45a464cec5b4feeecaa9b files/digest-opengl-update-2.1_pre7 116
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
-iD8DBQFCByxIArHZZzCEUG0RAouXAKCLF/A3k32421sbIiazS6XKlvsl3ACggE4a
-LqgbaonvAs0kXhuKE0uPvSM=
-=dQyJ
+iD8DBQFCCI/xArHZZzCEUG0RAoOtAJ0WiXa9i3qXdx3EJfKLFvhgKMxZiQCgh5ku
+jlyvEN1fiyuVhCRpJSknVb8=
+=ghv3
-----END PGP SIGNATURE-----
diff --git a/x11-base/opengl-update/files/digest-opengl-update-2.1_pre7 b/x11-base/opengl-update/files/digest-opengl-update-2.1_pre7
new file mode 100644
index 000000000000..6a175f487f3b
--- /dev/null
+++ b/x11-base/opengl-update/files/digest-opengl-update-2.1_pre7
@@ -0,0 +1,2 @@
+MD5 ad3eba2841c01c0a94b6477d11d5ac31 glext.h-26.bz2 32485
+MD5 3260a509b23a3519b8df335a4e8f5e1d glxext.h-10.bz2 5895
diff --git a/x11-base/opengl-update/files/opengl-update-2.1_pre5 b/x11-base/opengl-update/files/opengl-update-2.1_pre5
deleted file mode 100644
index 0703be0ea3ef..000000000000
--- a/x11-base/opengl-update/files/opengl-update-2.1_pre5
+++ /dev/null
@@ -1,300 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/x11-base/opengl-update/files/opengl-update-2.1_pre5,v 1.2 2005/02/07 08:22:11 eradicator Exp $
-# Author: Martin Schlemmer <azarah@gentoo.org>
-# Further modifications by Donnie Berkholz <spyderous@gentoo.org>
-# Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>
-# Further modifications by Jeremy Huddleston <eradicator@gentoo.org>
-
-. /etc/init.d/functions.sh
-
-need_version() {
- local X11 X11_VER X11_MAJOR_VER X11_MINOR_VER X11_MICRO_VER ERROR_MSG
- ERROR_MSG="This version requires >=x11-base/xorg-x11-6.8.0-r4"
- X11="$(portageq match / virtual/x11)"
- # Got the egrep from ferringb, who got it from portage code
- X11_VER="$(echo ${X11} | egrep -o '(cvs\.)?([[:digit:]]+)((\.[[:digit:]]+)*)([a-z]?)((_(pre|p|beta|alpha|rc)[[:digit:]]*)*)(-r([[:digit:]]+))?$')"
- X11_MAJOR_VER="${X11_VER%%.*}"
- # Hack around a little to get the minor version
- X11_MINOR_VER="${X11_VER#*.}"
- X11_MINOR_VER="${X11_MINOR_VER%%.*}"
- X11_REVISION_VER="${X11_VER##*-r}"
-
- # If version <6.*, die
- if [ ${X11_MAJOR_VER} -lt 6 ]
- then
- einfo "Detected X ${X11_MAJOR_VER}.${X11_MINOR_VER} series, revision ${X11_REVISION_VER}"
- eerror "${ERROR_MSG}"
- exit 1
- # If version =6.* and <6.8.*, die
- elif [ ${X11_MAJOR_VER} -eq 6 -a ${X11_MINOR_VER} -lt 8 ]
- then
- einfo "Detected X ${X11_MAJOR_VER}.${X11_MINOR_VER} series, revision ${X11_REVISION_VER}"
- eerror "${ERROR_MSG}"
- exit 1
- # If version =6.8.0 and <r4, die
- elif [ "${X11_VER}" = "6.8.0" ]
- then
- if [ ! ${X11_REVISION_VER} -lt 4 ]
- then
- einfo "Detected X ${X11_MAJOR_VER}.${X11_MINOR_VER} series, revision ${X11_REVISION_VER}"
- eerror "${ERROR_MSG}"
- exit 1
- fi
- fi
-}
-
-count_implementations() {
- local DIR
- COUNT="0"
- for DIR in $(ls /usr/lib/opengl)
- do
- if [ "${DIR}" != "global" ]
- then
- DIRS="${DIRS} ${DIR}"
- COUNT="$((COUNT + 1))"
- fi
- done
-}
-
-usage() {
-# In addition to the below function, there are two extra uses for this.
-#
-# They aren't in the printed help message because they're intended
-# for developer use.
-# 1) --use-old $NEW_IMPLEM will switch to the new implementation only if
-# no old setup existed (i.e., X has never been installed)
-# 2) --get-implementation will return the implementation
-
-count_implementations
-
-# Get grammar right in message
-local IS_ARE IMPLEM_PLURAL
-if [ ${COUNT} -eq 1 ]
-then
- IS_ARE="is"
- IMPLEM_PLURAL=""
-else
- IS_ARE="are"
- IMPLEM_PLURAL="s"
-fi
-
-cat << FOO
-usage: ${0##*/} <GL implementation>
-
-note:
- This utility switches between OpenGL implementations. There ${IS_ARE}
- ${COUNT} available implementation${IMPLEM_PLURAL}: ${DIRS}.
-
-examples:
- ${0##*/} xorg-x11
- This will setup things to use libGL.so from X.org.
-
- ${0##*/} nvidia
- This will setup things to use libGL.so from the nVidia drivers.
-
-FOO
- exit 1
-}
-
-need_version
-
-if [ "$#" -ne 1 -a "$#" -ne 2 ] || \
- [ "$#" -eq 2 -a "$1" != "--use-old" ]
-then
- usage
-fi
-
-GL_IMPLEM=""
-
-# Discover GL implementation if it exists
-get_implem() {
- if [ -f /etc/env.d/03opengl ]
- then
- source /etc/env.d/03opengl
- if [ -n "${LDPATH}" ]
- then
- GL_IMPLEM="${LDPATH%%:*}"
- GL_IMPLEM="${GL_IMPLEM##*opengl/}"
- GL_IMPLEM="${GL_IMPLEM%/lib*}"
- unset LDPATH
- fi
- fi
-}
-
-# Return current GL implementation
-if [ "$1" = "--get-implementation" ]
-then
- get_implem
-
- if [ -n "${GL_IMPLEM}" ]
- then
- echo "${GL_IMPLEM}"
- fi
-
- if [ -z "${GL_IMPLEM}" ]
- then
- exit 2
- fi
-
- exit 0
-fi
-
-if [ $(id -u) -ne 0 ]
-then
- eerror "${0}: must be root."
- exit 1
-fi
-
-# Only use specified implementation if it is not already selected.
-if [ "$1" = "--use-old" ]
-then
- shift
-
- get_implem
-
- if [ -z "${GL_IMPLEM}" ]
- then
- GL_IMPLEM="$1"
- fi
-else
- GL_IMPLEM="$1"
-fi
-
-if [ ! -d /usr/lib/opengl/${GL_IMPLEM} ]
-then
- usage
-fi
-
-ebegin "Switching to ${GL_IMPLEM} OpenGL interface"
- rm -f /etc/env.d/03opengl &> /dev/null
-
- LIBDIRS="lib lib32 lib64"
- for LIBDIR in ${LIBDIRS}; do
- # Special case handling of lib32 because it can be a symlink to
- # emul libs
- if [ "${LIBDIR}" = "lib32" ]; then
- [ -d "/usr/${LIBDIR}" ] || continue
- else
- [ -d "/usr/${LIBDIR}" -a ! -h "/usr/${LIBDIR}" ] || continue
- fi
-
- # System wide tls stuff
- [ -h "/usr/${LIBDIR}/tls" ] && rm -f /usr/${LIBDIR}/tls
- [ -d "/usr/${LIBDIR}/tls" ] || mkdir -p /usr/${LIBDIR}/tls
-
- # Fallback on xorg-x11 if we don't have this implementation for this LIBDIR.
- if [ ! -d /usr/${LIBDIR}/opengl/"${GL_IMPLEM}" ]; then
- GL_LOCAL="xorg-x11"
- else
- GL_LOCAL="${GL_IMPLEM}"
- fi
-
- # Provide the right libnvidia-tls depending on ntpl or not
- if [ "${GL_LOCAL}" = "nvidia" ]; then
- if [ -e "/usr/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls" ]; then
- rm -f /usr/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls
- fi
-
- if getconf GNU_LIBPTHREAD_VERSION | grep -i nptl; then
- ln -sf /usr/${LIBDIR}/opengl/${GL_LOCAL}/tls /usr/${LIBDIR}/opengl/${GL_IMPLEM}/lib/tls
- # This shouldn't be neccessary...
- #ldpath="${ldpath:+${ldpath}:}/usr/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls"
- fi
- fi
-
- pushd /usr/${LIBDIR}
- # First remove old symlinks
- for file in libGL.so* libGLcore.so* libnvidia-tls.so* tls/libnvidia-tls.so*; do
- [ -h ${file} ] && rm -f ${file}
- done
-
- # Note that we don't do .so*, just .so on purpose. The
- # loader knows to look in the profile dir, and the
- # linked just needs the .so
- for file in opengl/${GL_LOCAL}/lib/*.{so,a,la}; do
- [ -f "${file}" ] || continue
- rm -f $(basename ${file})
-
- # Fix libtool archives (#48297)
- if [ "${file%.la}" != "${file}" ]; then
- sed "s:/usr/[^/]*/opengl/[^/]*/lib:/usr/${LIBDIR}:g" ${file} > $(basename ${file})
- else
- ln -s ${file}
- fi
- done
- popd
-
- if [ -e "/usr/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls" ]; then
- pushd /usr/${LIBDIR}/tls
- for file in ../opengl/${GL_LOCAL}/lib/tls/*.{so,a,la}; do
- [ -f "${file}" ] || continue
- rm -f $(basename ${file})
-
- # Fix libtool archives (#48297)
- if [ "${file%.la}" != "${file}" ]; then
- sed "s:/usr/[^/]*/opengl/[^/]*/lib:/usr/${LIBDIR}:g" ${file} > $(basename ${file})
- else
- ln -s ${file}
- fi
- done
- popd
- fi
-
- if [ -e "/usr/${LIBDIR}/opengl/${GL_LOCAL}/extensions" ]; then
- mkdir -p /usr/${LIBDIR}/modules/extensions
- pushd /usr/${LIBDIR}/modules/extensions
- # First remove old symlinks
- for file in libglx.so libglx.a; do
- [ -h ${file} ] && rm -f ${file}
- done
-
- for file in ../../opengl/${GL_LOCAL}/extensions/*.{so,a,la}; do
- [ -f "${file}" ] || continue
- rm -f $(basename ${file})
-
- # Fix libtool archives (#48297)
- if [ "${file%.la}" != "${file}" ]; then
- sed "s:/usr/[^/]*/opengl/[^/]*/lib:/usr/${LIBDIR}:g" ${file} > $(basename ${file})
- else
- ln -s ${file}
- fi
- done
- popd
- fi
-
- # Setup the includes
- if [ -e "/usr/${LIBDIR}/opengl/${GL_LOCAL}/include" ]; then
- for x in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
- if [ -e /usr/X11R6/include/GL/${x} ]; then
- rm -f /usr/X11R6/include/GL/${x}
- fi
-
- # IMPORTANT
- # It is preferable currently to use the standard glext.h file
- # however if an OpenGL provider must use a self produced glext.h
- # then it should be installed to ${GL_IMPLEM}/include
-
- if [ -e /usr/${LIBDIR}/opengl/${GL_IMPLEM}/include/${x} ]; then
- ln -sf /usr/${LIBDIR}/opengl/${GL_IMPLEM}/include/${x} \
- /usr/X11R6/include/GL/${x}
- else
- ln -sf /usr/${LIBDIR}/opengl/global/include/${x} \
- /usr/X11R6/include/GL/${x}
- fi
- done
- fi
-
- # Setup the $LDPATH
- ldpath="${ldpath:+${ldpath}:}/usr/${LIBDIR}/opengl/${GL_LOCAL}/lib"
-
- done &> /dev/null
-
- echo "LDPATH=\"${ldpath}\"" > /etc/env.d/03opengl
-
- env-update
-
-eend 0
-
-# vim:ts=4
diff --git a/x11-base/opengl-update/files/opengl-update-2.1_pre7 b/x11-base/opengl-update/files/opengl-update-2.1_pre7
new file mode 100644
index 000000000000..28f670a8990b
--- /dev/null
+++ b/x11-base/opengl-update/files/opengl-update-2.1_pre7
@@ -0,0 +1,341 @@
+#!/bin/bash
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/opengl-update/files/opengl-update-2.1_pre7,v 1.1 2005/02/08 10:09:12 eradicator Exp $
+# Author: Martin Schlemmer <azarah@gentoo.org>
+# Further modifications by Donnie Berkholz <spyderous@gentoo.org>
+# Further modifications based off submissions to bug #54984 <cyfred@gentoo.org>
+# Further modifications by Jeremy Huddleston <eradicator@gentoo.org>
+
+. /etc/init.d/functions.sh
+
+hasq() {
+ local x
+
+ local me=${1}
+ shift
+
+ for x in "${@}"; do
+ if [[ "${x}" == "${me}" ]]; then
+ return 0
+ fi
+ done
+ return 1
+}
+
+check_user() {
+ if [[ $(id -u) -ne 0 ]]; then
+ eerror "${0}: Must be run as root."
+ exit 1
+ fi
+}
+
+check_version() {
+ if ! portageq has_version / '>=x11-base/xorg-x11-6.8.0-r4'; then
+ eerror "This version requires >=x11-base/xorg-x11-6.8.0-r4"
+ exit 1
+ fi
+}
+
+get_current_implem() {
+ local implem
+ if [[ -f ${ENV_D} ]]; then
+ source ${ENV_D}
+ if [[ -n "${OPENGL_PROFILE}" ]]; then
+ implem="${OPENGL_PROFILE}"
+ elif [[ -n "${LDPATH}" ]]; then
+ implem="${LDPATH%%:*}"
+ implem="${implem##*opengl/}"
+ implem="${implem%/lib*}"
+ fi
+ unset LDPATH
+ unset OPENGL_PROFILE
+ fi
+
+ echo ${implem}
+}
+
+get_implementations() {
+ local implems
+ for dir in ${PREFIX}/lib{,32,64}/opengl/*; do
+ if [[ -d "${dir}" && ${dir##*/} != "global" ]] && ! hasq ${dir##*/} ${implems}; then
+ implems=${implems:+${implems} }${dir##*/}
+ fi
+ done
+ echo ${implems}
+}
+
+usage() {
+ # Get grammar right in message
+ local IS_ARE IMPLEM_PLURAL
+ if [[ $(echo ${AVAIL_IMPLEMS} | wc -w) -eq 1 ]]; then
+ IS_ARE="is"
+ IMPLEM_PLURAL=""
+ else
+ IS_ARE="are"
+ IMPLEM_PLURAL="s"
+ fi
+
+ cat << FOO
+Usage: ${0##*/} [<options>] <GL implementation>
+ Set the opengl implementation.
+ Valid options:
+ --use-old: only change the implementation if isn't already set.
+ --prefix: set the source prefix (default: /usr)
+ --dst-prefix: set the destination prefix (default: /usr)
+
+Usage: ${0##*/} --get-implementation
+ Print the current implementaion
+
+Note:
+ This utility switches between OpenGL implementations. There ${IS_ARE}
+ $(echo ${AVAIL_IMPLEMS} | wc -w) available implementation${IMPLEM_PLURAL}: ${AVAIL_IMPLEMS}
+
+Examples:
+ ${0##*/} xorg-x11
+ This will setup things to use libGL.so from X.org.
+
+ ${0##*/} nvidia
+ This will setup things to use libGL.so from the nVidia drivers.
+
+FOO
+ exit 1
+}
+
+parse_options() {
+ local opt
+ while [[ ${#} -gt 0 ]]; do
+ opt=${1}
+ shift
+ case ${opt} in
+ --use-old)
+ if [[ -n "${ACTION}" ]]; then
+ ACTION="error"
+ eerror "Invalid usage."
+ else
+ if [[ -n "${CURRENT_GL_IMPLEM}" ]] && hasq ${CURRENT_GL_IMPLEM} ${AVAIL_IMPLEMS}; then
+ ACTION="nothing"
+ fi
+ fi
+ ;;
+ --get-implementation)
+ if [[ -n "${ACTION}" ]]; then
+ ACTION="error"
+ eerror "Invalid usage."
+ else
+ ACTION="get-implementation"
+ fi
+ ;;
+ --prefix=*)
+ PREFIX=${opt#*=}
+ AVAIL_IMPLEMS=$(get_implementations)
+ ;;
+ --dst-prefix=*)
+ DST_PREFIX=${opt#*=}
+ ;;
+ --help|-h|-?)
+ ACION="usage"
+ ;;
+ *)
+ if hasq ${opt} ${AVAIL_IMPLEMS}; then
+ NEW_GL_IMPLEM="${opt}"
+ if [[ "${ACTION}" != "nothing" ]]; then
+ if [[ -n "${ACTION}" ]]; then
+ ACTION="error"
+ eerror "Invalid usage."
+ else
+ ACTION="set-implementation"
+ fi
+ fi
+ else
+ eerror "Unrecognized option: ${opt}"
+ ACTION="error"
+ fi
+ ;;
+ esac
+ done
+}
+
+set-new-implementation() {
+ local GL_IMPLEM=${1}
+ local GL_LOCAL
+
+ check_version
+
+ ebegin "Switching to ${GL_IMPLEM} OpenGL interface"
+ rm -f ${ENV_D} &> /dev/null
+
+ LIBDIRS="lib lib32 lib64"
+ for LIBDIR in ${LIBDIRS}; do
+ # Special case handling of lib32 because it can be a symlink to
+ # emul libs
+ if [[ "${LIBDIR}" = "lib32" ]]; then
+ [[ -d "${PREFIX}/${LIBDIR}" ]] || continue
+ else
+ [[ -d "${PREFIX}/${LIBDIR}" && ! -h "${PREFIX}/${LIBDIR}" ]] || continue
+ fi
+
+ # System wide tls stuff
+ [[ -h "${DST_PREFIX}/${LIBDIR}/tls" ]] && rm -f ${DST_PREFIX}/${LIBDIR}/tls
+ [[ -d "${DST_PREFIX}/${LIBDIR}/tls" ]] || mkdir -p ${DST_PREFIX}/${LIBDIR}/tls
+
+ # Fallback on xorg-x11 if we don't have this implementation for this LIBDIR.
+ if [[ ! -d ${PREFIX}/${LIBDIR}/opengl/"${GL_IMPLEM}" ]]; then
+ GL_LOCAL="xorg-x11"
+ else
+ GL_LOCAL="${GL_IMPLEM}"
+ fi
+
+ # Provide the right libnvidia-tls depending on ntpl or not
+ if [[ "${GL_LOCAL}" = "nvidia" ]]; then
+ if [[ -e "${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls" ]]; then
+ rm -f ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls &> /dev/null
+ fi
+
+ if getconf GNU_LIBPTHREAD_VERSION | grep -qi nptl; then
+ ln -sf ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/tls ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/lib/tls &> /dev/null
+ fi
+ fi
+
+ mkdir -p ${DST_PREFIX}/${LIBDIR}
+ pushd ${DST_PREFIX}/${LIBDIR} &> /dev/null
+ # First remove old symlinks
+ for file in libGL.so* libGLcore.so* libnvidia-tls.so* tls/libnvidia-tls.so*; do
+ [[ -h ${file} ]] && rm -f ${file}
+ done
+
+ # Note that we don't do .so*, just .so on purpose. The
+ # loader knows to look in the profile dir, and the
+ # linked just needs the .so
+ for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/*.{so,a,la}; do
+ [[ -f "${file}" ]] || continue
+ [[ -f "${file##*/}" ]] && rm -f ${file##*/}
+
+ # Fix libtool archives (#48297)
+ if [[ "${file%.la}" != "${file}" ]]; then
+ sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}
+ else
+ ln -s ${file}
+ fi
+ done
+ popd &> /dev/null
+
+ if [[ -e "${PREFIX}/${LIBDIR}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls" ]]; then
+ mkdir -p ${DST_PREFIX}/${LIBDIR}/tls
+ pushd ${DST_PREFIX}/${LIBDIR}/tls &> /dev/null
+ for file in ${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib/tls/*.{so,a,la}; do
+ [[ -f "${file}" ]] || continue
+ [[ -f "${file##*/}" ]] && rm -f ${file##*/}
+
+ # Fix libtool archives (#48297)
+ if [ "${file%.la}" != "${file}" ]; then
+ sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}
+ else
+ ln -s ${file}
+ fi
+ done
+ popd &> /dev/null
+ fi
+
+ if [[ -e "${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/extensions" ]]; then
+ mkdir -p ${DST_PREFIX}/${LIBDIR}/modules/extensions
+ pushd ${DST_PREFIX}/${LIBDIR}/modules/extensions &> /dev/null
+ # First remove old symlinks
+ for file in libglx.so libglx.a; do
+ [[ -h ${file} ]] && rm -f ${file}
+ done
+
+ for file in ${PREFIX}/opengl/${GL_LOCAL}/extensions/*.{so,a,la}; do
+ [[ -f "${file}" ]] || continue
+ [[ -f "${file##*/}" ]] && rm -f ${file##*/}
+
+ # Fix libtool archives (#48297)
+ if [[ "${file%.la}" != "${file}" ]]; then
+ sed "s:${PREFIX}/[^/]*/opengl/[^/]*/lib:${DST_PREFIX}/${LIBDIR}:g" ${file} > ${file##*/}
+ else
+ ln -s ${file}
+ fi
+ done
+ popd &> /dev/null
+ fi
+
+ # Setup the includes
+ mkdir -p ${DST_PREFIX}/X11R6/include/GL
+ pushd ${DST_PREFIX}/X11R6/include/GL &> /dev/null
+ for file in gl.h glx.h glxtokens.h glext.h glxext.h glxmd.h glxproto.h; do
+ [[ -f "${file}" ]] && rm -f ${file}
+
+ # IMPORTANT
+ # It is preferable currently to use the standard glext.h file
+ # however if an OpenGL provider must use a self produced glext.h
+ # then it should be installed to ${GL_IMPLEM}/include
+
+ if [[ -e ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file} ]]; then
+ if [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${file} ]]; then
+ ewarn "Profile-specific header file is being used for ${file} instead of the global version provided."
+ fi
+ ln -s ${PREFIX}/${LIBDIR}/opengl/${GL_IMPLEM}/include/${file}
+ elif [[ -e ${PREFIX}/${LIBDIR}/opengl/global/include/${file} ]]; then
+ ln -s ${PREFIX}/${LIBDIR}/opengl/global/include/${file}
+ fi
+ done
+ popd &> /dev/null
+
+ # Setup the $LDPATH
+ ldpath="${ldpath:+${ldpath}:}${PREFIX}/${LIBDIR}/opengl/${GL_LOCAL}/lib"
+
+ done
+
+ echo "LDPATH=\"${ldpath}\"" > ${ENV_D}
+ echo "OPENGL_PROFILE=\"${GL_IMPLEM}\"" >> ${ENV_D}
+
+ env-update
+
+ eend 0
+}
+
+ENV_D="/etc/env.d/03opengl"
+NEW_GL_IMPLEM=""
+ACTION=""
+PREFIX="/usr"
+DST_PREFIX="/usr"
+AVAIL_IMPLEMS=$(get_implementations)
+CURRENT_GL_IMPLEM=$(get_current_implem)
+
+check_user
+parse_options ${@}
+
+case ${ACTION} in
+ get-implementation)
+ if [[ -n "${CURRENT_GL_IMPLEM}" ]]; then
+ echo ${CURRENT_GL_IMPLEM}
+ exit 0
+ else
+ exit 2
+ fi
+ ;;
+ set-implementation)
+ if [[ -n "${NEW_GL_IMPLEM}" ]]; then
+ set-new-implementation ${NEW_GL_IMPLEM}
+ exit $?
+ else
+ usage
+ exit 1
+ fi
+ ;;
+ nothing)
+ exit 0
+ ;;
+ usage)
+ usage
+ exit 0
+ ;;
+ error)
+ usage
+ exit 1
+ ;;
+ *)
+ usage
+ exit 1
+ ;;
+esac
diff --git a/x11-base/opengl-update/opengl-update-2.1_pre7.ebuild b/x11-base/opengl-update/opengl-update-2.1_pre7.ebuild
new file mode 100644
index 000000000000..12c9ea73be74
--- /dev/null
+++ b/x11-base/opengl-update/opengl-update-2.1_pre7.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/x11-base/opengl-update/opengl-update-2.1_pre7.ebuild,v 1.1 2005/02/08 10:09:12 eradicator Exp $
+
+inherit multilib toolchain-funcs
+
+DESCRIPTION="Utility to change the OpenGL interface being used"
+HOMEPAGE="http://www.gentoo.org/"
+
+# Source:
+# http://oss.sgi.com/projects/ogl-sample/ABI/glext.h
+# http://oss.sgi.com/projects/ogl-sample/ABI/glxext.h
+
+GLEXT="26"
+GLXEXT="10"
+
+SRC_URI="http://dev.gentoo.org/~eradicator/opengl/glext.h-${GLEXT}.bz2
+ http://dev.gentoo.org/~eradicator/opengl/glxext.h-${GLXEXT}.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+KEYWORDS="~alpha ~amd64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+#Removed: ~arm ~hppa ~ia64 due to insufficient xorg-x11 version
+IUSE=""
+RESTRICT="multilib-pkg-force"
+
+DEPEND="virtual/libc
+ app-arch/bzip2"
+
+RDEPEND="!x11-base/xfree86
+ !<x11-base/xorg-x11-6.8.0-r4
+ !<media-video/ati-drivers-8.8.25-r3"
+
+pkg_preinst() {
+ # It needs to be before 04multilib
+ [ -f "${ROOT}/etc/env.d/09opengl" ] && mv ${ROOT}/etc/env.d/09opengl ${ROOT}/etc/env.d/03opengl
+
+ OABI="${ABI}"
+ for ABI in $(get_install_abis); do
+ if [ -e "${ROOT}/usr/$(get_libdir)/opengl/xorg-x11/lib/libMesaGL.so" ]; then
+ einfo "Removing libMesaGL.so from xorg-x11 profile. See bug #47598."
+ rm -f ${ROOT}/usr/$(get_libdir)/opengl/xorg-x11/lib/libMesaGL.so
+ fi
+ if [ -e "${ROOT}/usr/$(get_libdir)/libMesaGL.so" ]; then
+ einfo "Removing libMesaGL.so from /usr/$(get_libdir). See bug #47598."
+ rm -f ${ROOT}/usr/$(get_libdir)/libMesaGL.so
+ fi
+ done
+ ABI="${OABI}"
+ unset OABI
+}
+
+src_install() {
+ newsbin ${FILESDIR}/opengl-update-${PV} opengl-update || die
+
+ # MULTILIB-CLEANUP: Fix this when FEATURES=multilib-pkg is in portage
+ local MLTEST=$(type dyn_unpack)
+ if has_multilib_profile && [ "${MLTEST/set_abi}" = "${MLTEST}" ]; then
+ OABI="${ABI}"
+ for ABI in $(get_install_abis); do
+ # Install default glext.h
+ insinto /usr/$(get_libdir)/opengl/global/include
+ newins ${WORKDIR}/glext.h-${GLEXT} glext.h || die
+ newins ${WORKDIR}/glxext.h-${GLXEXT} glxext.h || die
+ done
+ ABI="${OABI}"
+ unset OABI
+ else
+ # Install default glext.h
+ insinto /usr/$(get_libdir)/opengl/global/include
+ newins ${WORKDIR}/glext.h-${GLEXT} glext.h || die
+ newins ${WORKDIR}/glxext.h-${GLXEXT} glxext.h || die
+ fi
+}