diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2020-11-07 17:27:18 +1300 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2020-11-14 17:16:38 +0700 |
commit | db8f72b8d7dbadb904d4c84088ea65d2c2c359c9 (patch) | |
tree | 6ac07a39b0001003a0fb2691c1c589c72a3f6908 /development/mrustc | |
parent | 731deb72e5e6706011071e8bbddcbcca232b2f97 (diff) |
development/mrustc: Updated for version 0.9.
Signed-off-by: Andrew Clemons <andrew.clemons@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/mrustc')
-rw-r--r-- | development/mrustc/README | 10 | ||||
-rw-r--r-- | development/mrustc/mrustc-0.8.0-fix-variable-length-integer-receiving.patch | 15 | ||||
-rw-r--r-- | development/mrustc/mrustc.SlackBuild | 85 | ||||
-rw-r--r-- | development/mrustc/mrustc.info | 6 |
4 files changed, 61 insertions, 55 deletions
diff --git a/development/mrustc/README b/development/mrustc/README index eff3416e6e9c..d539994b672a 100644 --- a/development/mrustc/README +++ b/development/mrustc/README @@ -2,13 +2,3 @@ mrustc - alternative rust compiler This project is an attempt at creating a simple rust compiler in C++, with the ultimate goal of being a separate re-implementation. - -This slackbuild will build and package mrustc and additionally build -the official rust 1.19.0 with stdlib. - -This script may take a while to complete (around one hour on a 10 -core machine) and will require about 19GB (!) of disk space for its -temporary directory. It defaults to "/tmp/SBo" and you may redefine it -like this: - -TMP=/your/temporary/dir ./mrustc.SlackBuild diff --git a/development/mrustc/mrustc-0.8.0-fix-variable-length-integer-receiving.patch b/development/mrustc/mrustc-0.8.0-fix-variable-length-integer-receiving.patch deleted file mode 100644 index 9e76653a0775..000000000000 --- a/development/mrustc/mrustc-0.8.0-fix-variable-length-integer-receiving.patch +++ /dev/null @@ -1,15 +0,0 @@ -https://github.com/thepowersgang/mrustc/issues/109 -From: Danny Milosavljevic <dannym@scratchpost.org> -Date: Fri, 3 Jan 2019 13:00:00 +0100 - ---- mrustc/src/expand/proc_macro.cpp.orig 2019-02-01 14:16:54.208486062 +0100 -+++ mrustc/src/expand/proc_macro.cpp 2019-02-01 14:17:14.350925705 +0100 -@@ -977,7 +977,7 @@ - for(;;) - { - auto b = recv_u8(); -- v |= static_cast<uint64_t>(b) << ofs; -+ v |= static_cast<uint64_t>(b & 0x7F) << ofs; - if( (b & 0x80) == 0 ) - break; - ofs += 7; diff --git a/development/mrustc/mrustc.SlackBuild b/development/mrustc/mrustc.SlackBuild index 909bcb38aedf..75ace16a32a1 100644 --- a/development/mrustc/mrustc.SlackBuild +++ b/development/mrustc/mrustc.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for mrustc -# Copyright 2017-2019 Andrew Clemons, Wellington New Zealand +# Copyright 2017-2020 Andrew Clemons, Wellington New Zealand # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,8 +23,9 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=mrustc -VERSION=${VERSION:-0.8.0} +VERSION=${VERSION:-0.9} RUSTCVERSION=${RUSTCVERSION:-1.19.0} +MRUSTCTARGETVERSION=${MRUSTCTARGETVERSION:-1.19} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -79,11 +80,15 @@ rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION -patch -p1 < "$CWD/mrustc-0.8.0-fix-variable-length-integer-receiving.patch" -sed -i '/curl -sS https:/d' Makefile -sed -i 's/-src.tar.gz/-src.tar.xz/' Makefile +tar -xf "$CWD/rustc-$RUSTCVERSION-src.tar.xz" -cp "$CWD/rustc-$RUSTCVERSION-src.tar.xz" . +( + cd "rustc-$RUSTCVERSION-src" + patch -p0 < ../"rustc-$RUSTCVERSION-src.patch" + echo "$RUSTCVERSION" > dl-version +) + +sed -i 's/\(TargetVersion.*TargetVersion.*=.*\)TargetVersion::Rustc1_29/\1TargetVersion::Rustc1_19/' src/main.cpp chown -R root:root . find -L . \ @@ -92,45 +97,71 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -make RUSTCSRC +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +RUSTC_VERSION="$RUSTCVERSION" \ +MRUSTC_TARGET_VER="$MRUSTCTARGETVERSION" \ +OUTDIR_SUF="" \ +CC=gcc \ +CXX=g++ \ +make RUSTC_TARGET="$RUSTC_TARGET" CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ -RUSTC_TARGET="$RUSTC_TARGET" \ +RUSTC_VERSION="$RUSTCVERSION" \ +MRUSTC_TARGET_VER="$MRUSTCTARGETVERSION" \ +OUTDIR_SUF="" \ CC=gcc \ -make -f minicargo.mk +CXX=g++ \ +make -f minicargo.mk LIBS RUSTC_TARGET="$RUSTC_TARGET" -WITH_RUSTC=${WITH_RUSTC:-yes} +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +RUSTC_VERSION="$RUSTCVERSION" \ +MRUSTC_TARGET_VER="$MRUSTCTARGETVERSION" \ +OUTDIR_SUF="" \ +CC=gcc \ +CXX=g++ \ +make -C tools/minicargo RUSTC_TARGET="$RUSTC_TARGET" -if [ "$WITH_RUSTC" = "yes" ] ; then - CFLAGS="$SLKCFLAGS" \ - CXXFLAGS="$SLKCFLAGS" \ - RUSTC_TARGET="$RUSTC_TARGET" \ - CC=gcc \ - make -j1 -C run_rustc -fi +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +RUSTC_VERSION="$RUSTCVERSION" \ +MRUSTC_TARGET_VER="$MRUSTCTARGETVERSION" \ +OUTDIR_SUF="" \ +CC=gcc \ +CXX=g++ \ +make test RUSTC_TARGET="$RUSTC_TARGET" mkdir -p $PKG/usr/bin install -m 0755 bin/mrustc $PKG/usr/bin/mrustc install -m 0755 tools/bin/minicargo $PKG/usr/bin/minicargo -mkdir -p $PKG/usr/share/mrustc -find output -name '*.hir' -maxdepth 1 -exec install -m 0644 {} $PKG/usr/share/mrustc/ \; +mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/ +cp -a output $PKG/usr/lib$LIBDIRSUFFIX/mrust -if [ "$WITH_RUSTC" = "yes" ] ; then - mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/rustlib/$ARCH-unknown-linux-gnu/lib/ - cp -a run_rustc/prefix/lib/rustlib/$ARCH-unknown-linux-gnu/lib/* $PKG/usr/lib$LIBDIRSUFFIX/rustlib/$ARCH-unknown-linux-gnu/lib/ +find $PKG/usr/lib$LIBDIRSUFFIX -name '*.txt' -print0 | xargs -0 rm - find $PKG/usr/lib$LIBDIRSUFFIX -name "*.so" -exec chmod 755 "{}" \; +mkdir -p $PKG/usr/share/mrustc/run_rustc - install -m 0755 output/rustc $PKG/usr/bin/rustc - install -m 0755 output/cargo $PKG/usr/bin/cargo - install -m 0755 output/rustc-build/rustdoc $PKG/usr/bin/rustdoc -fi +install -m 0644 run_rustc/Makefile $PKG/usr/share/mrustc/run_rustc/Makefile 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 +mkdir -p $PKG/etc/profile.d +cat << EOF > $PKG/etc/profile.d/$PRGNAM.csh +#!/bin/csh +setenv MRUSTC_PATH=/usr/bin/mrustc +EOF + +cat << EOF > $PKG/etc/profile.d/$PRGNAM.sh +#!/bin/sh +export MRUSTC_PATH=/usr/bin/mrustc +EOF + +chmod 0755 $PKG/etc/profile.d/* + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ LICENCE-MIT README.md \ diff --git a/development/mrustc/mrustc.info b/development/mrustc/mrustc.info index 48936cbb7d57..09931e4e4294 100644 --- a/development/mrustc/mrustc.info +++ b/development/mrustc/mrustc.info @@ -1,9 +1,9 @@ PRGNAM="mrustc" -VERSION="0.8.0" +VERSION="0.9" HOMEPAGE="https://github.com/thepowersgang/mrustc" -DOWNLOAD="https://github.com/thepowersgang/mrustc/archive/v0.8.0/mrustc-0.8.0.tar.gz \ +DOWNLOAD="https://github.com/thepowersgang/mrustc/archive/v0.9/mrustc-0.9.tar.gz \ https://static.rust-lang.org/dist/rustc-1.19.0-src.tar.xz" -MD5SUM="c082e1e2d2258c1481d4bf492bf435ae \ +MD5SUM="4195695805ddfaf7cb2f4088760b26d0 \ e9af5bb321c0cad44ea0e3e2c644ab2f" DOWNLOAD_x86_64="" MD5SUM_x86_64="" |