2 #actual maintiner: ilikenwf/Matt Parnell <parwok@gmail.com>
3 # Contributor: Bartek Piotrowski <barthalion@gmail.com>
4 # Contributor: Det <nimetonmaili AT gmail dot com>
5 # Contributor: Dan Vratil <vratil@progdansoft.com>
6 # Contributor: Ng Oon-Ee <n g o o n e e AT g mail dot com>
7 # Contributor: Amaury Couste <amaury.couste@gmail.com>
8 # Contributor: James Rayner <iphitus@gmail.com>
9 # Contributor: Thomas Baechler <thomas@archlinux.org>
10 # Contributor: Nuno Aniceto aka quarkup <nuno.aja@gmail.com>
11 # Contributor: mar77i <mysatyre at gmail dot com>
14 true && pkgname=('nvidia-zen' 'nvidia-utils')
18 pkgdesc="NVIDIA drivers for the custom built zen-kernel"
19 url='http://www.nvidia.com/'
20 arch=('i686' 'x86_64')
23 if [ "$CARCH" = "i686" ]; then
25 _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
26 source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
27 md5sums=('50319a4b3818c12c9c7243525e0e6316')
28 elif [ "$CARCH" = "x86_64" ]; then
30 _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
31 source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
32 md5sums=('cebfba9a7e91716a06c66bb5b38d9661')
39 # Extract the nvidia drivers
40 sh "${_pkg}.run" --extract-only
42 msg "Building module..."
43 cd "${srcdir}/${_pkg}/kernel"
44 make "SYSSRC=/usr/src/linux-${_kernver}" module &> /dev/null
47 package_nvidia-utils() {
48 pkgdesc='NVIDIA drivers utilities and libraries'
49 depends=('xorg-server' 'libxvmc')
50 optdepends=('gtk2: nvidia-settings')
52 provides=('libgl' 'libcl')
53 install='nvidia-utils.install'
56 install -D -m755 nvidia_drv.so "$pkgdir/usr/lib/xorg/modules/drivers/nvidia_drv.so"
57 # GLX extension module for X
58 install -D -m755 "libglx.so.$pkgver" "$pkgdir/usr/lib/xorg/modules/extensions/libglx.so.$pkgver"
59 ln -s "libglx.so.$pkgver" "$pkgdir/usr/lib/xorg/modules/extensions/libglx.so" # X doesn't find glx otherwise
61 install -D -m755 "libGL.so.$pkgver" "$pkgdir/usr/lib/libGL.so.$pkgver"
63 install -D -m755 "libnvidia-glcore.so.$pkgver" "$pkgdir/usr/lib/libnvidia-glcore.so.$pkgver"
65 install -D -m644 libXvMCNVIDIA.a "$pkgdir/usr/lib/libXvMCNVIDIA.a"
66 install -D -m755 "libXvMCNVIDIA.so.$pkgver" "$pkgdir/usr/lib/libXvMCNVIDIA.so.$pkgver"
68 install -D -m755 "libvdpau_nvidia.so.$pkgver" "$pkgdir/usr/lib/vdpau/libvdpau_nvidia.so.$pkgver"
70 install -D -m755 "libcuda.so.$pkgver" "$pkgdir/usr/lib/libcuda.so.$pkgver"
71 install -D -m755 "libnvcuvid.so.$pkgver" "$pkgdir/usr/lib/libnvcuvid.so.$pkgver"
73 install -D -m755 "tls/libnvidia-tls.so.$pkgver" "$pkgdir/usr/lib/libnvidia-tls.so.$pkgver"
75 install -D -m755 "libnvidia-compiler.so.$pkgver" "$pkgdir/usr/lib/libnvidia-compiler.so.$pkgver"
76 install -D -m755 libOpenCL.so.1.0.0 "$pkgdir/usr/lib/libOpenCL.so.1.0.0"
77 install -D -m644 nvidia.icd "$pkgdir/etc/OpenCL/vendors/nvidia.icd"
79 install -D -m755 "libnvidia-cfg.so.$pkgver" "$pkgdir/usr/lib/libnvidia-cfg.so.$pkgver"
80 install -D -m755 "libnvidia-ml.so.$pkgver" "$pkgdir/usr/lib/libnvidia-ml.so.$pkgver"
82 # create soname links - in an unbelievably ugly fashion.
83 while read -d '' _lib; do
84 _soname="$(dirname ${_lib})/$(readelf -d "$_lib" | sed -nr 's/.*Library soname: \[(.*)\].*/\1/p')"
85 [[ -e "${_soname}" ]] || ln -s "$(basename ${_lib})" "${_soname}"
86 [[ -e "${_soname/.[0-9]*/}" ]] || ln -s "$(basename ${_soname})" "${_soname/.[0-9]*/}"
87 done < <(find "$pkgdir" -type f -name '*.so*' -print0)
90 install -D -m755 nvidia-xconfig "$pkgdir/usr/bin/nvidia-xconfig"
91 install -D -m644 nvidia-xconfig.1.gz "$pkgdir/usr/share/man/man1/nvidia-xconfig.1.gz"
93 install -D -m755 nvidia-settings "$pkgdir/usr/bin/nvidia-settings"
94 install -D -m644 nvidia-settings.1.gz "$pkgdir/usr/share/man/man1/nvidia-settings.1.gz"
95 install -D -m644 nvidia-settings.desktop "$pkgdir/usr/share/applications/nvidia-settings.desktop"
96 install -D -m644 nvidia-settings.png "$pkgdir/usr/share/pixmaps/nvidia-settings.png"
97 sed -i 's:__UTILS_PATH__:/usr/bin:; s:__PIXMAP_PATH__:/usr/share/pixmaps:' \
98 "$pkgdir/usr/share/applications/nvidia-settings.desktop"
100 install -D -m755 nvidia-bug-report.sh "$pkgdir/usr/bin/nvidia-bug-report.sh"
102 install -D -m755 nvidia-smi "$pkgdir/usr/bin/nvidia-smi"
103 install -D -m644 nvidia-smi.1.gz "$pkgdir/usr/share/man/man1/nvidia-smi.1.gz"
105 install -D -m644 LICENSE "$pkgdir/usr/share/licenses/nvidia/LICENSE"
106 ln -s nvidia "$pkgdir/usr/share/licenses/nvidia-utils"
107 install -D -m644 README.txt "$pkgdir/usr/share/doc/nvidia/README"
108 install -D -m644 NVIDIA_Changelog "$pkgdir/usr/share/doc/nvidia/NVIDIA_Changelog"
109 ln -s nvidia "$pkgdir/usr/share/doc/nvidia-utils"
112 package_nvidia-zen(){
113 pkgdesc='NVIDIA drivers for the zen-kernel'
114 conflicts=('nvidia-71xx' 'nvidia-96xx' 'nvidia-173xx' 'nvidia-legacy' 'nvidia')
115 depends=("nvidia-utils")
116 makedepends=('linux-headers')
118 install='nvidia-zen.install'
122 if [ $_compress = "y" ]; then
123 msg2 "Compressing module with gzip..."
124 gzip -9 "${srcdir}/${_pkg}/kernel/$_modname"
125 _modname="nvidia.ko.gz"
127 msg2 "Installing module..."
128 install -D -m644 "${srcdir}/${_pkg}/kernel/$_modname" "${pkgdir}/lib/modules/${_kernver}/kernel/drivers/video/$_modname"
130 # Blacklist the Nouveau driver (avoiding possible conflicts by appending the -all suffix)
131 install -d -m755 "${pkgdir}/etc/modprobe.d"
132 echo "blacklist nouveau" > "${pkgdir}/etc/modprobe.d/nouveau_blacklist-all.conf"