summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 91e88c5dffbb6367269f2c73a5f79210638f45f3 (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
# Maintainer: Corey Hinshaw <coreyhinshaw(at)gmail(dot)com>

pkgname=hidpi-daemon
pkgver=18.04.0
pkgrel=1
pkgdesc="Daemon to manage HiDPI and LoDPI monitors on X"
arch=('any')
url="https://github.com/pop-os/hidpi-daemon"
license=('GPL')
depends=(
  'acpid'
  'python>=3.6'
  'python-pydbus'
  'python-gobject'
  'python-xlib'
  'libnotify')
makepdepends=(
  'python-pyflakes')
conflicts=('system76-driver<17.10.32')
source=(
  "https://github.com/pop-os/${pkgname}/archive/${pkgver}.tar.gz")
sha1sums=(
  '2f3780e6965f70f28769c495249b91492137211b')

package() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # Build and install base package
  python setup.py install --prefix=/usr --root=${pkgdir} --optimize=1

  # Install daemons and executables
  install -m755 -D hidpi-daemon ${pkgdir}/usr/lib/${pkgname}/hidpi-daemon
  install -m755 -D hidpi-notification ${pkgdir}/usr/lib/${pkgname}/hidpi-notification

  # Install desktop launchers
  install -m644 -D hidpi-daemon.desktop ${pkgdir}/etc/xdg/autostart/hidpi-daemon.desktop
  install -m644 -D hidpi-frontend.desktop ${pkgdir}/etc/xdg/autostart/hidpi-frontend.desktop

  # Install schema
  install -m644 -D com.system76.hidpi.gschema.xml ${pkgdir}/usr/share/glib-2.0/schemas/com.system76.hidpi.gschema.xml

  # Create empty /var/lib package directory
  mkdir -p ${pkgdir}/var/lib/${pkgname}

  # Clean up
  rm -rf ${pkgdir}/usr/lib/python*/site-packages/hidpidaemon/{__pycache__,tests}
}