FreeBSD Part 2

Okay, it's Monday, and I haven't been babysitting any compilers lately, so it's time to make some progress on my laptop. In part 1, I got the basic OS installed, and a working X desktop. The next step is to install an easier (and prettier) window manager. Because of my desire to have the system run efficiently on this old hardware, I've decided to experiment with my first XFce window manager.

So, I realize I updated my ports tree in the last section (using csup). However, I'm finding there's a few more updates available when using portsnap, so I'm going to do that now for the first time:

portsnap fetch
portsnap extrac


This gets me a more up-to-date Makefiles and whatnot. The next part is to build the window manager itself:

cd /usr/ports/x11-wm/xfce4
make install distclean


Here's where things get complicated. This port won't just install. Keep in mind this is a fresh install, with a very fresh ports tree. Maybe systems that have been upgraded incrementally don't have this problem.

The first failure in building XFce has to do with something called "XCB." I started by assuming this had something to do with the X cut buffer (maybe it does, but it's really not clear what this is). Apparently, XFce needs version 1.4, and instead of the makefile using a regular dependency (which should upgrade "XCB"), it decides to just bombs out. Okay, no big deal. The first problem is that "XCB" is not the X cut buffer found at /usr/ports/x11/xcb. It's actually libxcb found at /usr/ports/x11/libxcb. This took a modest amount of Googling to figure out.

But, Google knows all, so we just upgrade libxcb:

cd /usr/ports/x11/libxcb
make deinstall
make clean
make install distclean


Woohoo, I have a nice, new libxcb! Let's continue...

cd /usr/ports/x11-wm/xfce4
make install distclean


The second failure is a complaint that some port called "py25-cairo-1.8.8" can't be built because it needs Python 2.6. Odd. But, okay, no huge deal:

cd /usr/ports/lang/python25
make deinstall
cd /usr/ports/lang/python26
make install distclean
rehash


Back to XFce. Surely, there won't be any problems now...

cd /usr/ports/x11-wm/xfce4
make install distclean


Well, not so fast, Mr. Unix Guy. Something says "xml2po" is "not found." Whatever that program is, it certainly is there. After digging up some posts on the FreeBSD message boards, it turns out there are a few ports that don't like Python 2.6 (but I need it to get through building XFce). I'm not sure how people figure this stuff out, but a poster on the boards suggests updating /usr/ports/textproc/gnome-doc-utils:

cd /usr/ports/textproc/gnome-doc-utils
make deinstall
make clean
make install distclean


Of course, it wouldn't be an interesting story if that didn't fail in some way. And, it does. This is easier to figure out, though, as the configure script tells me exactly what's wrong. textproc/py-libxml2 is out-of-date.

cd /usr/ports/textproc/py-libxml2
make deinstall
make clean
make install distclean


That goes perfectly smoothly. Wait, it doesn't go smoothly at all (sorry, I'm remembering the good times with FreeBSD 4.10 at the moment). Trying to upgrade py-libxml2 bombs out saying I should try to "make reinstall" instead. Okay, Mr. Makefile, here you go:

make deinstall
make reinstall


Nope, same problem. Let's try the final suggestion:

make install -DFORCE_PKG_REGISTER

It works! Although, I don't like forcing anyone to do things they don't want to do. But, that's over, and we can go back to the last thing that failed:

cd /usr/ports/textproc/gnome-doc-utils
make install distclean


To my surprise, it succeeds! Continuing with XFce:

cd /usr/ports/x11-wm/xfce4
make install distclean


This, too, finishes normally. Well, it was touch-and-go for a little bit, but everything is, at least, compiled. Finally, let's get our desktop services running by adding these lines to /etc/rc.conf:

linux_enable="YES"
hald_enable="YES"
dbus_enable="YES"
polkitd_enable="YES"


I'll also create the X startup file at ~/.xinitrc:

echo "startxfce" > ~/.xinitrc

Now, it's time to reboot the system (easy way to get all the basic daemons started). I log in and run startx, and we're off and running! XFce starts up quickly. It complains about the host name (since I don't bother with DNS for my laptop), so I just add the host name to my /etc/hosts file under the localhost aliases.

The first thing I don't like about X is the fonts. This has been a problem for a long time, and it's obvious no one has made any great strides in building modern font families for distribution under a BSD license. But, that's not a deal breaker. I just happen to have another operating system handy with some more up-to-date fonts in TrueType formats. I just copy a few select families over to the /usr/local/lib/X11/fonts/TTF directory. Then, run mkfontdir in that directory to update the index. Now, XFce will let you pick any of those new fonts. On my LCD panel, I also select appropriate stroke hinting algorithms to make the fonts look clean and smooth.

Another finishing touch is that XFce is expecting an X-based screen saver. Otherwise, it seems to try to suspend my video output, and fails brilliantly. I can't resume my session, and no TTYs (via CTRL+ALT+F#) will display on the screen. Just hitting the key sequence, works, though: CTRL+ALT+F2, type "root", hit enter, type the password, hit enter, type "reboot" hit enter.

Thus to get around this, I just install xscreensaver:

/usr/ports/x11/xscreensaver
make install distclean


So, after about 6-8 hours of compiling (a few times, the system was waiting for me to select build options, so maybe it goes faster if I'm staring at the screen most of the time), I have a fairly attractive, and minimalistic window environment. It looks good, and is very responsive to input. The companion programs for XFce (file browser, terminal, etc), are very fast to load. So far, I don't feel I've wasted my investment of time.

In the next article, I'm going to go over installing the necessary GUI applications (browser, media player, etc). As of writing this, I'm still not confident I can figure out the last problems preventing media players to use the video overlay, so this series of articles still has a mysterious ending (even for me).