blob: ffe734efb984dd75020643926b165df10061bd0f (
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: SandaruKasa <sandarukasa plus aur at ya dot ru>
pkgname=n2-git
pkgver=0.1.0.r488.668d9ab
pkgrel=1
pkgdesc='n2 ("into"), a ninja compatible build system'
arch=('x86_64' 'aarch64')
url="https://github.com/evmar/n2"
license=("Apache-2.0")
makedepends=(git rust coreutils sed gcc)
options=(!lto)
depends=(gcc-libs glibc)
conflicts=("${pkgname%-git}")
provides=("${pkgname%-git}")
_git_folder="${pkgname%-git}"
source=("${_git_folder}::git+$url.git")
sha256sums=(SKIP)
prepare() {
cd "${_git_folder}"
cargo fetch --locked --target "${CARCH}-unknown-linux-gnu"
}
pkgver() {
cd "${_git_folder}"
printf "%s.r%s.%s" \
"$(cargo pkgid | cut -d# -f2 | cut -d@ -f2 | cut -d: -f2 | sed 's/-/_/g')" \
"$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}
build() {
cd "${_git_folder}"
export CARGO_TARGET_DIR=target
cargo build --frozen --release --all-features
}
check() {
cd "${_git_folder}"
cargo test --frozen --all-features
}
package() {
cd "${_git_folder}"
install -Dm755 target/release/"${pkgname%-git}" -t "$pkgdir/usr/bin/"
install -d "${pkgdir}/usr/lib/n2/bin"
ln -s /usr/bin/n2 "${pkgdir}/usr/lib/n2/bin/ninja"
}
|