| | 1 | = !HaikuPorter for Package Management = |
| | 2 | |
| | 3 | This page and its subpages describe the second version of !HaikuPorter, which is intended to build packages for Haiku. Each reference to !HaikuPorter here and on any of the subpages means that second incarnation, not the first version of !HaikuPorter. |
| | 4 | |
| | 5 | == Introduction == |
| | 6 | |
| | 7 | !HaikuPorter is a command line Python application that, using the information contained in a !HaikuPort's RecipeFile: |
| | 8 | * fetches one or more original source code archives |
| | 9 | * extracts these archives |
| | 10 | * patches the sources for compilation on Haiku |
| | 11 | * builds the software in a 'chroot()'-ed environment, which contains only packages required for building the port |
| | 12 | * creates one or more packages ('*.hpkg') for distribution |
| | 13 | |
| | 14 | !HaikuPorter can automatically resolve any dependencies on other !HaikuPorts that have been declared in the RecipeFile, i.e. if any of the required packages are missing, the port that produces those packages will be built first. |
| | 15 | |
| | 16 | !HaikuPorter itself depends two things: |
| | 17 | [wiki:HaikuPorterForPM/HaikuPortsConf /etc/HaikuPorts.conf]:: |
| | 18 | Contains global !HaikuPorter options |
| | 19 | [wiki:HaikuPorterForPM/PortsTree A ports tree]:: |
| | 20 | Contains recipe files for all the ports to be built |
| | 21 | |
| | 22 | == [wiki:HaikuPorterForPM/PortsAndPackages Ports and Packages] == |
| | 23 | |
| | 24 | Each port will produce a set of packages, typically a base package containing the main binaries/libraries of the port plus one source and one debug package. Ports that provide libraries will usually provide an additional development package, too. |
| | 25 | |
| | 26 | All the packages built by !HaikuPorter are being collected in the 'packages'-folder of the ports tree. |
| | 27 | |
| | 28 | == [wiki:HaikuPorterForPM/Repository The Package Repository] == |
| | 29 | |
| | 30 | 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 will be put into the 'repository'-folder of the ports tree. Only this set of active package-infos will be considered during dependency resolution. |
| | 31 | |
| | 32 | The 'repository' folder defines which set of packages will finally be uploaded into the corresponding package repository (from where packages will be downloaded). Because of that, it is important that the set of packages in the repository folder is consistent with respect to declaration of provides, requires, conflicts, etc. |
| | 33 | |
| | 34 | Packages for other versions of a port can be built, but only if their dependencies can be resolved by the repository. If that is not the case and you really need to build a specific version of a package, then you can do so by checking out a (git-)revision of the ports tree where that package version was the active one. |
| | 35 | |
| | 36 | == [wiki:HaikuPorterForPM/HandlingRequirements] == |
| | 37 | |
| | 38 | === !HaikuPorter === |
| | 39 | |
| | 40 | !HaikuPorter is implemented in Python ([wiki:dev-lang/python]), so that is required. Only modules from Python's standard library are used, so no additional modules need to be installed. |
| | 41 | |
| | 42 | Apart from Python, !HaikuPorter itself requires the following programs/packages: |
| | 43 | |
| | 44 | * coreutils |
| | 45 | * git |
| | 46 | * tar |
| | 47 | * unzip |
| | 48 | * wget |
| | 49 | * XZ-utils (for a port that comes as a '*.xz' archive) |
| | 50 | * the sources of ports are only available as VCS-checkout, so any of these VCS might be required: |
| | 51 | * bzr |
| | 52 | * CVS |
| | 53 | * fossil |
| | 54 | * hg/Mercurial |
| | 55 | * svn/Subversion |
| | 56 | |
| | 57 | === Requirements defined by a RecipeFile === |
| | 58 | |
| | 59 | All packages listed as requirements in a port's RecipeFile will be resolved automatically by !HaikuPorter and the ports will be built in the correct order. |
| | 60 | |
| | 61 | == [wiki:HaikuPorterForPM/Usage Usage] == |
| | 62 | |
| | 63 | 'haikuporter -h' will show usage info. |
| | 64 | |
| | 65 | In order to build a port, just use 'haikuporter <portName>' |