HOWTO - Download and build Haiku under R5

Because Haiku is still in the development stage, there are a lot of things about it that are just plain hard. This document aims to help with that.

WARNING: This document assumes that you can navigate around the hard drive, make links (called shortcuts by Windows), know what the Terminal app is for, and have a basic level of computer literacy. If you do not fit this description, you should wait for Haiku's official release so as not to wreak havoc on your computer.

There are three ways to play with Haiku: building Haiku to boot it on your computer, building Haiku to run under BeOS, and building Haiku to run under VMWare or VirtualPC. This document covers the first two. The nice thing is that neither of these two methods is all that different until near the end. If you intend to boot Haiku you will need to have a spare partition available on your hard drive in addition to your BeOS partition.

Requirements:

  1. Existing BeOS installation
  2. At least 256MB RAM on your machine
  3. BeOS developer tools
  4. Oliver Tappe's gcc 2.95.3
  5. subversion
  6. jam
  7. internet connection
  8. time

BeOS Developer Tools

The developer tools are not automatically installed when you install BeOS. If you are running Personal Edition, it's not even an option at install time. You can tell if it's installed if the folder /boot/develop/BeIDE exists. If you don't have them, you can obtain them here as the file BeOS5-DevTools.zip :

Download (if you need to): http://ftp.bebits.com/pub/beos/

One word of warning to dial-up users: the tools are 19 Megs, so make sure you _really_ want to download the file before doing so.

To Install:

  1. Double-click on the file to start Expander
  2. Change the Destination box to /boot
  3. Click Expand

Oliver Tappe's gcc 2.95.3

GCC stands for Gnu C Compiler. For those unfamiliar, it is a program for turning source code files into programs. The one which comes with the BeOS Developer Tools sometimes runs into problems with the code in Haiku and -- amazingly enough -- sometimes it's not bugs in the Haiku code, either. This version produces better code and doesn't suffer from the bugs that the stock version does.

Download: http://www.bebits.com/app/4011. Download the Legacy version.

To Install:

  1. Double-click on the file you downloaded to start Expander
  2. Change the Destination box to /boot/home/Desktop and click Expand
  3. Open the folder on your Desktop marked gcc-2.95.3-beos-041202
  4. Double-click on the file marked gcc-2.95.3_binutils-2.15.zip
  5. Change the Destination box to /boot/develop/tools and click Expand
  6. Navigate on your BeOS drive to /boot/develop/tools. You should see three folders - experimental, gcc-2.95.3_binutils-2.15, and gnupro.
  7. Rename gnupro to gnupro.old
  8. Right-click on gcc-2.95.3_binutils-2.15, move down to Create Link. If you should see an item in the menu marked 'Current Folder', click on it. If not, just navigate to your BeOS disk, then develop, and then click on tools. If you have done it correctly, you should now see 4 folders in the window for /boot/develop/tools. Two of them will start with gcc-2.95.3 and one of those two will have its name underlined.
  9. Rename this underlined file to gnupro. What we have done in the last several steps is installed the new GCC in a way that we can change back to the old one (if we need to) simply by deleting the link and renaming gnupro.old back to gnupro.
  10. Go to /boot/develop/headers and rename the folder marked cpp to cpp.old
  11. Navigate to the folder /boot/develop/tools/gnupro/include.
  12. Right-click on the folder marked g++ and move down to Create Link. This time, you will navigate to your BeOS disk, then develop and then click on headers.
  13. Navigate to that very same folder (/boot/develop/headers) and rename g++ to cpp.
  14. Navigate to the folder /boot/beos/system/lib. You will see a lot of files, but the one we want to concern ourselves with is the one marked libstdc++.r4.so. Rename this file to libstdc++.r4.so.old. When you initially go to rename this file, you will see a warning message about not being able to boot BeOS. Hold down the Shift key and click 'Do It' and do the rename. We receive this message because we are in an important system folder, but we aren't going to do anything to hose the system, right? :)
  15. Navigate to /boot/develop/tools/gcc-2.95.3_binutils-2.15/lib/ and find the file libstdc++.r4.so - this is the new version. Copy it to /boot/beos/system/lib
  16. You can safely move the gcc-2.95.3-beos-041202 folder on your Desktop to the Trash, if you wish.
  17. To summarize, we have:
    • Opened the package and unzipped the compiler to /boot/develop/tools
    • Substituted the gnupro folder with a link (with the same name) to the compiler's folder
    • Substituted the cpp folder with a link (with the same name) to a subfolder of the compiler's folder which contains the same kind of files (lots of .h files).
    • Backed up libstdc++.r4.so and copied the new one from the compiler's folders

