1{
2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
5 versionCheckHook,
6}:
7
8buildNpmPackage rec {
9 pname = "speedscope";
10 version = "1.23.0";
11
12 src = fetchFromGitHub {
13 owner = "jlfwong";
14 repo = "speedscope";
15 tag = "v${version}";
16 hash = "sha256-I7XulOJuMSxDXyGlXL6AeqP0ohjNhzGTEyWsq6MiTho=";
17
18 # scripts/prepack.sh wants to extract the git commit from .git
19 # We don't want to keep .git for reproducibility reasons, so save the commit
20 # to a file and patch the script.
21 leaveDotGit = true;
22 postFetch = ''
23 ( cd $out; git rev-parse HEAD > COMMIT )
24 rm -rf $out/.git
25 '';
26 };
27
28 npmDepsHash = "sha256-5gsWnk37F+fModNUWETBercXE1avEtbAAu8/qi76yDY=";
29
30 patches = [
31 ./fix-shebang.patch
32 ];
33
34 postConfigure = ''
35 patchShebangs scripts
36 '';
37
38 dontNpmBuild = true;
39
40 postFixup = ''
41 # Remove some dangling symlinks
42 rm $out/lib/node_modules/speedscope/node_modules/.bin/sshpk*
43 '';
44
45 nativeInstallCheckInputs = [
46 versionCheckHook
47 ];
48 doInstallCheck = true;
49
50 meta = {
51 description = "Fast and interactive web-based viewer for performance profiles";
52 homepage = "https://github.com/jlfwong/speedscope";
53 license = lib.licenses.mit;
54 platforms = lib.platforms.linux;
55 mainProgram = "speedscope";
56 maintainers = with lib.maintainers; [ thomasjm ];
57 };
58}