From fc5554ef5cbfb0ee66795f38eec6709d7f82f55b Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Fri, 24 Apr 2026 21:47:48 -0700 Subject: [PATCH] main/postmarketos-base: split apk-tools into -apk subpkg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It doesn't make sense to install apk by default in all flavors of pmOS, like duranium. To avoid this, apk-tools is moved into a new -apk subpackage that is pulled in implicitly via install_if. This has the following benefits: - postmarketos-duranium can "depend" on !postmarketos-base-apk to exclude apk-tools - apk-tools remains a dependency in existing mutable pmOS installs, so it shouldn't be purged by this change 🤞 - we don't have to update hundreds of APKBUILDs in pmaports that explicitly depend on `postmarketos-base` to now depend on some other package that doesn't have apk-tools as an explicit dependency. After this change, we'll be able to remove some janky cleanup code in the duranium image build config for uninstalling apk-tools from the base image, and it will allow us to *add* apk-tools in a system extension later [1] Signed-off-by: Clayton Craft 1. https://gitlab.postmarketos.org/postmarketOS/pmaports/-/work_items/4502 Part-of: --- main/postmarketos-base/APKBUILD | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/main/postmarketos-base/APKBUILD b/main/postmarketos-base/APKBUILD index 85dbeb175..7079ea4c1 100644 --- a/main/postmarketos-base/APKBUILD +++ b/main/postmarketos-base/APKBUILD @@ -1,7 +1,7 @@ # Co-Maintainer: Achill Gilgenast maintainer="Clayton Craft " pkgname=postmarketos-base -pkgver=57 +pkgver=58 pkgrel=0 pkgdesc="Meta package for minimal postmarketOS base" url="https://postmarketos.org" @@ -12,7 +12,6 @@ makedepends="postmarketos-initramfs" # recommendation to not depend on openrc has been to copy them here: # https: // gitlab.alpinelinux.org/alpine/aports/-/merge_requests/71686#note_435428 depends=" - apk-tools busybox devicepkg-utils>=0.2.0 eudev @@ -31,6 +30,7 @@ _pmb_recommends="sudo-rs" install="$pkgname.post-install $pkgname.post-upgrade" triggers="$pkgname.trigger=/usr/share/deviceinfo" subpackages=" + $pkgname-apk:_apk $pkgname-core $pkgname-doas $pkgname-fwupd @@ -133,6 +133,17 @@ package() { done } +_apk() { + pkgdesc="apk-tools for mutable postmarketOS installations" + # The apk-tools dependency is in a subpackage so that other packages are able to + # depend on postmarketos-base AND exclude apk-tools at the same time with + # !postmarketos-base-apk + install_if="$pkgname=$pkgver-r$pkgrel" + depends="apk-tools" + + mkdir -p "$subpkgdir" +} + core() { # This is needed for backwards compatibility with installs that got # the alpine-baselayout-core package in world: