QNX Software Systems maintains a public open-source software (OSS) repository and package server (oss.qnx.com) built around the Alpine Package Keeper (apk) format.
This codelab sets out the official requirements and recommendations for contributing self-hosted open-source software packages to github.com/qnx-ports for inclusion in oss.qnx.com.
Target Repository | ||
Package Server | ||
Package Format | Alpine Package Keeper (APK) via | |
Document Status | Approved Guidelines (v1.2) | |
$pkgver and $pkgrelcheck() step that produces JUnit XML resultsAPKBUILD structure# | Requirement | Description | Deliverable / Evidence |
1 | Target Runtime & Distro | Software must compile, link, install, and run natively on the QNX Self-Hosted Distribution. | Verified build log and runtime execution on target hardware/VM. |
2 | Source Repo & Tagging | QNX source code must be in a public GitHub repo with formal Git release tags (SemVer preferred). | Immutable Git release tag URL (e.g. |
3 | APK Versioning | Must adhere to Alpine | Valid |
4 | Packaging Recipe | Packaging instructions must be provided as an | PR against qnx-ports/aports with |
5 | AI & Human Accountability |
|
|
6 | FOSS & Dependency Audit | Submitter is responsible for auditing licenses (SPDX) and all build/runtime dependencies. | Audited |
7 | Automated Testing |
| JUnit XML test report output path inside |
The following steps cover each requirement in detail.
x86_64, aarch64le), except in special cases such as firmware for specific aarch64 devices.github.com//-qnx ).main, master) or untagged commit hashes is strictly prohibited.vMAJOR.MINOR.PATCH, e.g., v1.2.3) is strongly preferred.Packages submitted to qnx-ports must strictly follow Alpine Package Keeper (apk) versioning rules.
$pkgver)$pkgver must match the upstream release tag version, omitting any leading v (e.g. pkgver="1.2.3" for tag v1.2.3)._alpha, _beta, _pre, _rc (e.g., 1.2.3_rc1)._p (e.g., 1.2.3_p2).$pkgrel)$pkgrel tracks package build revisions for the same upstream version ($pkgver).
pkgrel=0 when a new $pkgver is introduced.APKBUILD changes without an upstream version bump (adding QNX patches, altering compiler flags, fixing dependencies, or rebuilding against updated shared libraries), increment $pkgrel by 1 (pkgrel=1, pkgrel=2).pkgver="1.2.4"), $pkgrel resets to 0.APKBUILD packaging scripts, build options, environment configurations, and accompanying patch files must be explicitly authored or reviewed by a human.Every APKBUILD must identify a responsible human maintainer at the top of the file:
# Maintainer: Firstname Lastname <email@example.com>
If the APKBUILD is based on a package from another distribution, it must also say so:
# Alpine-Maintainer: Firstname Lastname <email@example.com>
$license variable in APKBUILD must use standard SPDX License Identifiers (e.g., MIT, Apache-2.0, GPL-2.0-or-later WITH Classpath-exception-2.0)./usr/share/licenses/$pkgname/ during package().$makedepends) and runtime dependencies ($depends).The check() function in APKBUILD must run the project's test suite.
check() must export their results in JUnit XML format.${builddir}/test-results/junit-*.xml) so the QNX CI build servers can collect them.CMake / CTest:
ctest --output-on-failure --output-junit ${builddir}/test-results/junit-ctest.xml
GoogleTest:
./test_runner --gtest_output=xml:${builddir}/test-results/junit-gtest.xml
PyTest:
pytest --junitxml=${builddir}/test-results/junit-pytest.xml
Cargo (Rust):
cargo nextest run --reporter junit --junit-path ${builddir}/test-results/junit-cargo.xml
To keep the repository consistent, follow these best practices, which are drawn from major Linux distribution standards (Alpine Linux, Fedora, Debian, Nixpkgs).
git commit -s, Signed-off-by: Real Name ).$source section with checksum verification (sha512sums). Downloading source manually anywhere else in the APKBUILD is strongly discouraged. Some build systems must download from the internet during the build (for example, cargo for Rust); in that case, a lock file for the build tool must be in place so the build cannot pull in unwanted libraries.From: Jane Developer <jane.developer@example.com>
Subject: [PATCH] Fix POSIX pthread_setname_np signature on QNX OS
Upstream-Status: Submitted [https://github.com/upstream/project/pull/42]
---
/usr/bin, /usr/lib, /usr/include and /usr/share. Never hardcode /usr/local.$pkgname-dev and documentation into $pkgname-doc using Alpine's $subpackages feature.v1.2.3).APKBUILD yourself, with pkgver=1.2.3 and pkgrel=0.check() with JUnit XML output, and add the maintainer header.APKBUILD and parses the JUnit XML results: .apk package is built and published to oss.qnx.com.Use this template as a starting point for your APKBUILD:
# Maintainer: Jane Developer <jane.developer@example.com>
# Contributor: John Co-Maintainer <john.smith@example.com>
# Alpine-Maintainer: Joe Doe <joe.doe@example.com>
pkgname="example-lib"
pkgver="1.2.3"
pkgrel=0
pkgdesc="Example open source library ported to QNX"
url="https://github.com/example/example-lib"
arch="x86_64 aarch64"
license="MIT AND Apache-2.0"
depends="qnx-base-libs zlib"
makedepends="cmake ninja googletest-dev zlib-dev"
source="https://github.com/partner-org/example-lib-qnx/archive/refs/tags/v${pkgver}.tar.gz
0001-fix-posix-pthread-qnx.patch"
subpackages="$pkgname-dev $pkgname-doc"
build() {
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_TESTING=ON
cmake --build build
}
check() {
cd "$builddir"/build
mkdir -p "${builddir}/test-results"
# Run unit tests and emit JUnit XML results for QNX CI server
ctest --output-on-failure --output-junit "${builddir}/test-results/junit-results.xml"
}
package() {
DESTDIR="$pkgdir" cmake --install build
# Install license file into standard location
install -Dm644 "$builddir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
sha512sums="
a1b2c3d4e5f67890... v1.2.3.tar.gz
f6e5d4c3b2a10987... 0001-fix-posix-pthread-qnx.patch
"