diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index f34f46afc8..ef890981bb 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -583,7 +583,9 @@ $(2)_DEPENDENCIES += host-skeleton endif ifneq ($$(filter cvs git svn,$$($(2)_SITE_METHOD)),) -$(2)_DOWNLOAD_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY) +$(2)_DOWNLOAD_DEPENDENCIES += \ + $(BR2_GZIP_HOST_DEPENDENCY) \ + $(BR2_TAR_HOST_DEPENDENCY) endif ifeq ($$(filter host-tar host-skeleton host-fakedate,$(1)),) diff --git a/support/dependencies/check-host-gzip.mk b/support/dependencies/check-host-gzip.mk new file mode 100644 index 0000000000..bf9a369a7d --- /dev/null +++ b/support/dependencies/check-host-gzip.mk @@ -0,0 +1,3 @@ +ifeq (,$(call suitable-host-package,gzip)) +BR2_GZIP_HOST_DEPENDENCY = host-gzip +endif diff --git a/support/dependencies/check-host-gzip.sh b/support/dependencies/check-host-gzip.sh new file mode 100755 index 0000000000..5f344c5f9b --- /dev/null +++ b/support/dependencies/check-host-gzip.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +candidate="$1" # ignored + +gzip="$(which gzip)" +if [ ! -x "${gzip}" ]; then + # echo nothing: no suitable gzip found + exit 1 +fi + +# gzip displays its version string on stdout +# pigz displays its version string on stderr +version="$("${gzip}" --version 2>&1)" +case "${version}" in + (*pigz*) + # echo nothing: no suitable gzip found + exit 1 + ;; +esac + +printf "%s" "${gzip}"