summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 31a56073dd20151e036165a58fdfb78659a4651b (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
# Maintainer: Wiktor Kwapisiewicz <wiktor@metacode.biz>

pkgname=oled-notifier-git
pkgver=0.1
pkgrel=1
license=('APL')
url="https://github.com/wiktor-k/oled-notifier"
# The package can be built on amd64 but will work only on aarch64
arch=('any')
makedepends=(cargo git clang)
source=("oled-notifier::git+https://github.com/wiktor-k/oled-notifier")
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
sha512sums=('SKIP')
pkgdesc="Provides simple statistics for ODROID-HC4 with OLED device."

build() {
    cd "${srcdir}/${pkgname%-git}"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"
    export AR_aarch64_unknown_linux_musl=llvm-ar
    export CC_aarch64_unknown_linux_musl=clang
    cargo build --bin main --release --target aarch64-unknown-linux-musl

}

check() {
    cd "${srcdir}/${pkgname%-git}"
    export RUSTUP_TOOLCHAIN=stable
    cargo test --verbose --lib
}

package() {
    cd "${srcdir}/${pkgname%-git}"
    cp "target/aarch64-unknown-linux-musl/release/main" "target/${pkgname%-git}"
    install -Dm0755 -t "$pkgdir/usr/bin/" "target/${pkgname%-git}"
    install -Dm0644 -t "$pkgdir/usr/lib/systemd/system/" "contrib/${pkgname%-git}.service"
}