void-packages/srcpkgs/cargo/template

57 lines
2.0 KiB
Bash

# Template file for 'cargo'
pkgname=cargo
version=0.13.0
revision=2
_githash_installer=755bc3db4ff795865ea31b5b4f38ac920d8acacb
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="90429180d3724385acb094f2896feea0c73690451a92215d6054d05edf4a5c49
2cf7a1b8920970b163bc9968685cd32234b7785a6d057a0d3b0d043110de81c7"
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-07-05/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"
checksum+="
cf47787fd50bf6c7f68db290eab054e493e4619d42a8faf66565431449055f1c"
;;
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
sed -i '/dl-snapshot/d' Makefile.in
}
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
}