summaryrefslogtreecommitdiff
path: root/development/rust
diff options
context:
space:
mode:
Diffstat (limited to 'development/rust')
-rw-r--r--development/rust/README6
-rw-r--r--development/rust/rust.SlackBuild50
2 files changed, 26 insertions, 30 deletions
diff --git a/development/rust/README b/development/rust/README
index 648e223114..2179a55991 100644
--- a/development/rust/README
+++ b/development/rust/README
@@ -1,12 +1,14 @@
Rust is a systems programming language that runs blazingly fast,
prevents segfaults, and guarantees thread safety.
+Cargo - the Rust package manager - is included in this build.
+
This will build rust from source, which requires using the "official" stage0
compiler for the version being built from rust-lang.org, which is currently
the previous stable version.
-If you already have rust and cargo installed, this slackbuild will use these to
-bootstrap itself.
+If you already have rust installed, this slackbuild will use it to bootstrap
+itself.
You can also force either behaviour through the LOCAL_BOOTSTRAP=yes|no
parameter.
diff --git a/development/rust/rust.SlackBuild b/development/rust/rust.SlackBuild
index d14e0b8b60..7c3cd7a311 100644
--- a/development/rust/rust.SlackBuild
+++ b/development/rust/rust.SlackBuild
@@ -25,11 +25,14 @@
PRGNAM=rust
SRCNAM="${PRGNAM}c"
VERSION=${VERSION:-1.19.0}
+
+# src/stage0.txt
RSTAGE0_VERSION=${RSTAGE0_VERSION:-1.18.0}
RSTAGE0_DIR=${RSTAGE0_DIR:-2017-06-08}
CSTAGE0_VERSION=${CSTAGE0_VERSION:-0.19.0}
CSTAGE0_DIR=${CSTAGE0_DIR:-$RSTAGE0_DIR}
-BUILD=${BUILD:-1}
+
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -84,18 +87,20 @@ if [ "$LOCAL_BOOTSTRAP" != "yes" ] ; then
fi
# src/bootstrap/config.toml.example
-cat <<EOF > config.toml
+cat << EOF > config.toml
[build]
vendor = true
-extended = false
-submodules = false
+extended = true
[install]
-prefix = "$PKG/usr"
+prefix = "/usr"
+docdir = "doc/rust"
libdir = "lib$LIBDIRSUFFIX"
mandir = "man"
[rust]
+codegen-units = 0
+debuginfo = true
channel = "stable"
rpath = false
codegen-tests = false
@@ -107,7 +112,7 @@ llvm-config = "/usr/bin/llvm-config"
EOF
if [ "$LOCAL_BOOTSTRAP" = "yes" ] ; then
- sed -i "s|^\(vendor = true\)$|\1\nrustc = \"/usr/bin/rustc\"\ncargo = \"/usr/bin/cargo\"|" config.toml
+ sed -i "s|^\(extended = true\)$|\1\nrustc = \"/usr/bin/rustc\"\ncargo = \"/usr/bin/cargo\"|" config.toml
fi
chown -R root:root .
@@ -118,33 +123,22 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
-export CC=clang
-export CXX=clang++
+# README.md says gcc 4.7 / clang 3.x or later needed
+# but building fails for me with GCC 5.3 from slackware 14.2
+CC=clang \
+CXX=clang++ \
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
-python x.py build --verbose
-
-python x.py dist --verbose
-
-for dist in rustc rust-std rust-docs ; do
- mkdir unpack
- (
- cd unpack
+python x.py build
- tar xvf ../build/dist/$dist-$VERSION-$ARCH-unknown-linux-gnu.tar.gz
-
- cd $dist-$VERSION-$ARCH-unknown-linux-gnu
- ./install.sh --prefix="$PKG/usr" --mandir="$PKG/usr/man"
- )
- rm -rf unpack
-done
-
-if [ "$ARCH" = "x86_64" ]; then
- mv $PKG/usr/lib $PKG/usr/lib$LIBDIRSUFFIX
-fi
+DESTDIR=$PKG python x.py install
-mv $PKG/usr/share/doc $PKG/usr/
+rm -rf $PKG/usr/lib$LIBDIRSUFFIX/rustlib/components
+rm -rf $PKG/usr/lib$LIBDIRSUFFIX/rustlib/install.log
+rm -rf $PKG/usr/lib$LIBDIRSUFFIX/rustlib/manifest-*
+rm -rf $PKG/usr/lib$LIBDIRSUFFIX/rustlib/rust-installer-version
+rm -rf $PKG/usr/lib$LIBDIRSUFFIX/rustlib/uninstall.sh
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true