Skip to content

Commit

Permalink
Merge pull request #34 from mariux64/add-rustc-1.29.2
Browse files Browse the repository at this point in the history
Rustc: Add version 1.29.2
  • Loading branch information
thomas authored Nov 9, 2018
2 parents ae6bbd4 + 6fc155e commit 553b0dd
Showing 1 changed file with 88 additions and 0 deletions.
88 changes: 88 additions & 0 deletions rustc-1.29.2-0.build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#! /bin/bash

PKG=rustc
VERSION=1.29.2
BUILD=0

PREFIX=/pkg/$PKG-$VERSION-$BUILD
#PREFIX=/dev/shm/$PKG-$VERSION-$BUILD

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
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
[llvm]
targets = "X86"
# When using system llvm prefer shared libraries
link-shared = true
[build]
# install cargo as well as rust
extended = true
[install]
prefix = "$PREFIX"
docdir = "share/doc/rustc-1.29.2"
sysconfdir = "etc"
[rust]
channel = "stable"
rpath = false
# BLFS does not install the FileCheck executable from llvm,
# so disable codegen tests
codegen-tests = false
[target.x86_64-unknown-linux-gnu]
# delete this *section* if you are not using system llvm.
# NB the output of llvm-config (i.e. help options) may be
# dumped to the screen when config.toml is parsed.
llvm-config = "/usr/bin/llvm-config"
EOF

export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" &&
python3 ./x.py build

python3 ./x.py install

cd ${BUILDDIR}

test -e ${BUILDDIR}/cbindgen-0.6.6.tar.gz || wget https://github.com/eqrion/cbindgen/archive/v0.6.6/cbindgen-0.6.6.tar.gz -O ${BUILDDIR}/cbindgen-0.6.6.tar.gz
test -d cbindgen-0.6.6 || tar xvf ${BUILDDIR}/cbindgen-0.6.6.tar.gz

cd cbindgen-0.6.6

$PREFIX/bin/cargo build --release
install -Dm755 target/release/cbindgen $PREFIX/bin


exit

0 comments on commit 553b0dd

Please sign in to comment.