1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeWrapper,
6 bash,
7 gnumake,
8}:
9
10stdenv.mkDerivation rec {
11 pname = "makefile2graph";
12 version = "2021.11.06";
13
14 src = fetchFromGitHub {
15 owner = "lindenb";
16 repo = "makefile2graph";
17 tag = version;
18 hash = "sha256-4jyftC0eCJ13X/L4uEWhT5FA5/UXUmSHSoba89GSySQ=";
19 };
20
21 nativeBuildInputs = [ makeWrapper ];
22
23 makeFlags = [ "prefix=$(out)" ];
24
25 fixupPhase = ''
26 substituteInPlace $out/bin/makefile2graph \
27 --replace '/bin/sh' ${bash}/bin/bash \
28 --replace 'make2graph' "$out/bin/make2graph"
29 wrapProgram $out/bin/makefile2graph \
30 --set PATH ${lib.makeBinPath [ gnumake ]}
31 '';
32
33 meta = with lib; {
34 homepage = "https://github.com/lindenb/makefile2graph";
35 description = "Creates a graph of dependencies from GNU-Make; Output is a graphiz-dot file or a Gexf-XML file";
36 maintainers = with maintainers; [ cmcdragonkai ];
37 license = licenses.mit;
38 platforms = platforms.all;
39 };
40}