diff mbox series

External BR overriding upstream packages

Message ID CAKJ_wKQYgGt=tgPX3oJa58890zx2Yhza2r0ZmtDc_Mp0nz+F+A@mail.gmail.com
State Handled Elsewhere
Headers show
Series External BR overriding upstream packages | expand

Commit Message

Andrew Barnes Jan. 7, 2026, 1:55 p.m. UTC
External BR projects can curate their own packages, but they can't easily
modify a package if it already exists upstream.

Ideally such modifications should be made to buildroots package and
upstreamed.
but if the modification is not to be accepted upstream, then we need
another way.

Real examples for just one project i'm working on:
1. downgrade libinput version (Touch screen doesn't work with later
versions, pending investigation)
2. mesa3d - enable legacy api for wpewebkit/cog (wpewebkit will be adopting
the new mesa3d api soon)
3. odd fix for getting QT6 to compile (raised already in mailing list,
could be an upstream patch)
4. complete instrumentation of wpewebkit options (unsure if is worth
upstreaming, will discuss it later)

All these changes can be managed as patches that are applied ontop of BR,
once the changes stablise that can work too.

However, in an IRC discussion, I suggested it could be that BR allows
duplicate packages, and uses the version from the external project instead
of the internal one.

here is a patch to do that:


 include boot/common.mk
 include linux/linux.mk


Happy to turn this into a proper patch email, I haven't done that this time
because I think it's more for interest than a serious suggestion.

Kind regards,

Andy
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index ff25027c13..efb577b2b2 100644
--- a/Makefile
+++ b/Makefile
@@ -532,7 +532,11 @@  ifneq ($(PACKAGE_OVERRIDE_FILE),)
 -include $(PACKAGE_OVERRIDE_FILE)
 endif

-include $(sort $(wildcard package/*/*.mk))
+EXTERNAL_PACKAGE_MKS = $(foreach dir,$(BR2_EXTERNAL_DIRS),$(wildcard
$(dir)/package/*/*.mk))
+EXTERNAL_PROVIDED_PACKAGES = $(sort $(notdir $(patsubst %/,%,$(dir
$(EXTERNAL_PACKAGE_MKS)))))
+BUILTIN_PACKAGE_MKS = $(filter-out $(addprefix package/,$(addsuffix
/%,$(EXTERNAL_PROVIDED_PACKAGES))),$(sort $(wildcard package/*/*.mk)))
+
+include $(BUILTIN_PACKAGE_MKS)