From aca4be1fff3c8b21cd328932f6cae3449d974858 Mon Sep 17 00:00:00 2001 From: RĂ©mi Lacroix Date: Mon, 23 Jan 2023 22:46:19 +0100 Subject: n2p2: Allow building shared libraries (#35080) --- var/spack/repos/builtin/packages/n2p2/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/n2p2/package.py b/var/spack/repos/builtin/packages/n2p2/package.py index d9e482ea31..203ca3293a 100644 --- a/var/spack/repos/builtin/packages/n2p2/package.py +++ b/var/spack/repos/builtin/packages/n2p2/package.py @@ -29,6 +29,7 @@ class N2p2(MakefilePackage): ) variant("doc", default=False, description="build documentation with Doxygen") + variant("shared", default=False, description="build shared libraries") patch("interface-makefile.patch", when="@2.1.0") patch("interface-makefile211.patch", when="@2.1.1:") @@ -61,6 +62,9 @@ class N2p2(MakefilePackage): test_requires_compiler = True def edit(self, spec, prefix): + makefile = FileFilter(join_path("src", "makefile")) + makefile.filter("MODE=.*", "MODE={0}".format("shared" if "+shared" in spec else "static")) + makefile = FileFilter(join_path("src", "makefile.gnu")) blas_libs = self.spec["blas"].libs makefile.filter("PROJECT_CC=.*", "PROJECT_CC={0}".format(spack_cxx)) -- cgit v1.2.3-70-g09d2