summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e81d595b103e6599e0c31434e4c32fb27d0ab816 (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
_pkgname=wl-gammarelay-applet
pkgname=${_pkgname}-git
pkgver=r16.9b06dec
pkgrel=1
pkgdesc="Control wl-gammarelay-rs via applet"
arch=(any)
url=https://github.com/junelva/wl-gammarelay-applet
license=(MIT)
makedepends=(cargo sed git)
conflicts=(${_pkgname})
source=(
  "git+$url.git"
)
sha256sums=(
  'SKIP'
)

pkgver() {
  cd ${srcdir}/${_pkgname}
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}

prepare() {
  cd ${srcdir}/${_pkgname}
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd ${srcdir}/${_pkgname}
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  export RUSTFLAGS=-Awarnings       # Suppress warnings, as build generates a lot of then and they are not relevant to end user
  cargo build --frozen --release --all-features
}

package() {
  cd ${srcdir}/${_pkgname}
  install -Dm0755 -t "$pkgdir/usr/bin/" target/release/${_pkgname}
}