[vlc-devel] [PATCH v2] tools: pick the right/available tool to do the sha512sum check

Steve Lhomme robux4 at ycbcr.xyz
Mon Aug 6 11:12:05 CEST 2018


shasum is not available on the latest msys2
these are the same tools in the same order as the contribs
---
 extras/tools/tools.mak | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/extras/tools/tools.mak b/extras/tools/tools.mak
index 8a86c32de4..240fc6eb80 100644
--- a/extras/tools/tools.mak
+++ b/extras/tools/tools.mak
@@ -24,9 +24,19 @@ else
 download = $(error Neither curl nor wget found!)
 endif
 
+ifeq ($(shell sha512sum --version >/dev/null 2>&1 || echo FAIL),)
+SHA512SUM = sha512sum --check
+else ifeq ($(shell shasum --version >/dev/null 2>&1 || echo FAIL),)
+SHA512SUM = shasum -a 512 --check
+else ifeq ($(shell openssl version >/dev/null 2>&1 || echo FAIL),)
+SHA512SUM = openssl dgst -sha512
+else
+SHA512SUM = $(error SHA-512 checksumming not found!)
+endif
+
 download_pkg = $(call download,$(VIDEOLAN)/$(2)/$(lastword $(subst /, ,$(@)))) || \
 	( $(call download,$(1)) && echo "Please upload package $(lastword $(subst /, ,$(@))) to our FTP" )  \
-	&& grep $(@) SHA512SUMS| shasum -a 512 -c
+	&& grep $(@) SHA512SUMS| $(SHA512SUM)
 
 UNPACK = $(RM) -R $@ \
     $(foreach f,$(filter %.tar.gz %.tgz,$^), && tar xvzf $(f)) \
-- 
2.17.0



More information about the vlc-devel mailing list