* [Buildroot] [PATCH v2] Add support for custom package patches
@ 2012-10-31 12:55 spdawson at gmail.com
2012-10-31 20:47 ` Samuel Martin
2012-10-31 22:27 ` Arnout Vandecappelle
0 siblings, 2 replies; 3+ messages in thread
From: spdawson at gmail.com @ 2012-10-31 12:55 UTC (permalink / raw)
To: buildroot
From: Simon Dawson <spdawson@gmail.com>
Add a configuration item to allow a space-separated list of directories
to be specified, from which custom package patches will be applied.
Signed-off-by: Simon Dawson <spdawson@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
v2: Incorporate improvements suggested by Arnout Vandecappelle, and
fix handling of the case where the new configuration item is not set
Config.in | 7 +++++++
package/pkg-generic.mk | 28 ++++++++++++++++------------
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/Config.in b/Config.in
index dab7787..2ea3fbb 100644
--- a/Config.in
+++ b/Config.in
@@ -415,6 +415,13 @@ config BR2_PACKAGE_OVERRIDE_FILE
as the source directory for a particular package. See the
Buildroot documentation for more details on this feature.
+config BR2_EXTRA_PACKAGE_PATCH_DIRS
+ string "extra package patch directories"
+ help
+ You may specify a space-separated list of directories containing
+ extra package patches. Note that any extra patches for a package
+ will be applied AFTER the Buildroot patch set for the package.
+
endmenu
source "toolchain/Config.in"
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 270da60..c975768 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -69,6 +69,20 @@ else
@true # Nothing to do to source a local package
endif
+# Apply package patches from the specified directory
+define pkg-apply-patch-directory
+ if test -d $(1); then \
+ if test "$(wildcard $(1)/$(NAMEVER)*.patch*)"; then \
+ support/scripts/apply-patches.sh $(@D) $(1) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \
+ else \
+ support/scripts/apply-patches.sh $(@D) $(1) $(RAWNAME)\*.patch $(RAWNAME)\*.patch.$(ARCH) || exit 1; \
+ if test -d $(1)/$(NAMEVER); then \
+ support/scripts/apply-patches.sh $(@D) $(1)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \
+ fi; \
+ fi; \
+ fi;
+endef
+
# Patch
#
# The RAWNAME variable is the lowercased package name, which allows to
@@ -79,18 +93,8 @@ $(BUILD_DIR)/%/.stamp_patched:
@$(call MESSAGE,"Patching $($(PKG)_DIR_PREFIX)/$(RAWNAME)")
$(foreach hook,$($(PKG)_PRE_PATCH_HOOKS),$(call $(hook))$(sep))
$(if $($(PKG)_PATCH),support/scripts/apply-patches.sh $(@D) $(DL_DIR) $($(PKG)_PATCH))
- $(Q)( \
- if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME); then \
- if test "$(wildcard $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER)*.patch*)"; then \
- support/scripts/apply-patches.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(NAMEVER)\*.patch $(NAMEVER)\*.patch.$(ARCH) || exit 1; \
- else \
- support/scripts/apply-patches.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(RAWNAME)\*.patch $(RAWNAME)\*.patch.$(ARCH) || exit 1; \
- if test -d $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER); then \
- support/scripts/apply-patches.sh $(@D) $($(PKG)_DIR_PREFIX)/$(RAWNAME)/$(NAMEVER) \*.patch \*.patch.$(ARCH) || exit 1; \
- fi; \
- fi; \
- fi; \
- )
+ $(Q)($(call pkg-apply-patch-directory,$($(PKG)_DIR_PREFIX)/$(RAWNAME)))
+ $(if $(call qstrip,$(BR2_EXTRA_PACKAGE_PATCH_DIRS)),$(Q)($(foreach patchdir,$(call qstrip,$(BR2_EXTRA_PACKAGE_PATCH_DIRS)),$(call pkg-apply-patch-directory,$(patchdir)))))
$(foreach hook,$($(PKG)_POST_PATCH_HOOKS),$(call $(hook))$(sep))
$(Q)touch $@
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread* [Buildroot] [PATCH v2] Add support for custom package patches
2012-10-31 12:55 [Buildroot] [PATCH v2] Add support for custom package patches spdawson at gmail.com
@ 2012-10-31 20:47 ` Samuel Martin
2012-10-31 22:27 ` Arnout Vandecappelle
1 sibling, 0 replies; 3+ messages in thread
From: Samuel Martin @ 2012-10-31 20:47 UTC (permalink / raw)
To: buildroot
Hi Simon,
2012/10/31 <spdawson@gmail.com>:
> From: Simon Dawson <spdawson@gmail.com>
>
> Add a configuration item to allow a space-separated list of directories
> to be specified, from which custom package patches will be applied.
>
> Signed-off-by: Simon Dawson <spdawson@gmail.com>
> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>
> ---
> v2: Incorporate improvements suggested by Arnout Vandecappelle, and
> fix handling of the case where the new configuration item is not set
>
> Config.in | 7 +++++++
> package/pkg-generic.mk | 28 ++++++++++++++++------------
> 2 files changed, 23 insertions(+), 12 deletions(-)
>
> diff --git a/Config.in b/Config.in
> index dab7787..2ea3fbb 100644
> --- a/Config.in
> +++ b/Config.in
> @@ -415,6 +415,13 @@ config BR2_PACKAGE_OVERRIDE_FILE
> as the source directory for a particular package. See the
> Buildroot documentation for more details on this feature.
>
> +config BR2_EXTRA_PACKAGE_PATCH_DIRS
> + string "extra package patch directories"
> + help
> + You may specify a space-separated list of directories containing
> + extra package patches. Note that any extra patches for a package
> + will be applied AFTER the Buildroot patch set for the package.
> +
> endmenu
>
It'd be great to have a section in the documentation about this feature.
Regards,
--
Sam
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH v2] Add support for custom package patches
2012-10-31 12:55 [Buildroot] [PATCH v2] Add support for custom package patches spdawson at gmail.com
2012-10-31 20:47 ` Samuel Martin
@ 2012-10-31 22:27 ` Arnout Vandecappelle
1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2012-10-31 22:27 UTC (permalink / raw)
To: buildroot
On 10/31/12 13:55, spdawson at gmail.com wrote:
> + $(Q)($(call pkg-apply-patch-directory,$($(PKG)_DIR_PREFIX)/$(RAWNAME)))
> + $(if $(call qstrip,$(BR2_EXTRA_PACKAGE_PATCH_DIRS)),$(Q)($(foreach patchdir,$(call qstrip,$(BR2_EXTRA_PACKAGE_PATCH_DIRS)),$(call pkg-apply-patch-directory,$(patchdir)))))
I could be wrong, but I think this would also work:
$(foreach patchdir,$(call qstrip,$(BR2_EXTRA_PACKAGE_PATCH_DIRS)),$(Q)$(call pkg-apply-patch-directory,$(patchdir))$(sep)))
(and the semicolon at the end of pkg-apply-patch-directory is redundant then).
Alternatively, you could define:
PACKAGE_PATCH_DIRS = $($(PKG)_DIR_PREFIX)/$(RAWNAME) $(call qstrip,$(BR2_EXTRA_PACKAGE_PATCH_DIRS))
...
$(Q)$(foreach patchdir,$(PACKAGE_PATCH_DIRS),$(call pkg-apply-patch-directory,$(patchdir)))
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286540
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-31 22:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 12:55 [Buildroot] [PATCH v2] Add support for custom package patches spdawson at gmail.com
2012-10-31 20:47 ` Samuel Martin
2012-10-31 22:27 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox