2019-07-21 03:11:03 -06:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
2020-04-30 12:40:07 -06:00
|
|
|
for patch in *.patch; do
|
2020-04-24 06:12:21 -06:00
|
|
|
patch -p1 < "$patch"
|
|
|
|
done
|
2020-02-27 13:05:15 -07:00
|
|
|
|
2019-10-15 02:16:27 -06:00
|
|
|
# This package mimics the download process of rust's 'x.py'
|
|
|
|
# bootstrap library to allow for the removal of the internet
|
2020-02-11 05:55:58 -07:00
|
|
|
# connection requirement per build.
|
2019-10-15 02:16:27 -06:00
|
|
|
{
|
2020-08-28 03:55:38 -06:00
|
|
|
mkdir -p "${cache_dir:=build/cache/2020-08-03}"
|
2019-10-15 02:16:27 -06:00
|
|
|
|
2020-01-31 02:30:15 -07:00
|
|
|
for tarball in *.tar.xz\?no-extract; do
|
2019-11-26 03:55:52 -07:00
|
|
|
mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}"
|
2019-10-15 02:16:27 -06:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-02-27 13:05:15 -07:00
|
|
|
# 'rust' checksums files in 'vendor/', but we patch a few.
|
2019-08-24 14:34:01 -06:00
|
|
|
for vendor in libc openssl-sys; do
|
|
|
|
sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json"
|
2019-07-29 20:02:13 -06:00
|
|
|
done
|
2019-07-21 03:11:03 -06:00
|
|
|
|
2019-08-24 14:34:01 -06:00
|
|
|
cat > config.toml <<EOF
|
|
|
|
[llvm]
|
|
|
|
link-shared = true
|
|
|
|
|
|
|
|
[build]
|
2020-02-27 13:05:15 -07:00
|
|
|
build = "x86_64-unknown-linux-musl"
|
|
|
|
host = [ "x86_64-unknown-linux-musl" ]
|
2019-08-24 14:34:01 -06:00
|
|
|
target = [ "x86_64-unknown-linux-musl" ]
|
2020-02-27 13:05:15 -07:00
|
|
|
|
|
|
|
docs = false
|
|
|
|
compiler-docs = false
|
|
|
|
extended = true
|
|
|
|
submodules = false
|
|
|
|
python = "python3"
|
|
|
|
locked-deps = true
|
|
|
|
vendor = true
|
|
|
|
sanitizers = false
|
|
|
|
profiler = false
|
|
|
|
full-bootstrap = false
|
2019-08-24 14:34:01 -06:00
|
|
|
|
|
|
|
[install]
|
|
|
|
prefix = "/usr"
|
|
|
|
|
|
|
|
[rust]
|
2020-02-27 13:05:15 -07:00
|
|
|
channel = "stable"
|
|
|
|
rpath = false
|
|
|
|
codegen-units = 1
|
|
|
|
debuginfo-level = 0
|
|
|
|
debug = false
|
|
|
|
backtrace = false
|
|
|
|
jemalloc = false
|
|
|
|
debug-assertions = false
|
|
|
|
codegen-tests = false
|
2019-08-24 14:34:01 -06:00
|
|
|
|
|
|
|
[target.x86_64-unknown-linux-musl]
|
|
|
|
llvm-config = "/usr/bin/llvm-config"
|
2020-02-27 13:05:15 -07:00
|
|
|
crt-static = false
|
2019-08-24 14:34:01 -06:00
|
|
|
EOF
|
|
|
|
|
2020-05-03 14:44:01 -06:00
|
|
|
export DESTDIR="$1"
|
2020-02-27 13:05:15 -07:00
|
|
|
|
2019-08-24 14:34:01 -06:00
|
|
|
python3 ./x.py build -j "$(nproc)"
|
2020-02-27 13:05:15 -07:00
|
|
|
python3 ./x.py install
|
2020-05-05 15:56:59 -06:00
|
|
|
|
|
|
|
rm -rf "$1/usr/lib/rustlib/src/"
|
2020-08-26 08:36:38 -06:00
|
|
|
rm -f "$1/usr/lib/rustlib/uninstall.sh"
|