Skip to content

Commit

Permalink
libzip: links with external libs found on host and new version (spack…
Browse files Browse the repository at this point in the history
…#47230)

* libzip links with external libs found on host feelpp#6

* add maintainers

* fix style

* use multi-build system

/cc @wdconinc

* fix style

* rm space and rename variant bz2 to bzip2

/cc @wdconinc

* fix variant name for bzip2

* zstd is supported in libzip@:1.8

* fix style

* fix style

* fix style

* rm deprecated version and versions that cannot be found easily

use only cmake from now on

* fix style

* fix style

* use variant when option for zstd

* Update var/spack/repos/builtin/packages/libzip/package.py

Co-authored-by: Wouter Deconinck <[email protected]>

* fix style

/cc @wdconinc

---------

Co-authored-by: Wouter Deconinck <[email protected]>
  • Loading branch information
2 people authored and teaguesterling committed Feb 5, 2025
1 parent e37f024 commit 3f0eb09
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions var/spack/repos/builtin/packages/libzip/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
from spack.package import *


class Libzip(CMakePackage, AutotoolsPackage):
class Libzip(CMakePackage):
"""libzip is a C library for reading, creating,
and modifying zip archives."""

homepage = "https://libzip.org/"

maintainers("prudhomm")
license("BSD-3-Clause")

# current versions are released on GitHub
version("1.11.1", sha256="c0e6fa52a62ba11efd30262290dc6970947aef32e0cc294ee50e9005ceac092a")
version("1.10.1", sha256="9669ae5dfe3ac5b3897536dc8466a874c8cf2c0e3b1fdd08d75b273884299363")
version("1.9.2", sha256="fd6a7f745de3d69cf5603edc9cb33d2890f0198e415255d0987a0cf10d824c6f")
version("1.8.0", sha256="30ee55868c0a698d3c600492f2bea4eb62c53849bcf696d21af5eb65f3f3839e")
Expand All @@ -24,17 +25,6 @@ class Libzip(CMakePackage, AutotoolsPackage):
sha256="06eb8e9141fd19e2788cabaea9c9c2fd4d488d9e1484eb474bbfcac78e7b1d88",
url="https://github.com/nih-at/libzip/releases/download/rel-1-6-1/libzip-1.6.1.tar.gz",
)
# older releases are available on libzip.org
version(
"1.3.2",
sha256="ab4c34eb6c3a08b678cd0f2450a6c57a13e9618b1ba34ee45d00eb5327316457",
deprecated=True,
)
version(
"1.2.0",
sha256="6cf9840e427db96ebf3936665430bab204c9ebbd0120c326459077ed9c907d9f",
deprecated=True,
)

depends_on("c", type="build") # generated
depends_on("cxx", type="build") # generated
Expand All @@ -46,14 +36,25 @@ def url_for_version(self, version):

depends_on("zlib-api")

# Build system
build_system(
conditional("cmake", when="@1.4:"), conditional("autotools", when="@:1.3"), default="cmake"
)

@property
def headers(self):
# Up to version 1.3.0 zipconf.h was installed outside of self.prefix.include
return find_all_headers(
self.prefix if self.spec.satisfies("@:1.3.0") else self.prefix.include
)
variant("gnutls", default=True, description="Enable gnutls support")
variant("bzip2", default=True, description="Enable bzip2 support")
variant("lzma", default=True, description="Enable lzma support")
variant("openssl", default=True, description="Enable openssl support")
variant("zstd", default=True, description="Enable zstd support", when="@1.8:")
variant("mbedtls", default=True, description="Enable mbedtls support")
depends_on("gnutls", when="+gnutls")
depends_on("bzip2", when="+bzip2")
depends_on("lzma", when="+lzma")
depends_on("openssl", when="+openssl")
depends_on("mbedtls", when="+mbedtls")
depends_on("zstd", when="+zstd")

def cmake_args(self):
return [
self.define_from_variant("ENABLE_GNUTLS", "gnutls"),
self.define_from_variant("ENABLE_MBEDTLS", "mbedtls"),
self.define_from_variant("ENABLE_OPENSSL", "openssl"),
self.define_from_variant("ENABLE_BZIP2", "bzip2"),
self.define_from_variant("ENABLE_LZMA", "lzma"),
self.define_from_variant("ENABLE_ZSTD", "zstd"),
]

0 comments on commit 3f0eb09

Please sign in to comment.