summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 24cfcf5197b3c9984e5605b446a762a7628e0ec0 (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
# Maintainer: Robin Candau <robincandau[at]protonmail[dot]com>

pkgname=ame-git
_pkgname=amethyst
_shortname="${pkgname%-git}"
pkgver=4.0.3.r643.182daa2
pkgrel=1
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 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"
}