summaryrefslogtreecommitdiffstats
path: root/abs/extra/nvidia-settings/PKGBUILD
blob: 798993ed1be1b56da3e8c8f22d7d3d38d4064995 (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
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgbase=nvidia-settings
pkgname=('nvidia-settings' 'libxnvctrl')
pkgver=375.26
pkgrel=1
pkgdesc="Tool for configuring the NVIDIA graphics driver"
arch=('i686' 'x86_64')
url="https://github.com/NVIDIA/nvidia-settings"
license=('GPL2')
makedepends=('git' 'inetutils' 'gtk2' 'jansson' 'gtk3' 'libxv' 'libvdpau' 'nvidia-utils' 'libxext')
options=('staticlibs')
source=(ftp://download.nvidia.com/XFree86/nvidia-settings/nvidia-settings-${pkgver}.tar.bz2
        libxnvctrl_so.patch)
sha512sums=('e575670ccf7e3ef0089ee6a969f107f6f43d742a60cc325c6d95efc4773f34a6e013fd2c4e38b5f90054e24146a05c2300c0cf6a9b7013b556bacc1402956f49'
            'ed4b609de9691fbb4421eea340399331e7a5c5f47b9de8eade40ca8f78ac39a6f76cc106928cd0d79825f248a3a0eb563a10f68b7b6991cf3e28db0dde2a0f8d')

prepare() {
  export PREFIX=/usr
  export NV_USE_BUNDLED_LIBJANSSON=0
  cd ${pkgbase}-${pkgver}
  patch -p1 < "${srcdir}/libxnvctrl_so.patch"
}

build() {
  cd ${pkgbase}-${pkgver}
  make
  make -C src/libXNVCtrl
}

package_nvidia-settings() {
  depends=('jansson' 'gtk3' 'libxv' 'libvdpau' 'nvidia-utils' 'libxnvctrl')

  cd ${pkgbase}-${pkgver}
  make DESTDIR="${pkgdir}" install

  install -D -m644 doc/nvidia-settings.desktop "${pkgdir}/usr/share/applications/nvidia-settings.desktop"
  install -D -m644 doc/nvidia-settings.png "${pkgdir}/usr/share/pixmaps/nvidia-settings.png"
  sed -e 's:__UTILS_PATH__:/usr/bin:' -e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' -i "${pkgdir}/usr/share/applications/nvidia-settings.desktop"

  rm "$pkgdir/usr/lib/libnvidia-gtk2.so.$pkgver"
}

package_libxnvctrl() {
  depends=('libxext')
  pkgdesc='NVIDIA NV-CONTROL X extension'

  cd ${pkgbase}-${pkgver}
  install -Dm 644 doc/{NV-CONTROL-API.txt,FRAMELOCK.txt} -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 samples/{Makefile,README,*.c,*.h,*.mk} -t "${pkgdir}/usr/share/doc/${pkgname}/samples"

  cd src/libXNVCtrl
  install -Dm 644 *.h -t "${pkgdir}/usr/include/NVCtrl"
  install -Dm 644 libXNVCtrl.a -t "${pkgdir}/usr/lib"
  install -Dm 755 libXNVCtrl.so.0.0.0 -t "${pkgdir}/usr/lib"
  ln -s libXNVCtrl.so.0.0.0 "${pkgdir}/usr/lib/libXNVCtrl.so.0"
  ln -s libXNVCtrl.so.0 "${pkgdir}/usr/lib/libXNVCtrl.so"
}

# vim: ts=2 sw=2 et: