#!/bin/sh -e export DESTDIR="$1" for p in *.patch; do patch -p1 < "$p" done # Instruct the compiler to trim absolute paths in resulting binaries and instead # change them to relative paths ($PWD/... ./...). export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix=$PWD=." sed 's/\("files":{\)[^}]*/\1/' \ vendor/curl-sys-0.4.52+curl-7.81.0/.cargo-checksum.json > _ mv -f _ vendor/curl-sys-0.4.52+curl-7.81.0/.cargo-checksum.json sed 's/\("files":{\)[^}]*/\1/' \ vendor/curl-sys-0.4.74+curl-8.9.0/.cargo-checksum.json > _ mv -f _ vendor/curl-sys-0.4.74+curl-8.9.0/.cargo-checksum.json cat > config.toml </dev/null) || rust_version=null cargo --version 2>/dev/null || rust_version=null rustfmt --version 2>/dev/null || rust_version=null rust_version="${rust_version#rustc }" case "$rust_version" in "$maj.$min".*|"$maj.$((min - 1))".*) cat >> config.toml <> config.toml <> config.toml mkdir -p libgcc printf 'INPUT(-lunwind)\n' > \ libgcc/libgcc_s.so ln -sf "$libunwind_path" \ libgcc/libgcc_s.so.1 export \ LD_LIBRARY_PATH="$PWD/libgcc:$LD_LIBRARY_PATH" \ LIBRARY_PATH="$PWD/libgcc:$LIBRARY_PATH" esac python x.py build -j "$(grep -scF 'core id' /proc/cpuinfo)" python x.py install rm -rf \ "$1/usr/lib/rustlib/src/" \ "$1/usr/share/doc" \ "$1/usr/share/zsh" \ "$1/usr/lib/rustlib/uninstall.sh"