From 2eaca3a1f89ed5ed29eb79a116b560e31ffbc877 Mon Sep 17 00:00:00 2001 From: Vasyl Gello Date: Mon, 11 Jul 2022 11:33:32 +0000 Subject: =?UTF-8?q?CMake:=E2=80=8C=20Allow=20overriding=20the=20hashsums?= =?UTF-8?q?=20of=20local=20tarball?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The local tarballs specified via custom MODULE_URL can be different from what is pinned in 'tools/depends/target/*/*-VERSION' files. This manifested during preparation of 20.0 Alpha 2 build in Debian where libdvd* tarballs are custom. Now specifying MODULE_HASH along with MODULE_URL works as expected. Signed-off-by: Vasyl Gello --- cmake/scripts/common/ModuleHelpers.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake index 7d1f17d7e1..472cdbd92b 100644 --- a/cmake/scripts/common/ModuleHelpers.cmake +++ b/cmake/scripts/common/ModuleHelpers.cmake @@ -56,10 +56,14 @@ function(get_versionfile_data) endif() set(${MODULE}_BYPRODUCT ${${MODULE}_BYPRODUCT} PARENT_SCOPE) - if (${MODULE}_HASH_SHA256) - set(${MODULE}_HASH ${${MODULE}_HASH_SHA256} PARENT_SCOPE) - elseif(${MODULE}_HASH_SHA512) - set(${MODULE}_HASH ${${MODULE}_HASH_SHA512} PARENT_SCOPE) + # allow user to override the download URL hash with a local tarball hash + # needed for offline build envs + if (NOT DEFINED ${MODULE}_HASH) + if (${MODULE}_HASH_SHA256) + set(${MODULE}_HASH ${${MODULE}_HASH_SHA256} PARENT_SCOPE) + elseif(${MODULE}_HASH_SHA512) + set(${MODULE}_HASH ${${MODULE}_HASH_SHA512} PARENT_SCOPE) + endif() endif() endfunction() -- cgit v1.2.3