diff --git a/pkgs/by-name/zo/zotero/build-fixes.patch b/pkgs/by-name/zo/zotero/build-fixes.patch index 2d4a5334a9dd..73854217084a 100644 --- a/pkgs/by-name/zo/zotero/build-fixes.patch +++ b/pkgs/by-name/zo/zotero/build-fixes.patch @@ -1,5 +1,5 @@ diff --git a/app/build.sh b/app/build.sh -index de092bde16..af6008e25c 100755 +index de092bde16..2e58b687e7 100755 --- a/app/build.sh +++ b/app/build.sh @@ -644,11 +644,6 @@ if [ $BUILD_MAC == 1 ]; then @@ -30,7 +30,7 @@ index de092bde16..af6008e25c 100755 cp -RH "$CALLDIR/modules/zotero-libreoffice-integration/install" "$APPDIR/integration/libreoffice" # Copy icons -+ mkdir "$APPDIR/icons/" ++ mkdir -p "$APPDIR/icons/" cp "$CALLDIR/linux/icons/icon32.png" "$APPDIR/icons/" cp "$CALLDIR/linux/icons/icon64.png" "$APPDIR/icons/" cp "$CALLDIR/linux/icons/icon128.png" "$APPDIR/icons/" diff --git a/pkgs/by-name/zo/zotero/js-build-fixes.patch b/pkgs/by-name/zo/zotero/js-build-fixes.patch index 56798cb01edc..446a476a0115 100644 --- a/pkgs/by-name/zo/zotero/js-build-fixes.patch +++ b/pkgs/by-name/zo/zotero/js-build-fixes.patch @@ -1,37 +1,40 @@ diff --git a/js-build/note-editor.js b/js-build/note-editor.js -index 1435730342..c58af27eae 100644 +index 1435730342..bfd552f863 100644 --- a/js-build/note-editor.js +++ b/js-build/note-editor.js -@@ -37,8 +37,6 @@ async function getZoteroNoteEditor(signatures) { +@@ -36,9 +36,6 @@ async function getZoteroNoteEditor(signatures) { + await fs.remove(path.join(targetDir, 'zotero')); } catch (e) { - console.error(e); +- console.error(e); - await exec('npm ci', { cwd: modulePath }); - await exec('npm run build', { cwd: modulePath }); await fs.copy(path.join(modulePath, 'build', 'zotero'), targetDir); } signatures['note-editor'] = { hash }; diff --git a/js-build/pdf-worker.js b/js-build/pdf-worker.js -index b820304f3a..3053275dde 100644 +index b820304f3a..aafb6b1ef5 100644 --- a/js-build/pdf-worker.js +++ b/js-build/pdf-worker.js -@@ -34,8 +34,6 @@ async function getPDFWorker(signatures) { +@@ -33,9 +33,6 @@ async function getPDFWorker(signatures) { + ); } catch (e) { - console.error(e); +- console.error(e); - await exec('npm ci', { cwd: modulePath }); - await exec('npm run build', { cwd: modulePath }); await fs.copy(path.join(modulePath, 'build', 'worker.js'), path.join(targetDir, 'worker.js')); } signatures['pdf-worker'] = { hash }; diff --git a/js-build/reader.js b/js-build/reader.js -index 67a02a3ad2..14834d80a2 100644 +index 67a02a3ad2..5de2f3ada8 100644 --- a/js-build/reader.js +++ b/js-build/reader.js -@@ -37,8 +37,6 @@ async function getReader(signatures) { +@@ -36,9 +36,6 @@ async function getReader(signatures) { + await fs.remove(path.join(targetDir, 'zotero')); } catch (e) { - console.error(e); +- console.error(e); - await exec('npm ci', { cwd: modulePath }); - await exec('npm run build', { cwd: modulePath }); await fs.copy(path.join(modulePath, 'build', 'zotero'), targetDir); diff --git a/pkgs/by-name/zo/zotero/package.nix b/pkgs/by-name/zo/zotero/package.nix index 193acf1f22e3..ffe8b1f8b2d1 100644 --- a/pkgs/by-name/zo/zotero/package.nix +++ b/pkgs/by-name/zo/zotero/package.nix @@ -3,7 +3,7 @@ stdenv, fetchFromGitHub, buildNpmPackage, - nodejs_20, + nodejs_22, git, perl, python3, @@ -19,8 +19,8 @@ doCheck ? false, }: let - # note-editor needs nodejs 20. Any newer version fails to build zotero's fork of @benrbray/prosemirror-math during npm install. - nodejs = nodejs_20; + # note-editor needs nodejs 22. Any newer version fails to build zotero's fork of @benrbray/prosemirror-math during npm install. + nodejs = nodejs_22; pname = "zotero"; version = "8.0.0"; @@ -40,13 +40,21 @@ let src = "${src}/pdf-worker/pdf.js"; npmDepsHash = "sha256-KeYAY6EWBZVd3QucDEDtI6lwtTahCEFBFf2Ebib9HKg="; buildPhase = '' + runHook preBuild + npm exec gulp lib-legacy npm exec gulp generic-legacy npm exec gulp minified-legacy + + runHook postBuild ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r . $out + + runHook postInstall ''; }; @@ -56,12 +64,20 @@ let src = "${src}/reader/epubjs/epub.js"; npmDepsHash = "sha256-6XY6uczPOpMpRHDQbkQRHKBDDRQ/MXIVepGBx1V+h5Q="; buildPhase = '' + runHook preBuild + npm run compile npm run build + + runHook postBuild ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r . $out + + runHook postInstall ''; }; @@ -84,8 +100,12 @@ let cp -r ${src}/chrome/locale/en-US/zotero/* locales/en-US/ ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r . $out + + runHook postInstall ''; }; @@ -102,8 +122,12 @@ let cp -r ${pdf-js} pdf.js ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r . $out + + runHook postInstall ''; }; @@ -119,8 +143,12 @@ let cp -r ${src}/chrome/locale/en-US/zotero/* locales/en-US/ ''; installPhase = '' + runHook preInstall + mkdir -p $out cp -r . $out + + runHook postInstall ''; }; @@ -206,7 +234,7 @@ buildNpmPackage rec { inherit doCheck; # Build with test support if `doCheck` is enabled. - ZOTERO_TEST = doCheck; + env.ZOTERO_TEST = doCheck; nativeCheckInputs = [ xvfb-run