diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 7c9d5c30312a..68399723ade7 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -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 aren’t + # 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"; diff --git a/pkgs/applications/virtualization/qemu/skip-macos-icon.patch b/pkgs/applications/virtualization/qemu/skip-macos-icon.patch new file mode 100644 index 000000000000..4f6f3a9a9e4a --- /dev/null +++ b/pkgs/applications/virtualization/qemu/skip-macos-icon.patch @@ -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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 707126c1a872..f90e43fdee32 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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; };