# Maintainer: Wilhelm Schuster pkgname=klipper-estimator _pkgname=${pkgname/-/_} pkgver=1.7.0 pkgrel=1 pkgdesc="A tool for determining the time a print will take on a 3D printer running Klipper firmware" url="https://github.com/Annex-Engineering/klipper_estimator" arch=('x86_64' 'i686' 'armv6h' 'armv7h' 'aarch64') license=("custom:MIT") makedepends=(cargo) source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Annex-Engineering/${_pkgname}/archive/v${pkgver}.tar.gz") sha512sums=('a9238f5c405f283ff437fb4583d5aea61fa7e6f95c02e0d863a0a2bf725b39e74a5b677a808089010d19085c20a9411858b3e6e54ed9c5444781d3623a22492d') prepare() { cd "$_pkgname-$pkgver" cargo fetch --locked --target "$CARCH-unknown-linux-gnu" } build() { cd "$_pkgname-$pkgver" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target # Build expects git metadata to generate version string, building from # .tar.gz we don't have that so fall back onto defining an environment # variable. export TOOL_VERSION=${pkgver} cargo build --frozen --release --all-features } package() { cd "$_pkgname-$pkgver" install -Dm755 target/release/$_pkgname -T "${pkgdir}/usr/bin/$pkgname" install -Dm644 LICENSE.txt -t "${pkgdir}/usr/share/licenses/${pkgname}" install -Dm644 compat/CuraPostProcessing/KlipperEstimator.py "${pkgdir}/usr/lib/cura/plugins/PostProcessingPlugin/scripts/KlipperEstimator.py" }