abuild doesn't trace depends of subpackages if main package has arch=noarch
Minimal example
To illustrate the issue (untested):
pkgname=test
arch="noarch"
subpackages="test-subpkg:subpkg:x86_64"
subpkg() {
make DEST="$pkgdir" install
}
abuild should not trace the depends of test
, but it should trace the depends of test-subpkg
.
Real example
APKBUILD:
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=calamares-extensions
pkgver=1.0.0
pkgrel=0
arch="noarch !armhf" # blocked by qt5-qtdeclarative
url="https://github.com/calamares/calamares-extensions"
pkgdesc="Calamares Branding and Module Examples"
license="GPL-3.0-or-later"
makedepends="
calamares-dev
qt5-qtsvg-dev
qt5-qtdeclarative-dev
"
source="https://github.com/calamares/calamares-extensions/releases/download/v$pkgver/calamares-extensions-$pkgver.tar.gz"
options="!check" # has no tests
# Modules and brandings to build:
# https://github.com/calamares/calamares-extensions/tree/calamares/modules
# https://github.com/calamares/calamares-extensions/tree/calamares/branding
_modules="
mobile
"
_brandings="
default-mobile
"
for i in $_modules; do
subpackages="$pkgname-mod-$i:_module:$CARCH $subpackages"
done
for i in $_brandings; do
subpackages="$pkgname-brand-$i:_branding $subpackages"
done
# Check if one module/branding is enabled
# $1: name of module/branding
# $2: either $_modules or $_brandings
is_enabled() {
local i
for i in $2; do
[ "$i" = "$1" ] && return 0
done
return 1
}
# Check if string $1 is in CMakeLists.txt and comment it out
comment_out() {
sed -i "s~$1~#&~g" "$builddir/CMakeLists.txt"
}
prepare() {
default_prepare
local i
msg "disabled modules:"
cd "$builddir/modules"
for i in *; do
if ! [ -d "$i" ] || is_enabled "$i" "$_modules"; then
continue
fi
echo " - $i"
comment_out "calamares_add_module_subdirectory( modules/$i "
done
msg "disabled brandings:"
cd "$builddir/branding"
for i in *; do
if ! [ -d "$i" ] || is_enabled "$i" "$_brandings"; then
continue
fi
echo " - $i"
comment_out "calamares_add_branding_subdirectory( branding/$i "
done
}
build() {
cmake -B build \
-DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib
cmake --build build
}
_module() {
local module=${subpkgname##calamares-extensions-mod-}
local path="usr/lib/calamares/modules"
mkdir -p "$subpkgdir/$path"
mv "$pkgdir/$path/$module" "$subpkgdir/$path/$module"
}
_branding() {
local branding=${subpkgname##calamares-extensions-brand-}
local path="usr/share/calamares/branding"
mkdir -p "$subpkgdir/$path"
mv "$pkgdir/$path/$branding" "$subpkgdir/$path/$branding"
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
sha512sums="46801342c14ad8e744378c90bcea8a60bff805096b39958b4856fef3c855b60be4d8507643e101700c52c1605db3ce1c872170a3ea79e59ef123cda0fdfe0a01 calamares-extensions-1.0.0.tar.gz"
Does not trace dependencies here (full log):
>>> calamares-extensions-mod-mobile*: Tracing dependencies...
>>> calamares-extensions-mod-mobile*: Package size: 116.0 KB
>>> calamares-extensions-mod-mobile*: Compressing data...
>>> calamares-extensions-mod-mobile*: Create checksum...
>>> calamares-extensions-mod-mobile*: Create calamares-extensions-mod-mobile-1.0.0-r0.apk
After changing arch
to all
in the main package and removing $CARCH
from the subpackage:
>>> calamares-extensions-mod-mobile*: Tracing dependencies...
so:libKF5CoreAddons.so.5
so:libQt5Core.so.5
so:libc.musl-x86_64.so.1
so:libcalamares.so.3.2.35.1
so:libgcc_s.so.1
so:libstdc++.so.6
>>> calamares-extensions-mod-mobile*: Package size: 116.0 KB
>>> calamares-extensions-mod-mobile*: Compressing data...
>>> calamares-extensions-mod-mobile*: Create checksum...
>>> calamares-extensions-mod-mobile*: Create calamares-extensions-mod-mobile-1.0.0-r1.apk
APKBUILD diff:
diff --git a/main/calamares-extensions/APKBUILD b/main/calamares-extensions/APKBUILD
index bff9de2f7..9186a9497 100644
--- a/main/calamares-extensions/APKBUILD
+++ b/main/calamares-extensions/APKBUILD
@@ -1,8 +1,8 @@
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=calamares-extensions
pkgver=1.0.0
-pkgrel=0
-arch="noarch !armhf" # blocked by qt5-qtdeclarative
+pkgrel=1
+arch="all !armhf" # blocked by qt5-qtdeclarative
url="https://github.com/calamares/calamares-extensions"
pkgdesc="Calamares Branding and Module Examples"
license="GPL-3.0-or-later"
@@ -25,7 +25,7 @@ _brandings="
"
for i in $_modules; do
- subpackages="$pkgname-mod-$i:_module:$CARCH $subpackages"
+ subpackages="$pkgname-mod-$i:_module $subpackages"
done
for i in $_brandings; do
subpackages="$pkgname-brand-$i:_branding $subpackages"