PKGBUILD 2.71 KB
Newer Older
Helmut Stult's avatar
Helmut Stult committed
1 2 3 4
# Maintainer: Helmut Stult <helmut[at]manjaro[dot]org>

# Arch credits:
# Contributor: Robin Lange <robin dot langenc at gmail dot com>
Helmut Stult's avatar
Helmut Stult committed
5

Philip Müller's avatar
Philip Müller committed
6
pkgname=optimus-manager
Helmut Stult's avatar
Helmut Stult committed
7
pkgver=1.3.1
Helmut Stult's avatar
Helmut Stult committed
8
pkgrel=1
Helmut Stult's avatar
Helmut Stult committed
9
pkgdesc="Management utility to handle GPU switching for Optimus laptops"
Philip Müller's avatar
Philip Müller committed
10 11
arch=('any')
url="https://github.com/Askannz/optimus-manager"
Philip Müller's avatar
Philip Müller committed
12
license=('MIT')
Helmut Stult's avatar
Helmut Stult committed
13 14
conflicts=("optimus-manager-git")
provides=("optimus-manager=$pkgver")
Helmut Stult's avatar
Helmut Stult committed
15
depends=('python3' 'python-setuptools' 'python-dbus' 'mesa-demos' 'xorg-xrandr')
Helmut Stult's avatar
Helmut Stult committed
16
optdepends=('bbswitch: alternative power switching method'
Helmut Stult's avatar
Helmut Stult committed
17
            'acpi_call: alternative power switching method'
Helmut Stult's avatar
Helmut Stult committed
18
            'xf86-video-intel: provides the Xorg intel driver')
Philip Müller's avatar
Philip Müller committed
19
makedepends=('python-setuptools' 'git')
Philip Müller's avatar
Philip Müller committed
20
backup=('etc/optimus-manager/xorg-intel.conf'
Helmut Stult's avatar
Helmut Stult committed
21
        'etc/optimus-manager/xorg-nvidia.conf'
Helmut Stult's avatar
Helmut Stult committed
22

Helmut Stult's avatar
Helmut Stult committed
23 24
        'etc/optimus-manager/xsetup-intel.sh'
        'etc/optimus-manager/xsetup-nvidia.sh'
Helmut Stult's avatar
Helmut Stult committed
25 26 27 28 29 30 31
        '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")
Philip Müller's avatar
Philip Müller committed
32 33
sha256sums=('SKIP')
 
Philip Müller's avatar
Philip Müller committed
34
build() {
Philip Müller's avatar
Philip Müller committed
35
 
Philip Müller's avatar
Philip Müller committed
36
  cd "${srcdir}/optimus-manager/"
Helmut Stult's avatar
Helmut Stult committed
37
  python3 setup.py build
Philip Müller's avatar
Philip Müller committed
38
 
Philip Müller's avatar
Philip Müller committed
39
}
Philip Müller's avatar
Philip Müller committed
40
 
Philip Müller's avatar
Philip Müller committed
41
 
Philip Müller's avatar
Philip Müller committed
42
package() {
Helmut Stult's avatar
Helmut Stult committed
43 44

  install="optimus-manager.install"
Philip Müller's avatar
Philip Müller committed
45
 
Philip Müller's avatar
Philip Müller committed
46 47
  cd "${srcdir}/optimus-manager/"
 
Philip Müller's avatar
Philip Müller committed
48
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
Helmut Stult's avatar
Helmut Stult committed
49
  install -Dm644 modules/optimus-manager.conf "$pkgdir/usr/lib/modprobe.d/optimus-manager.conf"
Philip Müller's avatar
Philip Müller committed
50 51 52
  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"
  
Helmut Stult's avatar
Helmut Stult committed
53 54 55 56 57
  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"
  
Philip Müller's avatar
Philip Müller committed
58 59 60
  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"
  
Helmut Stult's avatar
Helmut Stult committed
61 62
  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"
Helmut Stult's avatar
Helmut Stult committed
63 64 65 66
  install -Dm755 config/xsetup-hybrid.sh "$pkgdir/etc/optimus-manager/xsetup-hybrid.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"
Philip Müller's avatar
Philip Müller committed
67
 
Helmut Stult's avatar
Helmut Stult committed
68
  python3 setup.py install --root="$pkgdir/" --optimize=1 --skip-build
Philip Müller's avatar
Philip Müller committed
69 70
 
}