mirror of
https://github.com/openwrt/openwrt.git
synced 2026-07-15 06:11:53 +04:00
build: support git-src override for host builds
Extend the git-src source tree override to host builds. It is opt-in via HOST_USE_GIT_SRC, since by default the host build keeps using the tarball. Move the git-src detection and checkout recipe into unpack.mk so both the target and host build reuse the same code. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
@@ -70,3 +70,18 @@ endif
|
||||
|
||||
endif # PKG_SOURCE
|
||||
|
||||
GIT_SRC_CHECKOUT_DIR = $(wildcard $(TOPDIR)/git-src/$(PKG_NAME)/.git)
|
||||
GIT_TREE_OVERRIDE_DIR = $(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src))
|
||||
|
||||
# $1=build directory, $2=.git directory to link into it
|
||||
define Prepare/git-src
|
||||
mkdir -p $(1)
|
||||
ln -s $(2) $(1)/.git
|
||||
( cd $(1); \
|
||||
git checkout .; \
|
||||
git submodule update --recursive; \
|
||||
git submodule foreach git config --unset core.worktree; \
|
||||
git submodule foreach git checkout .; \
|
||||
)
|
||||
endef
|
||||
|
||||
|
||||
Reference in New Issue
Block a user