Subversion

This app is what Haiku developers use to be able to work on the same files at the same time without stepping on each other's toes. More information can be found at Subversion's Website. However, you will need to download Haiku's Subversion package because it also comes with some other files which are related, but are not officially part of Subversion.

Download Page: http://haiku-os.org/develop.php

You want to download the .pkg file. After the disgustingly complicated installation for GCC, you will be pleased to know that Subversion is quite easy.

To Install:

  1. Double-click on the .pkg file. It may be in a .zip file - if it is, just use Expander and put it in /boot/home/Desktop first.
  2. I wrote the install wizard, so things should be relatively easy - just walk through the wizard and most things will be done for you.

Jam

Jam is a program that Haiku uses to manage building the entire OS.

Download Page: http://haiku-os.org/develop.php

  1. Double-click on the Jam zipfile to start Expander
  2. Change the destination to /boot/home/Desktop and hit Expand.
  3. You should just see a new file on your Desktop marked jam. Right-click on it, move down to Move to and then navigate to home, then config, and then click on bin.

Installing and Building Haiku

We are going to install directly from the Subversion tree to (a) make sure that we are up-to-date and (b) make it easier to keep it that way.

  1. Make a folder somewhere on your BeOS disk to contain all the files. I went to /boot/develop and made a folder named HaikuTree
  2. Start the Terminal application and go to this folder. For me, this would be the command cd /boot/develop/HaikuTree.
  3. Now we will use Subversion to go get the source code from the tree. Command: svn checkout svn://svn.berlios.de/haiku/haiku/trunk
  4. Barring problems, you should start seeing entries that look something like this:

    U  trunk/src/tests/kits/app/Jamfile
    A  trunk/src/tests/kits/app/DanoMessageTest.cpp
  5. Go find something to do for a few hours. Assuming that nothing goes wrong with the checkout, it will take quite a while. Future checkouts will not take nearly as long.
  6. When the checkout finishes, you will see a line something like this:
    Checked out revision [some number here]
  7. We are almost finished! While still in the Terminal type the command cd trunk to go from where we were into the top folder that we just checked out.
Here is where the two paths diverge, depending on what you would like to do.

Building to Boot Haiku
  1. Enter the command: configure. This sets up some internal settings on how Jam will build the tree, such as whether we're building for BeOS R5 or for Haiku
  2. Enter the command makehdimage /[name of your Haiku partition here minus the brackets]
  3. . For example, my Haiku partition is named (appropriately enough) Haiku, so I type 'makehdimage /Haiku'.
  4. Following this, go find something to do. makehdimage will build the entire tree, which on my Athlon XP 2200+ takes a few hours. Slower machines will obviously take longer.
  5. When it finishes, you will need to update your boot manager. If you're using BeOS' boot manager, just type bootman & from where you are and make sure that your Haiku partition is in the menu and you are done. :^)

Building to Use Haiku Components Under BeOS R5
  1. Enter the command: configure --target=r5. This tells Jam to build the tree for BeOS R5
  2. Enter the command: jam
  3. Once jam is running, go find something to do while the tree is built, which on my Athlon XP 2200+ takes a few hours. Slower machines will obviously take longer.
When the tree is built, you will have a number of nice components available to you to upgrade your BeOS installation. You can close Terminal and look around for yourself, but I will provide notes and caveats below.
  • Finished components can be found in the set of folders under trunk/distro/x86.R1/beos
  • The preferences apps are mostly finished, but most people won't have a use for them over R5.
  • AboutHaiku is the Haiku About box
  • CDPlayer is still in development as of this writing, but is easier to use than in R5
  • Haiku's ShowImage has more features than R5, and all of them are nice little ones
  • StyledEdit works pretty much the same, but has a few small tweaks and supports more text encodings
  • Haiku's Terminal has a few more features than BeOS', such as support for mouse scroll wheels
  • The bin folder contains updated versions of most command-line apps on BeOS R5. If you use Terminal a lot, you will find this *quite* useful
  • etc/fonts contains two font folders with the Haiku system fonts.
  • system/addons/Translators contains new translators for images under BeOS, including some image types not supported by BeOS by default
  • This list is not comprehensive, but the most of the other apps are just stock replacements for BeOS apps which operate almost exactly the same as the corresponding ones in BeOS.
Caveats

Some apps do not run because they depend on code specific to Haiku. This includes BitmapDrawing, consoled, Playground, ResizeLimits, Appearance (runs but doesn't do much), DriveSetup (currently not finished), and Fonts.

Because things are always changing in the tree, something may not build or the app may be buggy or not work at all. Haiku's major components work for the most part. The smaller ones may or may not.