void-packages/srcpkgs/cargo/template
2017-07-25 15:30:45 +02:00

65 lines
1.9 KiB
Bash

# Template file for 'cargo'
pkgname=cargo
version=0.20.0
revision=1
_githash_installer=4f994850808a572e2cc8d43f968893c8e942e9bf
patch_args="-Np1"
hostmakedepends="rust python curl cmake pkg-config"
makedepends="libcurl-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="f0e21d23cffd3510ba8a65e6a4d1010073afc0e573d9d92c23d22b868ca0bc42
dc7240d60a869fa24a68c8734fb7c810c27cca0a6dad52df6279865e4e8e7fae"
nocross=yes
case "$XBPS_MACHINE" in
x86_64-musl)
distfiles+="
https://repo.voidlinux.eu/distfiles/cargo-0.18.0-x86_64-unknown-linux-musl.tar.gz"
checksum+="
28f2ee839f14f8b3edf3f4e4cc8600ac99ea50905ee8fb91116bba676728c2e9"
;;
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
mkdir -p target/snapshot
cp ../cargo-*/cargo/bin/cargo cargo
rm Cargo.lock # unlock rust-openssl 0.9.4
}
do_build() {
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
export CARGO_HOME="${wrksrc}/.cargo"
export RUST_BACKTRACE=1
./cargo build --release
}
do_install() {
vbin target/release/cargo
for f in src/etc/man/*.?; do
vman $f
done
vinstall src/etc/cargo.bashcomp.sh 0644 usr/share/bash-completion/completions cargo
vinstall src/etc/_cargo 0644 usr/share/zsh/site-functions
vlicense LICENSE-APACHE
vlicense LICENSE-MIT
vlicense LICENSE-THIRD-PARTY
}