repo/extra/rust/build

69 lines
1.5 KiB
Plaintext
Raw Normal View History

2019-07-21 09:11:03 +00:00
#!/bin/sh -e
2020-10-09 08:55:38 +00:00
patch -p1 < libressl.patch
2020-02-27 20:05:15 +00: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 12:55:58 +00:00
# connection requirement per build.
{
2020-10-09 08:55:38 +00:00
mkdir -p "${cache_dir:=build/cache/2020-08-27}"
2020-01-31 09:30:15 +00:00
for tarball in *.tar.xz\?no-extract; do
2019-11-26 10:55:52 +00:00
mv -f "$tarball" "$cache_dir/${tarball%%\?no-extract}"
done
}
2020-10-09 08:55:38 +00:00
# We modified openssl-sys.
sed -i 's/\("files":{\)[^}]*/\1/' \
vendor/openssl-sys/.cargo-checksum.json
sed -i 's/crt_static_default = true/crt_static_default = false/' \
src/librustc_target/spec/linux_musl_base.rs
2019-07-21 09:11:03 +00:00
2019-08-24 20:34:01 +00:00
cat > config.toml <<EOF
[llvm]
link-shared = true
[build]
2020-10-09 08:55:38 +00:00
build = "x86_64-unknown-linux-musl"
host = [ "x86_64-unknown-linux-musl" ]
target = [ "x86_64-unknown-linux-musl" ]
2020-02-27 20:05:15 +00: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 20:34:01 +00:00
[install]
prefix = "/usr"
[rust]
2020-10-09 08:55:38 +00:00
channel = "stable"
rpath = false
debuginfo-level = 0
debug = false
backtrace = false
jemalloc = false
debug-assertions = false
codegen-tests = false
codegen-units-std = 1
2019-08-24 20:34:01 +00:00
[target.x86_64-unknown-linux-musl]
llvm-config = "/usr/bin/llvm-config"
2020-02-27 20:05:15 +00:00
crt-static = false
2019-08-24 20:34:01 +00:00
EOF
2020-05-03 20:44:01 +00:00
export DESTDIR="$1"
2020-02-27 20:05:15 +00:00
2019-08-24 20:34:01 +00:00
python3 ./x.py build -j "$(nproc)"
2020-02-27 20:05:15 +00:00
python3 ./x.py install
2020-05-05 21:56:59 +00:00
rm -rf "$1/usr/lib/rustlib/src/"
2020-08-26 14:36:38 +00:00
rm -f "$1/usr/lib/rustlib/uninstall.sh"