From 2a7a69cdc83aef026af65d0363a64d9925977800 Mon Sep 17 00:00:00 2001 From: its-pointless Date: Sat, 26 Oct 2019 10:24:56 +1100 Subject: [PATCH 1/2] hopefully last fix.... --- packages/rust/build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/rust/build.sh b/packages/rust/build.sh index 5336ea971..970380341 100644 --- a/packages/rust/build.sh +++ b/packages/rust/build.sh @@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="Systems programming language focused on safety, speed an TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_MAINTAINER="Kevin Cotugno @kcotugno" TERMUX_PKG_VERSION=1.38.0 -TERMUX_PKG_REVISION=2 +TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz TERMUX_PKG_SHA256=3a7991aa4cb44ef941d71636e45a95468b520dc6fc7cf725364925bd3e3d3a34 TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib" @@ -55,8 +55,9 @@ termux_step_make() { } termux_step_make_install() { # ugly fix to get extended tools working - $TERMUX_PKG_SRCDIR/x.py install --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || cp ./build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_macros-*.so ./build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/librustc_macros-*.so - $TERMUX_PKG_SRCDIR/x.py install --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || true + $TERMUX_PKG_SRCDIR/x.py dist --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || true + $TERMUX_PKG_SRCDIR/x.py install --stage 2 --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown || cp ./build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_macros-*.so ./build/x86_64-unknown-linux-gnu/stage2-tools/release/deps/librustc_macros-*.so + $TERMUX_PKG_SRCDIR/x.py install --host $CARGO_TARGET_NAME --target $CARGO_TARGET_NAME --target wasm32-unknown-unknown cd "$TERMUX_PREFIX/lib" rm -f libc.so libdl.so ln -sf rustlib/$CARGO_TARGET_NAME/lib/*.so . From c4bbe24993c6c68f3c0c1d106684501dbb360c39 Mon Sep 17 00:00:00 2001 From: its-pointless Date: Sat, 26 Oct 2019 16:46:24 +1100 Subject: [PATCH 2/2] experiment generating llvm-config --- packages/rust/build.sh | 2 +- scripts/build/termux_step_start_build.sh | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/rust/build.sh b/packages/rust/build.sh index 970380341..87757ac4e 100644 --- a/packages/rust/build.sh +++ b/packages/rust/build.sh @@ -6,7 +6,7 @@ TERMUX_PKG_VERSION=1.38.0 TERMUX_PKG_REVISION=3 TERMUX_PKG_SRCURL=https://static.rust-lang.org/dist/rustc-$TERMUX_PKG_VERSION-src.tar.xz TERMUX_PKG_SHA256=3a7991aa4cb44ef941d71636e45a95468b520dc6fc7cf725364925bd3e3d3a34 -TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib" +TERMUX_PKG_DEPENDS="libc++, clang, openssl, lld, zlib, libllvm" termux_step_configure() { termux_setup_cmake diff --git a/scripts/build/termux_step_start_build.sh b/scripts/build/termux_step_start_build.sh index 5f6266480..d5619f3e0 100644 --- a/scripts/build/termux_step_start_build.sh +++ b/scripts/build/termux_step_start_build.sh @@ -106,7 +106,28 @@ termux_step_start_build() { TERMUX_BUILD_IGNORE_LOCK=true ./build-package.sh -s "${PKG_DIR}" done<<<$(./scripts/buildorder.py "$TERMUX_PKG_BUILDER_DIR" $TERMUX_PACKAGES_DIRECTORIES || echo "ERROR") fi - + if [ "$TERMUX_INSTALL_DEPS" == true ] && [ "$TERMUX_PKG_DEPENDS" != "${TERMUX_PKG_DEPENDS/libllvm/}" ]; then + LLVM_DEFAULT_TARGET_TRIPLE=$TERMUX_HOST_PLATFORM + if [ $TERMUX_ARCH = "arm" ]; then + LLVM_TARGET_ARCH=ARM + elif [ $TERMUX_ARCH = "aarch64" ]; then + LLVM_TARGET_ARCH=AArch64 + elif [ $TERMUX_ARCH = "i686" ]; then + LLVM_TARGET_ARCH=X86 + elif [ $TERMUX_ARCH = "x86_64" ]; then + LLVM_TARGET_ARCH=X86 + fi + LIBLLVM_VERSION=$(grep "TERMUX_PKG_VERSION=" $TERMUX_SCRIPTDIR/packages/libllvm/build.sh | cut -c20- ) + echo "$LIBLLVM_VERSION" + sed $TERMUX_SCRIPTDIR/packages/libllvm/llvm-config.in \ + -e "s|@TERMUX_PKG_VERSION@|$LIBLLVM_VERSION|g" \ + -e "s|@TERMUX_PREFIX@|$TERMUX_PREFIX|g" \ + -e "s|@TERMUX_PKG_SRCDIR@|$TERMUX_TOPDIR/libllvm/src|g" \ + -e "s|@LLVM_TARGET_ARCH@|$LLVM_TARGET_ARCH|g" \ + -e "s|@LLVM_DEFAULT_TARGET_TRIPLE@|$LLVM_DEFAULT_TARGET_TRIPLE|g" \ + -e "s|@TERMUX_ARCH@|$TERMUX_ARCH|g" > $TERMUX_PREFIX/bin/llvm-config + chmod 755 $TERMUX_PREFIX/bin/llvm-config + fi # Following directories may contain files with read-only permissions which # makes them undeletable. We need to fix that. [ -d "$TERMUX_PKG_BUILDDIR" ] && chmod +w -R "$TERMUX_PKG_BUILDDIR"