From 4eccbe3ef975fa7dcc8984fa9a19c778752d70af Mon Sep 17 00:00:00 2001 From: Mirza Krak Date: Wed, 15 Aug 2018 09:16:09 +0200 Subject: [PATCH] package/pkg-golang: post-pone evaluation of variables As explained in pkg-generic.mk, all variable references inside the inner-xxx-package should use $$(...). Otherwise, they are evaluated too early, and will not contain the expected value. In the content of the pkg-golang infrastructure, the _SRC_DOMAIN, _SRC_VENDOR and _SRC_SOFTWARE variables were not properly escaping their reference to the $$($(2)_SITE) variable. This was not visible until now, as only target Go packages were supported, where $(2)_SITE was always defined prior to this macro being expanded. With the upcoming support of host Go packages, we need to fix this, as $(2)_SITE may be defined later, inherited from $(3)_SITE. Signed-off-by: Mirza Krak [Thomas: rework commit log.] Signed-off-by: Thomas Petazzoni --- package/pkg-golang.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk index bf178622b5..6eacd14180 100644 --- a/package/pkg-golang.mk +++ b/package/pkg-golang.mk @@ -77,9 +77,9 @@ $(2)_INSTALL_BINS ?= $(1) # of GOPATH. It usually resolves around domain/vendor/software. By default, we # derive domain/vendor/software from the upstream URL of the project, but we # allow $(2)_SRC_SUBDIR to be overridden if needed. -$(2)_SRC_DOMAIN = $$(call domain,$($(2)_SITE)) -$(2)_SRC_VENDOR = $$(word 1,$$(subst /, ,$$(call notdomain,$($(2)_SITE)))) -$(2)_SRC_SOFTWARE = $$(word 2,$$(subst /, ,$$(call notdomain,$($(2)_SITE)))) +$(2)_SRC_DOMAIN = $$(call domain,$$($(2)_SITE)) +$(2)_SRC_VENDOR = $$(word 1,$$(subst /, ,$$(call notdomain,$$($(2)_SITE)))) +$(2)_SRC_SOFTWARE = $$(word 2,$$(subst /, ,$$(call notdomain,$$($(2)_SITE)))) $(2)_SRC_SUBDIR ?= $$($(2)_SRC_DOMAIN)/$$($(2)_SRC_VENDOR)/$$($(2)_SRC_SOFTWARE) $(2)_SRC_PATH = $$(@D)/$$($(2)_WORKSPACE)/src/$$($(2)_SRC_SUBDIR)