void-packages/srcpkgs/cargo/template
2017-04-11 18:54:25 +02:00

65 lines
2.2 KiB
Bash

# Template file for 'cargo'
pkgname=cargo
version=0.17.0
revision=3
_githash_installer=4f994850808a572e2cc8d43f968893c8e942e9bf
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="fc689ca7a09f1e6a1c31e69f0e2616a93576a68e0e1d7f0ae4c0d3301ff21ff8
dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae"
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-03-21/cargo-nightly-x86_64-unknown-linux-gnu.tar.gz"
checksum+="
55ad9a8929303b4e06c18d0dd30b0d6296da784606d9c55cce98d5d7fc39a0b2"
;;
i686)
distfiles+="
https://static.rust-lang.org/cargo-dist/2016-03-21/cargo-nightly-i686-unknown-linux-gnu.tar.gz"
checksum+="
b2a1c4c33fb9274771c8d830cd8ac07f7ae96af341fa30399d6929ffd6c8b425"
;;
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
cp ../cargo-nightly*/cargo/bin/cargo cargo
rm Cargo.lock # unlock rust-openssl 0.9.4
}
pre_configure() {
configure_args+=" --host=${XBPS_TRIPLET/-pc-/-unknown-} --build=${XBPS_TRIPLET/-pc-/-unknown-} --cargo=$wrksrc/cargo"
sed -i '/not recognized/s/err/warn/' configure
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
export CARGO_HOME="${wrksrc}/.cargo"
}
pre_build() {
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
}
post_install() {
rm -rf ${DESTDIR}/usr/lib/rustlib ${DESTDIR}/usr/share/doc/cargo
vlicense LICENSE-APACHE
vlicense LICENSE-MIT
vlicense LICENSE-THIRD-PARTY
}