Building Haiku on Ubuntu Linux, Step by Step

Article contributed by leavengood on Sat, 2007-07-21 04:11
2010-January: This document is now obsolete. We are in the process of consolidating and re-organizing the website documentation. For now please refer to the in-progress website documentation.

Another article on this site already describes the basics of building Haiku on Linux. Since my distribution of choice is Ubuntu, I decided to get Haiku building on it and then provide a detailed step-by-step guide for others to follow.

I performed these steps on a fresh Ubuntu 7.04 (Feisty Fawn) install, but they should be similar for other versions and probably the same for most Debian-based distributions.

  1. Install the needed packages for building:
    sudo apt-get install subversion yasm autoconf automake texinfo flex bison gawk build-essential
  2. Create the Haiku development directories and get the Haiku build tools source:
    mkdir develop
    cd develop
    mkdir haiku
    cd haiku
    For anonymous checkout:
    svn checkout http://svn.berlios.de/svnroot/repos/haiku/buildtools/trunk buildtools
    For an existing Haiku developer:
    svn checkout https://developername@svn.berlios.de/svnroot/repos/haiku/buildtools/trunk buildtools
  3. Build and install the Haiku Jam:
    cd  buildtools/jam
    make
    sudo ./jam0 install
    cd ../..
  4. Get the Haiku source (this will take a while): For anonymous check-out:
    svn checkout http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk trunk
    For an existing Haiku developer:
    svn checkout https://developername@svn.berlios.de/svnroot/repos/haiku/haiku/trunk trunk

    If there are any errors when checking out above, just cd into the trunk directory and type "svn up" to get any missed files. This also applies when updating the code in the future.

  5. Build the cross compiler tools (GCC 2.95):
    cd ~/develop/haiku/trunk
    ./configure --build-cross-tools ../buildtools/
    To build with GCC 4.x the configure line is:
    ./configure  --build-cross-tools-gcc4 x86 ../buildtools/

    But keep in mind this will produce binaries which are not compatible with BeOS.

  6. Build the Haiku image:
    jam haiku-image
    To build for testing in VMWare:
    jam haiku-vmware-image

    A VMWare configuration file for running this image can be found at 3rdparty/vmware/haiku.vmx

That is it! Not too bad. Thanks to Ingo and the various other contributors for making the Linux compiling so easy.

Comments

Re: Building Haiku on Ubuntu Linux, Step by Step

Thanks for the tutorial Ryan! I was able to build the Haiku VMware image on the first try.

Re: Building Haiku on Ubuntu Linux, Step by Step

Quote:

Thanks for the tutorial Ryan! I was able to build the Haiku VMware image on the first try.

Great! I wanted to make it as painless as possible. Of course most of the credit for this goes to Ingo and friends for making our nice build system.

Re: Building Haiku on Ubuntu Linux, Step by Step

Quote:

Great! I wanted to make it as painless as possible. Of course most of the credit for this goes to Ingo and friends for making our nice build system.

Well I will also say thanks to Ingo and Friends as well :). I managed to get it built and even copied it to a partition and made it bootable. Unfortunately Haiku doesn't like my hardware much but the VMware image works well.

Re: Building Haiku on Ubuntu Linux, Step by Step

Question: How do I use this image?

Re: Building Haiku on Ubuntu Linux, Step by Step

Basically these are raw disk/partition images, so you can either copy them to a physical partition and launch Haiku natively, or you can use them in a virtual machine.

Perhaps this is a better article for you:

http://haiku-os.org/documents/dev/installing_haiku_to_a_partition_from_l...

