2024-08-25 00:03:53 +00:00
|
|
|
pkgname=mapfixer
|
|
|
|
pkgver=1.1.1.r111
|
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="A tool for reviewing bhop and surf maps."
|
|
|
|
arch=('x86_64')
|
|
|
|
url="https://git.itzana.me/StrafesNET/mapfixer"
|
2024-08-25 00:06:52 +00:00
|
|
|
license=('MIT')
|
2024-08-25 00:03:53 +00:00
|
|
|
makedepends=('cargo')
|
2024-08-25 00:06:45 +00:00
|
|
|
source=("$pkgname::git+https://git.itzana.me/StrafesNET/mapfixer")
|
2024-08-25 00:03:53 +00:00
|
|
|
sha256sums=('SKIP')
|
|
|
|
|
|
|
|
pkgver() {
|
|
|
|
cd "$pkgname"
|
|
|
|
|
|
|
|
# Parse Cargo.toml to get version number
|
|
|
|
local version=$(grep -oP 'version\s*=\s*"\K[^"]+' Cargo.toml | head -n 1)
|
|
|
|
|
|
|
|
# Get git revision number
|
|
|
|
local revision=$(git rev-list --count HEAD)
|
|
|
|
|
|
|
|
# Combine version and revision to form PKGBUILD version string
|
|
|
|
echo "${version}.r${revision}"
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd $pkgname
|
|
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
|
|
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd $pkgname
|
|
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
|
|
export CARGO_TARGET_DIR=target
|
|
|
|
cargo build --frozen --release --all-features
|
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
|
|
|
cd $pkgname
|
|
|
|
export RUSTUP_TOOLCHAIN=stable
|
|
|
|
cargo test --frozen --all-features
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd $pkgname
|
|
|
|
install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
|
|
|
|
}
|