Skip to content

Commit 75ae39e

Browse files
committed
build: add a default build tar in depends
This is so we can override it later for BSDs.
1 parent a7e8044 commit 75ae39e

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

depends/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages)
182182
mkdir -p $(@D)
183183
echo copying packages: $^
184184
echo to: $(@D)
185-
cd $(@D); $(foreach package,$^, tar xf $($(package)_cached); )
185+
cd $(@D); $(foreach package,$^, $(build_TAR) xf $($(package)_cached); )
186186
touch $@
187187

188188
# $PATH is not preserved between ./configure and make by convention. Its

depends/builders/default.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
default_build_CC = gcc
22
default_build_CXX = g++
33
default_build_AR = ar
4+
default_build_TAR = tar
45
default_build_RANLIB = ranlib
56
default_build_STRIP = strip
67
default_build_NM = nm
@@ -12,7 +13,7 @@ build_$(build_os)_$1 ?= $$(default_build_$1)
1213
build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1)
1314
build_$1=$$(build_$(build_arch)_$(build_os)_$1)
1415
endef
15-
$(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var))))
16+
$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var))))
1617
define add_build_flags_func
1718
build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1)
1819
build_$1=$$(build_$(build_arch)_$(build_os)_$1)

depends/funcs.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path))
8484
#default commands
8585
# 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
8686
$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)),$$($(1)_download_file),$($(1)_file_name),$($(1)_sha256_hash))
87-
$(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)
87+
$(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)
8888
$(1)_preprocess_cmds ?=
8989
$(1)_build_cmds ?=
9090
$(1)_config_cmds ?=
@@ -207,7 +207,7 @@ $($(1)_preprocessed): | $($(1)_extracted)
207207
touch $$@
208208
$($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed)
209209
echo Configuring $(1)...
210-
rm -rf $(host_prefix); mkdir -p $(host_prefix)/lib; cd $(host_prefix); $(foreach package,$($(1)_all_dependencies), tar --no-same-owner -xf $($(package)_cached); )
210+
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); )
211211
mkdir -p $$(@D)
212212
+cd $$(@D); $($(1)_config_env) $(call $(1)_config_cmds, $(1))
213213
touch $$@
@@ -228,7 +228,7 @@ $($(1)_postprocessed): | $($(1)_staged)
228228
touch $$@
229229
$($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed)
230230
echo Caching $(1)...
231-
cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | tar --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T -
231+
cd $$($(1)_staging_dir)/$(host_prefix); find . | sort | $(build_TAR) --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T -
232232
mkdir -p $$(@D)
233233
rm -rf $$(@D) && mkdir -p $$(@D)
234234
mv $$($(1)_staging_dir)/$$(@F) $$(@)

depends/packages/qt.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ define $(package)_extract_cmds
201201
echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
202202
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
203203
mkdir qtbase && \
204-
tar --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
204+
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \
205205
mkdir qttranslations && \
206-
tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
206+
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \
207207
mkdir qttools && \
208-
tar --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools
208+
$(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools
209209
endef
210210

211211
# Preprocessing steps work as follows:

0 commit comments

Comments
 (0)