diff --git a/pkgs/by-name/zo/zotero/avoid-git.patch b/pkgs/by-name/zo/zotero/avoid-git.patch index f0c6b4ffdeaf..dda5290a3ab2 100644 --- a/pkgs/by-name/zo/zotero/avoid-git.patch +++ b/pkgs/by-name/zo/zotero/avoid-git.patch @@ -1,16 +1,3 @@ -diff --git a/app/scripts/dir_build b/app/scripts/dir_build -index 493288ad47..ccabb3722b 100755 ---- a/app/scripts/dir_build -+++ b/app/scripts/dir_build -@@ -86,7 +86,7 @@ fi - - CHANNEL="source" - --hash=$(git -C "$ROOT_DIR" rev-parse --short HEAD) -+hash="0000000000000000000000000000000000000000" - - build_dir=$(mktemp -d) - cleanup() { rm -rf "$build_dir"; } diff --git a/js-build/note-editor.js b/js-build/note-editor.js index 1435730342..6eebb10c50 100644 --- a/js-build/note-editor.js diff --git a/pkgs/by-name/zo/zotero/package.nix b/pkgs/by-name/zo/zotero/package.nix index ec1954aabc99..b9cbdf0a28b0 100644 --- a/pkgs/by-name/zo/zotero/package.nix +++ b/pkgs/by-name/zo/zotero/package.nix @@ -223,30 +223,48 @@ buildNpmPackage (finalAttrs: { done ''; - buildPhase = '' - runHook preBuild + buildPhase = + let + zoteroArch = + platform: + if platform.isAarch64 then + "arm64" + else if platform.isx86_64 then + "x64" + else if platform.isx86_32 then + "i686" + else + platform.parsed.cpu.name; + in + '' + runHook preBuild - npm run build + npm run build - # Place firefox files at the right place. - # The correct firefox version can be found in zotero/app/config.sh at `GECKO_VERSION_LINUX`. - mkdir -p app/xulrunner/ - '' - + lib.optionalString stdenv.targetPlatform.isDarwin '' - cp -r "${firefox-esr-140-unwrapped}/Applications/Firefox ESR.app" app/xulrunner/Firefox.app - '' - + lib.optionalString (!stdenv.targetPlatform.isDarwin) '' - cp -r "${firefox-esr-140-unwrapped}/lib/firefox" "app/xulrunner/firefox-${stdenv.targetPlatform.parsed.kernel.name}-${ - lib.replaceString "aarch64" "arm64" stdenv.targetPlatform.parsed.cpu.name - }" - '' - + '' - chmod -R u+w app/xulrunner/ + # Place firefox files at the right place. + # The correct firefox version can be found in zotero/app/config.sh at `GECKO_VERSION_LINUX`. + mkdir -p app/xulrunner/ + '' + + lib.optionalString stdenv.targetPlatform.isDarwin '' + cp -r "${firefox-esr-140-unwrapped}/Applications/Firefox ESR.app" app/xulrunner/Firefox.app + '' + + lib.optionalString (!stdenv.targetPlatform.isDarwin) '' + cp -r "${firefox-esr-140-unwrapped}/lib/firefox" "app/xulrunner/firefox-${stdenv.targetPlatform.parsed.kernel.name}-${ + lib.replaceString "aarch64" "arm64" stdenv.targetPlatform.parsed.cpu.name + }" + '' + + '' + chmod -R u+w app/xulrunner/ - ./app/scripts/dir_build + build_dir=$(mktemp -d) + ./app/scripts/prepare_build -s ./build -o "$build_dir" -c release + ./app/build.sh -d "$build_dir" -c release -s \ + ${ + if stdenv.targetPlatform.isDarwin then "-p m" else "-p l -a ${zoteroArch stdenv.targetPlatform}" + } - runHook postBuild - ''; + runHook postBuild + ''; inherit doCheck; # Build with test support if `doCheck` is enabled.