Compare commits
1
Commits
wip-mrustc
...
c6378d7cc7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6378d7cc7
|
@@ -0,0 +1,14 @@
|
||||
The $(RUSTC_SRC_DL) file already exists, but for some reason Make wants to rebuild
|
||||
this target when it has $(RUSTC_SRC_TARBALL) as a dependency.
|
||||
|
||||
--- a/minicargo.mk
|
||||
+++ b/minicargo.mk
|
||||
@@ -220,7 +220,7 @@ $(RUSTC_SRC_DL): rustc-$(RUSTC_VERSION)-src/extracted rustc-$(RUSTC_VERSION)-src
|
||||
# - libstd, libpanic_unwind, libtest and libgetopts
|
||||
# - libproc_macro (mrustc)
|
||||
ifeq ($(USE_MERGED_BUILD),1)
|
||||
-$(RUSTCSRC)mrustc-stdlib/Cargo.toml: $(RUSTC_SRC_DL) minicargo.mk
|
||||
+$(RUSTCSRC)mrustc-stdlib/Cargo.toml: minicargo.mk
|
||||
@mkdir -p $(dir $@)
|
||||
@echo "#![no_core]" > $(dir $@)/lib.rs
|
||||
@echo "[package]" > $@
|
||||
@@ -0,0 +1,77 @@
|
||||
package rustc-bootstrap-source {
|
||||
description = "rustc source tree used by mrustc";
|
||||
exclude = true;
|
||||
|
||||
version# = "1.90.0";
|
||||
output = remoteTar {
|
||||
url = "https://static.rust-lang.org/dist/rustc-"+version+"-src.tar.gz";
|
||||
compress = gzip;
|
||||
checksum = "kUjk5mOHRc7cTom0uJ5afFTkhFcXLYK8tJl_aqduffGSHc0TH_a-KKz6PI0nk_xK";
|
||||
};
|
||||
chmod = true;
|
||||
}
|
||||
|
||||
package mrustc {
|
||||
description = "alternative rust compiler (re-implementation)";
|
||||
website = "https://github.com/thepowersgang/mrustc";
|
||||
anitya = 391250;
|
||||
|
||||
version# = "0.12.0";
|
||||
source = remoteGitHub {
|
||||
suffix = "thepowersgang/mrustc";
|
||||
tag = "v"+version;
|
||||
checksum = "Db25OAKL_1yZIF6MlXOTHhrEJ-Pd-i-accVtt5rJollmpKm6B3bgS0xN7hoC1cVu";
|
||||
};
|
||||
patches = [ "0001-dont-download-rustc.patch" ];
|
||||
extra = [ rustc-bootstrap-source ];
|
||||
|
||||
enterSource = true;
|
||||
writable = true;
|
||||
chmod = true;
|
||||
|
||||
exec = make {
|
||||
inPlace = true;
|
||||
skipConfigure = true;
|
||||
preMake = `
|
||||
sed -i 's/\$(shell git show --pretty=%H -s --no-show-signature)/unknown/' Makefile
|
||||
sed -i 's/\$(shell git show -s --pretty=%h --no-show-signature)/unknown/' Makefile
|
||||
sed -i 's/\$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)/v`+version+`/' Makefile
|
||||
sed -i 's/\$(shell git diff-index --quiet HEAD; echo $$?)/0/' Makefile
|
||||
sed -i 's/\$(shell env LC_TIME=C date -u +"%a, %e %b %Y %T +0000")/Thu, 1 Jan 1970 00:00:00 +0000/' Makefile
|
||||
|
||||
export CC=gcc
|
||||
export PARLEVEL=`+jobsE+`
|
||||
export RUSTC_SOURCE='../extra/rustc-bootstrap-source'
|
||||
export RUSTC_VERSION="$(cut -d ' ' -f 1 "$RUSTC_SOURCE/version")"
|
||||
export MRUSTC_TARGET_VER="$(cut -d '.' -f 1,2 <<< "$RUSTC_VERSION")"
|
||||
export OUTDIR_SUF="-$RUSTC_VERSION"
|
||||
patch -d "$RUSTC_SOURCE" -p0 < "rustc-$RUSTC_VERSION-src.patch"
|
||||
touch "$RUSTC_SOURCE/dl-version"
|
||||
ln -s "$RUSTC_SOURCE" "rustc-$RUSTC_VERSION-src"
|
||||
`;
|
||||
preCheck = `
|
||||
make -f minicargo.mk LIBS
|
||||
make local_tests
|
||||
`;
|
||||
check = [ "test" ];
|
||||
|
||||
install = `
|
||||
OUTDIR="output-$RUSTC_VERSION"
|
||||
make -f minicargo.mk "$OUTDIR/rustc"
|
||||
make -f minicargo.mk "$OUTDIR/cargo"
|
||||
make -C run_rustc
|
||||
`;
|
||||
};
|
||||
|
||||
inputs = [
|
||||
bash,
|
||||
patch,
|
||||
cmake,
|
||||
python,
|
||||
|
||||
// mrustc requires buggy gcc behaviour
|
||||
gcc,
|
||||
|
||||
kernel-headers,
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user