build: add a default build tar in depends

This is so we can override it later for BSDs.
pull/23998/head
fanquake 3 years ago
parent a7e80449c0
commit 75ae39eeec
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -182,7 +182,7 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
mkdir -p $(@D) mkdir -p $(@D)
echo copying packages: $^ echo copying packages: $^
echo to: $(@D) echo to: $(@D)
cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); ) cd $(@D); $(foreach package,$^, $(build_TAR) xf $($(package)_cached); )
touch $@ touch $@
# $PATH is not preserved between ./configure and make by convention. Its # $PATH is not preserved between ./configure and make by convention. Its

@ -1,6 +1,7 @@
default_build_CC = gcc default_build_CC = gcc
default_build_CXX = g++ default_build_CXX = g++
default_build_AR = ar default_build_AR = ar
default_build_TAR = tar
default_build_RANLIB = ranlib default_build_RANLIB = ranlib
default_build_STRIP = strip default_build_STRIP = strip
default_build_NM = nm default_build_NM = nm
@ -12,7 +13,7 @@ build_$(build_os)_$1 ?= $$(default_build_$1)
build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1)
build_$1=$$(build_$(build_arch)_$(build_os)_$1) build_$1=$$(build_$(build_arch)_$(build_os)_$1)
endef endef
$(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) $(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var))))
define add_build_flags_func define add_build_flags_func
build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1)
build_$1=$$(build_$(build_arch)_$(build_os)_$1) build_$1=$$(build_$(build_arch)_$(build_os)_$1)

@ -84,7 +84,7 @@ $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path))
#default commands #default commands
# The default behavior for tar will try to set ownership when running as uid 0 and may not succeed, --no-same-owner disables this behavior # The default behavior for tar will try to set ownership when running as uid 0 and may not succeed, --no-same-owner disables this behavior
$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash)) $(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash))
$(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && tar --no-same-owner --strip-components=1 -xf $$($(1)_source) $(1)_extract_cmds ?= mkdir -p $$($(1)_extract_dir) && echo "$$($(1)_sha256_hash) $$($(1)_source)" > $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_SHA256SUM) -c $$($(1)_extract_dir)/.$$($(1)_file_name).hash && $(build_TAR) --no-same-owner --strip-components=1 -xf $$($(1)_source)
$(1)_preprocess_cmds ?= $(1)_preprocess_cmds ?=
$(1)_build_cmds ?= $(1)_build_cmds ?=
$(1)_config_cmds ?= $(1)_config_cmds ?=
@ -207,7 +207,7 @@ $($(1)_preprocessed): | $($(1)_extracted)
touch $$@ touch $$@
$($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed) $($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed)
echo Configuring $(1)... echo Configuring $(1)...
rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar --no-same-owner -xf $($(package)_cached); ) rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), $(build_TAR) --no-same-owner -xf $($(package)_cached); )
mkdir -p $$(@D) mkdir -p $$(@D)
+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1)) +cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1))
touch $$@ touch $$@
@ -228,7 +228,7 @@ $($(1)_postprocessed): | $($(1)_staged)
touch $$@ touch $$@
$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) $($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed)
echo Caching $(1)... echo Caching $(1)...
cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T - cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | $(build_TAR) --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T -
mkdir -p $$(@D) mkdir -p $$(@D)
rm -rf $$(@D) && mkdir -p $$(@D) rm -rf $$(@D) && mkdir -p $$(@D)
mv $$($(1)_staging_dir)/$$(@F) $$(@) mv $$($(1)_staging_dir)/$$(@F) $$(@)

@ -201,11 +201,11 @@ define $(package)_extract_cmds
echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
mkdir qtbase && \ mkdir qtbase && \
tar --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
mkdir qttranslations && \ mkdir qttranslations && \
tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
mkdir qttools && \ mkdir qttools && \
tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools
endef endef
# Preprocessing steps work as follows: # Preprocessing steps work as follows:

Loading…
Cancel
Save