public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] kbuild: control extra pacman packages with PACMAN_EXTRAPACKAGES
@ 2024-08-07  2:27 Jose Fernandez
  2024-08-07 13:37 ` Masahiro Yamada
  0 siblings, 1 reply; 10+ messages in thread
From: Jose Fernandez @ 2024-08-07  2:27 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	Thomas Weißschuh, Christian Heusel
  Cc: Jose Fernandez, Peter Jung, linux-kbuild, linux-kernel

Introduce a new variable, PACMAN_EXTRAPACKAGES, in the Makefile.package
to control the creation of additional packages by the pacman-pkg target.

The headers and api-headers packages will be included by default if
PACMAN_EXTRAPACKAGES is not set. This changes the previous behavior
where api-headers was always included, and headers was conditionally
included if CONFIG_MODULES=y. Now, this decision is delegated to the
user.

To disable extra packages, set PACMAN_EXTRAPACKAGES to an empty value:

make pacman-pkg PACMAN_EXTRAPACKAGES=

or

make pacman-pkg PACMAN_EXTRAPACKAGES=""

Signed-off-by: Jose Fernandez <jose.fernandez@linux.dev>
Reviewed-by: Peter Jung <ptr1337@cachyos.org>
---
v1 -> v2: Build all extra packages by default. Remove unnecessary lines.

In a previous patch, there was concern that adding a new debug package
would increase the package time. To address this concern and provide
more flexibility, this change has been added to allow users to decide
which extra packages to include before introducing an optional debug
package [1].

[1] https://lore.kernel.org/lkml/20240801192008.GA3923315@thelio-3990X/T/

 scripts/Makefile.package |  2 ++
 scripts/package/PKGBUILD | 11 +++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 4a80584ec771..ccdf8ba41f0b 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -144,6 +144,8 @@ snap-pkg:
 # pacman-pkg
 # ---------------------------------------------------------------------------
 
+PACMAN_EXTRAPACKAGES ?= headers api-headers
+
 PHONY += pacman-pkg
 pacman-pkg:
 	@ln -srf $(srctree)/scripts/package/PKGBUILD $(objtree)/PKGBUILD
diff --git a/scripts/package/PKGBUILD b/scripts/package/PKGBUILD
index 663ce300dd06..8de869f9b1d4 100644
--- a/scripts/package/PKGBUILD
+++ b/scripts/package/PKGBUILD
@@ -3,10 +3,13 @@
 # Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
 
 pkgbase=${PACMAN_PKGBASE:-linux-upstream}
-pkgname=("${pkgbase}" "${pkgbase}-api-headers")
-if grep -q CONFIG_MODULES=y include/config/auto.conf; then
-	pkgname+=("${pkgbase}-headers")
-fi
+pkgname=("${pkgbase}")
+
+_extrapackages=${PACMAN_EXTRAPACKAGES:-}
+for pkg in $_extrapackages; do
+	pkgname+=("${pkgbase}-${pkg}")
+done
+
 pkgver="${KERNELRELEASE//-/_}"
 # The PKGBUILD is evaluated multiple times.
 # Running scripts/build-version from here would introduce inconsistencies.
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-08-11 20:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07  2:27 [PATCH v2] kbuild: control extra pacman packages with PACMAN_EXTRAPACKAGES Jose Fernandez
2024-08-07 13:37 ` Masahiro Yamada
2024-08-07 16:40   ` Thomas Weißschuh
2024-08-07 17:02     ` Masahiro Yamada
2024-08-07 17:31       ` Thomas Weißschuh
2024-08-10  0:16         ` Jose Fernandez
2024-08-10  7:41           ` Masahiro Yamada
2024-08-11 16:01             ` Jose Fernandez
2024-08-10  7:54           ` Thomas Weißschuh
2024-08-11 20:46     ` Jose Fernandez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox