package: libsodium update URL to GitHub (#44090)

Problem: the libsodium download endpoints are not reliable,
they fail multiple times a day for several of our automated
pipelines.
Solution: use the GitHub releases and branches.

Signed-off-by: vsoch <vsoch@users.noreply.github.com>
This commit is contained in:
Vanessasaurus 2024-05-09 06:26:02 -06:00 committed by GitHub
parent 71b035ece1
commit 7df35d0da0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,11 +15,15 @@ class Libsodium(AutotoolsPackage):
decryption, signatures, password hashing and more."""
homepage = "https://download.libsodium.org/doc/"
url = "https://download.libsodium.org/libsodium/releases/libsodium-1.0.13.tar.gz"
list_url = "https://download.libsodium.org/libsodium/releases/old"
url = "https://github.com/jedisct1/libsodium/releases/download/1.0.19-RELEASE/libsodium-1.0.19.tar.gz"
git = "https://github.com/jedisct1/libsodium.git"
license("ISC")
version("master", branch="master")
version("stable", branch="stable")
version("next", branch="next")
version("1.0.19", sha256="018d79fe0a045cca07331d37bd0cb57b2e838c51bc48fd837a1472e50068bbea")
version("1.0.18", sha256="6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1")
version("1.0.17", sha256="0cc3dae33e642cc187b5ceb467e0ad0e1b51dcba577de1190e9ffa17766ac2b1")
@ -32,14 +36,6 @@ class Libsodium(AutotoolsPackage):
version("1.0.0", sha256="ced1fe3d2066953fea94f307a92f8ae41bf0643739a44309cbe43aa881dbc9a5")
version("0.7.1", sha256="ef46bbb5bac263ef6d3fc00ccc11d4690aea83643412919fe15369b9870280a7")
def url_for_version(self, version):
url = "https://download.libsodium.org/libsodium/releases/"
if version < Version("1.0.16"):
url += "old/unsupported/"
elif version < Version("1.0.17"):
url += "old/"
return url + f"libsodium-{version}.tar.gz"
def patch(self):
# Necessary on ppc64le / aarch64, because Spack tries to execute these scripts
# to check if they work (see lib/spack/spack/build_systems/autotools.py).