summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 36252d41427d04c6e42161914ec13a446c34d695 (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
# Maintainer: Michał Wojdyła < micwoj9292 at gmail dot com >

pkgname=cargo-mommy
pkgver=0.3.1
pkgrel=6
pkgdesc="Mommy's here to support you when running cargo~"
url='https://github.com/Gankra/cargo-mommy'
license=('Apache-2.0' 'MIT')
arch=('x86_64' 'i686' 'arm' 'aarch64')
depends=('gcc-libs' 'glibc' 'cargo')
source=("$pkgname-$pkgver.tar.gz::https://static.crates.io/crates/$pkgname/$pkgname-$pkgver.crate")
sha256sums=('9ed71fe85dd1edc1f19217c87a58bbc035dc4c69b037cfec52d8ed8406561f78')

case $CARCH in
  x86_64|i686|aarch64)
    _target="$CARCH-unknown-linux-gnu" ;;
  arm)
    _target="arm-unknown-linux-gnueabi" ;;
esac

prepare() {
  cd $pkgname-$pkgver

  cargo fetch --locked --target $_target
}

build() {
  cd $pkgname-$pkgver
  RUSTFLAGS='-C link-args=-Wl,-z,shstk' \
  CARGO_TARGET_DIR='target' \
    cargo build --frozen --release
}

package() {
  cd $pkgname-$pkgver

  install -Dm0755 -t "$pkgdir/usr/bin" \
    target/release/cargo-mommy
  install -Dm644 LICENSE-MIT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-MIT
}