567e8dfd8e
This commit was created by a combination of scripts and tools: - an ast-grep script to prefix things in meta with `lib.`, - a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and - regular nixfmt. Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
61 lines
1.4 KiB
Nix
61 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
zlib,
|
|
}:
|
|
|
|
let
|
|
version = "0.11.2";
|
|
tag = "v${version}";
|
|
rev = "b6754f574f8846eb842feba4ccbeeecb10bdfacc";
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "mrustc";
|
|
inherit version;
|
|
|
|
# Always update minicargo.nix and bootstrap.nix in lockstep with this
|
|
src = fetchFromGitHub {
|
|
owner = "thepowersgang";
|
|
repo = "mrustc";
|
|
rev = tag;
|
|
hash = "sha256-HW9+2mXri3ismeNeaDoTsCY6lxeH8AELegk+YbIn7Jw=";
|
|
};
|
|
|
|
postPatch = ''
|
|
sed -i 's/\$(shell git show --pretty=%H -s)/${rev}/' Makefile
|
|
sed -i 's/\$(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)/${tag}/' Makefile
|
|
sed -i 's/\$(shell git diff-index --quiet HEAD; echo $$?)/0/' Makefile
|
|
sed '1i#include <limits>' -i src/trans/codegen_c.cpp
|
|
'';
|
|
|
|
strictDeps = true;
|
|
buildInputs = [ zlib ];
|
|
enableParallelBuilding = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out/bin
|
|
cp bin/mrustc $out/bin
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Mutabah's Rust Compiler";
|
|
mainProgram = "mrustc";
|
|
longDescription = ''
|
|
In-progress alternative rust compiler, written in C++.
|
|
Capable of building a fully-working copy of rustc,
|
|
but not yet suitable for everyday use.
|
|
'';
|
|
inherit (src.meta) homepage;
|
|
license = lib.licenses.mit;
|
|
maintainers = with lib.maintainers; [
|
|
progval
|
|
r-burns
|
|
];
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|