From c564b2d9690935f1fa0ef13a4b84248f9c2d5348 Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Mon, 27 Nov 2023 13:12:49 +0100 Subject: [PATCH] googletest: Add 1.13.0 and 1.14.0 tags (#41253) * Add latest tags for googletest * Implement proper url_for_version * Fix hashes for older versions --- .../builtin/packages/googletest/package.py | 31 +++++++++++++++---- 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/googletest/package.py b/var/spack/repos/builtin/packages/googletest/package.py index bf995e9a4a..a375853902 100644 --- a/var/spack/repos/builtin/packages/googletest/package.py +++ b/var/spack/repos/builtin/packages/googletest/package.py @@ -16,14 +16,16 @@ class Googletest(CMakePackage): maintainers("sethrj") version("main", branch="main") + version("1.14.0", sha256="8ad598c73ad796e0d8280b082cebd82a630d73e73cd3c70057938a6501bba5d7") + version("1.13.0", sha256="ad7fdba11ea011c1d925b3289cf4af2c66a352e18d4c7264392fead75e919363") version("1.12.1", sha256="81964fe578e9bd7c94dfdb09c8e4d6e6759e19967e397dbea48d1c10e45d0df2") version("1.12.0", sha256="2a4f11dce6188b256f3650061525d0fe352069e5c162452818efbbf8d0b5fe1c") - version("1.11.0", sha256="07b0896360f8e14414a8419e35515da0be085c5b4547c914ab8f4684ef0a3a8e") - version("1.10.0", sha256="e4a7cd97c903818abe7ddb129db9c41cc9fd9e2ded654be57ced26d45c72e4c9") - version("1.8.1", sha256="8e40a005e098b1ba917d64104549e3da274e31261dedc57d6250fe91391b2e84") - version("1.8.0", sha256="d8c33605d23d303b08a912eaee7f84c4e091d6e3d90e9a8ec8aaf7450dfe2568") - version("1.7.0", sha256="9639cf8b7f37a4d0c6575f52c01ef167c5f11faee65252296b3ffc2d9acd421b") - version("1.6.0", sha256="a61e20c65819eb39a2da85c88622bac703b865ca7fe2bfdcd3da734d87d5521a") + version("1.11.0", sha256="b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5") + version("1.10.0", sha256="9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb") + version("1.8.1", sha256="9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c") + version("1.8.0", sha256="58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8") + version("1.7.0", sha256="f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc") + version("1.6.0", sha256="5fbc058e5b662b9c86d93ac76fefb58eec89cbf26144b49669a38ecb62758447") variant("gmock", default=True, when="@1.8:", description="Build with gmock") variant("pthreads", default=True, description="Build multithreaded version with pthreads") @@ -74,3 +76,20 @@ def darwin_fix(self): # The shared library is not installed correctly on Darwin; fix this if self.spec.satisfies("platform=darwin"): fix_darwin_install_name(self.prefix.lib) + + def url_for_version(self, version): + """googletest has changed how they publish releases on github. Up until, + including version 1.12.1 they were tagged as `release-`. + Afterwards things switched to the format `v`. Additionally, + newer versions are available from `archive/refs/tags/.tar.gz`, + while versions up to, and including, 1.8.0 are available only from + `archive/release-.tar.gz` + """ + if version.satisfies("@:1.8.0"): + return f"{self.git}/archive/release-{version}.tar.gz" + + tagname = f"release-{version}" + if version.satisfies("@1.13:"): + tagname = f"v{version}" + + return f"{self.git}/archive/refs/tags/{tagname}.tar.gz"