Skip to content

HaikuPorterForPM

Jérôme Duval edited this page Nov 15, 2019 · 8 revisions

HaikuPorter

This page and its subpages describe the second version of HaikuPorter, which is intended to build packages for Haiku with the Package Management system. Each reference to HaikuPorter here and on any of the subpages means that second incarnation, not the first version of HaikuPorter.

Introduction

HaikuPorter is a command line Python application that, using the information contained in a HaikuPort's build recipe file:

  • fetches one or more original source code archives
  • extracts these archives
  • patches the sources for compilation on Haiku
  • builds the software in a chroot()-ed environment, which contains only packages required for building the port
  • creates one or more packages (*.hpkg) for distribution

HaikuPorter can automatically resolve any dependencies on other HaikuPorts that have been declared in the recipe file, i.e. if any of the required packages are missing, the port that produces those packages will be built first.

HaikuPorter itself needs two more things:

Build Recipe Files

For a particular version of a port a build recipe file specifies what packages shall be built for that port and the build recipe provides all required information for that purpose.

More info on build recipes is available at HaikuPorter-BuildRecipes and HaikuPorter-Guidelines.

Ports and Packages

Each port will produce a set of packages, typically a base package containing the main binaries/libraries of the port plus a source and a debug package. Ports that provide libraries will usually provide an additional development package, too.

All the packages built by HaikuPorter are being collected in the packages-folder of the ports tree.

The Repository

For each port, the most current version that has been marked as stable for the Haiku platform HaikuPorter is running on will be considered the active one. For all active ports, a .PackageInfo file representing that to-be-built package will be put into the repository-folder of the ports tree. Only this set of active package-infos will be considered during dependency resolution among ports.

More info on the repository is available on this subpage: The Repository.

Handling Requirements

HaikuPorter

HaikuPorter is implemented in Python, so that is required. Only modules from Python's standard library are used, so no additional modules need to be installed.

Apart from Python, HaikuPorter itself requires the following programs/packages:

  • coreutils
  • git
  • tar
  • unzip
  • wget
  • XZ-utils (for a port that comes as a '*.xz' archive)
  • the sources of ports are only available as VCS-checkout, so any of these VCS might be required:
    • bzr (Bazaar)
    • cvs
    • fossil
    • hg (Mercurial)
    • svn (Subversion)

Requirements defined by a recipe file

In order to be able to automatically resolve dependencies and build ports in the correct order, HaikuPorter relies on the build recipe files to actually declare those dependencies. Haiku's packaging policy strongly advises packagers to declare dependencies on specific commands and libraries, not on other packages.

More info on how to handle requirements is available on this subpage: Handling Requirements.

Usage of HaikuPorter

haikuporter -h will show usage info, more detailed usage information is given on this subpage: Usage.

In order to build a port, just use haikuporter <portName>.