Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv
2, makeWrapper
3, mrustc
4}:
5
6stdenv.mkDerivation rec {
7 pname = "mrustc-minicargo";
8 inherit (mrustc) src version;
9
10 strictDeps = true;
11 nativeBuildInputs = [ makeWrapper ];
12
13 enableParallelBuilding = true;
14 makefile = "minicargo.mk";
15 makeFlags = [ "bin/minicargo" ];
16
17 installPhase = ''
18 runHook preInstall
19 mkdir -p $out/bin
20 cp bin/minicargo $out/bin
21
22 # without it, minicargo defaults to "<minicargo_path>/../bin/mrustc"
23 wrapProgram "$out/bin/minicargo" --set MRUSTC_PATH ${mrustc}/bin/mrustc
24 runHook postInstall
25 '';
26
27 meta = with lib; {
28 description = "A minimalist builder for Rust";
29 longDescription = ''
30 A minimalist builder for Rust, similar to Cargo but written in C++.
31 Designed to work with mrustc to build Rust projects
32 (like the Rust compiler itself).
33 '';
34 inherit (src.meta) homepage;
35 license = licenses.mit;
36 maintainers = with maintainers; [ progval r-burns ];
37 platforms = [ "x86_64-linux" ];
38 };
39}