Running X11 - 3. Getting and Installing X11
3.1 Installing X11 via Fink
Fink will let you install X11 in a variety of ways,
among these it provides XFree86 packages of its own. If you
use fink install ..., it will download
the source code and compile it on your computer. If
you use apt-get install ... or the
dselect frontend, it will download
precompiled binary packages, similar to the official
XFree86 distribution.
General notes:
- All of the X11 packages currently available via Fink support both full-screen and rootless operation, and have OpenGL support.
- Important note: Files get moved around between X11 releases. This frequently means that if you try to downgrade your X11 installation, you will find that binaries (executable programs, etc.) won't work anymore. You'd have to rebuild any such packages.
You can go the other way though: packages built vs an older X11 generally work on a later one.
For 10.3 or 10.4, the X11 hierarchy (newer -> older codebases) is as follows:
xorg > xfree86 > Apple's X11
10.4 users:
You can install XFree86 version 4.5.0-23 from source. You will need both the xfree86 and xfree86-shlibs packages to have a fully functional installation.
You can also install the X.org X11 release (currently version 6.8.2-35) via the xorg and xorg-shlibs packages in the unstable tree. This X11 flavor is similar to XFree86-4.5, but includes some bugfixes and new features, and removes some code with a disputed license.
10.3 users:
You can install XFree86 version 4.4.0-13 (that which is in the current binary distribution) or 4.5.0-13 (which is available from source). You will need both the xfree86 and xfree86-shlibs packages to have a fully functional installation.
You can also install X.org-6.8.2 via the xorg and xorg-shlibs packages as above.
10.2 users:
10.2 users may install version 4.3 via source or binary, and 4.4 from the unstable tree. As above, you'll install xfree86 and xfree86-shlibs.
XFree86 4.2.1.1 is also available for 10.2, in normal and -threaded flavors (later X11s all have threading support), though it is considered to be obsolete. The xfree86-base, xfree86-base-shlibs, xfree86-shlibs, and xfree86-rootless-shlibs packages (or their -threaded counterparts must all be installed for you to have a working XFree86 setup. In addition, you may need to install the xfree86-base-dev and xfree86-rootless-dev packages (or their -threaded equivalents) to keep Fink from trying to install a newer version.
10.1 users:
You can install version 4.2.0 from the binary distribution (only). You will install xfree86-base and xfree86-rootless.
3.2 Apple's Binaries
On January 7, 2003, Apple released a custom X11 implementation based on XFree86-4.2 which includes Quartz rendering and accelerated OpenGL. A new version was released on February 10, 2003 with additional features and bugfixes. A third release (i.e. Beta 3) was made on March 17, 2003 with further additional features and bugfixes. This version is usable on Jaguar.
On October 24, 2003, Apple released Panther (10.3), which includes a release version of their X11 distribution. This version is based on XFree86-4.3.
On April 29, 2005, Apple released Tiger (10.4), which includes a release version of Apple's X11 based on XFree86-4.4.
To use the Apple binaries, you need to make sure the X11 User package is installed, and you should also update Fink.
Under fink-0.16.2, you will need to install the X11 SDK package, as well. After you do this, Fink will
create a system-xfree86 virtual package.
Under fink-0.17.0 and later installing the X11 SDK is only necessary if
you want to build packages from source. In this case, even if you don't have the SDK, there will be system-xfree86
and system-xfree86-shlibs virtual packages, the latter representing the shared libraries. If you do install the SDK, there will also be a
system-xfree86-dev package, representing the headers.
If you have an existing XFree86 distribution installed, be it through Fink or otherwise, you can follow the instructions on replacing one X11 package with another. Make sure that you remove your existing packages, then install Apple's X11 (and X11 SDK, if needed or desired).
Some notes on using Apple's X11:
-
The
autocutselpackage is no longer needed. If you're starting X11 with it enabled, you should disable it. -
Apple's X11 uses your existing
~/.xinitrcfile. If you want the full effect of Quartz integration, you should use/usr/X11R6/bin/quartz-wmas your window manager, or delete your~/.xinitrccompletely.If you just want cut-and-paste integration, but want to use a different window manager, you can do this as in the following example:
/usr/X11R6/bin/quartz-wm --only-proxy & exec /sw/bin/fvwm2
You may, of course, call any other window manager,
startkde, etc. -
quartz-wmdoesn't fully support Gnome/KDE window manager hints, so you may see some strange behavior on windows that shouldn't have decorations, but do. -
Apple X11 doesn't honor the Fink environment settings by default. In order to call up startup applications that you have installed with fink (e.g. window managers, gnome-session, other apps under
/sw/bin) put the following near the top of~/.xinitrc(i.e. after the initial "#!/bin/sh", but before you run any programs):. /sw/bin/init.sh
so that the Fink environment is initialized. Note:
init.shis used rather thaninit.cshbecause.xinitrcis run byshrather thantcsh. -
Applications that require calling other programs which reside within your Fink tree for some of their functions need special treatment to get them to work when called from the Application menu. Instead of putting just the full path to the filename, e.g.
/sw/bin/emacs
you'll want to use something like the following, if you're using bash as your default shell:
. /sw/bin/init.sh ; emacs
and if you're using tcsh:
source /sw/bin/init.csh ; emacs
This makes sure that the application has the correct PATH information. You can use this syntax for any Fink-installed application.
-
If you are trying to build a package by hand against Apple's X11 and you see a failure like:
ld: err.o illegal reference to symbol: _XSetIOErrorHandler defined in indirectly referenced dynamic library /usr/X11R6/lib/libX11.6.dylib
then you'll need to make sure to that
-lX11is present during linking. Check your package's configuration options to see how to feed it the extra argument. -
If you use the
xfree86package, and later switch to Apple's X11 (on either 10.2.x or 10.3.x), any packages you have built againstxfree86will need to be rebuilt, as the binaries are incompatible. 10.3 and 10.4 users only: It is possible to use Apple's display server and window manager on top of XFree86 or X.org. If you install the
applex11toolspackage, Fink will install what you need, as long as you have a copy of X11User.pkg.
For more information on using Apple's X11, check out this article at the Apple Developer Connection.
3.3 The Official Binaries
The XFree86 project has an official binary distribution of XFree86
4.5.0. You can find it on your local XFree86 mirror in
the directory 4.5.0/binaries/Darwin-ppc-6.x (or 4.5.0/binaries/Darwin-ppc-5.x for OS 10.1).
Be sure to get the Xprog.tgz and Xquartz.tgz
tarballs even though they are marked as "optional".
If you're unsure what you need, just download the whole directory.
Run the Xinstall.sh script as root to install the stuff.
(You might want to read the official
instructions before installing.)
You've now got XFree86 with a server that can do fullscreen, or rootless under Mac OS X.
3.4 The Official Source
If you've got the time to spare, you can build XFree86 4.5 from
source.
You can find the source on your local XFree86 mirror in
the directory 4.5.0/source.
Grab all seven XFree86-4.5.0-src-#.tgz tarballs and extract them in
the same directory.
You can customize the build by putting macro definitions in the file
config/cf/host.def in the XFree86 source tree.
See
config/cf/darwin.cf for some hints.
(Note: Only the macros that have an #ifndef check around them can be
overwritten in host.def.)
When you're happy with your configuration, compile and install XFree86 with the following commands:
make World sudo make install install.man
As with the official binaries, you've now got XFree86 with a server that can do fullscreen, or rootless under Mac OS X.
3.5 The Latest Development Source
If you have not only time, but also some nerves to spare you can get the latest development version of XFree86 from the public CVS repository. Note that the code is under constant development; what you get today is usually not the same as what you got yesterday.
To install, follow the XFree86
CVS instructions to download the xc module.
Then, follow the source build instructions above.
3.6 Replacing X11
If you have already installed one of the Fink X11 packages but for one reason or another have decided you need to remove one and replace it with another, the procedure is pretty straightforward. You will have to force a removal of the old packages, and then install the new, to keep your dpkg database consistent.
There are two different ways to do this:
-
Use FinkCommander
If you are using FinkCommander, you can force removal through the menu. For example, if you have
xfree86-rootlessinstalled, but want the threaded version, you can select yourxfree86-rootless,xfree86-rootless-shlibs,xfree86-base, andxfree86-base-shlibspackages, and then run:Source -> Force Remove
-
Manually Remove from the Command-Line
To manually, remove them, you use the
dpkgwith the --force-depends option, like so:sudo dpkg -r --force-depends xfree86-rootless\ xfree86-rootless-shlibs xfree86-base xfree86-base-shlibs
Note that if you have apps that require threaded XFree86, you may have trouble with your dpkg database if you force remove it and install a different XFree86 package or placeholder package.
If, on the other hand, you have an X11 version that was not installed via Fink, you'll need to remove it via the command line:
sudo rm -rf /usr/X11R6 /etc/X11
The above holds true for removing any flavor of X11 that you didn't install through Fink. You will also need to remove XDarwin.app |
X11.app, depending on what you had installed. Make sure to check your .xinitrc if you are removing Apple's X11 to
make sure that you aren't trying to run quartz-wm. You can now install whatever new X11 variety you want, manually or via Fink.
3.7 Fink package summary
A quick summary of the install options and the Fink packages you should install:
| Install Type | Fink packages |
|---|---|
| XFree86-4.4.0 or 4.5.0 (10.3 and 10.4) |
|
| X.org-6.8.2 (10.3 and 10.4) |
|
| Apple's X11 (all versions) |
|
| XFree86-4.x official binaries |
|
| XFree86-4.x built from source, or from the latest CVS source |
|
| XFree86-4.2.1.x (10.2 only) or 4.2.0 (10.1 only) |
or |
Next: 4. Starting X11