aboutsummaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorJohn Crispin <john@phrozen.org>2019-07-10 13:32:24 +0200
committerJo-Philipp Wich <jo@mein.io>2019-09-04 13:26:54 +0200
commit0f4a3be2f424ca137c0cbc5f1fbab8c1fd24d7cc (patch)
tree96a1e34843130598d7a71e68cca0674c6ed3d8a3 /include/package.mk
parentc00c06b877d6a7522670932ba52c217b36f72466 (diff)
downloadupstream-0f4a3be2f424ca137c0cbc5f1fbab8c1fd24d7cc.tar.gz
upstream-0f4a3be2f424ca137c0cbc5f1fbab8c1fd24d7cc.tar.bz2
upstream-0f4a3be2f424ca137c0cbc5f1fbab8c1fd24d7cc.zip
include/package.mk: Add support for src-checkout/ folder
This feature is similar to the SRC_TREE_OVERRIDE. However instead of having to manually create a symlink inside the package folder, the buildsystem will check if $(TOP_DIR)/src-checkout/$(PKG_NAME)/.git is present and use this instead. Signed-off-by: John Crispin <john@phrozen.org> (cherry picked from commit 9e57b627834166f0b0e365a165975fafd72ab951)
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/package.mk b/include/package.mk
index 06ff21b0b0..66137f211b 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -40,6 +40,10 @@ include $(INCLUDE_DIR)/prereq.mk
include $(INCLUDE_DIR)/unpack.mk
include $(INCLUDE_DIR)/depends.mk
+ifneq ($(wildcard $(TOPDIR)/git-src/$(PKG_NAME)/.git),)
+ USE_GIT_SRC_CHECKOUT:=1
+ QUILT:=1
+endif
ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
USE_GIT_TREE:=1
QUILT:=1
@@ -129,6 +133,18 @@ ifeq ($(DUMP)$(filter prereq clean refresh update,$(MAKECMDGOALS)),)
endif
endif
+ifdef USE_GIT_SRC_CHECKOUT
+ define Build/Prepare/Default
+ mkdir -p $(PKG_BUILD_DIR)
+ ln -s $(TOPDIR)/git-src/$(PKG_NAME)/.git $(PKG_BUILD_DIR)/.git
+ ( cd $(PKG_BUILD_DIR); \
+ git checkout .; \
+ git submodule update --recursive; \
+ git submodule foreach git config --unset core.worktree; \
+ git submodule foreach git checkout .; \
+ )
+ endef
+endif
ifdef USE_GIT_TREE
define Build/Prepare/Default
mkdir -p $(PKG_BUILD_DIR)
@@ -248,7 +264,7 @@ define Build/CoreTargets
endef
define Build/DefaultTargets
- $(if $(USE_SOURCE_DIR)$(USE_GIT_TREE),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
+ $(if $(USE_SOURCE_DIR)$(USE_GIT_TREE)$(USE_GIT_SRC_CHECKOUT),,$(if $(strip $(PKG_SOURCE_URL)),$(call Download,default)))
$(if $(DUMP),,$(Build/CoreTargets))
define Build/DefaultTargets