- Add a setup hook to allow Darwin to build PE DLLs using MinGW; - Add a postConfigure script to fix preloader brekage on Apple Silicon Macs running under Rosetta 2; - Disable linking against X11 libraries (pulled in by ffmpeg); and - Allow building Wine 7.0 using the 10.12 SDK on x86_64-darwin.main
parent
bf1f71c0e2
commit
424e97118f
@ -0,0 +1,31 @@ |
||||
diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m
|
||||
index f64a6c0f6ad..6da0391e3fa 100644
|
||||
--- a/dlls/winemac.drv/cocoa_display.m
|
||||
+++ b/dlls/winemac.drv/cocoa_display.m
|
||||
@@ -289,7 +289,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
|
||||
* the primary GPU because we need to hide the integrated GPU for an automatic graphic switching pair to avoid apps
|
||||
* using the integrated GPU. This is the behavior of Windows on a Mac. */
|
||||
primary_device = [MTLCreateSystemDefaultDevice() autorelease];
|
||||
- if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, primary_device.registryID))
|
||||
+ if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, (uint64_t)[primary_device registryID]))
|
||||
goto done;
|
||||
|
||||
/* Hide the integrated GPU if the system default device is a dedicated GPU */
|
||||
@@ -301,7 +301,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
|
||||
|
||||
for (i = 0; i < devices.count; i++)
|
||||
{
|
||||
- if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], devices[i].registryID))
|
||||
+ if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], (uint64_t)[devices[i] registryID]))
|
||||
goto done;
|
||||
|
||||
if (hide_integrated && devices[i].isLowPower)
|
||||
@@ -354,7 +354,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp
|
||||
|
||||
device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease];
|
||||
if (device && [device respondsToSelector:@selector(registryID)])
|
||||
- ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
|
||||
+ ret = macdrv_get_gpu_info_from_registry_id(gpu, (uint64_t)[device registryID]);
|
||||
|
||||
done:
|
||||
[pool release];
|
@ -0,0 +1,37 @@ |
||||
|
||||
fixupCFlagsForDarwin() { |
||||
# Because it’s getting called from a Darwin stdenv, MinGW will pick up on Darwin-specific |
||||
# flags, and the ./configure tests will fail to consider it a working cross-compiler. |
||||
# Strip them out, so Wine can use MinGW to build its DLLs instead of trying to use Clang. |
||||
# Ideally, it would be possible to build the DLLs on Windows (i.e., as part of `pkgsCross``), |
||||
# but that is not the case currently with Wine’s build system. |
||||
cflagsFilter='s|-F[^ ]*||g;s|-iframework [^ ]*||g;s|-isystem [^ ]*||g;s| *| |g' |
||||
|
||||
# libiconv and libintl aren’t needed by Wine, and having them causes linking to fail. |
||||
# The `CoreFoundation` reference is added by `linkSystemCoreFoundationFramework` in the |
||||
# Apple SDK’s setup hook. Remove that because MingW will fail due to file not found. |
||||
ldFlagsFilter='s|-lintl||g;s|-liconv||g;s|/nix/store/[^-]*-apple-framework-CoreFoundation[^ ]*||g' |
||||
|
||||
# `cc-wrapper.sh`` supports getting flags from a system-specific salt. While it is currently a |
||||
# tuple, that’s not considered a stable interface, so the Wine derivation will provide them: |
||||
# - for Darwin: The source is `stdenv.cc.suffixSalt`; and |
||||
# - for MinGW: The source is the `suffixSalt`` attribute of each of the `mingwGccs`. |
||||
export NIX_CFLAGS_COMPILE_@darwinSuffixSalt@=${NIX_CFLAGS_COMPILE-} |
||||
export NIX_LDFLAGS_@darwinSuffixSalt@=${NIX_LDFLAGS-} |
||||
for mingwSalt in @mingwGccsSuffixSalts@; do |
||||
echo removing @darwinSuffixSalt@-specific flags from NIX_CFLAGS_COMPILE for $mingwSalt |
||||
export NIX_CFLAGS_COMPILE_$mingwSalt+="$(sed "$cflagsFilter" <<< "$NIX_CFLAGS_COMPILE")" |
||||
echo removing @darwinSuffixSalt@-specific flags from NIX_LDFLAGS for $mingwSalt |
||||
export NIX_LDFLAGS_$mingwSalt+="$(sed "$ldFlagsFilter;$cflagsFilter" <<< "$NIX_LDFLAGS")" |
||||
done |
||||
|
||||
# Make sure the global flags aren’t accidentally influencing the platform-specific flags. |
||||
export NIX_CFLAGS_COMPILE="" |
||||
export NIX_LDFLAGS="" |
||||
} |
||||
|
||||
# This is pretty hacky, but this hook _must_ run after `linkSystemCoreFoundationFramework`. |
||||
function runFixupCFlagsForDarwinLast() { |
||||
preConfigureHooks+=(fixupCFlagsForDarwin) |
||||
} |
||||
postUnpackHooks+=(runFixupCFlagsForDarwinLast) |
Loading…
Reference in new issue