Building packages with haikuporter

1. Getting HaikuPorter and the Recipes

Get the HaikuPorter tool and the haikuports tree with all the recipes:

git clone https://github.com/haikuports/haikuporter.git --depth=50 git clone https://github.com/haikuports/haikuports.git --depth=50

That'll create two directories: "haikuporter" with the python tool and "haikuports" with all the recipes categorized in sub-folders. --depth=50 limits the cloning to the last 50 commits to save download time and disk space.

2. Setting up HaikuPorter

Put HaikuPorter into the system's “Path”, so it can be invoked like any other command:

cd haikuporter ln -s haikuporter ~/config/non-packaged/bin/

Copy and edit the haikuports configuration file:

cp haikuports-sample.conf ~/config/settings/haikuports.conf lpe ~/config/settings/haikuports.conf

In the haikuports.conf file you have to edit/un-comment the lines:

TREE_PATH - where you cloned the haikuports tree, e.g. "/boot/home/haikuports"

PACKAGER - your name and email address, e.g. " Humdinger <humdinger@mymail.com> "

" TARGET_ARCHITECTURE="x86_gcc2"

SECONDARY_TARGET_ARCHITECTURE="x86"

This is for running the official 32bit Haiku (gcc2hybrid), where the older gcc2 compiler is the default to maintain BeOS compatibility and "x86" is a modern compiler (currently gcc5.4) for applications that won't build with the ancient gcc2.

3. Using HaikuPorter

Now you can start using HaikuPorter. You get all its options with " haikuporter --help ".

In the haikuports tree, you search the recipe of the software you’d like to build. You can also use, e.g. " haikuporter -o artpaint " to have haikuporter look for a specific recipe, here for “ArtPaint”.

To build ArtPaint, you type:

haikuporter -S -j4 --get-dependencies --no-source-packages artpaint

-S : enforce "strict policy" to create standard compliant HPKGs.

-j4 : use 4 cores when building to save time.

--get-dependencies : automatically download all packages needed for building that aren’t already installed.

--no-source-packages : don’t create a package with the source code.

artpaint : build the latest recipe for "ArtPaint".

You find successfully built packages in the folder " haikuports/packages ".

4. Keeping uptodate

The haikuports tree receives almost daily changes with new, updated and fixed recipes. To stay abreast with those changes, you should regularly update. This is very easy with " haikuporter --get ".

Likewise, haikuporter itself gets updated from time to time. At the latest if recipes start to fail building, you should update. This, too, is quite easy; you enter the directory "haikuporter" that you have cloned in the 1st step and use git to pull in all changes:

cd haikuporter git pull

5. Tips & Tricks