2019-08-24 00:02:55 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
patch -p1 < musl-libressl.patch
|
|
|
|
|
|
|
|
# '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
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2019-08-24 12:36:41 +00:00
|
|
|
python3 ./x.py build -j "$(nproc)"
|
2019-08-24 00:02:55 +00:00
|
|
|
DESTDIR="$1" python3 ./x.py install
|
2019-08-24 12:36:41 +00:00
|
|
|
|
|
|
|
# Remove junk.
|
|
|
|
rm -rf "$1/etc/bash_completion.d"
|
|
|
|
rm -rf "$1/usr/share/zsh"
|
|
|
|
rm -rf "$1/usr/share/doc"
|