summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 583b768b28e64ee42ec1a7d538f32acb22363cd8 (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: tleydxdy <shironeko(at)waifu(dot)club>
pkgname=system76-power
pkgver=1.2.4
pkgrel=1
pkgdesc="System76 Power Management"
arch=('x86_64' 'aarch64')
url="https://github.com/pop-os/system76-power"
license=('GPL-3.0-or-later')
depends=(
  'dbus'
  'libusb'
  'polkit'
)
makedepends=('cargo')
optdepends=(
  'system76-acpi-dkms: only needed for systems using open firmware with kernels <5.16'
  'system76-dkms: needed for systems using proprietary firmware'
)
provides=('power-profiles-daemon')
install="$pkgname.install"
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz"
        'use-mkinitcpio.patch')
sha256sums=('ab27688b22256006b2ca12cbaf41c99abd17213fe33f4e7c1ed41e1ac05613b7'
            'bae03d96faea0f7ea80cb1cc5d4f2f97804509db378aaacb3e1d08cd38e05765')

prepare() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"

  # use 'mkinitcpio -P' in place of 'update-initramfs -u'
  patch -Np1 -i "$srcdir/use-mkinitcpio.patch"
}

build() {
  cd "$pkgname-$pkgver"
  CFLAGS+=" -ffat-lto-objects"
  export RUSTUP_TOOLCHAIN=stable
  ARGS+=" --frozen" make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="${pkgdir}" install
}