cargo: update to 0.30.0.
- enable cross compilation [ci skip]
This commit is contained in:
parent
56a659ee50
commit
02992b4b05
|
@ -1,7 +1,7 @@
|
|||
# Template file for 'cargo'
|
||||
pkgname=cargo
|
||||
version=0.29.0
|
||||
revision=2
|
||||
version=0.30.0
|
||||
revision=1
|
||||
hostmakedepends="rust python curl cmake pkg-config"
|
||||
makedepends="libcurl-devel libgit2-devel"
|
||||
depends="rust"
|
||||
|
@ -10,45 +10,86 @@ maintainer="Enno Boland <gottox@voidlinux.eu>"
|
|||
license="MIT, Apache-2.0"
|
||||
homepage="https://crates.io/"
|
||||
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
|
||||
checksum=9aedb9536ec0b92059ed06b79a72798daf14e3fbcf29fac308ac07d23a9493d3
|
||||
nocross=yes
|
||||
checksum=82f3ba49192b74b115b8aeca9db24deca022ee5e6351292611ab5b50e4455251
|
||||
_cargo_dist_version=0.30.0
|
||||
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl)
|
||||
distfiles+="
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/cargo-0.29.0-x86_64-unknown-linux-musl-libgit2-27.tar.gz"
|
||||
checksum+="
|
||||
a46cb16e1008032277d744b74cba16a107539b12b8fbfd763c4cc1f80ee5568c"
|
||||
;;
|
||||
x86_64)
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/cargo-0.29.0-x86_64-unknown-linux-gnu.tar.gz"
|
||||
checksum+="
|
||||
a5e7749767c47669ed9b6e32c6fb8eda6b0fe1c63ac73a6d4666b5c1352bad24"
|
||||
;;
|
||||
i686)
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/cargo-0.29.0-i686-unknown-linux-gnu.tar.gz"
|
||||
checksum+="
|
||||
ec9ba3aa064719222bb59de4cf8f2ad061bb31288e7dd4e98b80215203aa5876"
|
||||
;;
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
hostmakedepends+=" cargo"
|
||||
makedepends+=" rust"
|
||||
else
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl)
|
||||
distfiles+="
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.gz"
|
||||
checksum+="
|
||||
e9344cbf3db669383cb3492d12bcd42d9130665f577be9ad4d2028011c7b1fae"
|
||||
;;
|
||||
x86_64)
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.gz"
|
||||
checksum+="
|
||||
b6012ef67923b67b9b558628cc41dd90a688742bf23e9b46ad8839d898f1b0b1"
|
||||
;;
|
||||
i686)
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-i686-unknown-linux-gnu.tar.gz"
|
||||
checksum+="
|
||||
2fc5f7f5b128de456a9e1e3f5f4ef2c6d3169dbfe078931d9fcf38c9aa9b45ba"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $XBPS_TARGET_MACHINE in
|
||||
i686) _host_triplet=i686-unknown-linux-gnu;;
|
||||
x86_64) _host_triplet=x86_64-unknown-linux-gnu;;
|
||||
x86_64-musl) _host_triplet=x86_64-unknown-linux-musl;;
|
||||
armv6l) _host_triplet=arm-unknown-linux-gnueabihf;;
|
||||
armv6l-musl) _host_triplet=arm-unknown-linux-musleabihf;;
|
||||
armv7l) _host_triplet=armv7-unknown-linux-gnueabihf;;
|
||||
armv7l-musl) _host_triplet=armv7-unknown-linux-musleabihf;;
|
||||
aarch64) _host_triplet=aarch64-unknown-linux-gnu;;
|
||||
aarch64-musl) _host_triplet=aarch64-unknown-linux-musl;;
|
||||
*) broken="Please add your triplet to the cargo template!";;
|
||||
esac
|
||||
|
||||
post_extract() {
|
||||
mkdir -p target/snapshot
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl) cp ../cargo cargo;;
|
||||
*) cp ../cargo-*/cargo/bin/cargo cargo;;
|
||||
esac
|
||||
if [ -z "$CROSS_BUILD" ]; then
|
||||
mkdir -p target/snapshot
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl) cp ../cargo cargo;;
|
||||
*) cp ../cargo-${_cargo_dist_version}-${_host_triplet}/cargo/bin/cargo cargo;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
do_configure() {
|
||||
# Actually use the config we set below
|
||||
export CARGO_HOME="$wrksrc/.cargo"
|
||||
|
||||
mkdir -p .cargo
|
||||
|
||||
cat >> .cargo/config <<EOF
|
||||
[build]
|
||||
jobs = ${makejobs#*j}
|
||||
target = "${_host_triplet}"
|
||||
[target.${_host_triplet}]
|
||||
linker = "${CC}"
|
||||
EOF
|
||||
}
|
||||
|
||||
do_build() {
|
||||
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
|
||||
export CARGO_HOME="${wrksrc}/.cargo"
|
||||
export RUST_BACKTRACE=1
|
||||
./cargo build --release
|
||||
export PKG_CONFIG_ALLOW_CROSS=1
|
||||
export RUSTFLAGS="--sysroot=${XBPS_CROSS_BASE}/usr"
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
cargo build --release
|
||||
else
|
||||
./cargo build --release
|
||||
fi
|
||||
}
|
||||
|
||||
do_install() {
|
||||
vbin target/release/cargo
|
||||
vbin target/${_host_triplet}/release/cargo
|
||||
for f in src/etc/man/*.?; do
|
||||
vman $f
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue