diff options
author | Vasyl Gello <vasek.gello@gmail.com> | 2022-07-11 11:33:32 +0000 |
---|---|---|
committer | Vasyl Gello <vasek.gello@gmail.com> | 2022-08-02 11:12:40 +0300 |
commit | 2eaca3a1f89ed5ed29eb79a116b560e31ffbc877 (patch) | |
tree | b52111ea4b0e4f9d90ce6e8688599269ba506f46 /cmake | |
parent | 0172d460c6a3121aa4049074e642005bf492c083 (diff) |
CMake: Allow overriding the hashsums of local tarball
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 <vasek.gello@gmail.com>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/scripts/common/ModuleHelpers.cmake | 12 |
1 files 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() |