Fink & XDarwin

Platform: Mac OS X
Level of Difficulty: Intermediate
<hr>
Rutgers Main | OIT Main | NBCS Main | NBCS Documentation Main


This document describes how to install XDarwin on Mac OS X with Fink. It covers the following topics: Hexley, the Darwin-OS Mascot

  1. Background
  2. Fink
  3. XDarwin
  4. Window Maker

Background

Mac OS X is based on Darwin, which is a version of the BSD Unix operating system. Unix operating systems use software which can be installed by a variety of methods. The traditional way to install software on a Unix system is to download the source code, compile it, and then install it on your system. Installing software in this manner can be a good learning experience, but it introduces the following problems:

  1. Dependencies are not managed. For example a piece of software that you are trying to install could need another piece software, and in turn that piece of software could have the same problem.

  2. There is no clean way to uninstall the software. For example, installing your software could have put files in lots of places on your system, and it could be tricky to track down and remove those files.

  3. There is no consistent interface for installing the software. A lot of source based software packages have a consistent method of installation, but this is not necessarily the case, and you might have to take time to learn the installation process behind each piece of software that you are interested in.

  4. There is no automatic way to keep track of what software has been installed on your system.

One way to avoid the above problems is to use a package manager. A package is a collection of software, which usually contains all of the files necessary to implement a set of related commands or features. For example, if you want to install the apache web server on your system and if you are using a package manager, you would want to find the 'apache web server' package and then tell your package manager to install it, as opposed to downloading the source code, compiling it, and installing it.

Fink

There are a variety of package managers available that run on Unix flavored operating systems, but not all of them solve the above problems. For example the RPM package manger manages RPM packages, but it does not solve the dependency problem. Thus, the process for installing a package called x.rpm could involve downloading x.rpm and attempting to install x.rpm only to find out that it needs a file called k.c. In order to figure out which package has the file called k.c, you might have to use something like rpm find to figure out that the file that you are interested in is contained in a package called y.rpm. You could spend a lot of time doing this, because y.rpm might have the same problem.

One package management tool that solves the dependency problem nicely is called apt-get, which was developed for the Debian GNU/Linux operating system. Debian has a tool called dpkg which is similar to RPM, in that it can be used to install binary ".deb" packages (as opposed to ".rpm" packages). However, Debian's package manager has a higher level command called apt-get, which manages dependencies based on packages, not files.

Some have said that apt-get is the greatest thing since sliced bread! If you want to install a package on a Debian system all you have to do (assuming that things are configured correctly), is figure out the package's name (this could be done using Debian's website) and type apt-get install x (where x is the package name). Apt will fetch the package (from a CD-ROM or across the internet over http or ftp, so that no special protocol is needed) as well as the packages that it depends on and make it work. In addition to solving all four of the above problems, apt can be used to upgrade all of your packages to the latest version with one command (apt-get upgrade).

Luckily, Fink (the package manager that runs on Mac OS X) is based on Debian's package manager and offers the same features.

Fink is easy to install. Point your browser at the following URL:

http://fink.sourceforge.net/download/

The above page will have you download a simple disk image file (.dmg) and offers simple instructions on how to install it. Once you have Fink installed, installing XDarwin is easy.

XDarwin

Mac OS X's default graphical user interface (GUI) is called Aqua. However, it is possible to run other GUIs such as Window Maker, GNOME, or KDE. All of these GUIs depend on an implementation of the X Window System, which was originally developed at MIT. XFree86 is an open source implementation of X that we will use.

XDarwin can be thought of as XFree86 with two additional libraries. Thus, to install XDarwin from source you need to download the XFree86 source along with the Xprog.tgz tarball (which provides dynamic libraries that XDarwin needs) and the Xquartz.tgz tarball (which is required if you want to run X and Aqua simultaneously, i.e. rootless).

Instead of installing XDarwin from source (and risking the problems that were discussed above), we will simply install the Fink xfree86-rootless package. To do this we type:

> sudo apt-get install xfree86-rootless

After executing the above command Fink will go and get a copy of an XDarwin binary package and install it on your computer. The apt-get install command should look familiar given the discussion above and xfree86-rootless is simply the name of the package. The sudo command is a way to delegate administrator, or root power to the command that it is is followed by it. Only those in administrator's group can use sudo, which comes from OS X's BSD heritage. Fink should be run with the sudo command since only the administrator should be able to install software. For further information on Fink see the Fink Documentation.

When the package is finished installing, try running XDarwin. In the Mac OS X Finder, double-click on the XDarwin icon, or open a terminal window and type "startx -- -quartz". Your screen will be temporarily blanked by XDarwin.

If this is your first time running XDarwin you should be sent back to the Mac OS X desktop. Where you should see that there is a button in the XFree86 window on the desktop, which will be labeled "Show X11". If you click this button, X11 will take over your screen and display things according to your .xinitrc file. We'll cover the details of this file later. To return to the Mac OS X desktop, press command-option-A. To return to X, select the XDarwin icon in the Dock. To quit X Windows click on XDarwin in the Dock and quit as you would any other application.

X might not look like much at first all it provides is the display and management of graphical information. This is because it is not a window manager. A window manager is a separate program that controls the window frames (title bar, close button, etc.) on top of X. We will install the 'Window Maker' window manger next.

Window Maker

Window Maker is a window manager that will run on top of X. It is the window manager of choice to be demonstrated in this document because it is indirectly related to Apple in the following respects:
  1. Mac OS X is based on an operating system called NeXTStep.

  2. NeXTStep comes from a company called NeXT that Steve Jobs started in 1986 and which Apple bought 1997.

  3. Window Maker was originally designed to provide support for GNUstep, which reproduces the look, feel, and API of NeXTStep, which formed the basis for Cocoa.

We will use the Fink windowmaker Package. To install it, simply type:

> sudo apt-get install windowmaker

When apt is done installing the windowmaker package, you should configure your .xinitrc file to run Window Maker. An .xinitrc file is a file that sits in your home directory that is executed when X starts. For more information on .xinitrc see this. Use your favorite text editor so that the following becomes the last line of your .xinitrc:

exec /sw/bin/wmaker

The above line tells X to execute the command wmaker, which starts Window Maker. The /sw/bin/ directory is where Fink will install this command.

Now that we have a window manager installed we can start XDarwin. As mentioned before, go to the Mac OS X Finder, and double-click on the XDarwin icon, or open a terminal window and type "startx -- -quartz". Window Maker should then start. For documentation on how to use it, see the Window Maker Website.

If you want to change the look of Window Maker you can go to freshmeat.net and download a collection of Window Maker themes. If Window Maker and X installed you can also make use of some great free software, such as The Gimp and AbiWord. All you have to do is use Fink to apt-get them!


<hr>
Copyright © 2009 Rutgers, The State University of New Jersey, NBCS Help Desk. All rights reserved.

Rutgers Logo

jfulton@nbcs.rutgers.edu
01/08/03