···3737 # The Wine preloader must _not_ be linked to any system libraries, but `NIX_LDFLAGS` will link
3838 # to libintl, libiconv, and CoreFoundation no matter what. Delete the one that was built and
3939 # rebuild it with empty NIX_LDFLAGS.
4040- rm loader/wine64-preloader
4141- make loader/wine64-preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}=""
4040+ for preloader in wine-preloader wine64-preloader; do
4141+ rm loader/$preloader &> /dev/null \
4242+ && ( echo "Relinking loader/$preloader"; make loader/$preloader NIX_LDFLAGS="" NIX_LDFLAGS_${stdenv.cc.suffixSalt}="" ) \
4343+ || echo "loader/$preloader not built, skipping relink."
4444+ done
4245 '';
4346}) // rec {
4447 inherit version src;
···109112 # uses property syntax in one place. The first patch is necessary only with older
110113 # versions of Wine. The second is needed on all versions of Wine.
111114 (lib.optional (lib.versionOlder version "8.12") ./darwin-metal-compat-pre8.12.patch)
112112- (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.19.patch)
113113- ./darwin-metal-compat.patch
115115+ (lib.optional (lib.versionOlder version "8.18") ./darwin-metal-compat-pre8.18.patch)
116116+ (lib.optional (lib.versionAtLeast version "8.18") ./darwin-metal-compat.patch)
114117 # Wine requires `qos.h`, which is not included by default on the 10.12 SDK in nixpkgs.
115118 ./darwin-qos.patch
116119 ]