From 96a484e28e9b210ec25b50c619344541aac69dee Mon Sep 17 00:00:00 2001 From: Mynacol Date: Thu, 21 May 2026 20:53:00 +0000 Subject: [PATCH] zotero: Fix build on x86_64-darwin When setting a non-`source` update channel, the build fails on x86_64-darwin. The build fails with: ``` source not found twice in ChannelPrefs source stringWithCString:encoding: ``` Which definitely means it is caused by the strings command here. When manually executing the strings command on the file, I can repeat getting only one `source` result on x86 mac, while getting two on arm64 or linux. After digging around, I tried with the flag `-arch all`, and both `source` values are found on x86 mac. Full command: `strings -n 3 -arch all $binary`. Also reported to upstream in https://github.com/zotero/zotero/pull/5926 --- pkgs/by-name/zo/zotero/fix-x86_64-darwin.patch | 13 +++++++++++++ pkgs/by-name/zo/zotero/package.nix | 1 + 2 files changed, 14 insertions(+) create mode 100644 pkgs/by-name/zo/zotero/fix-x86_64-darwin.patch diff --git a/pkgs/by-name/zo/zotero/fix-x86_64-darwin.patch b/pkgs/by-name/zo/zotero/fix-x86_64-darwin.patch new file mode 100644 index 000000000000..e8ffe53513a7 --- /dev/null +++ b/pkgs/by-name/zo/zotero/fix-x86_64-darwin.patch @@ -0,0 +1,13 @@ +diff --git a/app/mac/set-channel-prefs-channel b/app/mac/set-channel-prefs-channel +index 2431837584..ab85d7e5c0 100755 +--- a/app/mac/set-channel-prefs-channel ++++ b/app/mac/set-channel-prefs-channel +@@ -19,7 +19,7 @@ binary=$1 + from_channel=$2 + to_channel=$3 + # `strings` has a 4-character minimum by default, but we need 3 for 'dev' +-strings_cmd="strings -n 3" ++strings_cmd="strings -n 3 -arch all" + + if [ ${#to_channel} -gt 7 ]; then + echo "Channel length cannot exceed 7 characters -- aborting" >&2 diff --git a/pkgs/by-name/zo/zotero/package.nix b/pkgs/by-name/zo/zotero/package.nix index b9cbdf0a28b0..e36aa85c2d72 100644 --- a/pkgs/by-name/zo/zotero/package.nix +++ b/pkgs/by-name/zo/zotero/package.nix @@ -193,6 +193,7 @@ buildNpmPackage (finalAttrs: { ./js-build-fixes.patch ./avoid-xulrunner-fetch.patch ./build-fixes.patch + ./fix-x86_64-darwin.patch ]; postPatch = ''