repo/extra/rust/build

56 lines
1.1 KiB
Plaintext
Raw Normal View History

2019-07-21 09:11:03 +00:00
#!/bin/sh -e
# 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-01-31 09:30:15 +00:00
cache_dir=build/cache/2019-12-19
mkdir -p "$cache_dir"
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-01-31 09:30:15 +00:00
patch -p1 < musl.patch
2019-08-24 20:34:01 +00:00
# 'rust' checksums files in 'vendor/', but we patch a few files.
for vendor in libc openssl-sys; do
sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json"
done
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]
build = "x86_64-unknown-linux-musl"
host = [ "x86_64-unknown-linux-musl" ]
target = [ "x86_64-unknown-linux-musl" ]
docs = false
extended = true
submodules = false
python = "python3"
locked-deps = true
vendor = true
[install]
prefix = "/usr"
[rust]
channel = "stable"
rpath = false
codegen-units = 1
debuginfo-level = 0
backtrace = false
jemalloc = false
codegen-tests = false
[target.x86_64-unknown-linux-musl]
llvm-config = "/usr/bin/llvm-config"
crt-static = false
EOF
python3 ./x.py build -j "$(nproc)"
DESTDIR="$1" python3 ./x.py install