summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 611fa7a9264697493d2b5d81aed0bcee232804c6 (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
62
63
64
65
66
67
68
69
# Maintainer: Robin Lange <robin dot langenc at gmail dot com>
# Contributor: Robin Lange <robin dot langenc at gmail dot com>
pkgname=optimus-manager-git
pkgver=1.2.2.r2.gb4d07c7
pkgrel=1
pkgdesc="Management utility to handle GPU switching for Optimus laptops (Git version)"
arch=('any')
url="https://github.com/Askannz/optimus-manager"
license=('MIT')
conflicts=("optimus-manager")
provides=("optimus-manager=$pkgver")
depends=('python3' 'python-setuptools' 'python-dbus' 'mesa-demos' 'xorg-xrandr')
optdepends=('bbswitch: alternative power switching method'
            'xf86-video-intel: provides the Xorg intel driver')
makedepends=('python-setuptools' 'git')
backup=('etc/optimus-manager/xorg-intel.conf'
        'etc/optimus-manager/xorg-nvidia.conf'
        'etc/optimus-manager/xsetup-intel.sh'
        'etc/optimus-manager/xsetup-nvidia.sh'
        'var/lib/optimus-manager/startup_mode'
        'var/lib/optimus-manager/requested_mode')
source=("git+https://github.com/Askannz/optimus-manager.git#branch=master")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/optimus-manager/"
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
 
build() {
 
  cd "${srcdir}/optimus-manager/"
  python3 setup.py build
 
}
 
 
package() {

  install="optimus-manager.install"
 
  cd "${srcdir}/optimus-manager/"
 
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 modules/optimus-manager.conf "$pkgdir/usr/lib/modprobe.d/optimus-manager.conf"
  install -Dm644 systemd/optimus-manager.service "$pkgdir/usr/lib/systemd/system/optimus-manager.service"
  install -Dm644 optimus-manager.conf "$pkgdir/usr/share/optimus-manager.conf"
  
  install -Dm644 systemd/logind/10-optimus-manager.conf "$pkgdir/usr/lib/systemd/logind.conf.d/10-optimus-manager.conf"
  
  install -Dm644 var/startup_mode "$pkgdir/var/lib/optimus-manager/startup_mode"
  install -Dm644 var/requested_mode "$pkgdir/var/lib/optimus-manager/requested_mode"
  
  install -Dm755 scripts/prime-switch-boot "$pkgdir/usr/bin/prime-switch-boot"
  install -Dm755 scripts/prime-switch "$pkgdir/usr/bin/prime-switch"
  install -Dm755 scripts/prime-offload "$pkgdir/usr/bin/prime-offload"
  
  install -Dm644 login_managers/sddm/20-optimus-manager.conf "$pkgdir/etc/sddm.conf.d/20-optimus-manager.conf"
  install -Dm644 login_managers/lightdm/20-optimus-manager.conf  "$pkgdir/etc/lightdm/lightdm.conf.d/20-optimus-manager.conf"
  
  install -Dm644 config/xorg-intel.conf "$pkgdir/etc/optimus-manager/xorg-intel.conf"
  install -Dm644 config/xorg-nvidia.conf "$pkgdir/etc/optimus-manager/xorg-nvidia.conf"
  
  install -Dm755 config/xsetup-intel.sh "$pkgdir/etc/optimus-manager/xsetup-intel.sh"
  install -Dm755 config/xsetup-nvidia.sh "$pkgdir/etc/optimus-manager/xsetup-nvidia.sh"
 
  python3 setup.py install --root="$pkgdir/" --optimize=1 --skip-build
 
}