nixpkgs/pkgs/by-name/ti/time-ghc-modules/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

56 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, sqlite
, python3
, coreutils
, findutils
, gnused
}:
stdenv.mkDerivation rec {
pname = "time-ghc-modules";
version = "2.0.0";
src = fetchFromGitHub {
owner = "codedownio";
repo = "time-ghc-modules";
rev = version;
sha256 = "sha256-/PhJAhP3KCWFyeSk8e5JV0cpBueH/eVDwQTMZSnnZCo=";
};
nativeBuildInputs = [makeWrapper];
buildPhase = ''
runHook preBuild
mkdir -p $out/bin
cp ./time-ghc-modules $out/bin/time-ghc-modules
wrapProgram $out/bin/time-ghc-modules --prefix PATH : ${lib.makeBinPath [ sqlite python3 coreutils findutils gnused ]} \
--set PROCESS_SCRIPT $out/lib/process \
--set HTML_FILE $out/lib/index.html
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/lib
install -m 444 ./dist/index.html $out/lib
install ./scripts/process $out/lib
runHook postInstall
'';
meta = with lib; {
description = "Analyze GHC .dump-timings files";
mainProgram = "time-ghc-modules";
homepage = "https://github.com/codedownio/time-ghc-modules";
license = licenses.mit;
maintainers = [ maintainers.thomasjm ];
platforms = platforms.all;
};
}