This page intends to give hints to run usual linux applications on mac os x. First it is a memo to remind me how i've done it. But if it can be useful for someone else...
It starts from the beginning, when you get your new powerbook 12-inch (for instance), and aims to help you to configure your system so you feel at home, as on linux/x11 (to develop with emacs and a xterm to run the compiler, and make slides for your talks using latex, xfig and the usual stuff).
The developer toolkit (with gcc3.1) is included in the basic os x v10.2 version, but not installed. Now it's the wonderful world of "click to install":
Applications/Installers/Developer\ Tools/Developer.mpkg
A non user-friendly web browser is provided with os x. Every time you start it, a pop-up window raises to ask you selecting it as your favorite web browser. Though, it's obvious you don't want so ! Instead, you want something like firefox. A mac os x binary of both mozilla and firefox are downloadable from:
Moreover, there is a variant of mozilla (i.e. base on the NGLayout layout engine) with a cocoa interface for mac os x. It used to be known as chimera and is now called camino. Download binary from :
http://www.mozilla.org/projects/camino/
Fink ports and packages Open Source softwares for mac os x. It provides lots of common apps yet. But first, we have to install it:
http://fink.sourceforge.net/doc/users-guide/install.php
The source distribution of the package manager is downloadable as a .tar.gz file. Though mac os x extracts the archive with its own app, it is recommended to use:
tar -zxvf fink-0.x.x-full.tar.gz
cd fink-0.x.x-full
./bootstrap.sh
The bootstrap script seems to first download what it needs on various sites (debian, gimp, tetex...), and then go through the usual (./configure;make install;make
) process. A nice feature of fink is that all packages are put in a separate directory /sw
. Then we have to update (actually create) the .cshrc
file in our user directory by adding the line : source /sw/bin/init.csh
.
Then, fink's basic commands are fink list
to know which packages are available or installed (the ones with an i
before the name), and fink install znupf
to install the "znupf" package. It can be more useful to use predownloaded tarballs than doing it on the fly, so fink configure
helps you to change the fink.conf
configuration file : specify an alternate directory name where fink can look for tarballs. Downloaded tarballs are stored in /sw/src/
.
From now, fink will be our friend to install latex, xdvi, gnuplot, xfig, ghostview, antiword, imagemagick, gimp, xv...
Now, X11 is already part of os x 10.3. But a few months before, we had to install Xfree86, which is an open-source implementation of X11, the common graphic display system for UNIX and LINUX operating systems. This will let us run the window manager of our choice. Mac os x comes with its own proprietary graphics display system : Quartz, which is combined with the Aqua interface. There are several ways to get and install Xfree86, listed in the page below (which provides a comprehensive introduction to X servers, too):
http://fink.sourceforge.net/doc/x11/
The two solutions which seemed to us reliable (i.e. 1. commonly used 2. with step-by-step instructions for dummies) are using apple's binaries or installing through fink. X11 apple's binaries X11UserForMacOSX.dmg.bin
and the additional SDK X11SDK.dmg
can be downloaded both from:
http://www.apple.com/macosx/x11/download/
The SDK will be useful to compile X11 apps in a next future. Also, to make X11 compliant with fink, we install a small fink package : fink install system-xfree86
.
Such a .xinitrc file (which makes sure the fink environment is set up correctly and uses the quartz window manager) could be placed in the home directory:
source /sw/bin/init.sh
xterm -geometry 80x24+6+30 &
xterm -geometry 80x24+514+30 &
exec quartz-wm
At this point, we hope we can start emacs in a window. But it fails, though the $DISPLAY
variable is correctly set to :0.0
. Usually, emacs check this variable to start either in console if it is not defined, or in window if it is. It appears that the version of emacs provided with mac os x is compiled with the -nox
option, so does not support X11.
At the time of the writing, there's not many ways to get sorted out. The mac os x code for emacs21 will probably be part of the standard emacs distribution from version 21.4 (emacs21 for mac os x). Some unstable versions of emacs 21.3 can be found on the Web. So, the most reliable solution is to install the stable emacs21.2 using fink: fink install emacs21
.
Trolltech is now providing a free version of Qt for mac os x under the GNU General Public License. Qt allows to design usable interfaces for c++ programs.
http://www.trolltech.com/products/qt/mac.html
The "configure" step needs to specify "macx-g++" as the compiler to build Qt (./configure -platform macx-g++
).