summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 240568ce5529b1affb430ae573f477ce131db6e9 (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
# Maintainer: Carl Smedstad <carsme@archlinux.org>

pkgname=mirrord
pkgver=3.100.1
pkgrel=1
pkgdesc="Connect your local process and your cloud environment, and run local code in cloud conditions"
url="https://github.com/metalbear-co/mirrord"
arch=(x86_64)
license=(MIT)
depends=(
  gcc-libs
  glibc
)
makedepends=(
  cargo-nightly
  clang
  protobuf
)
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz")
sha256sums=('437afebdf7c19ad55d6e03846bdd9f3cab0db8e719d732f01066cfd98ae7bb00')

_archive="$pkgname-$pkgver"

prepare() {
  cd "$_archive"

  export RUSTUP_TOOLCHAIN=nightly

  # Update ahash to avoid the following compilation error in v0.8.6:
  # error[E0635]: unknown feature `stdsimd`
  cargo update --package ahash --precise 0.8.7

  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "$_archive"

  export RUSTUP_TOOLCHAIN=nightly
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features --package mirrord

  # Completions
  ./target/release/mirrord completions bash > mirrord.bash
  ./target/release/mirrord completions fish > mirrord.fish
  ./target/release/mirrord completions zsh > mirrord.zsh
}

package() {
  cd "$_archive"

  install -Dm755 -t "$pkgdir/usr/bin" target/release/mirrord

  install -Dm644 mirrord.bash "$pkgdir/usr/share/bash-completion/completions/mirrord"
  install -Dm644 mirrord.fish "$pkgdir/usr/share/fish/vendor_completions.d/mirrord.fish"
  install -Dm644 mirrord.zsh "$pkgdir/usr/share/zsh/site-functions/_mirrord"

  install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" ./*.md
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}