qemu: patch out calls to Rez(1) and SetFile(1)

This is the only remaining user of the `darwin.stubs.*` packages.
This commit is contained in:
Emily
2025-04-20 23:17:49 +01:00
parent 2f32b6190a
commit ed8925fc50
3 changed files with 21 additions and 5 deletions
@@ -33,8 +33,6 @@
libslirp,
apple-sdk_13,
darwinMinVersionHook,
rez,
setfile,
guestAgentSupport ?
(with stdenv.hostPlatform; isLinux || isNetBSD || isOpenBSD || isSunOS || isWindows) && !minimal,
numaSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32 && !minimal,
@@ -179,8 +177,6 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals hexagonSupport [ glib ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
sigtool
rez
setfile
]
++ lib.optionals (!userOnly) [ dtc ];
@@ -263,6 +259,13 @@ stdenv.mkDerivation (finalAttrs: {
patches = [
./fix-qemu-ga.patch
# On macOS, QEMU uses `Rez(1)` and `SetFile(1)` to attach its icon
# to the binary. Unfortunately, those commands are proprietary,
# deprecated since Xcode 6, and operate on resource forks, which
# these days are stored in extended attributes, which arent
# supported in the Nix store. So we patch out the calls.
./skip-macos-icon.patch
# Workaround for upstream issue with nested virtualisation: https://gitlab.com/qemu-project/qemu/-/issues/1008
(fetchpatch {
url = "https://gitlab.com/qemu-project/qemu/-/commit/3e4546d5bd38a1e98d4bd2de48631abf0398a3a2.diff";
@@ -0,0 +1,14 @@
diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh
index 0f412949ec..23f56d083a 100755
--- a/scripts/entitlement.sh
+++ b/scripts/entitlement.sh
@@ -25,9 +25,5 @@
codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC"
fi
-# Add the QEMU icon to the binary on Mac OS
-Rez -append "$ICON" -o "$SRC"
-SetFile -a C "$SRC"
-
mv -f "$SRC" "$DST"
trap '' exit
-1
View File
@@ -14735,7 +14735,6 @@ with pkgs;
eiskaltdcpp = libsForQt5.callPackage ../applications/networking/p2p/eiskaltdcpp { };
qemu = callPackage ../applications/virtualization/qemu {
inherit (darwin.stubs) rez setfile;
inherit (darwin) sigtool;
};