#!/bin/sh -e rustver="1.29.0" rustsrc="$(pwd)/rustc-$rustver-src" if [ ! -e "$rustsrc/dl-version" ]; then echo "bypassing the download step using a softlink to the rust source code..." ln -sf "/src/rust-$rustver" "$rustsrc" echo "$rustver" > "$rustsrc/dl-version" echo "applying the mrust patch to the rust source code..." cd "$rustsrc" patch -p0 < /mnt/src/rustc-$rustver-src.patch cd - > /dev/null echo "removing bundled rust dependencies..." rm -rf "$rustsrc/llvm-project/" echo "removing hardcoded LD_LIBRARY_PATH in rust's bootstrap.py..." sed -i "/LD_LIBRARY_PATH/d" "$rustsrc/src/bootstrap/bootstrap.py" else echo "pre-configure setup seems to have been done already. skipping." fi ln -sf /bin/python3 /mnt/build/python export PATH="$PATH:/mnt/build" export triple="powerpc64le-alpine-linux-musl" #cd "$rustsrc" #./configure \ # --build="$triple" \ # --target="$triple" \ # --release-channel="stable" \ # --llvm-root="$PREFIX/lib" \ # --disable-docs \ # --enable-extended \ # --tools="analysis,cargo,src" \ # --enable-llvm-link-shared \ # --enable-option-checking \ # --enable-locked-deps \ # --enable-vendor \ # --python="python3" \ # --set="target.${triple}.musl-root=$PREFIX" \ # --set="target.${triple}.crt-static=false" # #--set="rust.musl-root=$PREFIX" \ # #echo "making warnings non-fatal..." #sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml #sed 's|deny(warnings,|deny(|' -i src/bootstrap/lib.rs rm /mnt/build/python