googletest: Fix url_for_version (#42027)

This commit is contained in:
Juan Miguel Carceller 2024-01-11 14:13:13 +01:00 committed by GitHub
parent 7d8dff3a30
commit 7e814da5c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@ class Googletest(CMakePackage):
"""Google test framework for C++. Also called gtest."""
homepage = "https://github.com/google/googletest"
url = "https://github.com/google/googletest/archive/release-1.10.0.tar.gz"
url = "https://github.com/google/googletest/archive/refs/tags/v1.14.0.tar.gz"
git = "https://github.com/google/googletest"
maintainers("sethrj")
@ -85,11 +85,11 @@ def url_for_version(self, version):
while versions up to, and including, 1.8.0 are available only from
`archive/release-<version>.tar.gz`
"""
if version.satisfies("@:1.8.0"):
if version <= Version("1.8.0"):
return f"{self.git}/archive/release-{version}.tar.gz"
tagname = f"release-{version}"
if version.satisfies("@1.13:"):
if version >= Version("1.13"):
tagname = f"v{version}"
return f"{self.git}/archive/refs/tags/{tagname}.tar.gz"