Building packages with haikuporter

HaikuPorter is a python tool that takes a so-called recipe that describes the dependencies of a software and how to download, build and package it.


This is a companion discussion topic for the original entry at https://www.haiku-os.org/blog/humdinger/2017-02-22_building_packages_with_haikuporter/
5 Likes

Nice writing! Would have been nice also 5 years or so ago :slight_smile: Kudos Humdinger! +1

Great help! Just finished following your tutorial…
I think I got it! At least it is working so far.

Very good writing very clean and easy to understand
… >>no look here and more details here and there anymore<<
thanks alot…

hopefully I can use it now…

Two questions I have:
you wrote:

“If something goes wrong and you want a fresh start, open the folder of the recipe you try to build and delete all folders starting with “work-”. Also delete the “download” folder if you suspect a corrupted source archive.
Do a “haikuporter artpaint -c” for ArtPaint as example.”

For what and why I have to do a "haikuporter artpaint -c"
what is the -c doing?

Second:

which will be time-consumingly recreated with the next build.

That means it will be created the first time (creating all those files in haikuports)?
Starting “hp artpaint” for example?

hp --help says “clean the working directory of the specified port”.
I think it not only removes the “work-” folders. At least I think it resolves also an issue where haikuporter doesn’t find a file “.DependencyInfo”.

[quote]Second:

which will be time-consumingly recreated with the next build.

Is it happen the first time too (creating all those files in haikuports)? Starting “hp artpaint” for example?
[/quote]

Yes. So the first time you build something, it takes some time. After that, building is much faster.

Very very good I am really happy I got it to work finally… thanks again great work…

Humdinger makes Haiku easy again!:grinning:

Ah ok that makes sense…

In the copied haikuporter.config file the tip is different:

Tip:
Put this into your ~/config/settings/profile (a text file that you
have to create if it doesn’t exist already):to search for a string in all
recipes with “inrecipe {searchstring}” and build a package with
"hp {packagename}" (adjust your /path/to/your/haikuports/):

function inrecipe { grep -n $1 /path/to/your/haikuports/*/*/*.recipe; }
export -f inrecipe

alias hp="haikuporter -S -j2 --get-dependencies --no-source-packages"

=================================================================<<<
what does the function inrecipe do?
Do I need to adjust the path to haikuports?
do I need to uncomment it too?

“inrecipe” searches though the recipes for some text. It’s not really relevant for just building packages.
Those functions can be added to the “profile”, just like with the “hp” alias. If you add it, you need to adjust the path. I think the above “inrecipe” function doesn’t work anymore as described there.

I have these in my profile:

. ~/config/settings/haikuports.conf
function findrecipe() { find $TREE_PATH/* -maxdepth 2 -name $1*.recipe; }
function inrecipe()  { find $TREE_PATH/* -maxdepth 2 -name "*.recipe" -exec grep -ni --colour=always $1 {} \; -printf "\033[33;1m%p\033[0m\n"; }
function inpatches() { find $TREE_PATH/*/*/patches/* -exec grep -ni --colour=always $1 {} \; -printf "\033[33;1m%p\033[0m\n"; }

Only the “findrecipe” might be interesting, as it’s faster than “hp -o” to find a recipe.

ah ok stupid I…
I made a file called “profile” which is wrong! I just has to uncomment the line in the haikuports.config file… which is in fact the “profile” file!
thx

No, you were correct. :slight_smile:
The alias (and the findrecipe etc. functions) belong into a file ~/config/settings/profile.
The ~/config/settings/haikuports.conf file only has that tip at the top. In it you uncomment the architecture lines and edit TREE_PATH and PACKAGER.

Really clear and useful information. Thanks for sharing it!!! :beers:

Thanks for this tutorial, Humdinger.

Hi,
I added _x86 to the recipes names, but it didn’t work. I tried it with both bepdf (hp bepdf_x86) and dosbox. It says

Error: bepdf_x86 not found in repository
EDIT I didn’t uncomment SECONDARY_TARGET_ARCHITECTURES=“x86” in the config file. Now it works.

hp -s is a good way to search for packages in the tree also :slight_smile: