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

github.com/qnx-ports

Package Server

oss.qnx.com

Package Format

Alpine Package Keeper (APK) via APKBUILD

Document Status

Approved Guidelines (v1.2)

Guiding principles

What you'll learn

What you'll need

#

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. v1.2.3).

3

APK Versioning

Must adhere to Alpine $pkgver and $pkgrel version revision rules.

Valid $pkgver and $pkgrel fields in APKBUILD.

4

Packaging Recipe

Packaging instructions must be provided as an APKBUILD script submitted via Pull Request.

PR against qnx-ports/aports with APKBUILD + patches.

5

AI & Human Accountability

APKBUILD and patches must be human-authored/reviewed; maintainer must be identified by name/email.

# Maintainer: Name header and human review assurance.

6

FOSS & Dependency Audit

Submitter is responsible for auditing licenses (SPDX) and all build/runtime dependencies.

Audited $license, $depends, and $makedepends in APKBUILD.

7

Automated Testing

check() function must execute unit tests and emit results in JUnit XML format.

JUnit XML test report output path inside check().

The following steps cover each requirement in detail.

QNX self-hosted execution

Architecture support

Public repository

Mandatory release tagging

Upstream first policy

Packages submitted to qnx-ports must strictly follow Alpine Package Keeper (apk) versioning rules.

Package version ($pkgver)

Package revision ($pkgrel)

$pkgrel tracks package build revisions for the same upstream version ($pkgver).

Third-party upstream code

Human packaging ownership

Named human maintainer

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>

FOSS license audit

Dependency disclosure

Mandatory check() step

The check() function in APKBUILD must run the project's test suite.

JUnit XML output

Integration examples

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).

Supply chain security and integrity

Patch management hygiene

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]
---

Package lifecycle and SLA

File system and subpackage conventions

  1. Port the app on the QNX Self-Hosted Distribution.
  2. Tag a release in your public repo using SemVer (e.g. v1.2.3).
  3. Write the APKBUILD yourself, with pkgver=1.2.3 and pkgrel=0.
  4. Audit licenses and declare the full dependency tree.
  5. Implement check() with JUnit XML output, and add the maintainer header.
  6. Submit a DCO-signed pull request to github.com/qnx-ports.
  7. QNX CI runs the APKBUILD and parses the JUnit XML results:
    • Tests pass and audit is clean: the .apk package is built and published to oss.qnx.com.
    • Tests fail or rules are violated: PR feedback is sent to the maintainer for fixes.

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
"