Running Windows Programs on Mac OS X Using WineHQ
I wanted to run a Windows machine on my Mac OS X. So obvious choice was using WineHQ. Ideally, it should have been 1/ Download, 2/ Install and 3/ Run. However, it is never that simple, isn’t it!?
Configuration of iMac
macOS Cataline (10.15.1)
iMac (21.5-inch, Late 2102)
Standard Instructions
1. Downloaded WineHQ pkg for MacOS X from https://dl.winehq.org/wine-builds/macosx/download.html
2. It asked to me have the latest XQuartz installed. So I downloaded XQuartz 2.7.7 dmg from https://www.xquartz.org/releases/XQuartz-2.7.7.html. It installed successfully.
3. I tried reinstalling Wine again and it moved ahead this time. I chose 64-bit support (optional) while installing.
4. However, when I ran it from the Applications folder, I for an error that it needs to be updated and lead me to this page: https://support.apple.com/en-us/HT208436
Making WineHQ Work on MacOS Catalina
1. I followed instructions from https://wiki.winehq.org/MacOS/Building and downloaded version 5.3 from https://dl.winehq.org/wine/source/5.x/
$ brew install bison flex mingw-w64 pkgconfig
$ cd wine-5.3
$ ./configure CC="clang" CXX="clang++" CFLAGS="-std=gnu89 -g"
configure: error: Cannot build a 32-bit program, you need to install 32-bit development libraries.
2. I found this link and started following instructions: https://apple.stackexchange.com/questions/373851/how-to-get-wine-working-on-catalina. So I updated the command:
$ ./configure -enable-win64
configure: error: Your bison version is too old. Please install bison version 3.0 or newer.
$ which bison
/usr/bin/bison
3. I wanted to use HomeBrew, so I ran this command from https://brew.sh/.
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Hom...)"
4. From https://stackoverflow.com/questions/10778905/why-does-my-mac-os-x-10-7-3-have-an-old-version-2-3-of-gnu-bison/30844621#30844621 I realised that Mac has older version and thus upgraded it.
$ brew install bison
$ brew link bison --force
5. I updated ~/vi .bash_profile and added
$ export PATH=/usr/local/Cellar/bison/3.5.3/bin:$PATH
6. Opened a new window which had the path updated
$ which bison
/usr/local/Cellar/bison/3.5.3/bin/bison
7. I ran configure again successfully
$ ./configure -enable-win64
$ make
$ sudo make install
Took a while, but was successful
$ ll /usr/
total 0
lrwxr-xr-x 1 root wheel 25 Nov 6 15:21 X11@ -> ../private/var/select/X11
$ cd /private/var/select/
$ sudo ln -s /opt/X11 .
8. Moment of truth
$ wine64 ../npp.7.bin.x64/notepad++.exe
Segmentation fault: 11
Whaaaaaa ……..
11. Seems like this is a known bug https://bugs.winehq.org/show_bug.cgi?id=48689 and the fix has been provided here: https://source.winehq.org/git/wine.git/blobdiff/76606eaea034c51a73190aac92e75d8b20e82164..35c223850e1bc9e8f97bfaf403bfabca69db3447:/dlls/ntdll/locale.c
12. Edited wine-5.3/dlls/ntdll/locale.c accordingly (though the line numbers did not match), deleted locale.o and restarted
$ ./configure -enable-win64
$ make
$ sudo make install
13. Phew! No Segmentation faults. However, there are more hurdles. After waiting for a while, I got 2 issues.
$ wine64 npp.7.bin.x64/notepad++.exe
0019:err:environ:run_wineboot boot event wait timed out
Wine cannot find the FreeType font library. To enable Wine to
use TrueType fonts please install a version of FreeType greater than
or equal to 2.0.5.
http://www.freetype.org
and via a Mac OS X pop-up:
“notepad++.exe” cannot be opened because the developer cannot be verified.
macOS cannot verify that this app is free from malware.
14. I went to System Preferences and allowed the executable by clicking “Allow Anyway”
15. Then I installed FreeType using HomeBrew
brew install freetype
15. Tried again and had to repeat the step-14 multiple times for various DLLs. I had to export another env variable in ~/.bash_profile
export DYLD_FALLBACK_LIBRARY_PATH=/usr/X11/lib:/usr/local/lib:/usr/local/libpng
Finally, NotePad++ worked!
The post Running Windows Programs on Mac OS X Using WineHQ appeared first on Dinker Charak.


