speedscope: init at 1.22.2 (#402996)

This commit is contained in:
Alexis Hildebrandt
2025-06-26 08:44:04 +02:00
committed by GitHub
2 changed files with 71 additions and 0 deletions
@@ -0,0 +1,13 @@
diff --git a/scripts/prepack.sh b/scripts/prepack.sh
index 2172706..1f8f152 100755
--- a/scripts/prepack.sh
+++ b/scripts/prepack.sh
@@ -41,7 +41,7 @@ mkdir -p "$OUTDIR"
# Place info about the current commit into the build dir to easily identify releases
npm ls -depth -1 | head -n 1 | cut -d' ' -f 1 > "$OUTDIR"/release.txt
date >> "$OUTDIR"/release.txt
-git rev-parse HEAD >> "$OUTDIR"/release.txt
+cp COMMIT "$OUTDIR"/release.txt
# Place a json schema for the file format into the build directory too
node scripts/generate-file-format-schema-json.js > "$OUTDIR"/file-format-schema.json
+58
View File
@@ -0,0 +1,58 @@
{
lib,
buildNpmPackage,
fetchFromGitHub,
versionCheckHook,
}:
buildNpmPackage rec {
pname = "speedscope";
version = "1.22.2";
src = fetchFromGitHub {
owner = "jlfwong";
repo = "speedscope";
tag = "v${version}";
hash = "sha256-JzlS5onVac1UKJUl1YYE7a3oWk2crMyuowea8a7UoOo=";
# scripts/prepack.sh wants to extract the git commit from .git
# We don't want to keep .git for reproducibility reasons, so save the commit
# to a file and patch the script.
leaveDotGit = true;
postFetch = ''
( cd $out; git rev-parse HEAD > COMMIT )
rm -rf $out/.git
'';
};
npmDepsHash = "sha256-3LCixJJyz3O6xQxP0A/WyQXsDvkXpdo7KYNDoufZVS4=";
patches = [
./fix-shebang.patch
];
postConfigure = ''
patchShebangs scripts
'';
dontNpmBuild = true;
postFixup = ''
# Remove some dangling symlinks
rm $out/lib/node_modules/speedscope/node_modules/.bin/sshpk*
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
meta = {
description = "Fast and interactive web-based viewer for performance profiles";
homepage = "https://github.com/jlfwong/speedscope";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
mainProgram = "speedscope";
maintainers = with lib.maintainers; [ thomasjm ];
};
}