A long time ago, I compiled Wine from scratch on 32-bit macOS Sierra. I lost interest because I never used it. Now after WWDC 2023, everyone is talking about the happy side effect of Apple’s Game Porting Toolkit (GPTK) which uses Wine under the hood to run Windows 10 DirectX 12 games on macOS!

A trip down memory lane

Game Porting Toolkit (GPTK) leverages CodeWeavers’ open source CrossOver codebase, forked from Wine. A long time ago I was playing around with Wine on macOS:

  1. Compiling Wine 1.9 from scratch on macOS with Retina mode 21 Oct 2016
  2. Creating a wine.app bundle manually 26 Oct 2016
  3. Problem compiling Wine second time around 30 Oct 2016
  4. Automated script to compile Wine 2.9 from scratch 28 May 2017
  5. Building and packaging Wine 4.12.1 (32-bit and 64-bit) automatically 31 Jul 2019

Wine has come a long way since then, thanks to CodeWeavers and Valve (the SteamDeck also uses Wine)... and now Apple is also leveraging Wine. I hope these big companies contribute and support the project financially!

Don’t bother reading my old posts or trying my old code - it’s way out of date, and besides come Sonoma, there will be a better way of doing all this... read on!

Compiling GPTK in Sonoma Beta

If like me, you want to try macOS 14 (Sonoma) beta in UTM virtual machine:

  1. Login to developer.apple.com using your Apple ID (does not have to be a developer account), and download:
    • Under operating systems, macOS 14 beta (Sonoma),
    • And, Device support for macOS 14 beta to update the virtualization hypervisor,
    • Under applications, Xcode 15 beta > Command Line Tools for Xcode 15 beta,
    • Under more, Game porting toolkit beta.
  2. In the host OS, install DeviceSupport.dmg.

Apple Developer Betas Sonoma and GPTK Downloads

  1. Then create a new VM in UTM to Virtualize macOS 12+ and drag and drop the downloaded UniversalMac_14.0_xxxxxxxx_Restore.ipsw:
    • The installation should proceed and complete successfully.
    • If you get this error, then you didn’t install Device support - clicking the Install button here will result in an “Installation failed” error, since you need to get the beta manually:

Apple Virtualization Framework Update Required

  1. In the guest VM, install Command_Line_Tools_for_Xcode_15_beta.dmg.
  2. You can also open Game_porting_toolkit_beta.dmg and accept the T&Cs.
  3. Compile Game Porting Toolkit via Homebrew - I followed the guide by AppleGamingWiki.

Alas, my old code to create a Wine.app bundle does not work with GPTK - there are errors about locating FreeType libraries that I haven’t been able to figure it out.

Whisky: Wine but a bit stronger!

My Wine build was a bust, but Whisky worked for me!

I am running the current Whisky build 0.2.3 dated ~10 June on a Mac Mini with Ventura 13.4. I do not have Homebrew installed, nor do I have Game Porting Toolkit compiled.

When first run, Whisky prompts to drag and drop Game_porting_toolkit_beta.dmg to get the GPTK files required. After I did this, I created a Bottle for Windows 10 called Win10. Straight away, running the winecfg worked just fine. You can run it from Whisky by clicking the Config panel and Open Wine Configuration:

Whisky’s Wine Configuration

But I could’t get Windows apps to run at all. So I used the command line to run Wine (from within the Whisky.app) manually, to observe the error messages:

cd Whisky.app/Contents/Resources/Libraries/Wine/bin
WINEPREFIX=~/Library/Containers/com.isaacmarovitz.Whisky/Bottles/Win10 \
MTL_HUD_ENABLED=1 WINEESYNC=1 ./wine64 explorer

I noticed all sorts of errors related to missing d3d9.dll, d3d11.dll, etc. files, and missing D3DMetal.framework files. Errors like:

./wine64 explorer
0148:err:module:import_dll Library dxgi.dll (which is needed by L"C:\\GOG Games\\xxx.exe") not found
0148:err:module:import_dll Library d3d9.dll (which is needed by L"C:\\GOG Games\\xxx.exe") not found
0148:err:module:import_dll Library d3d11.dll (which is needed by L"C:\\GOG Games\\xxx.exe") not found
...
Assertion failed: (GFXTHandle && "Failed to dlopen D3DMetal"), function D3DRMDispatch_Init_block_invoke, file shared.mm, line 694.

I think I have screwed something up, since Whisky expects the GPTK to be mounted as /Volumes/Game Porting Toolkit-1.0 which is not the case for me. Rather than rely on the mount, I tried to just copy the files from the GPTK .DMG manaully. I don’t know what is right... but this worked for me:

  1. First, right click the Whisky.app and select Show Package Contents, and:

    • copy the contents of the lib folder from the GPTK volume to Contents\Resources\Libraries\Wine\lib
    • copy the contents of the external folder to Contents\Resources\Libraries\Wine (there is no folder called external on the target)
  2. Then, from the Whisky Bottle, click Open C Drive, or cd ~/Library/Containers/com.isaacmarovitz.Whisky/Bottles/Win10 in my case, and:

    • copy the contents of the lib\x86_64-windows folder from the toolkit to drive_c\windows\system32

I closed everything, and then re-started Wine from the command line again. What do you know, this time, I managed to install and run a few Windows games!

Though some games just hung or just displayed a blank screen... a few worked! I don’t have many games to test, so here I’m running Whisky, Wine’s Explorer and two GOG Games, Terraformers: First Steps on Mars and Haven Park, simulataneously. Whisky (Wine) running GPTK and Windows games