1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/pkgs/development/compilers/mrustc/minicargo.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

41 lines
1 KiB
Nix

{ lib, stdenv
, makeWrapper
, mrustc
}:
stdenv.mkDerivation rec {
pname = "mrustc-minicargo";
inherit (mrustc) src version;
strictDeps = true;
nativeBuildInputs = [ makeWrapper ];
enableParallelBuilding = true;
makefile = "minicargo.mk";
makeFlags = [ "bin/minicargo" ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp bin/minicargo $out/bin
# without it, minicargo defaults to "<minicargo_path>/../bin/mrustc"
wrapProgram "$out/bin/minicargo" --set MRUSTC_PATH ${mrustc}/bin/mrustc
runHook postInstall
'';
meta = with lib; {
description = "A minimalist builder for Rust";
mainProgram = "minicargo";
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" ];
};
}