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

This is the only remaining user of the `darwin.stubs.*` packages.

Emily ed8925fc 2f32b619

+21 -5
+7 -4
pkgs/applications/virtualization/qemu/default.nix
··· 33 libslirp, 34 apple-sdk_13, 35 darwinMinVersionHook, 36 - rez, 37 - setfile, 38 guestAgentSupport ? 39 (with stdenv.hostPlatform; isLinux || isNetBSD || isOpenBSD || isSunOS || isWindows) && !minimal, 40 numaSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32 && !minimal, ··· 179 ++ lib.optionals hexagonSupport [ glib ] 180 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 181 sigtool 182 - rez 183 - setfile 184 ] 185 ++ lib.optionals (!userOnly) [ dtc ]; 186 ··· 262 263 patches = [ 264 ./fix-qemu-ga.patch 265 266 # Workaround for upstream issue with nested virtualisation: https://gitlab.com/qemu-project/qemu/-/issues/1008 267 (fetchpatch {
··· 33 libslirp, 34 apple-sdk_13, 35 darwinMinVersionHook, 36 guestAgentSupport ? 37 (with stdenv.hostPlatform; isLinux || isNetBSD || isOpenBSD || isSunOS || isWindows) && !minimal, 38 numaSupport ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32 && !minimal, ··· 177 ++ lib.optionals hexagonSupport [ glib ] 178 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 179 sigtool 180 ] 181 ++ lib.optionals (!userOnly) [ dtc ]; 182 ··· 258 259 patches = [ 260 ./fix-qemu-ga.patch 261 + 262 + # On macOS, QEMU uses `Rez(1)` and `SetFile(1)` to attach its icon 263 + # to the binary. Unfortunately, those commands are proprietary, 264 + # deprecated since Xcode 6, and operate on resource forks, which 265 + # these days are stored in extended attributes, which aren’t 266 + # supported in the Nix store. So we patch out the calls. 267 + ./skip-macos-icon.patch 268 269 # Workaround for upstream issue with nested virtualisation: https://gitlab.com/qemu-project/qemu/-/issues/1008 270 (fetchpatch {
+14
pkgs/applications/virtualization/qemu/skip-macos-icon.patch
···
··· 1 + diff --git a/scripts/entitlement.sh b/scripts/entitlement.sh 2 + index 0f412949ec..23f56d083a 100755 3 + --- a/scripts/entitlement.sh 4 + +++ b/scripts/entitlement.sh 5 + @@ -25,9 +25,5 @@ 6 + codesign --entitlements "$ENTITLEMENT" --force -s - "$SRC" 7 + fi 8 + 9 + -# Add the QEMU icon to the binary on Mac OS 10 + -Rez -append "$ICON" -o "$SRC" 11 + -SetFile -a C "$SRC" 12 + - 13 + mv -f "$SRC" "$DST" 14 + trap '' exit
-1
pkgs/top-level/all-packages.nix
··· 14735 eiskaltdcpp = libsForQt5.callPackage ../applications/networking/p2p/eiskaltdcpp { }; 14736 14737 qemu = callPackage ../applications/virtualization/qemu { 14738 - inherit (darwin.stubs) rez setfile; 14739 inherit (darwin) sigtool; 14740 }; 14741
··· 14735 eiskaltdcpp = libsForQt5.callPackage ../applications/networking/p2p/eiskaltdcpp { }; 14736 14737 qemu = callPackage ../applications/virtualization/qemu { 14738 inherit (darwin) sigtool; 14739 }; 14740