2024-01-02 16:21:30 +08:00
|
|
|
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
|
2019-09-19 01:53:01 +08:00
|
|
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
|
|
|
2022-05-29 00:55:44 +08:00
|
|
|
from spack.package import *
|
2019-09-19 01:53:01 +08:00
|
|
|
|
|
|
|
|
|
|
|
class Minizip(AutotoolsPackage):
|
|
|
|
"""C library for zip/unzip via zLib."""
|
|
|
|
|
2021-09-02 14:46:27 +08:00
|
|
|
homepage = "https://www.winimage.com/zLibDll/minizip.html"
|
2019-09-19 01:53:01 +08:00
|
|
|
url = "https://zlib.net/fossils/zlib-1.2.11.tar.gz"
|
|
|
|
|
2023-12-23 03:29:11 +08:00
|
|
|
license("Zlib")
|
|
|
|
|
2019-09-19 01:53:01 +08:00
|
|
|
version("1.2.11", sha256="c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1")
|
|
|
|
|
|
|
|
configure_directory = "contrib/minizip"
|
|
|
|
|
|
|
|
depends_on("automake", type="build")
|
|
|
|
depends_on("autoconf", type="build")
|
|
|
|
depends_on("libtool", type="build")
|
|
|
|
depends_on("m4", type="build")
|
2023-08-09 21:22:58 +08:00
|
|
|
depends_on("zlib-api")
|
2020-08-31 11:22:48 +08:00
|
|
|
|
2020-12-28 22:43:37 +08:00
|
|
|
# error: implicit declaration of function 'mkdir' is invalid in C99
|
|
|
|
patch("implicit.patch", when="%apple-clang@12:")
|
2021-03-20 22:51:03 +08:00
|
|
|
patch("implicit.patch", when="%gcc@7.3.0:")
|
2020-12-28 22:43:37 +08:00
|
|
|
|
|
|
|
# statically link to libz.a
|
|
|
|
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/minizip.rb
|
2021-03-20 22:51:03 +08:00
|
|
|
patch("static.patch", when="%apple-clang@12:")
|
2020-12-28 22:43:37 +08:00
|
|
|
|
2020-08-31 11:22:48 +08:00
|
|
|
# build minizip and miniunz
|
|
|
|
@run_before("autoreconf")
|
|
|
|
def build_minizip_binary(self):
|
|
|
|
configure()
|
|
|
|
make()
|
|
|
|
with working_dir(self.configure_directory):
|
|
|
|
make()
|
|
|
|
|
|
|
|
# install minizip and miniunz
|
|
|
|
@run_after("install")
|
|
|
|
def install_minizip_binary(self):
|
|
|
|
mkdirp(self.prefix.bin)
|
|
|
|
with working_dir(self.configure_directory):
|
|
|
|
install("minizip", self.prefix.bin)
|
|
|
|
install("miniunz", self.prefix.bin)
|