summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7a37c0b8cd86babb7a4f4f1ec44201df66b6680f (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
# Maintainer: Jason Nader <jason.nader@protonmail.com>

pkgname=dyna-git
pkgver=0.1.1.r13.g96545ad
pkgrel=2
pkgdesc='Convert a colorscheme from one terminal emulator to another.'
arch=('x86_64')
url='https://git.sr.ht/~grtcdr/dyna'
license=('MIT')
makedepends=('git' 'cargo')
provides=("${pkgname%-*}")
conflicts=("${pkgname%-*}")
source=("${pkgname%-*}::git+$url")
sha1sums=('SKIP')

pkgver() {
  cd "${pkgname%-*}"
  echo $(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2).r$(git rev-list --count HEAD).g$(git describe --always)
}

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

build() {
  cd "${pkgname%-*}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features
}

package() {
  cd "${pkgname%-*}"
  install -Dm755 -t "${pkgdir}/usr/bin" "target/release/${pkgname%-*}"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname%-*}/LICENSE"
}