2021-04-25 03:57:28 +00:00
|
|
|
{ lib, stdenv
|
|
|
|
, makeWrapper
|
|
|
|
, mrustc
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mrustc-minicargo";
|
|
|
|
inherit (mrustc) src version;
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
makefile = "minicargo.mk";
|
2023-04-29 16:46:19 +00:00
|
|
|
makeFlags = [ "bin/minicargo" ];
|
2021-04-25 03:57:28 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
2023-04-29 16:46:19 +00:00
|
|
|
cp bin/minicargo $out/bin
|
2021-04-25 03:57:28 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
# without it, minicargo defaults to "<minicargo_path>/../bin/mrustc"
|
2021-04-25 03:57:28 +00:00
|
|
|
wrapProgram "$out/bin/minicargo" --set MRUSTC_PATH ${mrustc}/bin/mrustc
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Minimalist builder for Rust";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "minicargo";
|
2021-04-25 03:57:28 +00:00
|
|
|
longDescription = ''
|
|
|
|
A minimalist builder for Rust, similar to Cargo but written in C++.
|
|
|
|
Designed to work with mrustc to build Rust projects
|
|
|
|
(like the Rust compiler itself).
|
|
|
|
'';
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ progval r-burns ];
|
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|