summaryrefslogtreecommitdiff
blob: 7addcf10f2dabe9eea17fb3e54c58e5e60d01f31 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/pyopengl/pyopengl-2.0.0.44.ebuild,v 1.3 2004/08/14 03:22:20 liquidx Exp $

MY_P=${P/pyopengl/PyOpenGL}
S=${WORKDIR}/${MY_P}

inherit eutils distutils virtualx

DESCRIPTION="Python OpenGL bindings"
HOMEPAGE="http://pyopengl.sourceforge.net/"
SRC_URI="mirror://sourceforge/pyopengl/${MY_P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="x86 ppc sparc mips alpha arm hppa amd64 ia64 ppc64"
IUSE=""

DEPEND="virtual/python
	virtual/glut
	virtual/x11
	virtual/opengl"

src_unpack() {
	unpack ${A}
	EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/config.diff
	EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/${P}-disable_togl.patch
}

src_compile() {
	export maketype="python"
	export python="virtualmake"
	distutils_src_compile
}

src_install() {
	export maketype="python"
	export python="virtualmake"
	distutils_src_install
}

pkg_setup () {
	if [ -e /etc/env.d/09opengl ]
	then
		# Set up X11 implementation
		X11_IMPLEM_P="$(portageq best_version "${ROOT}" virtual/x11)"
		X11_IMPLEM="${X11_IMPLEM_P%-[0-9]*}"
		X11_IMPLEM="${X11_IMPLEM##*\/}"
		einfo "X11 implementation is ${X11_IMPLEM}."

		VOID=$(cat /etc/env.d/09opengl | grep ${X11_IMPLEM})

		USING_X11=$?
		if [ "${USING_X11}" -eq "1" ]
		then
			GL_IMPLEM=$(cat /etc/env.d/09opengl | cut -f5 -d/)
			opengl-update ${X11_IMPLEM}
		fi
	else
		die "Could not find /etc/env.d/09opengl. Please run opengl-update."
	fi
}

pkg_postinst () {
	if [ "${USING_X11}" -eq "1" ]
	then
		opengl-update ${GL_IMPLEM}
	fi
}