summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8bd76c73f8dec5d5269632b60b06ba611a256ab3 (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
# Maintainer: Adam Perkowski <adas1per@protonmail.com>
# https://github.com/adamperkowski/PKGBUILDs
pkgname=protondb-cli
pkgver=1.1.0
pkgrel=1
pkgdesc='A command-line tool to fetch and display game summaries from the ProtonDB API'
arch=('x86_64')
url="https://github.com/hypeedev/$pkgname"
license=('MIT')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('95a60ca4141b6d5bfbee10186f9322e5cc2962c47097b198a0cac87fc9532b86')
makedepends=('rustup' 'glibc' 'gcc-libs')
depends=('openssl')

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

build() {
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cd "$pkgname-$pkgver"
    cargo build --frozen --release --all-features
}

package() {
    cd "$pkgname-$pkgver"
    install -Dm0755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
    install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
    install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}