TITLE: XFree86 4.2.99.x for the Brave and/or Foolish LFS VERSION: 4.0 AUTHOR: Dagmar d'Surreal EMAIL ADDRESS: Thou shalt not spam. <`echo qntzne@fcrnxrnfl.arg | rot13`> SYNOPSIS: This hint explains how to obtain and install a beta-release copy of XFree86 from CVS. EXPIRES: 2003-3-15 HINT: * * * First, a word of friendly advice * * * As with all software classified as being in BETA release, installation of the software packages mentioned in this document is _not_ meant to be used in a production environment, _nor_ is it meant for the weak of heart, _nor_ is it meant for beginners. Attempting to follow the instructions contained herein unsuccessfully could possibly render your system *unuseable*, and the author of this document will not be responsible for it. This upgrade should not under any circumstances be considered a trivial matter. You should carefully read this _entire_ document before following _any_ of the instructions listed here. Changes of this nature may not be easily reversible! If you happen to be a newbie, or even still smell like a newbie, you should probably wait for the public release of XFree86 4.3.0 which is being promised us Real Soon Now and search for a more formal set of instructions then. The only thing this document contains for you is forewarning about what changes might be necessary at that future date. * * * Now, on to something more informative * * * Changelog --------- 2003-Feb-17, Updated Appendix B with new libxml version Removed reference to old Bison dependency (yay!) Updated information about the "core" cursor theme Pushed forward the expiry since the XFree86 team did same Clarified reasons for Freetype2 symlinks in /usr/X11R6 Acronym cleanups Overview -------- I. Changes from 4.2.x II. Quick List of Prerequisites III. Obtaining the XFree86 Sources IV. Configuring the Build V. Compiling the Binaries VI. Installing VII. Configuration VIII. Extra Information Appendices A - Zlib Compression Library B - Libxml2 Library C - PNG Graphics Library D - Expat Library E - Freetype2 Library I. Changes from 4.2.x --------------------- XFree86 4.3.0 is a pretty sizeable change from 4.2.1 releases. There are better places (by far) to get a complete list of the changes, but the ones that will be most immediately noticeable to us will be the colored cursor changes, no longer having to build an external program to install one's own TrueType fonts, and the lack of the expected Xft configuration file. The last item in that list is a lot more dangerous than it would at first seem to be. The colored cursor changes are a nice feature which hasn't quite finished cooking yet at the time of this writing. The code itself appears to do everything that it is supposed to do, however, the cursors themselves may annoy you. The default theme for the new cursors is called "redglass" and your only other option at this time is called "whiteglass". Although I have been hearing a lot of complaints that redglass is ugly, whiteglass isn't much of an option because somehow the PNG images of it that were used to make the cursor files got a little broken, and some of the cursors have vertical lines sliced out of them. If you see this on your screen, now at least you'll know it's not a hardware issue. I'm sure this will be fixed in time for the final release (although they'll probably still be ugly--get cracking Gimp fiends!). It's not known whether or not the nVidia drivers (certainly more likely than the ATI ones) will work with this release, but if you enabled the hardware accellerated cursor shadow in your config, you'll probably want to go and turn it off. The shadows on these pointers are part of the image and not removeable. Two of them might look pretty weird. A quick rundown on how you now go about installing TrueType fonts can be covered in just three steps, provided you already have a directory named /usr/X11R6/lib/X11/fonts/TrueType on your system. First, install the font file into that directory to make it accessible to everyone. Second, in that directory, run `mkfontscale`. Thirdly, run `mkfontdir` as usual. There no more mucking around with running `xftcache` or `xset fp rehash` with this release and this is a good thing. By the way, I mentioned TrueType/ as the place to install ttf fonts because /usr/X11R6/lib/X11/fonts/TTF appears to be a special directory used by XFree86 which is always searched for fonts, and is set up when X is installed. If you never mess with this directory, it and the fonts in it will always work, and nothing you do in the TrueType/ directory will be as likely to bring your display to an unreadable state. The changes to the font system are, to my knowledge, one of the more wide- sweeping changes for the 4.3.x release. Some new default TTF font families with strange names have been added, and Xft has been replaced with a newer version that might have been called Xft2 if not for the fact that it looks like instead they're going to call the old one Xft1 and the new one just Xft. I know that seems confusing, and you should expect it to be confusing for a while yet until they get all the kinks out. Xft2 is not totally compatible with Xft1, either, so expect packages to build against one or the other, but not both. The minor unpleasantness is that because of this, if you use anything that links to or uses libXft, you'll likely have to upgrade it to the next beta release of whatever it was anyway (this includes Pango and Gnome!). For the time being, however, it all seems binary-compatible enough to not fall over and die when you upgrade X, but you might not be able to compile new things that expect the old versions of Xft around. (This might not be entirely correct, since I had some fontconfig problems, but I haven't yet seen evidence to confirm this one way or the other. This is not something you should spend more than 60 seconds worrying about tho'.) II. Quick List of Pre-requisites -------------------------------- This release of XFree86, presumably being more advanced than previous versions, has a slightly larger number of things that should be installed before you attempt to compile it. Mercifully, this release isn't hampered by ancient Bison syntax, so it doesn't really matter which version of Bison you have installed. The thing you will definitely need is CVS. The XFree86 page mentions a utility called CVSup which you should avoid like the plague. It'll only take a moment to install cvs if you don't already have it, and it requires no knowledge or finesse to use. Once tarballs are released you won't need this anymore. Like previous versions of XFree86, you will need to have shared library versions of Freetype2 and zlib installed on the system. Unlike previous versions, this version also needs libpng, expat, and possibly libxml2 as well. Libpng and Freetype2 may require additional attention on your part, so in the appendices you'll find careful documentation explaining how those two should be compiled to ensure they'll work. III. Obtaining the XFree86 Sources ---------------------------------- There are _no_ tarballs of the beta. I'll save you a *huge* amount of time by giving you another warning _against_ attempting to build CVSup for use in obtaining the source as the XFree86.org site mentions. Just use plain old cvs to get the source unless you _already_ have CVSup (and Modula-3) on your system and working. Building Modula-3 and CVSup can make compiling the JRE look easy. Not only will I tell you to use cvs, I'll give you the commands you use... CVSROOT=:pserver:anoncvs@anoncvs.xfree86.org:/cvs export CVSROOT cvs login cvs -z3 checkout -A xc ...if you stick #!/bin/sh in front of that, it's a perfectly useable shell script. Now find yourself a directory with about 700Mb of space free in it, and run that puppy. Enter "anoncvs" for the password and _wait_. Sometimes it takes cvs awhile to get going, particularly with massive trees of source code. You should be seeing some crazy network activity already. I was not joking about the 700Mb of space. Fully 350Mb of that will be source code, and it will need the rest of the space to compile. The good news is that the completed binaries will take up about the same amount of space on your system as the previous version of XFree86 did. After much time has passed, you'll have a fresh set of sources to work from. If you have any doubts about your compiler or expect to be doing strange things to the source tree, now would be a _very_ good time to make a tarball of the CVS source you just downloaded. Normally any time you wish to update your source tree you should be able to cd back into the directory _above_ the xc/ directory and reissue the exact same commands as above (it'll take awhile to check your files against the files on the remote server, but _far_ less time than downloading the whole thing again would), however for paranoia or out of habit a tarball might be handy for being able to nuke the entire source tree and restoring your copy of the source to a known state of sanity. IV. Configuring the Build ------------------------- While you can usually get away with skipping the creation of a a host.def file to control the build process, this results in a very generic build not very well matched to your system. Once you have read the appendices and ensured that the prerequisites are installed properly in your system, cd to the top level source directory (xc/) and then create a file called host.def in the config/cf/ directory containing the following lines -----8<----- #define HasFreetype2 YES #define HasZlib YES #define HasLibpng YES #define HasLibxml2 YES #define HasExpat YES #define UseExpat YES #define DefaultGcc2i386Opt -O2 -fno-strength-reduce -march=i586 -mcpu=i686 ----->8----- You may wish to edit the last line a bit with respect to the -march argument but for anyone on a pentium or better these lines will work fine. The Has* directives are really all that's necessary to get XFree86 to use your locally installed copies of the various libraries instead of building it's own versions. The UseExpat directive is there to enable XFree86's use of the expat library for handing various things. It appears that as long as expat is present, XFree86 won't bother to use libxml2, but that may or may not be entirely accurate. In any case, we definitely want to prevent XFree86 from building it's own version of libxml2 by issuing the HasLibxml2 directive. V. Compiling the Binaries ------------------------- Once everything is ready, shake your rubber chicken over the monitor, cross your fingers, and type: make World 2>&1 | tee world.log The build will take quite some time to complete, so be patient. I've been told that if you have already built the package once, and changes to the source tree have been made (if you're familiar with the output of CVS, make a log of what happens when you update your source so you can see if/when these happen), you can try using `make Everything` instead of `make World` to execute a partial rebuild of the sources without having the build scripts methodically obliterate everything that's already been compiled. If you're lucky enough for it to get all the way to the end on the first try, then congratulations are in order! If your build stops and complains about undefined references to "inflate" or "deflate" then you need to re-read the Appendices concerning how your library pre-requisites were installed. If you get any other kind of errors, well... this is a beta release and is not actually guaranteed to compile. Give it a few hours, re-run the cvs commands to see if updates to the source tree have been made, and then try _a second time_ before posting to a mailing list about it. VI. Installing -------------- Assuming everything compiled, now would be a good time to make backups of your important files, extra fonts, app-default customizations, KDM/GDM config, etc. You might also want to just make a backup of everything you're about to delete on a CDR or something but that's up to you. The one thing you should definitely now do is remove _all_ your old XFree86 files. This means the following: rm -rf /usr/X11R6 /usr/X11 rm -rf /var/X11R6 /var/X11 rm -rf /etc/X11 ldconfig This way you will be certain to get a clean set of binaries that won't be tripping over any leftovers from the previous install that might break things for you. Now that the way has been paved for your new installation, from the xc/ directory, enter: make install && make install.man && ldconfig If these should stop at some point and complain about something being missing (this happened to me with two unclean builds) then you may have gotten a few things built out of sequence, which is no real calamity. The first thing you should try (which worked both times for me and shouldn't be likely to be needed with a release tarball) is to simply cd into the subdirectory where files are supposed to be missing and type just plain `make`. If it runs for a little bit, building this and that, and then ends normally, cd back to the top level xc/ directory and run `make install` again. If this doesn't work, _then_ you can worry a little over it, but provided you have all the requisites installed properly, you should have no problems whatsoever. There is one last thing you must do, both for the sake of FHS-compliance and to satisfy the whimsy of some archaic applications you might wish to compile. You'll need to make some symlinks, using the commands below: ln -sf /usr/X11R6/include/X11 /usr/include/X11 ln -sf /usr/X11R6/lib/X11 /usr/lib/X11 ln -sf /usr/X11R6/bin /usr/bin/X11 Now you can restore your fonts (although don't put anything new into the /usr/X11R6/lib/X11/fonts/TTF directory!) and your app-defaults and your xdm/gdm/kdm configuration files, and prepare to configure XFree86 using whatever configuration utility you normally use to create a new configuration file. As before, edit the FontPath directives to include where you installed all your font files, but don't bother adding /usr/X11R6/lib/X11/TTF. As was the case with 4.2.1, this directory seems to be hard-wired as one that is always searched for fonts, and can save your bacon if something goes horribly wrong when you install some new broken TrueType font of your own into the /usr/X11R6/lib/X11/TrueType directory. VII. Configuration ------------------ After running your usual configuration tool (`xf86cfg`, or if that fails, `xf86config` is always a reliable console-only fallback) the usual caveats apply to things you may have to edit. You'll need to make sure the freetype module isn't commented out by default in the new configuration file. You'll still need to add the entries for your custom font directories in the FontPath section. You may _also_ now need to edit /etc/fonts/fonts.conf and in the top section add an entry for