path: root/package
diff options
authorGravatar Luca Ceresoli <luca@lucaceresoli.net>2015-10-03 23:18:18 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-10-04 16:59:05 +0100
commitb9f4727ff4d512868352494f5209fff4da147473 (patch)
treeb2064d91ae8deb84e2dfa7b6a600ad2bda58cfef /package
parent8b69e6c54233036dd12c6e76b98798200553290a (diff)
legal-info: allow to declare the actual sources for binary packages
The FOO_SITE/FOO_SOURCE variables usually point to a tarball containing source code. For the downloaded external toolchains this is not true, the "source" tarball actually contains binaries. This is fine for making Buildroot work, but for legal-info we really want to ship real source code, not binaries. Luckily, some (hopefully all) toolchain vendors publish a downloadable tarball containing the source code counterpart for their binary packages. Here we allow the user to declare the URL of this other tarball in the pair of variables FOO_ACTUAL_SOURCE_TARBALL (by default equal to FOO_SOURCE) and FOO_ACTUAL_SOURCE_SITE (by default equal to FOO_SITE). If the "actual source" package can be downloaded from the same directory as the binary package, then only FOO_ACTUAL_SOURCE_TARBALL needs to be set. Note this change is not strictly toolchain-specific: it might be useful for other packages that happen to ship binaries in the same way. [Thomas: - remove "the source code has not been saved" warning that could never be triggered due to how the conditions were organized. Discussed with Luca live during the meeting.] Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package')
1 files changed, 14 insertions, 5 deletions
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 3942a89b39..76ec295b33 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -708,12 +708,18 @@ ifneq ($$($(2)_SITE_METHOD),local)
ifneq ($$($(2)_SITE_METHOD),override)
# Packages that have a tarball need it downloaded beforehand
$(1)-legal-info: $(1)-source $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))
-$(2)_MANIFEST_SITE = $$(call qstrip,$$($(2)_SITE))
+# If FOO_ACTUAL_SOURCE_TARBALL is explicitly defined, it means FOO_SOURCE is
+# indeed a binary (e.g. external toolchain) and FOO_ACTUAL_SOURCE_TARBALL/_SITE
+# point to the actual sources tarball. Use the actual sources for legal-info.
+# For most packages the FOO_SITE/FOO_SOURCE pair points to real source code,
+# so these are the defaults for FOO_ACTUAL_*.
+$(2)_ACTUAL_SOURCE_SITE ?= $$(call qstrip,$$($(2)_SITE))
# legal-info: produce legally relevant info.
# Packages without a source are assumed to be part of Buildroot, skip them.
@@ -744,13 +750,16 @@ else
# Other packages
ifeq ($$($(2)_REDISTRIBUTE),YES)
+ifneq ($$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_SOURCE))
# Copy the source tarball (just hardlink if possible)
- @cp -l $$(DL_DIR)/$$($(2)_SOURCE) $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))) 2>/dev/null || \
- cp $$(DL_DIR)/$$($(2)_SOURCE) $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4)))
+ @cp -l $$(DL_DIR)/$$($(2)_ACTUAL_SOURCE_TARBALL) $$(REDIST_SOURCES_DIR_$$(call UPPERCASE,$(4))) 2>/dev/null || \
endif # redistribute
endif # other packages
- @$$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_MANIFEST_TARBALL),$$($(2)_MANIFEST_SITE),$$(call UPPERCASE,$(4)))
+ @$$(call legal-manifest,$$($(2)_RAWNAME),$$($(2)_VERSION),$$($(2)_LICENSE),$$($(2)_MANIFEST_LICENSE_FILES),$$($(2)_ACTUAL_SOURCE_TARBALL),$$($(2)_ACTUAL_SOURCE_SITE),$$(call UPPERCASE,$(4)))
endif # ifneq ($$(call qstrip,$$($(2)_SOURCE)),)
$$(foreach hook,$$($(2)_POST_LEGAL_INFO_HOOKS),$$(call $$(hook))$$(sep))