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

pkgname=dyna-git
pkgver=0.1.1.r13.g96545ad
pkgrel=1
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%-*}"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

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

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