foam-extend: add v5.0 (#40480)

* foam-extend:add new version
* depreacted versions
This commit is contained in:
kjrstory 2023-12-06 11:11:59 +09:00 committed by GitHub
parent 1cd5397b12
commit 969fbbfb5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,13 +53,14 @@ class FoamExtend(Package):
and owner of the OPENFOAM trademark.
"""
homepage = "http://www.extend-project.de/"
homepage = "https://sourceforge.net/projects/foam-extend/"
version("5.0", git="http://git.code.sf.net/p/foam-extend/foam-extend-5.0.git")
version("4.1", git="http://git.code.sf.net/p/foam-extend/foam-extend-4.1.git")
version("4.0", git="http://git.code.sf.net/p/foam-extend/foam-extend-4.0.git")
version("3.2", git="http://git.code.sf.net/p/foam-extend/foam-extend-3.2.git")
version("3.1", git="http://git.code.sf.net/p/foam-extend/foam-extend-3.1.git")
version("3.0", git="http://git.code.sf.net/p/foam-extend/foam-extend-3.0.git")
version("3.1", git="http://git.code.sf.net/p/foam-extend/foam-extend-3.1.git", deprecated=True)
version("3.0", git="http://git.code.sf.net/p/foam-extend/foam-extend-3.0.git", deprecated=True)
# variant('int64', default=False,
# description='Compile with 64-bit label')
@ -87,6 +88,7 @@ class FoamExtend(Package):
# mgridgen is statically linked
depends_on("parmgridgen", when="+parmgridgen", type="build")
depends_on("paraview@:5.0.1", when="+paraview")
depends_on("mesquite")
# General patches
common = ["spack-Allwmake", "README-spack"]
@ -201,10 +203,28 @@ def archlib(self):
"""Relative location of architecture-specific libraries"""
return join_path("lib", self.foam_arch)
def rename_source(self):
"""The github tarfiles have weird names that do not correspond to the
canonical name. We need to rename these, but leave a symlink for
spack to work with.
"""
# Note that this particular Foam-Extned requires absolute directories
# to build correctly!
parent = os.path.dirname(self.stage.source_path)
original = os.path.basename(self.stage.source_path)
target = "foam-extend-{0}".format(self.version)
# Could also grep through etc/bashrc for WM_PROJECT_VERSION
with working_dir(parent):
if original != target and not os.path.lexists(target):
os.rename(original, target)
os.symlink(target, original)
tty.info("renamed {0} -> {1}".format(original, target))
def patch(self):
"""Adjust OpenFOAM build for spack.
Where needed, apply filter as an alternative to normal patching."""
add_extra_files(self, self.common, self.assets)
self.rename_source()
# Adjust ParMGridGen - this is still a mess
files = [
@ -262,6 +282,12 @@ def configure(self, spec, prefix):
"flex": {"FLEX_SYSTEM": 1, "FLEX_DIR": spec["flex"].prefix},
"bison": {"BISON_SYSTEM": 1, "BISON_DIR": spec["flex"].prefix},
"zlib": {"ZLIB_SYSTEM": 1, "ZLIB_DIR": spec["zlib-api"].prefix},
"mesquite": {
"MESQUITE_SYSTEM": 1,
"MESQUITE_DIR": spec["mesquite"].prefix,
"MESQUITE_INCLUDE_DIR": spec["mesquite"].prefix.include,
"NESQUITE_LIB_DIR": spec["mesquite"].prefix.lib,
},
}
# Adjust configuration via prefs - sort second
self.etc_prefs["001"].update(self.foam_arch.foam_dict())