From 9c1bf26e566a97da51576c35d72815a62730533a Mon Sep 17 00:00:00 2001 From: Kevin Cotugno Date: Tue, 30 Oct 2018 08:19:19 -0700 Subject: [PATCH] Build for host This fixes the issue where clippy failed to build for arm causing that release to be incomplete. We remove the host files from the install directory to reduce the final size is minimal. --- packages/rust/build.sh | 12 ++++++++++-- packages/rust/no-host-build.patch | 10 ---------- scripts/setup-ubuntu.sh | 1 + 3 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 packages/rust/no-host-build.patch diff --git a/packages/rust/build.sh b/packages/rust/build.sh index bb8d41206..61f4c77b2 100644 --- a/packages/rust/build.sh +++ b/packages/rust/build.sh @@ -16,8 +16,12 @@ termux_step_configure () { | sed "s%\\@triple\\@%$triple%g" \ > config.toml + local env_host=`printf $triple | tr a-z A-Z | sed s/-/_/g` + export LD_LIBRARY_PATH=$TERMUX_PKG_BUILDDIR/build/x86_64-unknown-linux-gnu/llvm/lib - export OPENSSL_DIR=$TERMUX_PREFIX + export ${env_host}_OPENSSL_DIR=$TERMUX_PREFIX + export X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu + export X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include unset CC CXX CPP LD CFLAGS CXXFLAGS CPPFLAGS LDFLAGS } @@ -28,5 +32,9 @@ termux_step_make () { } termux_step_make_install () { - $TERMUX_PKG_SRCDIR/x.py install + local host_files_to_remove="$TERMUX_PREFIX/lib/rustlib/x86_64-unknown-linux-gnu \ + $TERMUX_PREFIX/lib/rustlib/manifest-rust-analysis-x86_64-unknown-linux-gnu \ + $TERMUX_PREFIX/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu" + + $TERMUX_PKG_SRCDIR/x.py install && rm -rf $host_files_to_remove } diff --git a/packages/rust/no-host-build.patch b/packages/rust/no-host-build.patch deleted file mode 100644 index ee868f747..000000000 --- a/packages/rust/no-host-build.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- ../rustc-1.29.2-src/src/bootstrap/config.rs 2018-10-05 15:19:57.000000000 -0700 -+++ ./src/bootstrap/config.rs 2018-10-19 14:18:14.000000000 -0700 -@@ -416,7 +416,6 @@ - - let build = toml.build.clone().unwrap_or(Build::default()); - // set by bootstrap.py -- config.hosts.push(config.build.clone()); - for host in build.host.iter() { - let host = INTERNER.intern_str(host); - if !config.hosts.contains(&host) { diff --git a/scripts/setup-ubuntu.sh b/scripts/setup-ubuntu.sh index c1583b979..ae4b111ea 100755 --- a/scripts/setup-ubuntu.sh +++ b/scripts/setup-ubuntu.sh @@ -36,6 +36,7 @@ PACKAGES+=" xmlto" PACKAGES+=" libexpat1-dev" # Needed by ghostscript PACKAGES+=" libjpeg-dev" # Needed by ghostscript PACKAGES+=" gawk" # Needed by apr-util +PACKAGES+=" libssl-dev" # Needed to build Rust sudo DEBIAN_FRONTEND=noninteractive \ apt-get install -yq --no-install-recommends $PACKAGES