nixos/wyoming/{faster-whisper,piper}: drop download directory (#376447)
[NixPkgs.git] / pkgs / by-name / ti / time-ghc-modules / package.nix
blobe4dbe40b46cde8ba34d0c27e0804d2a6ffae8461
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   makeWrapper,
6   sqlite,
7   python3,
8   coreutils,
9   findutils,
10   gnused,
13 stdenv.mkDerivation rec {
14   pname = "time-ghc-modules";
15   version = "2.0.0";
17   src = fetchFromGitHub {
18     owner = "codedownio";
19     repo = "time-ghc-modules";
20     rev = version;
21     sha256 = "sha256-/PhJAhP3KCWFyeSk8e5JV0cpBueH/eVDwQTMZSnnZCo=";
22   };
24   nativeBuildInputs = [ makeWrapper ];
26   buildPhase = ''
27     runHook preBuild
29     mkdir -p $out/bin
30     cp ./time-ghc-modules $out/bin/time-ghc-modules
31     wrapProgram $out/bin/time-ghc-modules --prefix PATH : ${
32       lib.makeBinPath [
33         sqlite
34         python3
35         coreutils
36         findutils
37         gnused
38       ]
39     } \
40                                           --set PROCESS_SCRIPT $out/lib/process \
41                                           --set HTML_FILE $out/lib/index.html
43     runHook postBuild
44   '';
46   installPhase = ''
47     runHook preInstall
49     mkdir -p $out/lib
50     install -m 444 ./dist/index.html $out/lib
51     install ./scripts/process $out/lib
53     runHook postInstall
54   '';
56   meta = with lib; {
57     description = "Analyze GHC .dump-timings files";
58     mainProgram = "time-ghc-modules";
59     homepage = "https://github.com/codedownio/time-ghc-modules";
60     license = licenses.mit;
61     maintainers = [ maintainers.thomasjm ];
62     platforms = platforms.all;
63   };