From 86f7e7930b6c786baf3e89643dbfa7cd9d3693ad Mon Sep 17 00:00:00 2001 From: Erwin Boskma Date: Thu, 23 Jan 2025 14:01:26 +0100 Subject: [PATCH] pds: Update --- pkgs/pds/default.nix | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/pkgs/pds/default.nix b/pkgs/pds/default.nix index 81a2825..5ca2f9d 100644 --- a/pkgs/pds/default.nix +++ b/pkgs/pds/default.nix @@ -4,7 +4,7 @@ removeReferencesTo, srcOnly, python3, - pnpm, + pnpm_9, fetchFromGitHub, nodejs, vips, @@ -35,7 +35,7 @@ let }; nodeSources = srcOnly nodejs; - customPython3 = python3.withPackages (p: [ p.setuptools ]); + pythonEnv = python3.withPackages (p: [ p.setuptools ]); in stdenv.mkDerivation (finalAttrs: { @@ -51,20 +51,18 @@ stdenv.mkDerivation (finalAttrs: { sourceRoot = "${finalAttrs.src.name}/service"; - npmDepsHash = "sha256-uQKhODaVHLj+JEq6LYiJ/zXuu7kDCLmpxOs/VCc0GqQ="; - nativeBuildInputs = [ makeBinaryWrapper nodejs - customPython3 + pythonEnv pkg-config - pnpm.configHook + pnpm_9.configHook ]; # Required for `sharp` NPM dependency buildInputs = [ vips ]; - pnpmDeps = pnpm.fetchDeps { + pnpmDeps = pnpm_9.fetchDeps { inherit (finalAttrs) pname version @@ -77,14 +75,10 @@ stdenv.mkDerivation (finalAttrs: { buildPhase = '' runHook preBuild - for f in $(find -path '*/node_modules/better-sqlite3' -type d); do - (cd "$f" && ( - npm run build-release --offline --nodedir=${nodeSources} - find build -type f -exec \ - ${lib.getExe removeReferencesTo} \ - -t "${nodeSources}" {} \; - )) - done + pushd ./node_modules/.pnpm/better-sqlite3@*/node_modules/better-sqlite3 + npm run build-release --offline --nodedir="${nodeSources}" + find build -type f -exec remove-references-to -t "${nodeSources}" {} \; + popd makeWrapper "${lib.getExe nodejs}" "$out/bin/pds" \ --add-flags --enable-source-maps \