I apologize for the short, and somewhat uninformative reply, but these are basically the same images created for download on the factory site (where you'll find links to various virtual machine links):

http://haiku-os.org/build_factory

and HaikuHost:

http://haikuhost.com/

also some links here:

http://haiku-os.org/downloads

Re: Building Haiku on Ubuntu Linux, Step by Step

I got successfully to the last step, but now I'm stuck. I have read through both readme files in haiku/trunk to no avail. Type 'jam haiku-image', get back "No 'BuildConfig' found in generated/build! Run ./configure in the source tree's rood directory first!" I have tried ./configure in ~/develop/haiku/trunk/generated/build and ~/develop/haiku. I get back bash: ./configure: No such file or directory. I understand this is a noob question, but I'm trying and willing to learn so give me a shot. What is the source tree's root directory? and what in there needs to be configured?

Re: Building Haiku on Ubuntu Linux, Step by Step

Hi berzirker,

I think unfortunately right now the build tools are in a state of flux and I suspect step 5 above may have failed for you because of this. To fix this you can checkout a working revision of the build tools by going to the buildtools directory (which should be ~/develop/haiku/buildtools if you followed the above exactly) and typing the following:

svn update -r 24507

This will update the build tools code to the last working revision, which was 24507. If you then repeat steps 5 and 6 it should work.

The configure file that is being complained about is in the ~/develop/haiku/trunk directory and that is what you use in step 5 above. I suspect that failed because apparently it did not create the BuildConfig file you need to build.

Here is the mailing list posting that describes the problems with the build tools:

http://www.freelists.org/archives/haiku-development/03-2008/msg00454.html

Hope this helps,
Ryan

Re: Building Haiku on Ubuntu Linux, Step by Step

4.

For anonymous checkout:

svn checkout http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk trunk

For an existing Haiku developer:

svn checkout https://developername@svn.berlios.de/svnroot/repos/haiku/trunk trunk

Re: Building Haiku on Ubuntu Linux, Step by Step

luroh wrote:

4.

For anonymous checkout:

svn checkout http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk trunk

For an existing Haiku developer:

svn checkout https://developername@svn.berlios.de/svnroot/repos/haiku/trunk trunk

Thanks, I have updated the article, though I wonder if the second URL should also have the two haiku directories in its path?

Re: Building Haiku on Ubuntu Linux, Step by Step

Oops, yes I think you are right, looks like I forgot one /haiku in there.

Re: Building Haiku on Ubuntu Linux, Step by Step

Hello!
I'm running VirtualBox from sun is it possible to use this image with that too?

Re: Building Haiku on Ubuntu Linux, Step by Step

Quote:

I'm running VirtualBox from sun is it possible to use this image with that too?

This is probably not the best place to ask about virtualbox compatibility...

It can work, but requires hardware virtualization turned on.

See trac tickets here for more info:

http://dev.haiku-os.org/search?q=virtualbox&noquickjump=1&ticket=on

Re: Building Haiku on Ubuntu Linux, Step by Step

Oh, how I wish I had done this YEARS before! I can NOT believe how fast and easy getting and JAM'ing Haiku was within Ubuntu 8.10 (Intrepid Ibex) on Athlonica!

Mind you, "Athlonica" is the *EXACT SAME SYSTEM* I have been running BeOS R5 PE (Wind Distro) on for YEARS now, and downloading/JAM'ing Haiku on.

Now, for the amazing part...

In BeOS, to download the entire source tree for Haiku takes about 2 hours. I tried it in Haiku, it took about same amount of time.

In Ubuntu 8.10... it took a mere *25 minutes*!!!

In BeOS, to JAM Haiku the first time, takes about 2 hours.

In Ubuntu 8.10, it took a mere *45 minutes*!!!

Mind you, this is on the EXACT same hardware (Athlon XP 2000+ CPU, 512MB of RAM, nVidia Geforce 2 GTS, 20Gb UDMA133 ATA hard drive, 10Mbit/s Cox Cable Internet, etc.). No upgrades. No overclocking. Same cable Internet speed. Everything. And, yet, Ubuntu 8.10 does it SOOOOOOO much faster!

I am, to put it mildly... thrown to the floor and stomped flat, with amazement.

Now, if I can only figure out how to transfer (mount and copy) Haiku over to the BFS partition I already have on this drive. Someone wanna point me in the right direction? :-)

Re: Building Haiku on Ubuntu Linux, Step by Step

On Ubuntu 8.10 using GCC4.x requires the patch mentioned in ticket #3012:

http://dev.haiku-os.org/raw-attachment/ticket/3021/wnoerror.patch

Apply the patch with:

patch -p0 < wnoerror.patch

Additionally if you plan to use xattr make sure to also get the related development package:

sudo apt-get install libattr1-dev

Happy building ...

Re: Building Haiku on Ubuntu Linux, Step by Step

I just tried this and step 4, checking out, didn't work for me - subversion said that there was no repository there. I made a guess and tried:
svn checkout svn://svn.berlios.de/haiku/haiku/trunk trunk

and that worked. I can't change the article, but Ryan, you may want to. :-)

Re: Building Haiku on Ubuntu Linux, Step by Step

mphipps wrote:

I just tried this and step 4, checking out, didn't work for me - subversion said that there was no repository there. I made a guess and tried:
svn checkout svn://svn.berlios.de/haiku/haiku/trunk trunk

and that worked. I can't change the article, but Ryan, you may want to. :-)

