Browse Source

- small changes to DOWNLOAD and EXTRACT macros

master
vanhofen 4 years ago
parent
commit
a8cc8a5597
  1. 29
      make/buildsystem-helpers.mk

29
make/buildsystem-helpers.mk

@ -9,39 +9,39 @@ download = wget --no-check-certificate -t3 -T60 -c -P $(DL_DIR)
WGET_DOWNLOAD = wget --no-check-certificate -t3 -T60 -c -P WGET_DOWNLOAD = wget --no-check-certificate -t3 -T60 -c -P
define DOWNLOAD define DOWNLOAD
$(call MESSAGE,"Downloading")
$(foreach hook,$($(PKG)_PRE_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
$(Q)( \ $(Q)( \
if [ "$($(PKG)_VER)" == "git" ]; then \ if [ "$($(PKG)_VER)" == "git" ]; then \
$(call MESSAGE,"Downloading") ; \
$(GET-GIT-SOURCE) $($(PKG)_SITE)/$($(PKG)_SOURCE) $(DL_DIR)/$($(PKG)_SOURCE); \ $(GET-GIT-SOURCE) $($(PKG)_SITE)/$($(PKG)_SOURCE) $(DL_DIR)/$($(PKG)_SOURCE); \
else \ elif [ "$($(PKG)_VER)" == "svn" ]; then \
if [ ! -f $(DL_DIR)/$($(PKG)_SOURCE) ]; then \ $(GET-SVN-SOURCE) $($(PKG)_SITE)/$($(PKG)_SOURCE) $(DL_DIR)/$($(PKG)_SOURCE); \
$(call MESSAGE,"Downloading") ; \ elif [ ! -f $(DL_DIR)/$(1) ]; then \
$(WGET_DOWNLOAD) $(DL_DIR) $($(PKG)_SITE)/$(1); \ $(WGET_DOWNLOAD) $(DL_DIR) $($(PKG)_SITE)/$(1); \
fi; \
fi; \ fi; \
) )
$(foreach hook,$($(PKG)_POST_DOWNLOAD_HOOKS),$(call $(hook))$(sep))
endef endef
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# unpack archives into build directory # unpack archives into given directory
define EXTRACT define EXTRACT # (directory)
@$(call MESSAGE,"Extracting") @$(call MESSAGE,"Extracting")
$(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep))
$(Q)( \ $(Q)( \
case $($(PKG)_SOURCE) in \ case $($(PKG)_SOURCE) in \
*.tar | *.tar.bz2 | *.tbz | *.tar.gz | *.tgz | *.tar.xz | *.txz) \ *.tar | *.tar.bz2 | *.tbz | *.tar.gz | *.tgz | *.tar.xz | *.txz) \
tar -xf ${DL_DIR}/$($(PKG)_SOURCE) -C ${1}; \ tar -xf ${DL_DIR}/$($(PKG)_SOURCE) -C $(1); \
;; \ ;; \
*.zip) \ *.zip) \
unzip -o -q ${DL_DIR}/$($(PKG)_SOURCE) -d ${1}; \ unzip -o -q ${DL_DIR}/$($(PKG)_SOURCE) -d $(1); \
;; \ ;; \
*.git) \ *.git) \
cp -a -t ${1} $(DL_DIR)/$($(PKG)_SOURCE); \ cp -a -t $(1) $(DL_DIR)/$($(PKG)_SOURCE); \
if test -z $($(PKG)_CHECKOUT); then \ if test $($(PKG)_CHECKOUT); then \
$(call MESSAGE,"use original head"); \
else \
$(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \ $(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \
$(CD) ${1}/$($(PKG)_DIR); git checkout -q $($(PKG)_CHECKOUT); \ $(CD) $(1)/$($(PKG)_DIR); git checkout $($(PKG)_CHECKOUT); \
fi; \ fi; \
;; \ ;; \
*) \ *) \
@ -49,6 +49,7 @@ define EXTRACT
false ;; \ false ;; \
esac \ esac \
) )
$(foreach hook,$($(PKG)_POST_EXTRACT_HOOKS),$(call $(hook))$(sep))
endef endef
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

Loading…
Cancel
Save