···9090 ++ lib.optionals tlsSupport [ pkgs.openssl pkgs.gnutls ]
9191 ++ lib.optionals (openglSupport && !stdenv.isDarwin) [ pkgs.libGLU pkgs.libGL pkgs.mesa.osmesa pkgs.libdrm ]
9292 ++ lib.optionals stdenv.isDarwin (with pkgs.buildPackages.darwin.apple_sdk.frameworks; [
9393- CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration Security
9393+ CoreServices Foundation ForceFeedback AppKit OpenGL IOKit DiskArbitration PCSC Security
9494 ApplicationServices AudioToolbox CoreAudio AudioUnit CoreMIDI OpenCL Cocoa Carbon
9595 ])
9696 ++ lib.optionals (stdenv.isLinux && !waylandSupport) (with pkgs.xorg; [
···103103104104 patches = [ ]
105105 ++ lib.optionals stdenv.isDarwin [
106106- # Wine requires `MTLDevice.registryID` for `winemac.drv`, but that property is not available
107107- # in the 10.12 SDK (current SDK on x86_64-darwin). Work around that by using selector syntax.
106106+ # Wine uses `MTLDevice.registryID` in `winemac.drv`, but that property is not available in
107107+ # the 10.12 SDK (current SDK on x86_64-darwin). That can be worked around by using selector
108108+ # syntax. As of Wine 8.12, the logic has changed and uses selector syntax, but it still
109109+ # uses property syntax in one place. The first patch is necessary only with older
110110+ # versions of Wine. The second is needed on all versions of Wine.
111111+ (lib.optional (lib.versionOlder version "8.12") ./darwin-metal-compat-pre8.12.patch)
108112 ./darwin-metal-compat.patch
109113 # Wine requires `qos.h`, which is not included by default on the 10.12 SDK in nixpkgs.
110114 ./darwin-qos.patch
111115 ]
112116 ++ patches';
117117+118118+ # Because the 10.12 SDK doesn’t define `registryID`, clang assumes the undefined selector returns
119119+ # `id`, which is a pointer. This causes implicit pointer to integer errors in clang 15+.
120120+ # The following post-processing step adds a cast to `uint64_t` before the selector invocation to
121121+ # silence these errors.
122122+ postPatch = lib.optionalString stdenv.isDarwin ''
123123+ sed -e 's|\(\[[A-Za-z_][][A-Za-z_0-9]* registryID\]\)|(uint64_t)\1|' \
124124+ -i dlls/winemac.drv/cocoa_display.m
125125+ '';
113126114127 configureFlags = prevConfigFlags
115128 ++ lib.optionals supportFlags.waylandSupport [ "--with-wayland" ]
···192205 ];
193206 description = if supportFlags.waylandSupport then "An Open Source implementation of the Windows API on top of OpenGL and Unix (with experimental Wayland support)" else "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
194207 platforms = if supportFlags.waylandSupport then (lib.remove "x86_64-darwin" prevPlatforms) else prevPlatforms;
195195- maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira ];
208208+ maintainers = with lib.maintainers; [ avnik raskin bendlas jmc-figueira reckenrode ];
196209 inherit mainProgram;
197210 };
198211})
···11+diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m
22+--- a/dlls/winemac.drv/cocoa_display.m
33++++ b/dlls/winemac.drv/cocoa_display.m
44+@@ -289,7 +289,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
55+ * the primary GPU because we need to hide the integrated GPU for an automatic graphic switching pair to avoid apps
66+ * using the integrated GPU. This is the behavior of Windows on a Mac. */
77+ primary_device = [MTLCreateSystemDefaultDevice() autorelease];
88+- if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, primary_device.registryID))
99++ if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, [primary_device registryID]))
1010+ goto done;
1111+1212+ /* Hide the integrated GPU if the system default device is a dedicated GPU */
1313+@@ -301,7 +301,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
1414+1515+ for (i = 0; i < devices.count; i++)
1616+ {
1717+- if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], devices[i].registryID))
1818++ if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], [devices[i] registryID]))
1919+ goto done;
2020+2121+ if (hide_integrated && devices[i].isLowPower)
2222+
···11diff --git a/dlls/winemac.drv/cocoa_display.m b/dlls/winemac.drv/cocoa_display.m
22-index f64a6c0f6ad..6da0391e3fa 100644
32--- a/dlls/winemac.drv/cocoa_display.m
43+++ b/dlls/winemac.drv/cocoa_display.m
55-@@ -289,7 +289,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
66- * the primary GPU because we need to hide the integrated GPU for an automatic graphic switching pair to avoid apps
77- * using the integrated GPU. This is the behavior of Windows on a Mac. */
88- primary_device = [MTLCreateSystemDefaultDevice() autorelease];
99-- if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, primary_device.registryID))
1010-+ if (macdrv_get_gpu_info_from_registry_id(&primary_gpu, (uint64_t)[primary_device registryID]))
1111- goto done;
1212-1313- /* Hide the integrated GPU if the system default device is a dedicated GPU */
1414-@@ -301,7 +301,7 @@ static int macdrv_get_gpus_from_metal(struct macdrv_gpu** new_gpus, int* count)
1515-1616- for (i = 0; i < devices.count; i++)
1717- {
1818-- if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], devices[i].registryID))
1919-+ if (macdrv_get_gpu_info_from_registry_id(&gpus[gpu_count], (uint64_t)[devices[i] registryID]))
2020- goto done;
2121-2222- if (hide_integrated && devices[i].isLowPower)
234@@ -354,7 +354,7 @@ static int macdrv_get_gpu_info_from_display_id_using_metal(struct macdrv_gpu* gp
245256 device = [CGDirectDisplayCopyCurrentMetalDevice(display_id) autorelease];
267 if (device && [device respondsToSelector:@selector(registryID)])
278- ret = macdrv_get_gpu_info_from_registry_id(gpu, device.registryID);
2828-+ ret = macdrv_get_gpu_info_from_registry_id(gpu, (uint64_t)[device registryID]);
99++ ret = macdrv_get_gpu_info_from_registry_id(gpu, [device registryID]);
29103011 done:
3112 [pool release];