From f4b1bade01b2239ab315431df7f1199b270bb440 Mon Sep 17 00:00:00 2001 From: Mukul Agarwal Date: Mon, 6 Jul 2026 19:24:25 -0400 Subject: [PATCH 1/2] zotero: change all instances of targetPlatform to hostPlatform --- pkgs/by-name/zo/zotero/package.nix | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/zo/zotero/package.nix b/pkgs/by-name/zo/zotero/package.nix index b77389cec912..95e060d8899e 100644 --- a/pkgs/by-name/zo/zotero/package.nix +++ b/pkgs/by-name/zo/zotero/package.nix @@ -182,10 +182,10 @@ buildNpmPackage (finalAttrs: { rsync copyDesktopItems ] - ++ lib.optionals stdenv.targetPlatform.isDarwin [ + ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeBinaryWrapper ] - ++ lib.optionals (!stdenv.targetPlatform.isDarwin) [ + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ wrapGAppsHook3 ]; @@ -247,12 +247,12 @@ buildNpmPackage (finalAttrs: { # 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 '' + + lib.optionalString stdenv.hostPlatform.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 + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' + cp -r "${firefox-esr-140-unwrapped}/lib/firefox" "app/xulrunner/firefox-${stdenv.hostPlatform.parsed.kernel.name}-${ + lib.replaceString "aarch64" "arm64" stdenv.hostPlatform.parsed.cpu.name }" '' + '' @@ -261,9 +261,7 @@ buildNpmPackage (finalAttrs: { 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}" - } + ${if stdenv.hostPlatform.isDarwin then "-p m" else "-p l -a ${zoteroArch stdenv.hostPlatform}"} runHook postBuild ''; @@ -307,12 +305,12 @@ buildNpmPackage (finalAttrs: { installPhase = '' runHook preInstall '' - + lib.optionalString stdenv.targetPlatform.isDarwin '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' # Copy package contents mkdir -p $out/Applications cp -r app/staging/Zotero.app $out/Applications/ '' - + lib.optionalString (!stdenv.targetPlatform.isDarwin) '' + + lib.optionalString (!stdenv.hostPlatform.isDarwin) '' # Copy package contents mkdir -p $out/lib/ cp -r app/staging/*/. $out/lib/ @@ -331,7 +329,7 @@ buildNpmPackage (finalAttrs: { runHook postInstall ''; - preFixup = lib.optionalString (!stdenv.targetPlatform.isDarwin) '' + preFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) '' gappsWrapperArgs+=(--suffix LD_LIBRARY_PATH : ${ lib.makeLibraryPath [ libGL @@ -341,7 +339,7 @@ buildNpmPackage (finalAttrs: { }) ''; - postFixup = lib.optionalString stdenv.targetPlatform.isDarwin '' + postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' mkdir -p $out/bin makeWrapper $out/Applications/Zotero.app/Contents/MacOS/zotero $out/bin/zotero ''; From 37121b66bb50d612ffceae96780b0945f838ccc2 Mon Sep 17 00:00:00 2001 From: Mukul Agarwal Date: Mon, 6 Jul 2026 19:54:57 -0400 Subject: [PATCH 2/2] zotero: sign .app bundle on darwin --- pkgs/by-name/zo/zotero/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/zo/zotero/package.nix b/pkgs/by-name/zo/zotero/package.nix index 95e060d8899e..4399cd3e1f58 100644 --- a/pkgs/by-name/zo/zotero/package.nix +++ b/pkgs/by-name/zo/zotero/package.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, buildNpmPackage, + darwin, nodejs_22, perl, python3, @@ -184,6 +185,7 @@ buildNpmPackage (finalAttrs: { ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ makeBinaryWrapper + darwin.autoSignDarwinBinariesHook ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ wrapGAppsHook3