Replace common functionality with rust implementation

This commit is contained in:
2025-09-03 17:06:13 +02:00
parent d0d162f3e9
commit d31d39473b
38 changed files with 2871 additions and 204 deletions

View File

@@ -0,0 +1,41 @@
# Maintainer: Hannes Körber <hannes@hkoerber.de>
pkgname='workstation-mgr'
pkgver=3
pkgrel=1
pkgdesc=''
arch=('x86_64')
depends=('glibc' 'gcc-libs')
makedepends=('cargo')
source=()
sha256sums=()
pkgver() {
cd "/var/lib/dotfiles/mgr/"
git log --oneline . | wc -l
}
prepare() {
cd "/var/lib/dotfiles/mgr/"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cd "/var/lib/dotfiles/mgr/"
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=/var/lib/makepkg/${pkgname}/build/target
cargo build --frozen --release
}
check() {
cd "/var/lib/dotfiles/mgr/"
export RUSTUP_TOOLCHAIN=stable
cargo test --frozen
}
package() {
cd "/var/lib/dotfiles/mgr/"
export CARGO_TARGET_DIR=/var/lib/makepkg/${pkgname}/build/target
install -Dm0755 -t "$pkgdir/usr/bin/" "${CARGO_TARGET_DIR}/release/${pkgname}"
install -Dm0755 -t "$pkgdir/usr/bin/" "${CARGO_TARGET_DIR}/release/workstation-client"
}