All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/scripts/apply-patches.sh: introduce envvar BR_PATCH_ARGS
@ 2025-01-27 21:53 Markus Mayer via buildroot
  2025-01-28 21:09 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Mayer via buildroot @ 2025-01-27 21:53 UTC (permalink / raw)
  To: Buildroot Mailing List; +Cc: Markus Mayer

Introduce the environment variable BR_PATCH_ARGS as a means for the
caller to pass additional arguments to the patch(1) command. These
arguments can be new arguments not originally used -- or they can
override one of the default arguments.

In addition, provide a mechanism to add patch parameters on a
per-package basis using the <PACKAGENAME>_PATCH_ARGS makefile variable,
for example "PROCPS_NG_PATCH_ARGS". This allows individual packages to
specify extra arguments or override defaults while not affecting any
other part of the build environment.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
 package/Makefile.in              | 4 +++-
 support/scripts/apply-patches.sh | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index 829636900ba9..9df66670c8d3 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -256,7 +256,9 @@ endif
 INSTALL := $(shell which install || type -p install)
 UNZIP := $(shell which unzip || type -p unzip) -q
 
-APPLY_PATCHES = TAR="$(TAR)" PATH=$(HOST_DIR)/bin:$$PATH support/scripts/apply-patches.sh $(if $(QUIET),-s)
+APPLY_PATCHES = TAR="$(TAR)" PATH=$(HOST_DIR)/bin:$$PATH \
+	BR_PATCH_ARGS=$($(PKG)_PATCH_ARGS) \
+	support/scripts/apply-patches.sh $(if $(QUIET),-s)
 
 HOST_CPPFLAGS  = -I$(HOST_DIR)/include
 HOST_CFLAGS   ?= -O2
diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 2acaa63e9fd3..26e7a4a37bb1 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -116,7 +116,8 @@ function apply_patch {
         exit 1
     fi
     echo "${path}/${patch}" >> ${builddir}/.applied_patches_list
-    ${uncomp} "${path}/$patch" | patch -F0 -g0 -p1 --no-backup-if-mismatch -d "${builddir}" -t -N $silent
+    ${uncomp} "${path}/$patch" | patch -F0 -g0 -p1 --no-backup-if-mismatch \
+		-d "${builddir}" -t -N $silent $BR_PATCH_ARGS
     if [ $? != 0 ] ; then
         echo "Patch failed!  Please fix ${patch}!"
         exit 1
-- 
2.48.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2025-02-05 22:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-27 21:53 [Buildroot] [PATCH] support/scripts/apply-patches.sh: introduce envvar BR_PATCH_ARGS Markus Mayer via buildroot
2025-01-28 21:09 ` Thomas Petazzoni via buildroot
2025-02-05 16:58   ` Markus Mayer via buildroot
2025-02-05 19:28     ` Arnout Vandecappelle via buildroot
2025-02-05 22:08       ` Markus Mayer via buildroot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.