archrelease: copy trunk to community-any
[arch-community.git] / cargo-shuttle / trunk / PKGBUILD
blob95d540e68478b731af445016aea0d2fa94aeabd6
1 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
2 # Contributor: Stijn Seghers <stijnseghers at gmail dot com>
4 pkgname=cargo-shuttle
5 _commit=62a21c17d035fb62586ca2d0c786ccdca0d5d12c
6 pkgver=0.16.0
7 pkgrel=2
8 pkgdesc='Cargo command for the shuttle platform'
9 arch=('x86_64')
10 url="https://github.com/shuttle-hq/shuttle"
11 license=('Apache')
12 depends=('gcc-libs' 'openssl' 'zlib' 'curl')
13 makedepends=('cargo' 'git')
14 source=("$pkgname::git+$url.git#commit=$_commit"
15         "$pkgname-examples::git+https://github.com/shuttle-hq/examples.git")
16 sha512sums=('SKIP'
17             'SKIP')
18 options=('!lto')
20 prepare() {
21   cd "$pkgname"
22   git submodule init
23   git config submodule."examples".url "${srcdir}/${pkgname}"-examples
24   git -c protocol.file.allow=always submodule update --init --recursive
25   mkdir completions
27   cd "$pkgname"
28   cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
31 build() {
32   cd "$pkgname/$pkgname"
33   cargo build --release --frozen
34   cd ..
35   local compgen="target/release/$pkgname generate -s"
36   $compgen bash >"completions/$pkgname"
37   $compgen fish >"completions/$pkgname.fish"
38   $compgen zsh >"completions/_$pkgname"
41 check() {
42   cd "$pkgname/$pkgname"
43   cargo test --frozen --lib
46 package() {
47   cd "$pkgname"
48   install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
49   install -Dm 644 "$pkgname/README.md" -t "$pkgdir/usr/share/doc/$pkgname"
50   install -Dm 644 "completions/$pkgname" -t "$pkgdir/usr/share/bash-completion/completions/"
51   install -Dm 644 "completions/$pkgname.fish" -t "$pkgdir/usr/share/fish/vendor_completions.d/"
52   install -Dm 644 "completions/_$pkgname" -t "$pkgdir/usr/share/zsh/site-functions/"
55 # vim:set ts=2 sw=2 et: