pinentry_mac: fix the build with `sandbox = true` (#431236)

Emily 200a9164 3f566362

Changed files
+28 -5
pkgs
tools
+21
pkgs/tools/security/pinentry/fix-with-xcbuild-plistbuddy.patch
···
+
diff --git a/macosx/copyInfoPlist.sh b/macosx/copyInfoPlist.sh
+
index f366665153..dfd9511e79 100755
+
--- a/macosx/copyInfoPlist.sh
+
+++ b/macosx/copyInfoPlist.sh
+
@@ -20,9 +20,10 @@
+
cp "$1" "$dest" || exit 1
+
+
+
-/usr/libexec/PlistBuddy \
+
- -c "Set CommitHash '${COMMIT_HASH:--}'" \
+
- -c "Set BuildNumber '${BUILD_NUMBER:-0}'" \
+
- -c "Set CFBundleVersion '${BUILD_VERSION:-0n}'" \
+
- -c "Set CFBundleShortVersionString '$VERSION'" \
+
- "$dest" || exit 1
+
+PlistBuddy "$dest" <<EOF || exit 1
+
+ Set CommitHash "${COMMIT_HASH:--}"
+
+ Set BuildNumber "${BUILD_NUMBER:-0}"
+
+ Set CFBundleVersion "${BUILD_VERSION:-0n}"
+
+ Set CFBundleShortVersionString "$VERSION"
+
+ Save
+
+EOF
+7 -5
pkgs/tools/security/pinentry/mac.nix
···
libgpg-error,
makeBinaryWrapper,
texinfo,
+
xcbuild,
common-updater-scripts,
writers,
}:
···
patches = [
./gettext-0.25.patch
+
+
# Fix the build with xcbuild’s inferior `PlistBuddy(8)`.
+
./fix-with-xcbuild-plistbuddy.patch
];
# use pregenerated nib files because generating them requires XCode
···
cp '${lib.getDev libassuan}/share/aclocal/libassuan.m4' m4/libassuan.m4
'';
-
# Unfortunately, PlistBuddy from xcbuild is not compatible enough pinentry-mac’s build process.
-
sandboxProfile = ''
-
(allow process-exec (literal "/usr/libexec/PlistBuddy"))
-
'';
-
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
makeBinaryWrapper
texinfo
+
+
# for `PlistBuddy(8)`
+
xcbuild
];
configureFlags = [