summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorRandy Eckenrode <randy@largeandhighquality.com>2023-11-16 17:02:42 -0500
committerRandy Eckenrode <randy@largeandhighquality.com>2023-11-18 10:30:48 -0500
commitfc2852466d8c28b4757cf51789cfd19353880d2e (patch)
tree9bb699d717884dd84d2281990d53909b99aaad91 /pkgs/applications
parentfd2703130c48a494f85805ed91dc45bfcd73aea2 (diff)
downloadnixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.tar
nixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.tar.gz
nixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.tar.bz2
nixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.tar.lz
nixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.tar.xz
nixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.tar.zst
nixpkgs-fc2852466d8c28b4757cf51789cfd19353880d2e.zip
wineWow64Packages: fix build on Darwin
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/emulators/wine/base.nix11
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgs/applications/emulators/wine/base.nix b/pkgs/applications/emulators/wine/base.nix
index cb385018de4..bb44f186cff 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
     ]