summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b91b1a19f8103d11a9aa889a0a9e01e9cdd64dc6 (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Corey Hinshaw <corey@electrickite.org>
pkgname=system76-firmware-git
pkgver=1.0.62.r4.g987eb58
pkgrel=1
pkgdesc="System76 Firmware Tool and Daemon"
arch=('x86_64' 'aarch64')
url="https://github.com/pop-os/system76-firmware"
license=('GPL-3.0-or-later')
depends=(
  'ca-certificates'
  'dbus'
  'dfu-programmer'
  'gcc-libs'
  'glibc'
  'efibootmgr'
  'openssl'
  'xz'
)
makedepends=(
  'cargo'
  'git'
)
provides=("${pkgname%-git}" 'system76-firmware-daemon')
conflicts=("${pkgname%-git}" 'system76-firmware-daemon')
source=('git+https://github.com/pop-os/system76-firmware.git')
sha256sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"
  git describe --long --tags --abbrev=7 | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

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

build() {
  cd "${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  ARGS+=" --frozen" make
}

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

  mv "$pkgdir"/etc/systemd "$pkgdir"/usr/lib/
}