From e1f07e98ae396396f2260d4138299e7156096080 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Mon, 7 Aug 2023 19:48:12 +0200 Subject: [PATCH] libdeflate: new versions, switch to cmake (#39062) --- .../builtin/packages/libdeflate/package.py | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/libdeflate/package.py b/var/spack/repos/builtin/packages/libdeflate/package.py index 0a3c1e11c7..34f8751c43 100644 --- a/var/spack/repos/builtin/packages/libdeflate/package.py +++ b/var/spack/repos/builtin/packages/libdeflate/package.py @@ -3,10 +3,11 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.build_systems import cmake, makefile from spack.package import * -class Libdeflate(MakefilePackage): +class Libdeflate(MakefilePackage, CMakePackage): """Heavily optimized library for DEFLATE/zlib/gzip compression and decompression""" homepage = "https://github.com/ebiggers/libdeflate" @@ -14,11 +15,29 @@ class Libdeflate(MakefilePackage): maintainers("dorton21") + version("1.18", sha256="225d982bcaf553221c76726358d2ea139bb34913180b20823c782cede060affd") + version("1.14", sha256="89e7df898c37c3427b0f39aadcf733731321a278771d20fc553f92da8d4808ac") version("1.10", sha256="5c1f75c285cd87202226f4de49985dcb75732f527eefba2b3ddd70a8865f2533") version("1.7", sha256="a5e6a0a9ab69f40f0f59332106532ca76918977a974e7004977a9498e3f11350") + build_system( + conditional("makefile", when="@:1.14"), + conditional("cmake", when="@1.15:"), + default="cmake", + ) + depends_on("zlib") depends_on("gzip") - def patch(self): - filter_file(r"\/usr\/local", self.prefix, "Makefile") + with when("build_system=cmake"): + depends_on("cmake@3.7:", type="build") + + +class MakefileBuilder(makefile.MakefileBuilder): + def install(self, pkg, spec, prefix): + with working_dir(self.build_directory): + make("install", f"PREFIX={prefix}") + + +class CMakeBuilder(cmake.CMakeBuilder): + pass