forked from kiss-community/repo
rust: minor changes
- Build less tools. Reduces compilation times. If the now disabled tools are needed, fork the package. - Trim build directory paths in resulting binaries. - Minor changes.
This commit is contained in:
parent
31bf9188d9
commit
91a7ed6a4d
|
@ -1,5 +1,9 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
# 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=."
|
||||||
|
|
||||||
# This package mimics the download process of rust's 'x.py'
|
# This package mimics the download process of rust's 'x.py'
|
||||||
# bootstrap library to allow for the removal of the internet
|
# bootstrap library to allow for the removal of the internet
|
||||||
# connection requirement per build.
|
# connection requirement per build.
|
||||||
|
@ -41,7 +45,7 @@ submodules = false
|
||||||
python = "python3"
|
python = "python3"
|
||||||
locked-deps = true
|
locked-deps = true
|
||||||
vendor = true
|
vendor = true
|
||||||
tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src", "rust-demangler"]
|
tools = [ "cargo" ]
|
||||||
sanitizers = false
|
sanitizers = false
|
||||||
profiler = false
|
profiler = false
|
||||||
full-bootstrap = false
|
full-bootstrap = false
|
||||||
|
@ -52,42 +56,42 @@ prefix = "/usr"
|
||||||
[target.x86_64-unknown-linux-musl]
|
[target.x86_64-unknown-linux-musl]
|
||||||
llvm-config = "/usr/bin/llvm-config"
|
llvm-config = "/usr/bin/llvm-config"
|
||||||
crt-static = false
|
crt-static = false
|
||||||
|
sanitizers = false
|
||||||
|
|
||||||
[rust]
|
[rust]
|
||||||
channel = "stable"
|
|
||||||
rpath = false
|
|
||||||
debuginfo-level = 0
|
|
||||||
debug = false
|
|
||||||
backtrace = false
|
backtrace = false
|
||||||
jemalloc = false
|
channel = "stable"
|
||||||
debug-assertions = false
|
|
||||||
codegen-tests = false
|
codegen-tests = false
|
||||||
codegen-units-std = 1
|
codegen-units-std = 0
|
||||||
|
debug = false
|
||||||
|
debug-assertions = false
|
||||||
|
debuginfo-level = 0
|
||||||
|
incremental = false
|
||||||
|
jemalloc = false
|
||||||
|
rpath = false
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Workaround to get Rust to build in llvm-only environments.
|
# Workaround to get Rust to build in llvm-only environments.
|
||||||
|
# libgcc_s.so is needed for Rust's bootstrap binaries, on llvm-only systems
|
||||||
|
# this library does not exist. This hack creates it as alias to libunwind.
|
||||||
case $("$CC" -print-file-name=libunwind.so) in */*)
|
case $("$CC" -print-file-name=libunwind.so) in */*)
|
||||||
printf 'llvm-libunwind = "system"\n' >> config.toml
|
printf 'llvm-libunwind = "system"\n' >> config.toml
|
||||||
|
|
||||||
# libgcc_s.so is needed for Rust's bootstrap binaries, on llvm-only systems
|
mkdir -p libgcc
|
||||||
# this library does not exist. This hack creates it as alias to libunwind.
|
|
||||||
{
|
|
||||||
mkdir -p libgcc
|
|
||||||
|
|
||||||
printf 'INPUT(-lunwind)\n' > \
|
printf 'INPUT(-lunwind)\n' > \
|
||||||
libgcc/libgcc_s.so
|
libgcc/libgcc_s.so
|
||||||
|
|
||||||
ln -sf "$KISS_ROOT/usr/lib/libunwind.so.1" \
|
ln -sf "$KISS_ROOT/usr/lib/libunwind.so.1" \
|
||||||
libgcc/libgcc_s.so.1
|
libgcc/libgcc_s.so.1
|
||||||
|
|
||||||
export \
|
export \
|
||||||
LD_LIBRARY_PATH="$PWD/libgcc:$LD_LIBRARY_PATH" \
|
LD_LIBRARY_PATH="$PWD/libgcc:$LD_LIBRARY_PATH" \
|
||||||
LIBRARY_PATH="$PWD/libgcc:$LIBRARY_PATH"
|
LIBRARY_PATH="$PWD/libgcc:$LIBRARY_PATH"
|
||||||
}
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
python3 ./x.py build -j "$(nproc)"
|
./x.py build -j "$(grep -scF 'core id' /proc/cpuinfo)"
|
||||||
python3 ./x.py install
|
./x.py install
|
||||||
|
|
||||||
rm -rf \
|
rm -rf \
|
||||||
"$1/usr/lib/rustlib/src/" \
|
"$1/usr/lib/rustlib/src/" \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
cmake make
|
cmake make
|
||||||
curl make
|
curl make
|
||||||
openssl
|
|
||||||
llvm
|
llvm
|
||||||
|
openssl
|
||||||
pkgconf make
|
pkgconf make
|
||||||
python make
|
python make
|
||||||
xz
|
xz
|
||||||
|
|
Loading…
Reference in New Issue
Block a user