-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Firefox 73.0 needs at least Rust 1.39.0, and cbindgen 0.12.0.
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
#! /bin/bash | ||
|
||
PKG=rustc | ||
VERSION=1.41.0 | ||
BUILD=0 | ||
|
||
PREFIX=/pkg/$PKG-$VERSION-$BUILD | ||
if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi | ||
|
||
set -xe | ||
umask 022 | ||
|
||
BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp | ||
test -d $BUILD_TMPDIR && rm -rf $BUILD_TMPDIR | ||
mkdir -p $BUILD_TMPDIR/home | ||
export TMPDIR=$BUILD_TMPDIR | ||
export HOME=$BUILD_TMPDIR/home | ||
|
||
exec </dev/null | ||
|
||
mkdir -p $PREFIX | ||
cat >$PREFIX/profile <<-EOF | ||
PATH=$PREFIX/bin:\$PATH | ||
LD_LIBRARY_PATH=$PREFIX/lib:\$LD_LIBRARY_PATH | ||
export PATH LD_LIBRARY_PATH | ||
if [ -d /pkg/${PKG}-${VERSION}-${BUILD}/.compatlibs ]; then LD_LIBRARY_PATH=${PREFIX}/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi | ||
EOF | ||
. $PREFIX/profile | ||
|
||
export MAKEFLAGS="-j $(nproc)" | ||
|
||
BUILDDIR=$PREFIX/build | ||
|
||
mkdir -p $BUILDDIR | ||
cd $BUILDDIR | ||
|
||
test -e $PKG-$VERSION-src.tar.gz || wget https://static.rust-lang.org/dist/$PKG-$VERSION-src.tar.gz | ||
test -d $PKG-$VERSION-src || tar xvf $PKG-$VERSION-src.tar.gz | ||
cd $PKG-$VERSION-src | ||
cat << EOF > config.toml | ||
# see config.toml.example for more possible options | ||
# see config.toml.example for more possible options | ||
[llvm] | ||
# use ninja | ||
ninja = true | ||
targets = "X86" | ||
# When compiling LLVM, the experimental targets (WebAssembly | ||
# and RISCV) are built by default - omit them | ||
experimental-targets = "" | ||
[build] | ||
# omit HTML docs to save time and space (comment this to build them) | ||
docs = false | ||
# install cargo as well as rust | ||
extended = true | ||
[install] | ||
# Adjust the prefix for the desired destination | ||
prefix = "$PREFIX" | ||
sysconfdir = "etc" | ||
# docdir is used even if the full awesome docs are not installed | ||
docdir = "share/doc/rustc-${VERSION}" | ||
[rust] | ||
channel = "stable" | ||
rpath = false | ||
# BLFS does not install the FileCheck executable from llvm, | ||
# so disable codegen tests | ||
codegen-tests = false | ||
# get a trace if there is an Internal Compiler Exception | ||
backtrace-on-ice = false | ||
EOF | ||
|
||
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" && | ||
python3 ./x.py build --exclude src/tools/miri | ||
|
||
python3 ./x.py install | ||
|
||
cd ${BUILDDIR} | ||
|
||
BINDGENVERS=0.13.1 | ||
|
||
test -e ${BUILDDIR}/cbindgen-${BINDGENVERS}.tar.gz || wget https://github.com/eqrion/cbindgen/archive/v${BINDGENVERS}/cbindgen-${BINDGENVERS}.tar.gz -O ${BUILDDIR}/cbindgen-${BINDGENVERS}.tar.gz | ||
test -d cbindgen-${BINDGENVERS} || tar xvf ${BUILDDIR}/cbindgen-${BINDGENVERS}.tar.gz | ||
|
||
cd cbindgen-${BINDGENVERS} | ||
|
||
source ${PREFIX}/profile | ||
|
||
cargo build --release | ||
install -Dm755 target/release/cbindgen $PREFIX/bin | ||
|
||
|
||
exit |