summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02bd1da680536b3e453da5e96d7d3be921ff968b (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
# Maintainer: Mark Wagie <mark dot wagie at proton dot me>
pkgname=ognibuild
pkgver=0.0.31
pkgrel=1
epoch=1
pkgdesc="Detect and invoke build systems"
arch=('x86_64')
url="https://github.com/jelmer/ognibuild"
license=('GPL-2.0-or-later')
depends=(
  'breezy'
  'glibc'
  'openssl'
)
makedepends=(
  'cargo'
)
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('00bbe0466353c7a91e4c6460477d88fc20edcf7e1fc79d2381b95ba58cfde668')

prepare() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
}

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

check() {
  cd "$pkgname-$pkgver"
  export RUSTUP_TOOLCHAIN=stable

  # Exclude debian features:
  cargo test --frozen --no-default-features --features=breezy,dep-server,upstream || :
}

package() {
  cd "$pkgname-$pkgver"

  for target in deb-fix-build deb-upstream-deps dep-server ogni "$pkgname-deb" "$pkgname-dist" report-apt-deps-status; do
    install -Dm755 target/release/$target -t "$pkgdir/usr/bin/"
  done
}