summaryrefslogtreecommitdiffstats
path: root/base/ati-utils/Pkgfile
blob: 8ef0af8ebc2be823266e50d43a321faeddd5baf2 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Description: Utilitaire pour cartes graphiques ATI
# URL: http://www.nvidia.com/object/unix.html
# Maintainer: NuTyX core team
# Packager: thierryn1 at hispeed dot ch
# Depends on: 

name=ati-utils
version=11.6
release=1
[ "`uname -m`" == "i686"   ] && _ARCH=x86
[ "`uname -m`" == "x86_64"   ] && _ARCH=x86_64
source=(http://www2.ati.com/drivers/linux/ati-driver-installer-${version/./-}-x86.x86_64.run)

build() {
	sh ati-driver-installer-${version/./-}-x86.x86_64.run --extract ati
	
	# Installation des librairies et utilitaires spécifiques à l'architecture
	install -m755 -d $PKG/etc/ati
	install -m755 -d $PKG/etc/rc.d/init.d/

	install -m755 -d $PKG/usr/lib/dri
	install -m755 -d $PKG/usr/lib/X11/modules/{dri,drivers,extensions/fglrx,linux}

	install -m755 -d $PKG/usr/{include,bin,sbin,lib/fglrx}
	install -m755 -d $PKG/usr/include/X11/extensions
	install -m755 -d $PKG/usr/include/GL

	install -m755 -d $PKG/usr/share/{applications,ati/amdcccle}
	install -m755 -d $PKG/usr/share/licenses/$name
	install -m755 -d $PKG/usr/share/man/man8
	install -m755 -d $PKG/usr/share/pixmaps
	if [ "`uname -m`" == "i686" ]; then
		cd ati/xpic/usr/X11R6/lib/modules
	elif  [ "`uname -m`" == "x86_64" ]; then
		cd ati/xpic_64/usr/X11R6/lib64/modules
	fi
	# install -m644 *.a $PKG/usr/lib/X11/modules/
	install -m755 *.so $PKG/usr/lib/X11/modules/
	install -m755 drivers/*.so $PKG/usr/lib/X11/modules/drivers/
	install -m755 linux/*.so $PKG/usr/lib/X11/modules/linux/

	install -m755 extensions/fglrx/fglrx-libglx.so \
	$PKG/usr/lib/X11/modules/extensions/fglrx/fglrx-libglx.so
	ln -s /usr/lib/X11/modules/extensions/fglrx/fglrx-libglx.so \
	$PKG/usr/lib/X11/modules/extensions/libglx.so

        if [ "`uname -m`" == "i686" ]; then
                cd $SRC/ati/arch/x86/usr
		_lib=lib
        elif  [ "`uname -m`" == "x86_64" ]; then
                cd $SRC/ati/arch/x86_64/usr
		_lib=lib64
        fi
	install -m755 X11R6/bin/* $PKG/usr/bin/
	install -m755 sbin/* $PKG/usr/sbin/
	install -m755 X11R6/${_lib}/fglrx/fglrx-libGL.so.1.2 $PKG/usr/lib/fglrx
	ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 $PKG/usr/lib/fglrx/libGL.so.1.2
	ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 $PKG/usr/lib/fglrx-libGL.so.1.2
	ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 $PKG/usr/lib/libGL.so.1.2
	ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 $PKG/usr/lib/libGL.so.1
	ln -snf /usr/lib/fglrx/fglrx-libGL.so.1.2 $PKG/usr/lib/libGL.so
	install -m755 X11R6/${_lib}/libAMDXvBA.so.1.0 $PKG/usr/lib/
	ln -snf libAMDXvBA.so.1.0 $PKG/usr/lib/libAMDXvBA.so.1
	ln -snf libAMDXvBA.so.1.0 $PKG/usr/lib/libAMDXvBA.so
	install -m755 X11R6/${_lib}/libatiadlxx.so $PKG/usr/lib/
	install -m755 X11R6/${_lib}/libfglrx_dm.so.1.0 $PKG/usr/lib/ 
	install -m755 X11R6/${_lib}/libXvBAW.so.1.0 $PKG/usr/lib/
	ln -snf libXvBAW.so.1.0 $PKG/usr/lib/libXvBAW.so.1
	ln -snf libXvBAW.so.1.0 $PKG/usr/lib/libXvBAW.so
	install -m644 X11R6/${_lib}/*.a $PKG/usr/lib/
	install -m644 X11R6/${_lib}/*.cap $PKG/usr/lib/
	install -m755 X11R6/${_lib}/modules/dri/*.so $PKG/usr/lib/X11/modules/dri/
	install -m755 ${_lib}/*.so* $PKG/usr/lib/
	
	ln -snf /usr/lib/X11/modules/dri/fglrx_dri.so $PKG/usr/lib/dri/fglrx_dri.so
	ln -snf libfglrx_dm.so.1.0 $PKG/usr/lib/libfglrx_dm.so.1
	ln -snf libfglrx_dm.so.1.0 $PKG/usr/lib/libfglrx_dm.so
	ln -snf libatiuki.so.1.0 $PKG/usr/lib/libatiuki.so.1
	ln -snf libatiuki.so.1.0 $PKG/usr/lib/libatiuki.so

	cd $SRC/ati/common
	
	install -m644 usr/X11R6/bin/amdupdaterandrconfig $PKG/usr/bin/
	install -m644 usr/include/GL/*.h $PKG/usr/include/GL/
	install -m755 usr/sbin/*.sh $PKG/usr/sbin/
	install -m644 usr/share/man/man8/*.8 $PKG/usr/share/man/man8/

	install -m644 etc/ati/* $PKG/etc/ati/
	chmod 755 $PKG/etc/ati/authatieventsd.sh
#	install -m755 $SRC/atieventsd.sh $PKG/etc/rc.d/init.d/atieventsd

	install -m644 $SRC/ati/ATI_LICENSE.TXT $PKG/usr/share/licenses/$name/
	mkdir -p $PKG/etc/X11/xorg.conf.d
	cat > $PKG/etc/X11/xorg.conf.d/30-ati.conf << "EOF"
Section "ServerLayout"
        Identifier     "aticonfig Layout"
        Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Module"
EndSection

Section "Monitor"
        Identifier   "aticonfig-Monitor[0]-0"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
EndSection

Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        BusID       "PCI:1:0:0"
EndSection

Section "Screen"
        Identifier "aticonfig-Screen[0]-0"
        Device     "aticonfig-Device[0]-0"
        Monitor    "aticonfig-Monitor[0]-0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection
EOF
}