The PortaLinux Ports/Build System Documentation (Alpha Release)
The PortaLinux Ports System is the main way to install packages on a PortaLinux system. It remotely fetches packages from a package repository, just like any other package manager, but it compiles the packages from scratch just like Arch's AUR, Gentoo's Portage and FreeBSD ports (which is what pl-ports is named after).
The PortaLinux Build System for the 0.12 release is also based on a modified version of the Ports System. Hybrid versions of packages can be created that work on both implementations of the Ports System
PortaLinux's implementation of the ports system works very similarly to macOS's Homebrew package manager.
Main Ports Repo
The official PortaLinux Project Ports Repo is the main repo that will be used within Ports. It is currently self-hosted by me, Cinnamon, the founder of the project.
The repo is subdivided into two subrepos: the core subrepo and the extras subrepo
The core subrepo only stores packages used within the stock PortaLinux root filesystem, while the extras store programs and libraries that are very useful for app development and deployment, such as wlroots, mesa, gtk, qt, sdl, etc.
Package Creation
PortaLinux Ports packages are gzip-compressed tape archives (tar.gz). There are multiple types of files that can be put in a package, with some of them being required. There are 3 types of Ports packages and the files they package:
- Full Package: The most common type of package in the Ports repo. Can target either the root filesystem and/or the toolchain built by the Build System. Contains metadata and a build script
- properties.plml
- build.rb
- Thin Package: Only contains metadata and an archive that contains precompiled binaries. Mainly used to bootstrap the full Ports system from a stock PortaLinux root filesystem
- properties.plml
- data.tar
properties.plml
This is the main metadata of the package. All packages require this file to be considered valid packages. It contains the name of the package, the version of the package, the author of the package and a link to the source tarball. It optionally also includes configure and compile flags for either the root filesystem or the Build System toolchain, but these will be ignored if a data.tar is detected. Here is an example:
build.rb
This is the build script in a Full Ports Package. It can be made to work for either the root filesystem or the Build System toolchain (proper API will be documented at some point soon). For now, here is an example that works on only the root filesystem while I cook up a more appropriate example to replace this one:
data.tar
This is a precompiled archive. This file only contains files that are basically ready to be dumped into whatever folder the Ports implementation installs to by default. This is mainly used for bootstrapping the Ports System on a stock root filesystem, as well as installing the stock etc files in the root filesystem.