summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b5da3eb86a5517d23174230a6c18fbb917f37454 (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
# Maintainer: Tony Lambiris <tony@criticalstack.com>

pkgname=system76-power-git
pkgver=r160.1c347b8
pkgrel=1
pkgdesc="System76 Power Management"
arch=('any')
url="https://github.com/pop-os/system76-power"
license=('GPL')
install=system76-power-git.install
conflicts=("system76-power")
provides=("system76-power")
makedepends=('git' 'rust')
depends=('dbus' 'systemd' 'system76-dkms')
source=("${pkgname}::git+https://github.com/pop-os/system76-power.git"
        "graphics.patch")
sha256sums=('SKIP'
            'c951b97d420bd3e26178b404a24ae334cae54f96ca4930f53ce1d0bc8f83d1dc')

pkgver() {
    cd ${pkgname}

	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
    cd ${pkgname}

    patch -p1 -i ${srcdir}/graphics.patch
}

build() {
    cd ${pkgname}

    #patch -p0 < ${srcdir}/graphics.patch

    # Build and install base package
    cargo build --release
}

package() {
    # Install daemons
    install -Dm755 ${srcdir}/${pkgname}/target/release/system76-power ${pkgdir}/usr/bin/system76-power

    # Install systemd unit files
    install -Dm644 ${srcdir}/${pkgname}/debian/system76-power.service ${pkgdir}/usr/lib/systemd/system/system76-power.service

    # Install scripts and configuration
    install -Dm755 ${srcdir}/${pkgname}/data/system76-power.conf ${pkgdir}/usr/share/dbus-1/system.d/system76-power.conf
}