Unverified Commit fc285246 authored by Randy Eckenrode's avatar Randy Eckenrode
Browse files

wineWow64Packages: fix build on Darwin

parent fd270313
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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
    ]