summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8964b5681438ecb9968decbf0cb05598efe9d8b6 (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
47
48
49
# Maintainer: Sergio Carmine <me@sergiocarmi.net>

_pkgname=baseic
pkgname=baseic-git
pkgver=0.1.0.r0.b8f68be
pkgrel=1
pkgdesc='A simple numeric conversion tool'
arch=(x86_64)
url=https://github.com/carmisergio/baseic
license=(MIT)

provides=($_pkgname)
conflicts=($_pkgname)
depends=(gcc-libs glibc)
makedepends=(git cargo)
source=(git+$url)
sha256sums=(SKIP)
options=(!lto)

pkgver() {
    cd "$srcdir"/$_pkgname
    git describe --tags --long --abbrev=7 |\
        sed 's/\([^-]*-\)g/r\1/;s/-/./g;s/^v//'
}

prepare() {
    cd "$srcdir"/$_pkgname
    cargo update
    cargo fetch --locked --target $CARCH-unknown-linux-gnu
}

build() {
    cd "$srcdir"/$_pkgname
    cargo build --frozen --release 
}

check() {
    cd "$srcdir"/$_pkgname
    cargo test --frozen
}

package() {
    cd "$srcdir"/$_pkgname
    install -Dm755 -t "$pkgdir"/usr/bin target/release/$_pkgname
    install -Dm644 -t "$pkgdir"/usr/share/licenses/$_pkgname LICENSE
    install -Dm644 -t "$pkgdir"/usr/share/doc/$_pkgname \
        README.md
}