n2p2: Allow building shared libraries (#35080)

This commit is contained in:
Rémi Lacroix 2023-01-23 22:46:19 +01:00 committed by GitHub
parent beba33b2d8
commit aca4be1fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))