summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ede128a0221a15d1ccfa690ef8b5f30903bfa9e2 (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: Robin Candau <antiz@archlinux.org>

pkgname=ame-git
_pkgname=amethyst
_shortname="${pkgname%-git}"
pkgver=4.0.3.r643.182daa2
pkgrel=2
pkgdesc='Amethyst is a fast and efficient AUR helper (git version)'
arch=('x86_64' 'aarch64')
url="https://git.getcryst.al/crystal/software/${_pkgname}"
license=('GPL3')
provides=("${_shortname}")
conflicts=("${_shortname}")
depends=(
    'git'
    'pacman-contrib'
    'vim'
    'expac'
    'less'
)
makedepends=('cargo')
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${_pkgname}"
    printf "%s.r%s.%s" "$(git tag | tail -1 | sed 's/^v//')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

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 --frozen --release
}

package() {
    cd "${_pkgname}"
    install -Dm 755 "target/release/${_shortname}" "${pkgdir}/usr/bin/${_shortname}"
    install -Dm 644 README.md "${pkgdir}/usr/share/doc/${_shortname}/README.md"
}