Skip to content

Commit

Permalink
depends: fix shasum on osx < 10.9
Browse files Browse the repository at this point in the history
Shasum verification from stdin doesn't work there, so we write to a file
instead.

Formatted a bit too.
  • Loading branch information
theuni committed Aug 16, 2014
1 parent 984ff68 commit 1910910
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions depends/funcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ $(sort $(foreach dep,$(2),$(2) $(call int_get_all_dependencies,$(1),$($(dep)_dep
endef

define fetch_file
(test -f $(SOURCES_PATH)/$(3) || ( mkdir -p $$($(1)_extract_dir) && $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)" && echo "$(4) $$($(1)_extract_dir)/$(3).temp" | $(build_SHA256SUM) -c && mv $$($(1)_extract_dir)/$(3).temp $(SOURCES_PATH)/$(3) ))
(test -f $(SOURCES_PATH)/$(3) || \
( mkdir -p $$($(1)_extract_dir) && $(build_DOWNLOAD) "$$($(1)_extract_dir)/$(3).temp" "$(2)" && \
echo "$(4) $$($(1)_extract_dir)/$(3).temp" > $$($(1)_extract_dir)/.$(3).hash && \
$(build_SHA256SUM) -c $$($(1)_extract_dir)/.$(3).hash && \
mv $$($(1)_extract_dir)/$(3).temp $(SOURCES_PATH)/$(3) ))
endef

define int_get_build_recipe_hash
Expand Down Expand Up @@ -62,7 +66,7 @@ $(1)_download_path_fixed=$(subst :,\:,$$($(1)_download_path))

#default commands
$(1)_fetch_cmds ?= $(call fetch_file,$(1),$(subst \:,:,$$($(1)_download_path_fixed)/$$($(1)_download_file)),$($(1)_file_name),$($(1)_sha256_hash))
$(1)_extract_cmds ?= echo "$$($(1)_sha256_hash) $$($(1)_source)" | $(build_SHA256SUM) -c && tar --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 && tar --strip-components=1 -xf $$($(1)_source)
$(1)_preprocess_cmds ?=
$(1)_build_cmds ?=
$(1)_config_cmds ?=
Expand Down

0 comments on commit 1910910

Please sign in to comment.