updated on Sat Jan 14 00:11:12 UTC 2012
[aur-mirror.git] / nvidia-utils-256 / PKGBUILD
blob9a9d46579ade854261a21a063e7b087b57e59828
1 # Syco <SycoLTH at gmail dot com>
3 pkgname=nvidia-utils-256
4 pkgver=256.53
5 pkgrel=3
6 pkgdesc="NVIDIA drivers utilities and libraries."
7 arch=('i686' 'x86_64')
8 url="http://www.nvidia.com/"
9 depends=('xorg-server' 'libxvmc')
10 optdepends=('gtk2: nvidia-settings' 'pkg-config: nvidia-xconfig')
11 conflicts=('libgl' 'nvidia-utils')
12 provides=('libgl' "nvidia-utils=${pkgver}")
13 license=('custom')
14 install=nvidia.install
15 options=('!strip')
16 backup=('etc/X11/xorg.conf.d/20-nvidia.conf')
18 if [ "$CARCH" = "i686" ]; then
19     _arch='x86'
20     _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
21     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
22         md5sums=('21fe3fe0afed7818b7adf383477b2155')
23 elif [ "$CARCH" = "x86_64" ]; then
24     _arch='x86_64'
25     _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
26     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
27         md5sums=('73f08a19e00d05165cbbfc74e2fa4bdd')
30 source[1]='20-nvidia.conf'
31 md5sums[1]='541cb36684b6764ccba73d7afe268bf5'
33 build() {
34     cd ${srcdir}
35     sh ${_pkg}.run --extract-only
38 package() {
39     cd ${srcdir}/${_pkg}
41     # X driver
42     install -D -m755 nvidia_drv.so ${pkgdir}/usr/lib/xorg/modules/drivers/nvidia_drv.so
43     # GLX extension module for X
44     install -D -m755 libglx.so.${pkgver} ${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so.${pkgver}
45     ln -s libglx.so.${pkgver} ${pkgdir}/usr/lib/xorg/modules/extensions/libglx.so   # X doesn't find glx otherwise
46     # OpenGL library
47     install -D -m755 libGL.so.${pkgver} ${pkgdir}/usr/lib/libGL.so.${pkgver}
48     # OpenGL core library
49     install -D -m755 libnvidia-glcore.so.${pkgver} ${pkgdir}/usr/lib/libnvidia-glcore.so.${pkgver}
50     # XvMC
51     install -D -m644 libXvMCNVIDIA.a ${pkgdir}/usr/lib/libXvMCNVIDIA.a
52     install -D -m755 libXvMCNVIDIA.so.${pkgver} ${pkgdir}/usr/lib/libXvMCNVIDIA.so.${pkgver}
53     # VDPAU
54     install -D -m755 libvdpau_nvidia.so.${pkgver} ${pkgdir}/usr/lib/vdpau/libvdpau_nvidia.so.${pkgver}
55     # CUDA
56     install -D -m755 libcuda.so.${pkgver} ${pkgdir}/usr/lib/libcuda.so.${pkgver}
57     # nvidia-tls library
58     install -D -m755 tls/libnvidia-tls.so.${pkgver} ${pkgdir}/usr/lib/libnvidia-tls.so.${pkgver}
59     # OpenCL
60     install -D -m755 libnvidia-compiler.so.${pkgver} ${pkgdir}/usr/lib/libnvidia-compiler.so.${pkgver}
61     install -D -m755 libOpenCL.so.1.0.0 ${pkgdir}/usr/lib/libOpenCL.so.1.0.0
62     install -D -m644 nvidia.icd ${pkgdir}/etc/OpenCL/vendors/nvidia.icd
64     install -D -m755 libnvidia-cfg.so.${pkgver} ${pkgdir}/usr/lib/libnvidia-cfg.so.${pkgver}
66     # create soname links
67     for _lib in $(find ${pkgdir} -name '*.so*'); do
68         _soname="$(dirname ${_lib})/$(readelf -d "$_lib" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
69         if [ ! -e "${_soname}" ]; then
70             ln -s "$(basename ${_lib})" "${_soname}"
71             ln -s "$(basename ${_soname})" "${_soname/.[0-9]*/}"
72         fi
73     done
76     # nvidia-xconfig
77     install -D -m755 nvidia-xconfig ${pkgdir}/usr/bin/nvidia-xconfig
78     install -D -m644 nvidia-xconfig.1.gz ${pkgdir}/usr/share/man/man1/nvidia-xconfig.1.gz
79     # nvidia-settings
80     install -D -m755 nvidia-settings ${pkgdir}/usr/bin/nvidia-settings
81     install -D -m644 nvidia-settings.1.gz ${pkgdir}/usr/share/man/man1/nvidia-settings.1.gz
82     install -D -m644 nvidia-settings.desktop ${pkgdir}/usr/share/applications/nvidia-settings.desktop
83     install -D -m644 nvidia-settings.png ${pkgdir}/usr/share/pixmaps/nvidia-settings.png
84     sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i ${pkgdir}/usr/share/applications/nvidia-settings.desktop
85     # nvidia-bug-report
86     install -D -m755 nvidia-bug-report.sh ${pkgdir}/usr/bin/nvidia-bug-report.sh
87     # nvidia-smi
88     install -D -m755 nvidia-smi ${pkgdir}/usr/bin/nvidia-smi
89     install -D -m644 nvidia-smi.1.gz ${pkgdir}/usr/share/man/man1/nvidia-smi.1.gz
92     install -D -m644 LICENSE ${pkgdir}/usr/share/licenses/nvidia/LICENSE
93     ln -s nvidia ${pkgdir}/usr/share/licenses/nvidia-utils
94     install -D -m644 README.txt ${pkgdir}/usr/share/doc/nvidia/README
95     install -D -m644 NVIDIA_Changelog ${pkgdir}/usr/share/doc/nvidia/NVIDIA_Changelog
96     ln -s nvidia ${pkgdir}/usr/share/doc/nvidia-utils
98     # Install xorg.conf.d file for nvidia autodetection in xorg.conf-less configurations
99     install -D -m644 ${srcdir}/20-nvidia.conf ${pkgdir}/etc/X11/xorg.conf.d/20-nvidia.conf