void-packages/srcpkgs/cargo/template

65 lines
2.1 KiB
Bash

# Template file for 'cargo'
pkgname=cargo
version=0.18.0
revision=1
_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="Leah Neukirchen <leah@vuxu.org>"
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="19b5c142c194fc2f940d93b4679850980ed077db0ff7c558122c7ef865e24983
dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae"
nocross=yes
case "$XBPS_MACHINE" in
x86_64-musl)
distfiles+="
https://repo.voidlinux.eu/distfiles/cargo-0.17.0-x86_64-unknown-linux-musl.tar.gz"
checksum+="
0150d5b249fa66a5d2515e6beb27aa6dfb25301bb50522fab7c2445bb7ecdd09"
;;
x86_64)
distfiles+="
https://static.rust-lang.org/dist/cargo-0.18.0-x86_64-unknown-linux-gnu.tar.gz"
checksum+="
3601e95c968850230b137b849ff08a507e50d77ab584c779143a100f1843d8dd"
;;
i686)
distfiles+="
https://static.rust-lang.org/dist/cargo-0.18.0-i686-unknown-linux-gnu.tar.gz"
checksum+="
fbc5a0614345dfb2b41e133bd821257906a839753a9aa4c4590cc9d658164e58"
;;
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-*/cargo/bin/cargo cargo
}
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
}