summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ad6ff533081df46d47dfe3088146dce7e7fdaa89 (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
70
71
72
73
# Maintainer: Robin Lange <robin dot langenc at gmail dot com>

pkgname=optimus-manager-git
pkgver=1.3
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'
         'python-py3nvml' 'python-psutil')
optdepends=('bbswitch: alternative power switching method'
            'acpi_call: alternative power switching method'
            'xf86-video-intel: provides the Xorg intel driver')
makedepends=('python-setuptools' 'git')
backup=('etc/optimus-manager/xorg-integrated-gpu.conf'
        'etc/optimus-manager/xorg-nvidia-gpu.conf'

        'etc/optimus-manager/xsetup-integrated.sh'
        'etc/optimus-manager/xsetup-nvidia.sh'
        'etc/optimus-manager/xsetup-hybrid.sh'

        'etc/optimus-manager/nvidia-enable.sh'
        'etc/optimus-manager/nvidia-disable.sh'

        'var/lib/optimus-manager/persistent/startup_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/"
  /usr/bin/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 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-integrated-gpu.conf "$pkgdir/etc/optimus-manager/xorg-integrated-gpu.conf"
  install -Dm644 config/xorg-nvidia-gpu.conf "$pkgdir/etc/optimus-manager/xorg-nvidia-gpu.conf"
  
  install -Dm755 config/xsetup-nvidia.sh "$pkgdir/etc/optimus-manager/xsetup-nvidia.sh"
  install -Dm755 config/xsetup-hybrid.sh "$pkgdir/etc/optimus-manager/xsetup-hybrid.sh"
  install -Dm755 config/xsetup-integrated.sh "$pkgdir/etc/optimus-manager/xsetup-integrated.sh"

  install -Dm755 config/nvidia-enable.sh "$pkgdir/etc/optimus-manager/nvidia-enable.sh"
  install -Dm755 config/nvidia-disable.sh "$pkgdir/etc/optimus-manager/nvidia-disable.sh"
 
  /usr/bin/python3 setup.py install --root="$pkgdir/" --optimize=1 --skip-build
 
}