Browse Source

- add $(PKG)_EXTRACT_DIR to fix packages w/o subdirs in archive

master
vanhofen 3 years ago
parent
commit
76c7ffbe97
  1. 30
      package/pkg-utils.mk

30
package/pkg-utils.mk

@ -38,6 +38,11 @@ ifeq ($(PKG_PACKAGE),HOST)
endif endif
endif endif
# extract
ifndef $(PKG)_EXTRACT_DIR
$(PKG)_EXTRACT_DIR =
endif
# patch # patch
ifndef $(PKG)_PATCH ifndef $(PKG)_PATCH
$(PKG)_PATCH = $$(PKG_PATCHES_DIR) $(PKG)_PATCH = $$(PKG_PATCHES_DIR)
@ -263,39 +268,44 @@ define EXTRACT # (directory)
@$(call MESSAGE,"Extracting") @$(call MESSAGE,"Extracting")
$(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep)) $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep))
$(Q)( \ $(Q)( \
EXTRACT_DIR=$(1); \
if [ "$($(PKG)_EXTRACT_DIR)" ]; then \
EXTRACT_DIR=$(1)/$($(PKG)_EXTRACT_DIR); \
$(INSTALL) -d $${EXTRACT_DIR}; \
fi; \
case $($(PKG)_VERSION).$($(PKG)_SOURCE) in \ case $($(PKG)_VERSION).$($(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 $${EXTRACT_DIR}; \
;; \ ;; \
*.zip) \ *.zip) \
unzip -o -q ${DL_DIR}/$($(PKG)_SOURCE) -d $(1); \ unzip -o -q $(DL_DIR)/$($(PKG)_SOURCE) -d $${EXTRACT_DIR}; \
;; \ ;; \
ni-git.*) \ ni-git.*) \
cp -a -t $(1) $(SOURCE_DIR)/$($(PKG)_SOURCE); \ cp -a -t $${EXTRACT_DIR} $(SOURCE_DIR)/$($(PKG)_SOURCE); \
if test $($(PKG)_CHECKOUT); then \ if test $($(PKG)_CHECKOUT); then \
$(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \ $(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \
$(CD) $(1)/$($(PKG)_DIR); git checkout $($(PKG)_CHECKOUT); \ $(CD) $${EXTRACT_DIR}/$($(PKG)_DIR); git checkout $($(PKG)_CHECKOUT); \
fi; \ fi; \
;; \ ;; \
*.git | git.*) \ *.git | git.*) \
cp -a -t $(1) $(DL_DIR)/$($(PKG)_SOURCE); \ cp -a -t $${EXTRACT_DIR} $(DL_DIR)/$($(PKG)_SOURCE); \
if test $($(PKG)_CHECKOUT); then \ if test $($(PKG)_CHECKOUT); then \
$(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \ $(call MESSAGE,"git checkout $($(PKG)_CHECKOUT)"); \
$(CD) $(1)/$($(PKG)_DIR); git checkout $($(PKG)_CHECKOUT); \ $(CD) $${EXTRACT_DIR}/$($(PKG)_DIR); git checkout $($(PKG)_CHECKOUT); \
fi; \ fi; \
;; \ ;; \
*.hg | hg.*) \ *.hg | hg.*) \
cp -a -t $(1) $(DL_DIR)/$($(PKG)_SOURCE); \ cp -a -t $${EXTRACT_DIR} $(DL_DIR)/$($(PKG)_SOURCE); \
if test $($(PKG)_CHECKOUT); then \ if test $($(PKG)_CHECKOUT); then \
$(call MESSAGE,"hg checkout $($(PKG)_CHECKOUT)"); \ $(call MESSAGE,"hg checkout $($(PKG)_CHECKOUT)"); \
$(CD) $(1)/$($(PKG)_DIR); hg checkout $($(PKG)_CHECKOUT); \ $(CD) $${EXTRACT_DIR}/$($(PKG)_DIR); hg checkout $($(PKG)_CHECKOUT); \
fi; \ fi; \
;; \ ;; \
*.svn | svn.*) \ *.svn | svn.*) \
cp -a -t $(1) $(DL_DIR)/$($(PKG)_SOURCE); \ cp -a -t $${EXTRACT_DIR} $(DL_DIR)/$($(PKG)_SOURCE); \
if test $($(PKG)_CHECKOUT); then \ if test $($(PKG)_CHECKOUT); then \
$(call MESSAGE,"svn checkout $($(PKG)_CHECKOUT)"); \ $(call MESSAGE,"svn checkout $($(PKG)_CHECKOUT)"); \
$(CD) $(1)/$($(PKG)_DIR); svn checkout $($(PKG)_CHECKOUT); \ $(CD) $${EXTRACT_DIR}/$($(PKG)_DIR); svn checkout $($(PKG)_CHECKOUT); \
fi; \ fi; \
;; \ ;; \
*) \ *) \

Loading…
Cancel
Save