Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit e6b65ee

Browse files
jfernandezmasahir0y
authored andcommitted
kbuild: control extra pacman packages with PACMAN_EXTRAPACKAGES
Introduce the PACMAN_EXTRAPACKAGES variable in PKGBUILD to allow users to specify which additional packages are built by the pacman-pkg target. Previously, the api-headers package was always included, and the headers package was included only if CONFIG_MODULES=y. With this change, both headers and api-headers packages are included by default. Users can now control this behavior by setting PACMAN_EXTRAPACKAGES to a space-separated list of desired extra packages or leaving it empty to exclude all. For example, to build only the base package without extras: make pacman-pkg PACMAN_EXTRAPACKAGES="" Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev> Reviewed-by: Peter Jung <ptr1337@cachyos.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Tested-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Christian Heusel <christian@heusel.eu> Tested-by: Christian Heusel <christian@heusel.eu> Acked-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent 7a7f974 commit e6b65ee

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

scripts/package/PKGBUILD

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
44

55
pkgbase=${PACMAN_PKGBASE:-linux-upstream}
6-
pkgname=("${pkgbase}" "${pkgbase}-api-headers")
7-
if grep -q CONFIG_MODULES=y include/config/auto.conf; then
8-
pkgname+=("${pkgbase}-headers")
9-
fi
6+
pkgname=("${pkgbase}")
7+
8+
_extrapackages=${PACMAN_EXTRAPACKAGES-headers api-headers}
9+
for pkg in $_extrapackages; do
10+
pkgname+=("${pkgbase}-${pkg}")
11+
done
12+
1013
pkgver="${KERNELRELEASE//-/_}"
1114
# The PKGBUILD is evaluated multiple times.
1215
# Running scripts/build-version from here would introduce inconsistencies.
@@ -77,10 +80,13 @@ _package-headers() {
7780
cd "${objtree}"
7881
local builddir="${pkgdir}/usr/${MODLIB}/build"
7982

80-
echo "Installing build files..."
81-
"${srctree}/scripts/package/install-extmod-build" "${builddir}"
83+
if grep -q CONFIG_MODULES=y include/config/auto.conf; then
84+
echo "Installing build files..."
85+
"${srctree}/scripts/package/install-extmod-build" "${builddir}"
86+
fi
8287

8388
echo "Installing System.map and config..."
89+
mkdir -p "${builddir}"
8490
cp System.map "${builddir}/System.map"
8591
cp .config "${builddir}/.config"
8692

0 commit comments

Comments
 (0)