From fc2852466d8c28b4757cf51789cfd19353880d2e Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 16 Nov 2023 17:02:42 -0500 Subject: [PATCH] wineWow64Packages: fix build on Darwin --- pkgs/applications/emulators/wine/base.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix index cb385018de4b..bb44f186cff5 100644 --- a/pkgs/applications/emulators/wine/base.nix +++ b/pkgs/applications/emulators/wine/base.nix @@ -37,8 +37,11 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # The Wine preloader must _not_ be linked to any system libraries, but `NIX_LDFLAGS` will link # to libintl, libiconv, and CoreFoundation no matter what. Delete the one that was built and # rebuild it with empty NIX_LDFLAGS. - rm loader/wine64-preloader - make loader/wine64-preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}="" + for preloader in wine-preloader wine64-preloader; do + rm loader/$preloader &> /dev/null \ + && ( echo "Relinking loader/$preloader"; make loader/$preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}="" ) \ + || echo "loader/$preloader not built, skipping relink." + done ''; }) // rec { inherit version src; @@ -109,8 +112,8 @@ stdenv.mkDerivation ((lib.optionalAttrs (buildScript != null) { # uses property syntax in one place. The first patch is necessary only with older # versions of Wine. The second is needed on all versions of Wine. (lib.optional (lib.versionOlder version "8.12") ./darwin-metal-compat-pre8.12.patch) - (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.19.patch) - ./darwin-metal-compat.patch + (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.18.patch) + (lib.optional (lib.versionAtLeast version "8.18") ./darwin-metal-compat.patch) # Wine requires `qos.h`, which is not included by default on the 10.12 SDK in nixpkgs. ./darwin-qos.patch ]