summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 523bf6dd8240259a7a83a76def17ec40d2cdec4f (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>
pkgname=cosmic-ext-applet-caffeine-git
pkgver=r11.af74b93
pkgrel=1
pkgdesc="Caffeine Applet for the COSMICâ„¢ desktop"
arch=('x86_64')
url="https://github.com/tropicbliss/cosmic-ext-applet-caffeine"
license=('MIT')
depends=('cosmic-applets')
makedepends=(
  'cargo'
  'git'
  'just'
)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("git+https://github.com/tropicbliss/cosmic-ext-applet-caffeine.git"
        'justfile.patch')
sha256sums=('SKIP'
            'bcdb963ae64e1ddc6a9a9d24092fab06fe82cac7bbb6f163e2fa0b13383a7fe1')

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

prepare() {
  cd "${pkgname%-git}"
  patch -Np1 -i ../justfile.patch

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

build() {
  cd "${pkgname%-git}"
  export RUSTUP_TOOLCHAIN=stable
  just build-release --frozen
}

package() {
  cd "${pkgname%-git}"
  just rootdir="$pkgdir" install

  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}