# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=cargo-make
pkgver=0.37.24
pkgrel=0
pkgdesc="Rust task runner and build tool"
url="https://github.com/sagiegurari/cargo-make"
arch="all"
license="Apache-2.0"
makedepends="cargo openssl-dev cargo-auditable"
subpackages="$pkgname-bash-completion"
source="https://github.com/sagiegurari/cargo-make/archive/$pkgver/cargo-make-$pkgver.tar.gz"
options="!check"  # FIXME: some tests are broken

_cargo_opts="--frozen --no-default-features --features tls-native"


prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build $_cargo_opts --release
}

check() {
	cargo test $_cargo_opts
}

package() {
	install -D -m755 -t "$pkgdir"/usr/bin/ \
		target/release/cargo-make \
		target/release/makers

	install -D -m644 extra/shell/makers-completion.bash \
		"$pkgdir"/usr/share/bash-completion/completions/makers
}

sha512sums="
2d7c169d65e3049cfe9212dbb578377bcda581d52a2e5543c1c178d6531f9f08c4d0336d2feb6e3889cb7b83891e4dd592c6e5147ef7c09ca3577440231408ba  cargo-make-0.37.24.tar.gz
"
