summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5237843966f0c756448e636c7ce8b062a3c7313a (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
# Maintainer: scarlettekk <scarlett AT enby DOT site>
# Contributor: willemw <willemw12@gmail.com>

pkgname=gdrive-git
pkgver=3.9.0.r4.gf03868a
pkgrel=1
pkgdesc="Google Drive CLI Client (Rust rewrite)"
arch=('x86_64' 'aarch64')
url="https://github.com/glotlabs/gdrive"
license=('MIT')
makedepends=('git' 'cargo')
options=('!lto')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

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

prepare() {
    cd $pkgname
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target="$CARCH-unknown-linux-gnu"
}

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

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

package() {
    cd $pkgname
    install -Dm755 "target/release/${pkgname%-git}" -t "$pkgdir/usr/bin/"
    install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}