lib32-nvidia-utils: fixed md5sum
[chakra-packages:lib32.git] / lib32-nvidia-utils / PKGBUILD
1 # Lib32 Packages for Chakra, part of chakra-project.org
2
3 _pkgbasename=nvidia-utils
4 pkgname=lib32-$_pkgbasename
5 pkgver=331.20
6 pkgrel=1
7 pkgdesc="NVIDIA drivers utilities and libraries. (32-bit)"
8 arch=('x86_64')
9 url="http://www.nvidia.com/"
10 depends=('lib32-libxvmc' 'lib32-zlib' 'lib32-gcc-libs' $_pkgbasename=$pkgver)
11 conflicts=('lib32-libgl')
12 provides=('lib32-libgl')
13 license=('custom')
14 options=('!strip')
15
16 _filearch='x86'
17 _pkg="NVIDIA-Linux-${_filearch}-${pkgver}"
18 source=("http://us.download.nvidia.com/XFree86/Linux-${_filearch}/${pkgver}/${_pkg}.run")
19 md5sums=('801aa04a087891690f1cac09575b2ba9')
20
21 build() {
22     cd $srcdir
23     sh ${_pkg}.run --extract-only
24 }
25
26 package() {
27     cd $srcdir/${_pkg}
28
29     # OpenGL library
30     install -D -m755 libGL.so.$pkgver $pkgdir/usr/lib32/libGL.so.$pkgver
31     # OpenGL core library
32     install -D -m755 libnvidia-glcore.so.$pkgver $pkgdir/usr/lib32/libnvidia-glcore.so.$pkgver
33     # VDPAU
34     install -D -m755 libvdpau_nvidia.so.$pkgver $pkgdir/usr/lib32/vdpau/libvdpau_nvidia.so.$pkgver
35     # CUDA
36     install -D -m755 libcuda.so.$pkgver $pkgdir/usr/lib32/libcuda.so.$pkgver
37     install -D -m755 libnvcuvid.so.$pkgver $pkgdir/usr/lib32/libnvcuvid.so.$pkgver
38     # nvidia-tls library
39     install -D -m755 tls/libnvidia-tls.so.$pkgver $pkgdir/usr/lib32/libnvidia-tls.so.$pkgver
40     # OpenCL
41     install -D -m755 libnvidia-compiler.so.$pkgver $pkgdir/usr/lib32/libnvidia-compiler.so.$pkgver
42     install -D -m755 libOpenCL.so.1.0.0 $pkgdir/usr/lib32/libOpenCL.so.1.0.0
43
44     install -D -m755 libnvidia-cfg.so.$pkgver $pkgdir/usr/lib32/libnvidia-cfg.so.$pkgver
45     install -D -m755 libnvidia-ml.so.$pkgver $pkgdir/usr/lib32/libnvidia-ml.so.$pkgver
46
47     # create soname links
48     for _lib in $(find $pkgdir -name '*.so*'); do
49         _soname="$(dirname ${_lib})/$(readelf -d "$_lib" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
50         if [ ! -e "${_soname}" ]; then
51             ln -s "$(basename ${_lib})" "${_soname}"
52             ln -s "$(basename ${_soname})" "${_soname/.[0-9]*/}"
53         fi
54     done
55
56     rm -rf "${pkgdir}"/usr/{include,share,bin}
57     mkdir -p "$pkgdir/usr/share/licenses"
58     ln -s $_pkgbasename "$pkgdir/usr/share/licenses/$pkgname"
59 }