cargo: update to 0.30.0.
- enable cross compilation [ci skip]
This commit is contained in:
parent
56a659ee50
commit
02992b4b05
1 changed files with 72 additions and 31 deletions
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'cargo'
|
# Template file for 'cargo'
|
||||||
pkgname=cargo
|
pkgname=cargo
|
||||||
version=0.29.0
|
version=0.30.0
|
||||||
revision=2
|
revision=1
|
||||||
hostmakedepends="rust python curl cmake pkg-config"
|
hostmakedepends="rust python curl cmake pkg-config"
|
||||||
makedepends="libcurl-devel libgit2-devel"
|
makedepends="libcurl-devel libgit2-devel"
|
||||||
depends="rust"
|
depends="rust"
|
||||||
|
@ -10,45 +10,86 @@ maintainer="Enno Boland <gottox@voidlinux.eu>"
|
||||||
license="MIT, Apache-2.0"
|
license="MIT, Apache-2.0"
|
||||||
homepage="https://crates.io/"
|
homepage="https://crates.io/"
|
||||||
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
|
distfiles="https://github.com/rust-lang/cargo/archive/${version}.tar.gz"
|
||||||
checksum=9aedb9536ec0b92059ed06b79a72798daf14e3fbcf29fac308ac07d23a9493d3
|
checksum=82f3ba49192b74b115b8aeca9db24deca022ee5e6351292611ab5b50e4455251
|
||||||
nocross=yes
|
_cargo_dist_version=0.30.0
|
||||||
|
|
||||||
case "$XBPS_MACHINE" in
|
if [ "$CROSS_BUILD" ]; then
|
||||||
x86_64-musl)
|
hostmakedepends+=" cargo"
|
||||||
distfiles+="
|
makedepends+=" rust"
|
||||||
https://alpha.de.repo.voidlinux.org/distfiles/cargo-0.29.0-x86_64-unknown-linux-musl-libgit2-27.tar.gz"
|
else
|
||||||
checksum+="
|
case "$XBPS_MACHINE" in
|
||||||
a46cb16e1008032277d744b74cba16a107539b12b8fbfd763c4cc1f80ee5568c"
|
x86_64-musl)
|
||||||
;;
|
distfiles+="
|
||||||
x86_64)
|
https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.gz"
|
||||||
distfiles+="
|
checksum+="
|
||||||
https://static.rust-lang.org/dist/cargo-0.29.0-x86_64-unknown-linux-gnu.tar.gz"
|
e9344cbf3db669383cb3492d12bcd42d9130665f577be9ad4d2028011c7b1fae"
|
||||||
checksum+="
|
;;
|
||||||
a5e7749767c47669ed9b6e32c6fb8eda6b0fe1c63ac73a6d4666b5c1352bad24"
|
x86_64)
|
||||||
;;
|
distfiles+="
|
||||||
i686)
|
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
distfiles+="
|
checksum+="
|
||||||
https://static.rust-lang.org/dist/cargo-0.29.0-i686-unknown-linux-gnu.tar.gz"
|
b6012ef67923b67b9b558628cc41dd90a688742bf23e9b46ad8839d898f1b0b1"
|
||||||
checksum+="
|
;;
|
||||||
ec9ba3aa064719222bb59de4cf8f2ad061bb31288e7dd4e98b80215203aa5876"
|
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
|
esac
|
||||||
|
|
||||||
post_extract() {
|
post_extract() {
|
||||||
mkdir -p target/snapshot
|
if [ -z "$CROSS_BUILD" ]; then
|
||||||
case "$XBPS_MACHINE" in
|
mkdir -p target/snapshot
|
||||||
x86_64-musl) cp ../cargo cargo;;
|
case "$XBPS_MACHINE" in
|
||||||
*) cp ../cargo-*/cargo/bin/cargo cargo;;
|
x86_64-musl) cp ../cargo cargo;;
|
||||||
esac
|
*) 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() {
|
do_build() {
|
||||||
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
|
export LIBGIT2_SYS_USE_PKG_CONFIG=yes
|
||||||
export CARGO_HOME="${wrksrc}/.cargo"
|
|
||||||
export RUST_BACKTRACE=1
|
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() {
|
do_install() {
|
||||||
vbin target/release/cargo
|
vbin target/${_host_triplet}/release/cargo
|
||||||
for f in src/etc/man/*.?; do
|
for f in src/etc/man/*.?; do
|
||||||
vman $f
|
vman $f
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue