diff options
| author | George Sapkin | 2026-01-04 17:50:52 +0000 |
|---|---|---|
| committer | Robert Marko | 2026-01-12 13:28:52 +0000 |
| commit | 952c918028b4811e5cf0f3fa8607ce50630a5060 (patch) | |
| tree | 34b886054c2549d2f7c735e045da288092015990 | |
| parent | 779fa7ff6caa509d5df3827342162fdb07093cee (diff) | |
| download | openwrt-952c918028b4811e5cf0f3fa8607ce50630a5060.tar.gz | |
build: fix provides logic when ABI version is set
Same as for the base package name, when a package has an ABI version,
provide both unversioned provider in addition to one with ABI version
and version.
So for each provide instead of providing only:
$provide$ABI_version=$package_version
now provide:
$provide $provide$ABI_version=$package_version
When a provide ends in a number, the ABI version will be prefixed with
a - sign, e.g.: provide1-0
Fixes: 18029977 ("build: fix apk packaging and ABI-versioning")
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/21369
Signed-off-by: Robert Marko <robimarko@gmail.com>
| -rw-r--r-- | include/package-pack.mk | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/include/package-pack.mk b/include/package-pack.mk index 94ad16dd6d..ee71c0367e 100644 --- a/include/package-pack.mk +++ b/include/package-pack.mk @@ -130,11 +130,22 @@ endef # Format provide and add ABI and version if it's not a virtual provide marked # with an @. # +# Same as for the base package name, if ABI version is set, provide both +# unversioned provide and one with ABI version and version. +# # 1: provide name # 2: provide version -# 3: (optional) ABI preformatted by FormatABISuffix +# 3: (optional) ABI version define AddProvide -$(if $(filter @%,$(1)),$(patsubst @%,%,$(1)),$(1)$(3)=$(2)) +$(strip + $(if $(filter @%,$(1)), + $(patsubst @%,%,$(1)), + $(if $(3), + $(1) $(1)$(call FormatABISuffix,$(1),$(3))=$(2), + $(1)=$(2) + ) + ) +) endef # Remove virtual provides prefix and self. apk doesn't like it when packages @@ -158,9 +169,14 @@ endef # at the same time # - additionally provide `${package_name}` so multiple packages can be looked # up by its base name -# - for each `provides`, provide `${provide}${ABI_version}=${package_version}` -# this implies that only one version of a provide can be installed at the -# same time +# - for each `provides`: +# - provide `${provide}${ABI_version}=${package_version}` +# this implies that only one version of a provide can be installed at the +# same time +# - if a `provide` ends in a number, the `ABI_version` will be prefixed with +# a - sign, e.g.: provide1-0 +# - additionally provide `${provide}` so multiple packages can be looked up +# by its base name # # - else if ABI version is _not_ defined # - package is named `${package_name}` @@ -213,16 +229,17 @@ endef # # 1: package name # 2: package version -# 3: list of provides +# 3: ABI version +# 4: list of provides define FormatProvides $(strip - $(if $(ABIV_$(1)), + $(if $(call FormatABISuffix,$(1),$(3)), $(1) $(foreach provide, - $(filter-out $(1),$(3)), - $(call AddProvide,$(provide),$(2),$(ABIV_$(1))) + $(filter-out $(1),$(4)), + $(call AddProvide,$(provide),$(2),$(3)) ), $(foreach provide, - $(filter-out $(1),$(3)), + $(filter-out $(1),$(4)), $(call AddProvide,$(provide),$(2)) ) ) @@ -367,7 +384,7 @@ endif Package/$(1)/PROVIDES := $$(patsubst @%,%,$(PROVIDES)) Package/$(1)/PROVIDES := $$(filter-out $(1)$$(ABIV_$(1)),$$(Package/$(1)/PROVIDES)$$(if $$(ABIV_$(1)), $(1) $$(foreach provide,$$(Package/$(1)/PROVIDES),$$(provide)$$(ABIV_$(1))))) else - Package/$(1)/PROVIDES := $$(call FormatProvides,$(1),$(VERSION),$(PROVIDES)) + Package/$(1)/PROVIDES := $$(call FormatProvides,$(1),$(VERSION),$(ABI_VERSION),$(PROVIDES)) endif $(_define) Package/$(1)/CONTROL |