Installing applications

With the advent of package management, there are now different ways to install an application.

1. A proper .hpkg package

Either installed automatically via HaikuDepot or with pkgman in Terminal, e.g. WonderBrush, or downloaded off some site. When using HaikuDepot or pkgman, you're all set. If downloaded somewhere else, just move the .hpkg file into /system/packages/ and (in case of an application) it'll appear in /system/apps/.

2. An "old", self-contained archive

Those come traditionally in form of a zipped up folder. As before, you can unzip that anywhere in /boot/home/ (besides ~/config/ which is read-only) and launch the app just like you did before package management.

3. An "old" archive that has files to spread around

This is the case where you used to unzip the archive anywhere and had to invoke an install script or copy some files to special locations. Think of screen savers, translators or similar things. Since the file system hierarchy has changed a bit and some folders became read-only, those apps don't work any more out-of-the-box. You have two choices to get them working:

3.1 The non-packaged folder

Under ~/config/non-packaged/ you can recreate the needed file hierarchy. Let's take for example the very convenient tool TextBank (meanwhile the app has vanished from the interwebs, but it can still serve as example), that provides a history and templates of the clipboard. After unzipping it to ~/config/non-packaged/apps/ you can launch TextBank, but it doesn't yet do anything. The input_server add-ons TextBankAssistantPasteSender and TextBankAssistantSpy aren't yet in the right place in the filesystem and therefore aren't picked up by the system.

TextBank offers to install these files in its preferences, but since the changed hierarchy due to package management, that doesn't work anymore. You'll have to do that manually by creating the needed folders and copying the corresponding file:


The next time you boot up (or restart the input_server from Terminal with "/system/servers/input_server -q") it should work.

3.2 Making it into a proper .hpkg package

The non-packaged folder route is a bit unwieldy if you're updating your system from scratch often. Here is how you create a .hpkg of TextBank:

You create some folder "SomeFolder" and within it the subfolders "apps", "add-ons/input_server/filters/" and "add-ons/input_server/devices/".

Then unzip the TextBank archive under "apps" and move "TextBankAssistantPasteSender" and "TextBankAssistantSpy" in their corresponding folders you just created.

Now, the hardest part, you have to create the text file ".PackageInfo" in the top folder "SomeFolder". The exact syntax of that file is described in the Building Packages documentation. Also, .hpkg files opened in Expander (check "Show contents") can be educational. It'll look something like this:

name			textbank
version			5.3.2-1
architecture		x86_gcc2

summary			"A tool to provide clipboard history and more"
description		"Useful text provision tool (Clipboard history/template/time & date...)"

packager		"Humdinger "
vendor			"SHINTA"

copyrights		"SHINTA"
licenses		"MIT"

provides {
			textbank = 5.3.2-1

Note, the license is actually Creative Commons, but that doesn't exist yet under /system/data/licenses/. You could create your own of course, but that would lead us astray for this educational example. Hope SHINTA doesn't mind... :)

Finally, let's create the actual .hpkg file. Open a Terminal at "SomeFolder" and type:

package create -b textbank.hpkg

That creates an empty package with just the .PackageInfo. Continue with:

package add textbank.hpkg apps add-ons

And there we are. Put into ~/config/packages to install and TextBank will appear under ~/config/apps/

[Edit 14.10.2013: corrected path, thanks Giovanni.]