about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/pgrok/web.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
committerAlyssa Ross <hi@alyssa.is>2023-10-20 22:09:03 +0000
commit50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e (patch)
treef2556b911180125ccbb7ed0e78a54e92da89adce /nixpkgs/pkgs/tools/networking/pgrok/web.nix
parent4c16d4548a98563c9d9ad76f4e5b2202864ccd54 (diff)
parentcfc75eec4603c06503ae750f88cf397e00796ea8 (diff)
downloadnixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.gz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.bz2
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.lz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.xz
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.tar.zst
nixlib-50c21d167f7114fa1dbd95e5c4fb30eeb1a2d02e.zip
Merge commit 'cfc75eec4603c06503ae750f88cf397e00796ea8'
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/tools/networking/pgrok/web.nix')
-rw-r--r--nixpkgs/pkgs/tools/networking/pgrok/web.nix49
1 files changed, 25 insertions, 24 deletions
diff --git a/nixpkgs/pkgs/tools/networking/pgrok/web.nix b/nixpkgs/pkgs/tools/networking/pgrok/web.nix
index f9b1485c20ae..0cbe45e0e396 100644
--- a/nixpkgs/pkgs/tools/networking/pgrok/web.nix
+++ b/nixpkgs/pkgs/tools/networking/pgrok/web.nix
@@ -1,29 +1,30 @@
-{ buildNpmPackage
-, src
+{ src
 , version
+, nodejs
+, nodePackages
+, stdenvNoCC
 }:
-buildNpmPackage {
-    name = "pgrok-web";
-    inherit src version;
-    sourceRoot = "${src.name}/pgrokd/web";
+let
+  build-deps = nodePackages."pgrok-build-deps-../../tools/networking/pgrok/build-deps";
+in
+stdenvNoCC.mkDerivation {
+  pname = "pgrok-web";
+  inherit version;
+  src = "${src}/pgrokd/web";
 
-    npmDepsHash = "sha256-f4pDBoG6sTJE3aUknqUvHHpBR9KWo/B4YMrWHkGbvA8=";
+  nativeBuildInputs = [ nodejs ];
 
-    # Upstream doesn't have a lockfile
-    postPatch = ''
-      cp ${./package-lock.json} ./package-lock.json
-      substituteInPlace ./package.json \
-        --replace "../cli/dist" "$out"
-    '';
+  buildPhase = ''
+    runHook preBuild
+    cp ${./build-deps/package.json} package.json
+    ln -s ${build-deps}/lib/node_modules/pgrokd/node_modules node_modules
+    npm run build
+    runHook postBuild
+  '';
 
-    patches = [
-      ./add_version_to_package.json.patch
-    ];
-
-    dontInstall = true;
-    dontFixup = true;
-
-    NODE_OPTIONS = "--openssl-legacy-provider";
-
-    npmPackFlags = [ "--ignore-scripts" ];
-  }
+  installPhase = ''
+    runHook preInstall
+    cp -r dist $out
+    runHook postInstall
+  '';
+}