blob: f6ab7c5679c5fe89d2cfcfd7239d3a56bc1816fa (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# Maintainer: yuioto <yuiotochan@outlook.com>
pkgname=fav-git
_pkgname="${pkgname%-git}"
pkgver=v0.2.37.r1.gf38df3d
pkgrel=1
pkgdesc='Back up your favorite bilibili resources with CLI'
url="https://github.com/kingwingfly/${_pkgname}"
# license=('LicenseRef-MIT')
license=('custom:MIT')
arch=('x86_64')
provides=("$_pkgname")
conflicts=("$_pkgname" "$_pkgname-bin")
makedepends=('cargo' 'git' 'pkgconf')
source=("$_pkgname::git+$url.git")
sha256sums=('SKIP')
pkgver() {
cd "$_pkgname"
( set -o pipefail
git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
prepare() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
# copy LICENSE file
cp LICENSE $srcdir/
}
build() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
cargo build --release --frozen --all-features
}
check() {
cd "$_pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen --all-features --workspace
}
package() {
cd "$_pkgname"
install -Dm755 "target/release/${_pkgname}" -t "$pkgdir/usr/bin/"
# completions
target/release/${_pkgname} completion bash > ${_pkgname}.bash
target/release/${_pkgname} completion fish > ${_pkgname}.fish
target/release/${_pkgname} completion zsh > _${_pkgname}
install -Dm644 ${_pkgname}.bash "$pkgdir"/usr/share/bash-completion/completions/${_pkgname}
install -Dm644 ${_pkgname}.fish "$pkgdir"/usr/share/fish/vendor_completions.d/${_pkgname}.fish
install -Dm644 _${_pkgname} "$pkgdir"/usr/share/zsh/site-functions/_${_pkgname}
# license
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
|