How to create a simple port

Hi,

can anyone recommed a simple howto to create an easy port, e.g. neovim or ansible ?

Compile the program you want, see where it breaks.
When changes need to be made, look though the Haiku API, and realise that system files are immutable. Some directories have a non-packaged variant where files can be installed. Once that works, lay out the files in a sub-directory which has internal paths that mimic a real system, and build a package! This is over simplified, but should get you started.

3 Likes

Maybe this blog will help you: https://medium.com/@probonopd/my-fifth-day-with-haiku-lets-port-some-apps-e0f26487cea7

3 Likes

There is documentation in the haikuporter wiki, A Gentle Introduction to HaikuPorter #1 · haikuports/haikuports Wiki · GitHub is a good starting point I think

2 Likes

Neovim is NOT an easy port. Stop assuming an easy ride and invest time in learning the differences to be able to create a proper port. If you dont like to spend time for this you will have a hard time or you will abandon your plan really quickly. You decide.

1 Like

Hi. I guess we can split the topic in two: First, how to get the desired application compiled successfully on Haiku (first problem), and then, how to create the proper HPKG using Haikuports (second problem) :slight_smile:

I am not a developer, but a random guy that managed to port some simple apps into Haiku, so maybe I am not the best one to guide you, but this is what worked to me:

  1. Search for the simplest application: could be a CLI or a simple Qt application. Is best to take some “Hello World” example from the Qt site. Then, try to compile this one on Haiku. This will help you to understand the most basic usage (for example, I had a hard time until I realized that, on 32 bit version, I need to use setarch x86 before trying to compile something using the modern C++).

  2. Look at the dependences before start to work: most apps needs libraries that are not already ported to Haiku.

  3. At first, just try to build the application manually (I mean, without using Haikuport’s recipes).

  4. When you managed get the application built, and are sure it works fine, then you can try to write a recipe file to get the proper HPKG file.

Until you get comfortable with the process, try to stick to simple apps.

Hope this helps!

.

1 Like

qt apps usually relatively easy port…

Not sure it’s helpful, but I gathered some information (mainly for myself) at: Checking a new port · Begasus/haikuports Wiki · GitHub

@extrowerk what is the difficulty of porting neovim consist in ?

Checked neovim depencies, probably some libs are absent in Haku ?

https://archlinux.org/packages/community/x86_64/neovim

ansible requires only python depencies and might be easy to port:

https://archlinux.org/packages/community/any/ansible/

neovim was a fork off nvim to get rid of legacy crust, like us :wink:

think they wanted to get rid off linux/gpl bazaar paradigm legacy and turned towards cafedral unix, and especially from overly bloated code, but we are modern and innovative! :wink: and Haiku much more elegant and elitist than the Amiga OS was and is.

I have tried to port neovim years ago, but some dependecies made a headache. I dont recall if it was libluv or libvtermkey or something else. Feel free to dive in.

1 Like

The easiest way to port is to use the HPKG package builder directly. This is sub-optimal to a full blown ports dev kit on you computer, but is easy for one-off ports. See:

1 Like

Note that I’m not encouraging public face usage of a web server on Haiku. I suspect the devs would tell you not to do it, since Haiku is beta software. However; for my intranet (not internet) usage it is fine, since there is no connection to the real internet for it.

That and, the whole “haiku is not a server and isn’t designed with security for that in mind” stuff : )

1 Like

but creating Haiku server edition fork would be awesome, with multiuser support at least. in the case of security, its possible to hide the machine with haiku behind nat and forward ports to it.

NAT and port forwarding does not add security, just complexity

From the homepage:

Haiku is an open-source operating system that specifically targets personal computing.

Overall if you want to make a port it is best if it is for software you want to use, and if it is your first time it is best to try something a bit simpler. So Neovim would be more challenging and probably frustrating. Also it is good to check previous work on that.

For example someone tried to port Neovim about 6 years ago and they documented it on GitHub: Try to build neovim in haiku · GitHub

It would be good to read things like that and maybe try to build off their work or knowledge. Though over six years maybe neovim (in this example) has changed enough that the above is useless. But probably not.

If you want an idea, I would like to see pianobar ported: GitHub - PromyLOPh/pianobar: Console-based pandora.com player

It lets you listen to Pandora.com music (without ads) from within a terminal. I have used it on Windows and macOS. It uses libao for audio, and this is in HaikuPorts, though in this bug extrowerk notes it may have some bugs as the audio quality was not good for cmus. Of course when I get a chance I will try to port it, so this is just an idea and don’t feel like you need to port it for me. But mainly I wanted to show the level of complexity that might be good for a first port. It uses a few libraries but not a ton and I think most already work on Haiku.

2 Likes