pds: Update

This commit is contained in:
Erwin Boskma 2025-01-23 14:01:26 +01:00
parent 575170595a
commit 86f7e7930b
Signed by: erwin
SSH key fingerprint: SHA256:9LmFDe1C6jSrEyqxxvX8NtJBmcbB105XoqyUZF092bg

View file

@ -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 \