updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / nvidia-utils-bumblebee / PKGBUILD
blob05ab1e4926e7be4f24df7e19b3d550f06b0d7554
1 # $Id$
2 # Maintainer: Samsagax <samsagax@gmail.com>
3 # Contributor: Thomas Baechler <thomas@archlinux.org>
4 # Contributor: James Rayner <iphitus@gmail.com>
5 pkgname=nvidia-utils-bumblebee
6 #pkgname=('nvidia-utils-bumblebee' 'opencl-nvidia')
7 pkgver=290.10
8 pkgrel=3
9 arch=('i686' 'x86_64')
10 url="http://www.nvidia.com/"
11 license=('custom')
12 options=('!strip')
14 if [ "$CARCH" = "i686" ]; then
15     _arch='x86'
16     _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
17     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
18     md5sums=('50319a4b3818c12c9c7243525e0e6316')
19 elif [ "$CARCH" = "x86_64" ]; then
20     _arch='x86_64'
21     _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
22     source=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
23     md5sums=('cebfba9a7e91716a06c66bb5b38d9661')
26 create_links() {
27     # create soname links
28     while read -d '' _lib; do
29         _soname="$(dirname "${_lib}")/$(readelf -d "${_lib}" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
30         [[ -e "${_soname}" ]] || ln -s "$(basename "${_lib}")" "${_soname}"
31         [[ -e "${_soname/.[0-9]*/}" ]] || ln -s "$(basename "${_soname}")" "${_soname/.[0-9]*/}"
32     done < <(find "${pkgdir}" -type f -name '*.so*' -print0)
35 build() {
36     cd "${srcdir}"
37     sh "${_pkg}.run" --extract-only
40 package() {
41     pkgdesc="NVIDIA drivers utilities and libraries. With LibGL and xorg modules installed in a different directory."
42     depends=('xorg-server' 'libxvmc')
43     optdepends=('gtk2: nvidia-settings' 'pkg-config: nvidia-xconfig'
44                 'opencl-nvidia: OpenCL support')
45     provides=("nvidia-utils=${pkgver}")
46     conflicts=('nvidia-utils')
47     cd "${srcdir}/${_pkg}"
49     # X driver
50     install -D -m755 nvidia_drv.so "${pkgdir}/usr/lib/xorg/modules/drivers/nvidia_drv.so"
51     # GLX extension module for X
52     install -D -m755 "libglx.so.${pkgver}" "${pkgdir}/usr/lib/nvidia-bumblebee/xorg/modules/extensions/libglx.so.${pkgver}"
53     ln -s "libglx.so.${pkgver}" "${pkgdir}/usr/lib/nvidia-bumblebee/xorg/modules/extensions/libglx.so"  # X doesn't find glx otherwise
54     # OpenGL library
55     install -D -m755 "libGL.so.${pkgver}" "${pkgdir}/usr/lib/nvidia-bumblebee/libGL.so.${pkgver}"
56     # OpenGL core library
57     install -D -m755 "libnvidia-glcore.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-glcore.so.${pkgver}"
58     # XvMC
59     install -D -m644 libXvMCNVIDIA.a "${pkgdir}/usr/lib/libXvMCNVIDIA.a"
60     install -D -m755 "libXvMCNVIDIA.so.${pkgver}" "${pkgdir}/usr/lib/libXvMCNVIDIA.so.${pkgver}"
61     # VDPAU
62     install -D -m755 "libvdpau_nvidia.so.${pkgver}" "${pkgdir}/usr/lib/vdpau/libvdpau_nvidia.so.${pkgver}"
63     # nvidia-tls library
64     install -D -m755 "tls/libnvidia-tls.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-tls.so.${pkgver}"
65     install -D -m755 "libnvidia-cfg.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-cfg.so.${pkgver}"
67     install -D -m755 "libnvidia-ml.so.${pkgver}" "${pkgdir}/usr/lib/libnvidia-ml.so.${pkgver}"
69     # nvidia-xconfig
70     install -D -m755 nvidia-xconfig "${pkgdir}/usr/bin/nvidia-xconfig"
71     install -D -m644 nvidia-xconfig.1.gz "${pkgdir}/usr/share/man/man1/nvidia-xconfig.1.gz"
72     # nvidia-settings
73     install -D -m755 nvidia-settings "${pkgdir}/usr/bin/nvidia-settings"
74     install -D -m644 nvidia-settings.1.gz "${pkgdir}/usr/share/man/man1/nvidia-settings.1.gz"
75     install -D -m644 nvidia-settings.desktop "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
76     install -D -m644 nvidia-settings.png "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"
77     sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
78     # nvidia-bug-report
79     install -D -m755 nvidia-bug-report.sh "${pkgdir}/usr/bin/nvidia-bug-report.sh"
80     # nvidia-smi
81     install -D -m755 nvidia-smi "${pkgdir}/usr/bin/nvidia-smi"
82     install -D -m644 nvidia-smi.1.gz "${pkgdir}/usr/share/man/man1/nvidia-smi.1.gz"
85     install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/nvidia/LICENSE"
86     ln -s nvidia "${pkgdir}/usr/share/licenses/nvidia-utils"
87     install -D -m644 README.txt "${pkgdir}/usr/share/doc/nvidia/README"
88     install -D -m644 NVIDIA_Changelog "${pkgdir}/usr/share/doc/nvidia/NVIDIA_Changelog"
89     ln -s nvidia "${pkgdir}/usr/share/doc/nvidia-utils"
91     create_links