summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6201c18583f8a3c21b754e822428feed11156967 (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
50
# Maintainer: gesh <gesh AT gesh DOT uni DOT cx>

pkgname=pizauth-git
_pkgname="${pkgname%-git}"
pkgver=1.0.4.r0.gcaf045c
pkgrel=2
pkgdesc="OAuth2 token requester daemon"
arch=('i686' 'x86_64')
url="https://github.com/ltratt/${_pkgname}"
license=('MIT' 'Apache-2.0')
provides=("$_pkgname")
makedepends=(git cargo)
source=("${pkgname}::git+${url}.git")
sha256sums=('SKIP')

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

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

build() {
    cd "$pkgname"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    export CFLAGS+=('-ffat-lto-objects')
    cargo build --frozen --release --all-features
}

check() {
    cd "$pkgname"
    export RUSTUP_TOOLCHAIN=stable
    cargo test --frozen --all-features
}

package() {
    cd "$pkgname"
    make \
        PREFIX='/usr' \
        EXAMPLESDIR='/usr/share/' \
        DESTDIR="$pkgdir/" \
        install
}