From d283b48c39dcbac2c0dc2481c3d2b1e59beede8b Mon Sep 17 00:00:00 2001 From: q66 Date: Sun, 10 Feb 2019 19:09:44 +0100 Subject: [PATCH] rust: use host triplet from env instead of guessing [ci skip] --- srcpkgs/rust/template | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/srcpkgs/rust/template b/srcpkgs/rust/template index 81bd9ab1609..d465e89e91a 100644 --- a/srcpkgs/rust/template +++ b/srcpkgs/rust/template @@ -97,17 +97,6 @@ else 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 - ppc64le) _build_triplet=powerpc64le-unknown-linux-gnu;; - ppc64le-musl) _build_triplet=powerpc64le-unknown-linux-musl;; - ppc64-musl) _build_triplet=powerpc64-unknown-linux-musl;; - *-musl) _build_triplet=${XBPS_MACHINE%-musl}-unknown-linux-musl;; - *) _build_triplet=${XBPS_MACHINE}-unknown-linux-gnu;; -esac - post_extract() { if [ -z "$CROSS_BUILD" ]; then mkdir -p stage0 @@ -153,7 +142,7 @@ do_configure() { --prefix=/usr --host=${RUST_TARGET} --target=${RUST_TARGET} - --build=${_build_triplet} + --build=${RUST_BUILD} --disable-full-bootstrap --release-channel=stable --disable-rpath @@ -164,7 +153,7 @@ do_configure() { if ! [ "$build_option_internal_llvm" ]; then configure_args+=" --llvm-root=/usr - --set=target.${_build_triplet}.llvm-config=/usr/bin/llvm-config + --set=target.${RUST_BUILD}.llvm-config=/usr/bin/llvm-config --set=target.${RUST_TARGET}.llvm-config=/usr/bin/llvm-config --enable-llvm-link-shared " @@ -178,10 +167,10 @@ do_configure() { # 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=target.${RUST_BUILD}.cc=${CC_host} + --set=target.${RUST_BUILD}.cxx=${CXX_host} + --set=target.${RUST_BUILD}.ar=${AR_host} + --set=target.${RUST_BUILD}.linker=${CC_host} " else configure_args+=" --local-rust-root=$wrksrc/stage0" @@ -210,7 +199,7 @@ pre_build() { # of the cross host. # Unset LDFLAGS, otherwise cross builds to the same arch will fail do_build() { - env CFLAGS_${_build_triplet}="${CFLAGS_host}" LDFLAGS='' make ${makejobs} ${make_build_args} + env CFLAGS_${RUST_BUILD}="${CFLAGS_host}" LDFLAGS='' make ${makejobs} ${make_build_args} } do_install() {