Install Wine Mac Lion OS X 10.7 / 10.8 Mountain Lion

Wine (Windows Emulator) is a free and open-source application that aims to allow programs / softwares written for Microsoft Windows to run on Unix-like operating system such as Linux, BSD, Solaris and Mac OS X.

That said if you own Mac OS X based computers, you can run Windows applications such as Notepad, Mikrotik Winbox and more.

In this post I want to show you how to install Wine on Mac OS X Lion 10.7.2 (it should be also applicable for Snow Leopard 10.6, Leopard 10.5, and Tiger 10.4) via MacPorts.

UPDATE: For those of you who have upgraded to OS X Mountain Lion, you will be surprised that Wine will no longer work because Apple removes the X11 from Mountain Lion. The solution is you have to install XQuartz as the substitute of X11. You can download and install the XQuartz from XQuartz project website.

1. Download the MacPorts from its website. Select the appropriate file to meet with your Mac version. Note that you must have XCode and X11 (XQuartz in Mountain Lion) window environment installed in the system.

2. Once it’s downloaded, double-click the dmg file and follow the on-screen installation process. You have to be connected to internet while installing the MacPorts because it downloads the port files in a background process.

3. Once the MacPorts has been successfully installed, check whether the ‘port’ command is already in your PATH or not. In Mac OS X Lion, it should be already in the PATH. Otherwise run the below command to export the port into the PATH.

$ export PATH=$PATH:/opt/local/bin

4. Now we are ready to install the Wine via MacPorts by issuing ‘sudo port install wine’ as follow

$ sudo port install wine
Password:
Computing dependencies for wine
Dependencies to be installed: apple-gcc42 expat expat flex gettext libiconv gperf libiconv ncurses ncursesw ncurses fontconfig freetype bzip2 zlib zlib zlib freetype gnutls libgcrypt libgpg-error libtasn1 lzo2 pkgconfig glib2 libffi libffi perl5 perl5.12 gdbm gdbm perl5.12 perl5 perl5 xz xz glib2 pkgconfig readline jpeg jpeg lcms tiff tiff libpng libxml2 libxml2 libxslt mesa makedepend xorg-xproto py27-libxml2 python27 db46 libedit openssl openssl python_select sqlite3 xorg-dri2proto xorg-glproto xorg-libXfixes xorg-fixesproto xorg-libX11 xorg-bigreqsproto xorg-inputproto xorg-kbproto xorg-libXau xorg-libXdmcp xorg-libxcb xorg-libpthread-stubs xorg-xcb-proto xorg-util-macros xorg-xcmiscproto xorg-xextproto xorg-xf86bigfontproto xorg-xtrans xorg-libXi xorg-libXext autoconf help2man p5.12-locale-gettext m4 automake libtool xorg-libXi xorg-libXmu xorg-libXt xorg-libsm xorg-libice xorg-libsm xorg-libXcomposite xorg-compositeproto xorg-libXcursor xorg-renderproto xrender xrender xorg-libXinerama xorg-xineramaproto xorg-libXrandr xorg-randrproto xorg-libXxf86vm xorg-xf86vidmodeproto

Fetching apple-gcc42
Attempting to fetch gcc-5666.3.tar.gz from http://jog.id.distfiles.macports.org/macports/mpdistfiles/apple-gcc42

It will take a couple of minutes for the port script to retrieve, download, building and then install the wine and its dependency softwares. So be patient!.

When it’s done, you should see something like below:

Fetching archive for wine
Attempting to fetch wine-1.2.3_1.darwin_11.i386.tbz2 from http://packages.macports.org/wine
Fetching wine
Attempting to fetch wine-1.2.3.tar.bz2 from http://voxel.dl.sourceforge.net/project/wine/Source
Attempting to fetch wine_gecko-1.0.0-x86.cab from http://voxel.dl.sourceforge.net/project/wine/Wine%20Gecko/1.0.0
Verifying checksum(s) for wine
Extracting wine
Configuring wine
Building wine
Staging wine into destroot
Installing wine @1.2.3_1
Activating wine @1.2.3_1
Cleaning wine

If there is no error like above, the Wine has been successfully installed on Mac OS X and you are ready to run Microsoft Windows programs.