parent
a822e98bb4
commit
56a659ee50
|
@ -0,0 +1,15 @@
|
|||
Reason: rustc_codegen_llvm attempts to link against the host's llvm without this patch
|
||||
--- rustc-1.28.0-src/src/librustc_llvm/build.rs.orig 2018-10-01 04:00:15.481334857 +0200
|
||||
+++ rustc-1.28.0-src/src/librustc_llvm/build.rs 2018-10-01 04:01:15.145790417 +0200
|
||||
@@ -227,8 +227,8 @@
|
||||
println!("cargo:rustc-link-search=native={}", &lib[9..]);
|
||||
} else if is_crossed {
|
||||
if lib.starts_with("-L") {
|
||||
- println!("cargo:rustc-link-search=native={}",
|
||||
- lib[2..].replace(&host, &target));
|
||||
+ println!("cargo:rustc-link-search=native={}{}",
|
||||
+ env::var("XBPS_CROSS_BASE").unwrap(), &lib[2..]);
|
||||
}
|
||||
} else if lib.starts_with("-l") {
|
||||
println!("cargo:rustc-link-lib={}", &lib[2..]);
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
# Template file for 'rust'
|
||||
pkgname=rust
|
||||
version=1.28.0
|
||||
revision=1
|
||||
_rust_dist_version=1.27.2
|
||||
_cargo_dist_version=0.29.0
|
||||
revision=2
|
||||
_rust_dist_version=1.28.0
|
||||
_cargo_dist_version=0.30.0
|
||||
# NB. if you push any(!) new version, don't forget to put a build
|
||||
# output of musl to https://alpha.de.repo.voidlinux.org/distfiles/
|
||||
wrksrc="rustc-${version}-src"
|
||||
|
@ -11,51 +11,79 @@ lib32disabled=yes
|
|||
patch_args="-Np1"
|
||||
build_style=configure
|
||||
make_build_args="dist VERBOSE=1"
|
||||
only_for_archs="i686 x86_64 x86_64-musl"
|
||||
hostmakedepends="cmake curl pkg-config python"
|
||||
makedepends="libffi-devel llvm ncurses-devel libxml2-devel libunwind-devel
|
||||
zlib-devel"
|
||||
makedepends="libffi-devel llvm ncurses-devel libxml2-devel libunwind-devel zlib-devel"
|
||||
short_desc="Safe, concurrent, practical systems language"
|
||||
maintainer="Enno Boland <gottox@voidlinux.eu>"
|
||||
homepage="http://www.rust-lang.org/"
|
||||
homepage="https://www.rust-lang.org/"
|
||||
license="MIT, Apache-2.0"
|
||||
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
|
||||
checksum=1d5a81729c6f23a0a23b584dd249e35abe9c6f7569cee967cc42b1758ecd6486
|
||||
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl)
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
hostmakedepends+=" cargo llvm"
|
||||
|
||||
# These are required for building the buildhost's stage0/1
|
||||
hostmakedepends+=" libffi-devel libxml2-devel libunwind-devel
|
||||
ncurses-devel zlib-devel"
|
||||
else
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl)
|
||||
hostmakedepends+=" libcurl libgit2"
|
||||
distfiles+="
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/rustc-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.gz"
|
||||
checksum+="
|
||||
2da811f9a81f63a93d62cefe15f391efaff663438f2c364fd1a522ef576753f4
|
||||
e18aea5529d434e0950a77c266c3230ea878e3f3ea8b4114ee5a081092f98037
|
||||
d54f7b4c6e8af657e6173e9e0200130b2f297f365ed4c06a4e9029762d975836"
|
||||
1c54d595b0a1f3e283e453ff142800b3fdfb20dc2e45ceb71317693d2a278362
|
||||
17d52f198877228788f012acf7b3ccbcbf9240553d42502b6816a3431806d9e1
|
||||
e9344cbf3db669383cb3492d12bcd42d9130665f577be9ad4d2028011c7b1fae"
|
||||
;;
|
||||
x86_64)
|
||||
x86_64)
|
||||
# extract from src/stage0.txt
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/rustc-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.xz"
|
||||
checksum+="
|
||||
ec3efc17ddbe6625840957049e15ebae960f447c8e8feb7da40c28dd6adf655f
|
||||
68984f2233853d3e9c7c56edd72a91b5822157f28fdb42023fb311af68f842dd
|
||||
2e62f91aab9ea496209a060e7ec62f088f5081b568a28b88f3c8ea7073db9829"
|
||||
008bb3d714544bc991594b29a98a154441914c4771007130361bbadfb54143d0
|
||||
c5aed4c7ef362b5754526d26acaccdc9300942fd12e5cc67cc56fc89576a9dab
|
||||
9524db722356307669c9068bb7df8dbd57e153717e62071b62560eb22ce2f3cd"
|
||||
;;
|
||||
i686)
|
||||
i686)
|
||||
# extract from src/stage0.txt
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/rustc-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-i686-unknown-linux-gnu.tar.xz"
|
||||
checksum+="
|
||||
a9ba9c97cf4818ab14966617390eadfc3dfd5221033f8f749aebd86c1d722ef9
|
||||
0ac6356223f53ec5f21cea6a9e9e5cd2fee3d45916f831e1ca54853893ec0b73
|
||||
2bc3468b9b470824bf366f7404ad36644ad4d5a41f1be29601fd6a138d3b72a5"
|
||||
30fa399934c90024275a08aa8992e76e98e04f152fc65b8aad3ca1fe231db39e
|
||||
fbf71c10787fa1cd4fbde0a1ef6805fa4978705c809959f48917bb7c5b5b6d61
|
||||
4b828c263283241ad1c99f30e0b5d8554b6dac2737d09cfd466b4c15b0d7296a"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# In rust terminology 'build' is the build host ($CBUILD) and `target`
|
||||
# and `host` are the triplets that are supposed to run the built binaries
|
||||
# ($CTARGET)
|
||||
case $XBPS_MACHINE in
|
||||
*-musl) _build_triplet=${XBPS_MACHINE%-musl}-unknown-linux-musl;;
|
||||
*) _build_triplet=${XBPS_MACHINE}-unknown-linux-gnu;;
|
||||
esac
|
||||
|
||||
# Use the targets from `rustc --print target-list` here!
|
||||
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 rust template!";;
|
||||
esac
|
||||
|
||||
post_extract() {
|
||||
|
@ -65,38 +93,75 @@ post_extract() {
|
|||
*-musl) patch -p1 < $FILESDIR/musl.patch ;;
|
||||
esac
|
||||
|
||||
if [ -z "$CROSS_BUILD" ]; then
|
||||
mkdir -p stage0
|
||||
cp -flr ../rustc-*/rustc/* stage0
|
||||
cp -flr ../rust-std-*/rust-std-*/* stage0
|
||||
cp -bflr ../rustc-*/rustc/* stage0
|
||||
cp -bflr ../rust-std-*/rust-std-*/* stage0
|
||||
case "$XBPS_MACHINE" in
|
||||
*-musl) cp -flr ../cargo stage0/bin;;
|
||||
*) cp -flr ../cargo-*/cargo/* stage0;;
|
||||
*-musl) cp -bflr ../cargo stage0/bin;;
|
||||
*)
|
||||
rm ../cargo-*/cargo/manifest.in
|
||||
cp -flr ../cargo-*/cargo/* stage0
|
||||
;;
|
||||
esac
|
||||
|
||||
# XXX: Cheat Rust build system so we can build rustc using different
|
||||
# version of (prebuilt) stable rustc than preconfigured. It's hack-ish,
|
||||
# but since we're basically rebuilding rustc with the same version,
|
||||
# it's actually safe.
|
||||
# Note: --enable-local-rebuild from #33787 didn't work, don't know why.
|
||||
export LD_LIBRARY_PATH="$wrksrc/stage0/lib"
|
||||
rustc_ver="$($wrksrc/stage0/bin/rustc --version | cut -f2 -d ' ')"
|
||||
rustc_key="$(printf "$rustc_ver" | md5sum | cut -c1-8)"
|
||||
sed -Ei \
|
||||
-e "s/^(rustc):.*/\1: $rustc_ver-1970-01-01/" \
|
||||
-e "s/^(rustc_key):.*/\1: $rustc_key/" \
|
||||
src/stage0.txt
|
||||
|
||||
# Generate config for bootstrap.py to use our prebuilt rustc and cargo
|
||||
# for bootstrapping instead of downloading snapshot from internet.
|
||||
cat > config.toml <<EOF
|
||||
[build]
|
||||
cargo = "$wrksrc/stage0/bin/cargo"
|
||||
rustc = "$wrksrc/stage0/bin/rustc"
|
||||
EOF
|
||||
fi
|
||||
|
||||
sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
export LD_LIBRARY_PATH="$wrksrc/stage0/lib"
|
||||
|
||||
configure_args="
|
||||
--prefix=/usr
|
||||
--host=${_host_triplet}
|
||||
--target=${_host_triplet}
|
||||
--build=${_build_triplet}
|
||||
--disable-full-bootstrap
|
||||
--release-channel=stable
|
||||
--disable-rpath
|
||||
--disable-docs
|
||||
--disable-codegen-tests
|
||||
--llvm-root=/usr
|
||||
--set=target.${_build_triplet}.llvm-config=/usr/bin/llvm-config
|
||||
"
|
||||
|
||||
# Disable jemalloc for now. It increases the size of small programs
|
||||
# significantly (hello world without jemalloc 130KB vs with jemalloc
|
||||
# 300KB) and provides worse performance in some cases.
|
||||
configure_args+=" --disable-jemalloc"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
configure_args+="
|
||||
--local-rust-root=/usr
|
||||
--enable-local-rebuild
|
||||
"
|
||||
|
||||
# Set the appropriate values for the native compilation tools
|
||||
configure_args+="
|
||||
--set=target.${_build_triplet}.cc=${CC_host}
|
||||
--set=target.${_build_triplet}.cxx=${CXX_host}
|
||||
--set=target.${_build_triplet}.ar=${AR_host}
|
||||
--set=target.${_build_triplet}.linker=${CC_host}
|
||||
"
|
||||
|
||||
# Set 'llvm-config' for the cross target (host) so that we don't build
|
||||
# LLVM for it again.
|
||||
configure_args+="
|
||||
--set=target.${_host_triplet}.llvm-config="/usr/bin/llvm-config"
|
||||
"
|
||||
else
|
||||
configure_args+=" --local-rust-root=$wrksrc/stage0"
|
||||
fi
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
*-musl)
|
||||
configure_args+=" --musl-root=/usr"
|
||||
;;
|
||||
esac
|
||||
|
||||
./configure $configure_args
|
||||
}
|
||||
|
||||
pre_build() {
|
||||
export CARGO_HOME="$wrksrc/.cargo"
|
||||
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
|
@ -104,42 +169,20 @@ pre_build() {
|
|||
export PATH="$wrksrc/stage0/bin:$PATH"
|
||||
export MUSL_ROOT=/usr
|
||||
export RUST_BACKTRACE=1
|
||||
export RUSTFLAGS="-C linker=${CC}"
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
local _triplet
|
||||
case $XBPS_TARGET_MACHINE in
|
||||
i686) _triplet=i686-unknown-linux-gnu;;
|
||||
x86_64) _triplet=x86_64-unknown-linux-gnu;;
|
||||
x86_64-musl) _triplet=x86_64-unknown-linux-musl;;
|
||||
*) _triplet=$XBPS_TARGET_MACHINE;;
|
||||
esac
|
||||
export LD_LIBRARY_PATH="$wrksrc/stage0/lib"
|
||||
configure_args="
|
||||
--prefix=/usr
|
||||
--host=${_triplet}
|
||||
--build=${_triplet}
|
||||
--release-channel=stable
|
||||
--disable-rpath
|
||||
--disable-docs
|
||||
--disable-codegen-tests
|
||||
--enable-ccache
|
||||
--llvm-root=/usr
|
||||
--enable-local-rust
|
||||
--local-rust-root=$wrksrc/stage0
|
||||
"
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
*-musl)
|
||||
configure_args+="--musl-root=/usr --disable-jemalloc"
|
||||
;;
|
||||
esac
|
||||
./configure $configure_args
|
||||
|
||||
# Set the correct CFLAGS for the build host, we have to compile libbacktrace
|
||||
# for it during stage1. Otherwise it attemps to use CFLAGS, which are the CFLAGS
|
||||
# of the cross host.
|
||||
do_build() {
|
||||
env CFLAGS_${_build_triplet}="${CFLAGS_host}" make ${makejobs} ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
vmkdir usr
|
||||
tar xf build/dist/rustc-*-*-*.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
|
||||
tar xf build/dist/rust-std-*-*-*.tar.gz -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in
|
||||
tar xf build/dist/rustc-${version}-${_host_triplet}.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
|
||||
tar xf build/dist/rust-std-${version}-${_host_triplet}.tar.gz -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in
|
||||
|
||||
vlicense COPYRIGHT
|
||||
vlicense LICENSE-APACHE
|
||||
|
|
|
@ -0,0 +1,197 @@
|
|||
# Template file for 'rust'
|
||||
pkgname=rust
|
||||
version=1.28.0
|
||||
revision=1
|
||||
_rust_dist_version=1.27.2
|
||||
_cargo_dist_version=0.29.0
|
||||
# NB. if you push any(!) new version, don't forget to put a build
|
||||
# output of musl to https://alpha.de.repo.voidlinux.org/distfiles/
|
||||
wrksrc="rustc-${version}-src"
|
||||
lib32disabled=yes
|
||||
patch_args="-Np1"
|
||||
build_style=configure
|
||||
make_build_args="dist VERBOSE=1"
|
||||
hostmakedepends="cmake curl pkg-config python"
|
||||
makedepends="libffi-devel llvm ncurses-devel libxml2-devel libunwind-devel zlib-devel"
|
||||
short_desc="Safe, concurrent, practical systems language"
|
||||
maintainer="Enno Boland <gottox@voidlinux.eu>"
|
||||
homepage="https://www.rust-lang.org/"
|
||||
license="MIT, Apache-2.0"
|
||||
distfiles="https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz"
|
||||
checksum=1d5a81729c6f23a0a23b584dd249e35abe9c6f7569cee967cc42b1758ecd6486
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
hostmakedepends+=" cargo llvm"
|
||||
|
||||
# These are required for building the buildhost's stage0/1
|
||||
hostmakedepends+=" libffi-devel libxml2-devel libunwind-devel
|
||||
ncurses-devel zlib-devel"
|
||||
else
|
||||
case "$XBPS_MACHINE" in
|
||||
x86_64-musl)
|
||||
hostmakedepends+=" libcurl libgit2"
|
||||
distfiles+="
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/rustc-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.gz"
|
||||
checksum+="
|
||||
2da811f9a81f63a93d62cefe15f391efaff663438f2c364fd1a522ef576753f4
|
||||
e18aea5529d434e0950a77c266c3230ea878e3f3ea8b4114ee5a081092f98037
|
||||
d54f7b4c6e8af657e6173e9e0200130b2f297f365ed4c06a4e9029762d975836"
|
||||
;;
|
||||
x86_64)
|
||||
# extract from src/stage0.txt
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/rustc-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.xz"
|
||||
checksum+="
|
||||
ec3efc17ddbe6625840957049e15ebae960f447c8e8feb7da40c28dd6adf655f
|
||||
68984f2233853d3e9c7c56edd72a91b5822157f28fdb42023fb311af68f842dd
|
||||
2e62f91aab9ea496209a060e7ec62f088f5081b568a28b88f3c8ea7073db9829"
|
||||
;;
|
||||
i686)
|
||||
# extract from src/stage0.txt
|
||||
distfiles+="
|
||||
https://static.rust-lang.org/dist/rustc-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-i686-unknown-linux-gnu.tar.xz"
|
||||
checksum+="
|
||||
a9ba9c97cf4818ab14966617390eadfc3dfd5221033f8f749aebd86c1d722ef9
|
||||
0ac6356223f53ec5f21cea6a9e9e5cd2fee3d45916f831e1ca54853893ec0b73
|
||||
2bc3468b9b470824bf366f7404ad36644ad4d5a41f1be29601fd6a138d3b72a5"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# In rust terminology 'build' is the build host ($CBUILD) and `target`
|
||||
# and `host` are the triplets that are supposed to run the built binaries
|
||||
# ($CTARGET)
|
||||
case $XBPS_MACHINE in
|
||||
*-musl) _build_triplet=${XBPS_MACHINE%-musl}-unknown-linux-musl;;
|
||||
*) _build_triplet=${XBPS_MACHINE}-unknown-linux-gnu;;
|
||||
esac
|
||||
|
||||
# Use the targets from `rustc --print target-list` here!
|
||||
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 rust template!";;
|
||||
esac
|
||||
|
||||
post_extract() {
|
||||
rm -rf src/llvm
|
||||
|
||||
case "$XBPS_MACHINE" in
|
||||
*-musl) patch -p1 < $FILESDIR/musl.patch ;;
|
||||
esac
|
||||
|
||||
if ! [ "$CROSS_BUILD" ]; then
|
||||
mkdir -p stage0
|
||||
cp -flr ../rustc-*/rustc/* stage0
|
||||
cp -flr ../rust-std-*/rust-std-*/* stage0
|
||||
case "$XBPS_MACHINE" in
|
||||
*-musl) cp -flr ../cargo stage0/bin;;
|
||||
*) cp -flr ../cargo-*/cargo/* stage0;;
|
||||
esac
|
||||
fi
|
||||
|
||||
sed -i /LD_LIBRARY_PATH/d src/bootstrap/bootstrap.py
|
||||
}
|
||||
|
||||
do_configure() {
|
||||
export LD_LIBRARY_PATH="$wrksrc/stage0/lib"
|
||||
|
||||
configure_args="
|
||||
--prefix=/usr
|
||||
--host=${_host_triplet}
|
||||
--target=${_host_triplet}
|
||||
--build=${_build_triplet}
|
||||
--disable-full-bootstrap
|
||||
--release-channel=stable
|
||||
--disable-rpath
|
||||
--disable-docs
|
||||
--disable-codegen-tests
|
||||
--llvm-root=/usr
|
||||
--enable-local-rebuild
|
||||
--set=target.${_build_triplet}.llvm-config="/usr/bin/llvm-config"
|
||||
"
|
||||
|
||||
# Disable jemalloc for now. It increases the size of small programs
|
||||
# significantly (hello world without jemalloc 130KB vs with jemalloc
|
||||
# 300KB) and provides worse performance in some cases.
|
||||
configure_args=+" --disable-jemalloc"
|
||||
|
||||
if [ "$CROSS_BUILD" ]; then
|
||||
configure_args+="
|
||||
--local-rust-root=/usr
|
||||
"
|
||||
|
||||
# Set the appropriate values for the native compilation tools
|
||||
configure_args+="
|
||||
--set=target.${_build_triplet}.cc=${CC_host}
|
||||
--set=target.${_build_triplet}.cxx=${CXX_host}
|
||||
--set=target.${_build_triplet}.ar=${AR_host}
|
||||
--set=target.${_build_triplet}.linker=${LD_host}
|
||||
"
|
||||
|
||||
# Set 'llvm-config' for the cross target (host) so that we don't build
|
||||
# LLVM for it again.
|
||||
configure_args+="
|
||||
--set=target.${_host_triplet}.llvm-config="/usr/bin/llvm-config"
|
||||
"
|
||||
else
|
||||
configure_args+="--local-rust-root=$wrksrc/stage0"
|
||||
fi
|
||||
case "$XBPS_TARGET_MACHINE" in
|
||||
*-musl)
|
||||
configure_args+="--musl-root=/usr"
|
||||
;;
|
||||
esac
|
||||
|
||||
./configure $configure_args
|
||||
}
|
||||
|
||||
pre_build() {
|
||||
export CARGO_HOME="$wrksrc/.cargo"
|
||||
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
|
||||
export LD_LIBRARY_PATH="$wrksrc/stage0/lib"
|
||||
export PATH="$wrksrc/stage0/bin:$PATH"
|
||||
export MUSL_ROOT=/usr
|
||||
export RUST_BACKTRACE=1
|
||||
export RUSTFLAGS="-C linker=${CC}"
|
||||
}
|
||||
|
||||
# Set the correct CFLAGS for the build host, we have to compile libbacktrace
|
||||
# for it during stage1
|
||||
do_build() {
|
||||
env CFLAGS_${_build_triplet}="${CFLAGS_host}" make ${makejobs} ${make_build_args}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
vmkdir usr
|
||||
tar xf build/dist/rustc-${version}-${_host_triplet}.tar.gz -C "$DESTDIR/usr" --strip-components=2 --exclude=manifest.in
|
||||
tar xf build/dist/rust-std-${version}-${_host_triplet}.tar.gz -C "$DESTDIR/usr/lib" --strip-components=3 --exclude=manifest.in
|
||||
|
||||
vlicense COPYRIGHT
|
||||
vlicense LICENSE-APACHE
|
||||
vlicense LICENSE-MIT
|
||||
|
||||
cd ${DESTDIR}/usr/lib
|
||||
ln -sf rustlib/*/lib/*.so . # symlinks instead of copies
|
||||
}
|
||||
|
||||
rust-doc_package() {
|
||||
short_desc+=" - documentation"
|
||||
noarch=yes
|
||||
pkg_install() {
|
||||
vmove usr/share/doc
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
--- srcpkgs/rust/template
|
||||
+++ srcpkgs/rust/template
|
||||
@@ -30,9 +30,9 @@ x86_64-musl)
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/rust-std-${_rust_dist_version}-x86_64-unknown-linux-musl.tar.xz
|
||||
https://alpha.de.repo.voidlinux.org/distfiles/cargo-${_cargo_dist_version}-x86_64-unknown-linux-musl.tar.gz"
|
||||
checksum+="
|
||||
- 2da811f9a81f63a93d62cefe15f391efaff663438f2c364fd1a522ef576753f4
|
||||
- e18aea5529d434e0950a77c266c3230ea878e3f3ea8b4114ee5a081092f98037
|
||||
- d54f7b4c6e8af657e6173e9e0200130b2f297f365ed4c06a4e9029762d975836"
|
||||
+ 1c54d595b0a1f3e283e453ff142800b3fdfb20dc2e45ceb71317693d2a278362
|
||||
+ 17d52f198877228788f012acf7b3ccbcbf9240553d42502b6816a3431806d9e1
|
||||
+ e9344cbf3db669383cb3492d12bcd42d9130665f577be9ad4d2028011c7b1fae"
|
||||
;;
|
||||
x86_64)
|
||||
# extract from src/stage0.txt
|
||||
@@ -41,9 +41,9 @@ x86_64)
|
||||
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-x86_64-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-x86_64-unknown-linux-gnu.tar.xz"
|
||||
checksum+="
|
||||
- ec3efc17ddbe6625840957049e15ebae960f447c8e8feb7da40c28dd6adf655f
|
||||
- 68984f2233853d3e9c7c56edd72a91b5822157f28fdb42023fb311af68f842dd
|
||||
- 2e62f91aab9ea496209a060e7ec62f088f5081b568a28b88f3c8ea7073db9829"
|
||||
+ 008bb3d714544bc991594b29a98a154441914c4771007130361bbadfb54143d0
|
||||
+ c5aed4c7ef362b5754526d26acaccdc9300942fd12e5cc67cc56fc89576a9dab
|
||||
+ 9524db722356307669c9068bb7df8dbd57e153717e62071b62560eb22ce2f3cd"
|
||||
;;
|
||||
i686)
|
||||
# extract from src/stage0.txt
|
||||
@@ -52,9 +52,9 @@ i686)
|
||||
https://static.rust-lang.org/dist/rust-std-${_rust_dist_version}-i686-unknown-linux-gnu.tar.gz
|
||||
https://static.rust-lang.org/dist/cargo-${_cargo_dist_version}-i686-unknown-linux-gnu.tar.xz"
|
||||
checksum+="
|
||||
- a9ba9c97cf4818ab14966617390eadfc3dfd5221033f8f749aebd86c1d722ef9
|
||||
- 0ac6356223f53ec5f21cea6a9e9e5cd2fee3d45916f831e1ca54853893ec0b73
|
||||
- 2bc3468b9b470824bf366f7404ad36644ad4d5a41f1be29601fd6a138d3b72a5"
|
||||
+ 30fa399934c90024275a08aa8992e76e98e04f152fc65b8aad3ca1fe231db39e
|
||||
+ fbf71c10787fa1cd4fbde0a1ef6805fa4978705c809959f48917bb7c5b5b6d61
|
||||
+ 4b828c263283241ad1c99f30e0b5d8554b6dac2737d09cfd466b4c15b0d7296a"
|
||||
;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue