summaryrefslogtreecommitdiff
blob: d428beb0805f1fac503f6f8880e9ad2b758b332a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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.1.ebuild,v 1.1 2005/02/10 06:45:38 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"
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"

S="${WORKDIR}"

src_unpack() {
	unpack ${A}

	# Bug #81199
	sed -i 's/^#warn /#warning /' glxext.h-${GLXEXT}
}

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
}