zotero: Cleanups

- Always run pre/post phase hooks
- Hide some expected errors
- Update to nodejs 22
- Some other cleanups
This commit is contained in:
Mynacol
2026-02-11 19:04:49 +01:00
parent f767b3ad8f
commit 20c8c8b098
3 changed files with 46 additions and 15 deletions
+2 -2
View File
@@ -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/"
+12 -9
View File
@@ -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);
+32 -4
View File
@@ -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