void-packages/srcpkgs/cargo/template
2016-08-20 16:35:43 +02:00

55 lines
1.9 KiB
Bash

# Template file for 'cargo'
pkgname=cargo
version=0.12.0
revision=1
_githash_installer=c37d3747da75c280237dc2d6b925078e69555499
patch_args="-Np1"
build_style=gnu-configure
make_build_args="VERBOSE=1"
hostmakedepends="rust python curl cmake pkg-config"
makedepends="libcurl-devel http-parser-devel libgit2-devel"
depends="rust"
short_desc="Rust package manager"
maintainer="Christian Neukirchen <chneukirchen@gmail.com>"
license="MIT, Apache-2.0"
homepage="https://crates.io/"
distfiles="https://github.com/rust-lang/${pkgname}/archive/${version}.tar.gz
https://github.com/rust-lang/rust-installer/archive/${_githash_installer}.tar.gz"
checksum="4080d76b56b8202f7df271b4bb7d7d22abea5ff8c261aef42e6e5d248ca5972b
6326434c225d25c6bfd28ff8bbc3108e331ae65e89a5c38dac8a2c8ffa09732b"
nocross=yes
case "$XBPS_MACHINE" in
x86_64-musl)
distfiles+="
https://alpine.geeknet.cz/distfiles/cargo-0.11.0-nightly-x86_64-alpine-linux-musl.tar.gz"
checksum+="
587172026c0565e839d96b0c1d4c68c000927817398241f96682dca47fa8c3b9"
;;
x86_64)
distfiles+="
https://static.rust-lang.org/cargo-dist/2016-04-10/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"
checksum+="
721a2bfb1f2ffff09b59911ba686a3a55eac6a2df88f19168be0a7c8a1fdffca"
;;
esac
post_extract() {
rm -rf src/rust-installer
mv ../rust-installer-${_githash_installer} src/rust-installer
sed -i 's,/etc/bash_completion.d,/share/bash-completion/completions,g' Makefile.in
mkdir -p target/snapshot
mv ../cargo-nightly*/cargo/* target/snapshot
}
pre_configure() {
configure_args+=" --host=${XBPS_TRIPLET/-pc-/-unknown-} --build=${XBPS_TRIPLET/-pc-/-unknown-}"
sed -i '/not recognized/s/err/warn/' configure
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
export CARGO_HOME="${wrksrc}/.cargo"
}
post_install() {
rm -rf ${DESTDIR}/usr/lib/rustlib ${DESTDIR}/usr/share/doc/cargo
vlicense LICENSE-APACHE
vlicense LICENSE-MIT
vlicense LICENSE-THIRD-PARTY
}