UmVirt LFS Package info

DB commit: 57bed5a54ba91b88b24a1c8eb97bd083dbf72f0d
APP commit: 634ff2193dea70dde75eb1916d758638b7417453

mrustc

Mutabah's Rust Compiler is in-progress alternative rust compiler. Capable of building a fully-working copy of rustc, but not suitable for everyday use (due to terrible error messages).

Package info

Codename: mrustc
Source file: mrust-bf20f57582638fcaef5fd3428ec819b22708aff6.tar.xz
Source directory: mrust-bf20f57582638fcaef5fd3428ec819b22708aff6
Package URL: https://umvirt.com/linux/downloads/0.2/packages/m/mrust-bf20f57582638fcaef5fd3428ec819b22708aff6.tar.xz
Package md5-checksum URL: https://umvirt.com/linux/downloads/0.2/packages/m/mrust-bf20f57582638fcaef5fd3428ec819b22708aff6.tar.xz.md5sum
Dependances: git.
Dependance of: *** NO PACKAGES FOUND ***
Patches: *** NO PATCHES FOUND ***
Addons: mrust-minicargo.patch, rustc-1.54.0-src.tar.gz.
Nestings *** NO NESTINGS FOUND ***
Configuration script:
#enable directory access to git
/usr/bin/git config --global --add safe.directory $PWD

#reset git tree
git reset --hard
#copy rustc source
cp -v ../rustc-1.54.0-src.tar.gz .

#apply patch
patch -p1 < ../mrust-minicargo.patch

#speedup
sed "s/PARLEVEL ?= 1/PARLEVEL ?= `nproc`/" -i minicargo.mk 
sed "s/LLVM_TARGETS ?= X86;ARM;AArch64#;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX/LLVM_TARGETS ?= X86/" -i minicargo.mk

sed "s/LLVM_TARGETS ?= X86;ARM;AArch64#;Mips;PowerPC;SystemZ;JSBackend;MSP430;Sparc;NVPTX/LLVM_TARGETS ?= X86/" -i run_rustc/Makefile 
sed "s/PARLEVEL ?= 1/PARLEVEL ?= `nproc`/" -i run_rustc/Makefile

#build std library
echo "LIBGIT2_SYS_USE_PKG_CONFIG=1 make -C run_rustc $@" >> build-1.54.0.sh
sleep 10

Build script:
time ./build-1.54.0.sh

Install script:
#create directories
install -vdm755 /opt/mrustc
install -vdm755 /opt/mrustc/bin
install -vdm755 /opt/mrustc/lib
install -vdm755 /opt/mrustc/test
#install binaries
install -v -m555 output-1.54.0/rustc /opt/mrustc/bin/mrustc
install -v -m555 output-1.54.0/cargo /opt/mrustc/bin
#install libraries
install -v -m644 run_rustc/output-1.54.0/prefix/lib/rustlib/`uname -m`-unknown-linux-gnu/lib/*.rlib /opt/mrustc/lib

cat > /etc/profile.d/rustc.sh << "EOF"
# Begin /etc/profile.d/rustc.sh

pathprepend /opt/mrustc/bin           PATH

RUSTFLAGS='-L /opt/mrustc/lib '

export RUSTFLAGS

# End /etc/profile.d/rustc.sh
EOF

cat > /opt/mrustc/bin/rustc << "EOF"
/opt/mrustc/bin/mrustc -L /opt/mrustc/lib \$@
EOF

chmod -v 555 /opt/mrustc/bin/rustc


#test. executable file must built 
pathprepend /opt/mrustc/bin           PATH

cat > /opt/mrustc/test/hello.rs << "EOF"
fn main() {
    println!("Rustc is works!");
}
EOF


cd /opt/mrustc/test/
rustc hello.rs
./hello