summaryrefslogtreecommitdiff
blob: a5ae5fd183b5eb9076252b5201a0c4b5423d93b3 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-video/ati-drivers-extra/ati-drivers-extra-3.2.8-r1.ebuild,v 1.5 2004/06/25 00:36:12 agriffis Exp $

IUSE="qt kde gnome"

DESCRIPTION="Ati precompiled drivers extra applications"
HOMEPAGE="http://www.ati.com"
SRC_URI="http://www2.ati.com/drivers/linux/fglrx-glc22-4.3.0-${PV}.i586.rpm"
SLOT="${KV}"
LICENSE="ATI GPL-2 QPL-1.0"
KEYWORDS="-* x86"

DEPEND="app-arch/rpm2targz
	>=x11-base/xfree-4.3.0
	=media-video/ati-drivers-${PV}*
	qt? ( >=x11-libs/qt-3.0 )"

RDEPEND="=media-video/ati-drivers-${PV}*
		qt? ( >=x11-libs/qt-3.0 )"

ATIBIN="${D}/opt/ati/bin"
RESTRICT="nostrip"

src_unpack() {
	cd ${WORKDIR}
	rpm2targz ${DISTDIR}/${A} ||die
	tar zxf ${WORKDIR}/fglrx-glc22-4.3.0-${PV}.i586.tar.gz || die
	mkdir ${WORKDIR}/fglrxgears
	cd ${WORKDIR}/fglrxgears
	tar zxf ${WORKDIR}/usr/src/ATI/fglrx_sample_source.tgz || die
	mv xc/programs/fgl_glxgears/* .
	cp Makefile.Linux Makefile.Linux.orig || die
	#defining USE_GLU allows this to compile with NVIDIA headers just fine
	sed -e "s:-I/usr/X11R6/include:-D USE_GLU -I/usr/X11R6/include:" Makefile.Linux.orig > Makefile.Linux || die
	cd ${WORKDIR}
	local OLDBIN="/usr/X11R6/bin"
	local ATIBIN="${D}/opt/ati/bin"
	mkdir fglrx_panel
	cd fglrx_panel
	tar zxf ${WORKDIR}/usr/src/ATI/fglrx_panel_sources.tgz || die
	sed -e "s:"${OLDBIN}":"${ATIBIN}":"\
	Makefile >Makefile.new
	mv Makefile.new Makefile
}

pkg_setup(){
	check_KV || die "please ensure /usr/src/linux points to your kernel symlink"
}


src_compile() {
	einfo "building the fgl_glxgears sample"
	cd ${WORKDIR}/fglrxgears
	make -f Makefile.Linux || ewarn "fgl_glxgears sample not build"

	if use qt
	then
	einfo "building the qt fglx panel"
		cd ${WORKDIR}/fglrx_panel
		emake || die
	fi
}


src_install() {
	local ATI_ROOT="/usr/lib/opengl/ati"
	cd ${WORKDIR}
	exeinto /opt/ati/bin
	doexe fglrxgears/fgl_glxgears
	rm usr/X11R6/bin/*

	if use qt
	then
		doexe fglrx_panel/fireglcontrol
	fi
}