p7zip: Add new versions from fork (#35627)

This commit is contained in:
Mosè Giordano 2023-02-23 12:10:28 +00:00 committed by GitHub
parent 26c314f04f
commit 5c7cccd052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,13 +12,14 @@ class P7zip(MakefilePackage):
maintainers("vmiheer") maintainers("vmiheer")
homepage = "http://p7zip.sourceforge.net" homepage = "http://p7zip.sourceforge.net"
url = "https://downloads.sourceforge.net/project/p7zip/p7zip/16.02/p7zip_16.02_src_all.tar.bz2"
version("17.05", sha256="9473e324de6a87d89cb7ff65b0fec4ae3f147f03ffc138189c336a4650d74804")
version("17.04", sha256="ea029a2e21d2d6ad0a156f6679bd66836204aa78148a4c5e498fe682e77127ef")
version("16.02", sha256="5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f") version("16.02", sha256="5eb20ac0e2944f6cb9c2d51dd6c4518941c185347d4089ea89087ffdd6e2341f")
patch( patch(
"gcc10.patch", "gcc10.patch",
when="%gcc@10:", when="@16.02%gcc@10:",
sha256="96914025b9f431fdd75ae69768162d57751413634622f9df1a4bc4960e7e8fe1", sha256="96914025b9f431fdd75ae69768162d57751413634622f9df1a4bc4960e7e8fe1",
) )
@ -27,7 +28,7 @@ class P7zip(MakefilePackage):
# forbidden by C++17, the default standard targeted by GCC 11. # forbidden by C++17, the default standard targeted by GCC 11.
patch( patch(
"gcc11.patch", "gcc11.patch",
when="%gcc@11:", when="@16.02%gcc@11:",
sha256="39dd15f2dfc86eeee8c3a13ffde65c2ca919433cfe97ea126fbdc016afc587d1", sha256="39dd15f2dfc86eeee8c3a13ffde65c2ca919433cfe97ea126fbdc016afc587d1",
) )
@ -36,6 +37,17 @@ class P7zip(MakefilePackage):
depends_on("yasm", type="build", when="%clang") depends_on("yasm", type="build", when="%clang")
# Old package is abandoned, newer versions come from a fork
def url_for_version(self, version):
if version >= Version("17"):
return "https://github.com/p7zip-project/p7zip/archive/refs/tags/v{0}.tar.gz".format(
version
)
else:
return "https://downloads.sourceforge.net/project/p7zip/p7zip/{0}/p7zip_{0}_src_all.tar.bz2".format(
version
)
def edit(self, spec, prefix): def edit(self, spec, prefix):
# Use the suggested makefile # Use the suggested makefile
for tgt, makefile in { for tgt, makefile in {