Skip to content

Commit

Permalink
#8
Browse files Browse the repository at this point in the history
  • Loading branch information
prudhomm authored Oct 27, 2024
1 parent fea2171 commit b7e247a
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions var/spack/repos/builtin/packages/cln/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


import os

import spack.build_systems.autotools
import spack.build_systems.cmake
from spack.package import *


class Cln(AutotoolsPackage):
class Cln(CMakePackage, AutotoolsPackage):
"""CLN is a library for efficient computations with all kinds of numbers
in arbitrary precision. It features number classes for unlimited length
integers, rationals, arbitrary precision floating point numbers and much
Expand Down Expand Up @@ -40,16 +41,34 @@ class Cln(AutotoolsPackage):

variant("gmp", default=True, description="Enable GMP multiprecision library")

depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
# Build system
build_system(
conditional("cmake", when="@1.3:"),
conditional("autotools", when="@:1.2.2"),
default="cmake",
)

with when("build_system=autotools"):
depends_on("autoconf", type="build")
depends_on("automake", type="build")
depends_on("libtool", type="build")
depends_on("m4", type="build")
depends_on("texinfo", type="build")
# Dependencies required to define macro AC_LIB_LINKFLAGS_FROM_LIBS
depends_on("gettext", type="build")

with when("build_system=cmake"):
depends_on("cmake", type="build")

depends_on("[email protected]:", when="+gmp")
depends_on("texinfo", type="build")

# Dependencies required to define macro AC_LIB_LINKFLAGS_FROM_LIBS
depends_on("gettext", type="build")

class CMakeBuilder(spack.build_systems.cmake.CMakeBuilder):
def cmake_args(self):
return [self.define_from_variant("CLN_USE_GMP", "gmp")]


class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):
def autoreconf(self, spec, prefix):
autoreconf_args = ["-i"]

Expand Down

0 comments on commit b7e247a

Please sign in to comment.