I believe the original article had the above URL, but I changed it when that one stopped working (I believe Berlios made some change that broke the anonymous SVN, then they changed it back.)

The thing is, when I load http://svn.berlios.de/svnroot/repos/haiku/haiku/trunk/ in my browser it comes up, so SVN should be able to use it too.

Though if the SVN URL you used works I could change it back to that.

I should also maybe add Marcus' comments into the article. I'll look into it.

Re: Building Haiku on Ubuntu Linux, Step by Step

It would be useful to indicate that the manual is true for 32-bit architecture of the kernel Linux.
I have a Ubuntu x86-64 and the assembly process is not completed successfully.
Or, in this case, the assembly does not depend on the architecture of my OS?

Re: Building Haiku on Ubuntu Linux, Step by Step

fidaj wrote:

It would be useful to indicate that the manual is true for 32-bit architecture of the kernel Linux.
I have a Ubuntu x86-64 and the assembly process is not completed successfully.
Or, in this case, the assembly does not depend on the architecture of my OS?

If you want to build on a 64bit Linux just use the 32bit subsystem, which can be invoked with the linux32 command.

Re: Building Haiku on Ubuntu Linux, Step by Step

rossi wrote:
fidaj wrote:

It would be useful to indicate that the manual is true for 32-bit architecture of the kernel Linux.
I have a Ubuntu x86-64 and the assembly process is not completed successfully.
Or, in this case, the assembly does not depend on the architecture of my OS?

If you want to build on a 64bit Linux just use the 32bit subsystem, which can be invoked with the linux32 command.

Thanks!

Re: Building Haiku on Ubuntu Linux, Step by Step

Developer checkout for step 2:

svn checkout https://developername@svn.berlios.de/svnroot/repos/haiku/buildtools/trunk buildtools

Re: Building Haiku on Ubuntu Linux, Step by Step

We're also switching protocols inconsistently between step 2 and 4.

IIRC, this was because at one point svn:// stopped working, but http:// still worked.

Likewise, I had always thought that svn+ssh:// always worked for developers, but I guess https:// works as well.

Perhaps we need a subpage that explains all the various ways that someone can obtain the sources if a single anonymous method isn't appropriate (including downloading a tarball and not using SVN at all if desired, or even using git-svn).

Re: Building Haiku on Ubuntu Linux, Step by Step

umccullough wrote:

We're also switching protocols inconsistently between step 2 and 4.

Please be specific indicating what change(s) are required, so that the document can be modified accordingly.

Re: Building Haiku on Ubuntu Linux, Step by Step

http:// and svn:// are both suitable for anonymous svn access svn+ssh:// and https:// are both suitable for developer svn access

At one point, svn:// stopped working for a couple days, so http:// was used instead, but then it was changed back.

My point was that mixing the protocols in the guide doesn't make sense - they should either be http:// or svn:// but it doesn't make sense to mix them here. If anything, it should list both options in the event that one fails to work - but http:// seems to be more reliable, even though I believe it is actually slower (I can't verify this currently, but I suspect it is).

Re: Building Haiku on Ubuntu Linux, Step by Step

umccullough wrote:

My point was that mixing the protocols in the guide doesn't make sense - they should either be http:// or svn:// but it doesn't make sense to mix them here.

OK. So, which protocol should be the first choice and which the alternative?

Re: Building Haiku on Ubuntu Linux, Step by Step

http:// has been proven more reliable from berlios.de, and I also remember now that it's more likely to work through strict corporate firewalls and such.

Re: Building Haiku on Ubuntu Linux, Step by Step

umccullough wrote:

http:// has been proven more reliable from berlios.de, and I also remember now that it's more likely to work through strict corporate firewalls and such.

Yes, I agree that http:// should be the first choice, as svn:// has gone down from time to time on me. I admit last night though that I blindly copied from this page without looking, and now have the two mixed again, as I did on my last setup until I made them the same. I don't like the inconsistency either, as the only benefit of having them mixed is to see if the other method happens to be broken.

From the average user's point of view, http:// seems to be the way to go, even if svn:// seems to give the impression of being snappier.

Re: Building Haiku on Ubuntu Linux, Step by Step

@Joseph

You can still use svn switch to change the URL of your local repo - I apologize if I don't have the exact commandline here, but you should be able to find info on it in the svn help

- Urias

Re: Building Haiku on Ubuntu Linux, Step by Step

umccullough wrote:

You can still use svn switch to change the URL of your local repo - I apologize if I don't have the exact commandline here, but you should be able to find info on it in