From cc92b9a3a2005ef494bf7b1249ffd64e68f81217 Mon Sep 17 00:00:00 2001 From: Nicolas Richart Date: Fri, 2 Dec 2016 22:51:03 +0100 Subject: foam-extend: modification to accept flex version >= 2.6 (#2452) * Modification to accept flex version >= 2.6 + bug fix on paraview dependency * flake8 "corrections" --- .../repos/builtin/packages/foam-extend/package.py | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py index 6b3b87a110..163871d823 100644 --- a/var/spack/repos/builtin/packages/foam-extend/package.py +++ b/var/spack/repos/builtin/packages/foam-extend/package.py @@ -39,7 +39,7 @@ class FoamExtend(Package): depends_on('mpi') depends_on('python') - depends_on('flex@:2.5.99') + depends_on('flex') depends_on('zlib') depends_on('cmake', type='build') @@ -92,7 +92,7 @@ class FoamExtend(Package): filter_file( r'-lMGridGen', r'-lmgrid', - 'src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options') # noqa + 'src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options') # noqa: E501 # Get the wmake arch and compiler (arch, foam_compiler) = self.set_arch() @@ -155,11 +155,11 @@ class FoamExtend(Package): if '+paraview' in self.spec: prefs_dict['PARAVIEW_SYSTEM'] = 1 - prefs_dict['PARAVIEW_DIR'] = self.spec['paraview'].prefix, - prefs_dict['PARAVIEW_BIN_DIR'] = self.spec['paraview'].prefix.bin, + prefs_dict['PARAVIEW_DIR'] = self.spec['paraview'].prefix + prefs_dict['PARAVIEW_BIN_DIR'] = self.spec['paraview'].prefix.bin prefs_dict['QT_SYSTEM'] = 1 - prefs_dict['QT_DIR'] = self.spec['qt'].prefix, - prefs_dict['QT_BIN_DIR'] = self.spec['qt'].prefix.bin, + prefs_dict['QT_DIR'] = self.spec['qt'].prefix + prefs_dict['QT_BIN_DIR'] = self.spec['qt'].prefix.bin # write the prefs files to define the configuration needed, # only the prefs.sh is used by this script but both are @@ -215,6 +215,22 @@ class FoamExtend(Package): for key, val in compiler_flags.iteritems(): fh.write('{0}{1} = {2}\n'.format(comp, key, val)) + _files_to_patch = [ + 'src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L', # noqa: E501 + 'src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L', # noqa: E501 + 'src/meshTools/triSurface/triSurface/interfaces/STL/readSTLASCII.L', # noqa: E501 + 'applications/utilities/preProcessing/fluentDataToFoam/fluentDataToFoam.L', # noqa: E501 + 'applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L', # noqa: E501 + 'applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L', # noqa: E501 + 'applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L', # noqa: E501 + 'applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L', # noqa: E501 + 'applications/utilities/mesh/conversion/fluent3DMeshToElmer/fluent3DMeshToElmer.L' # noqa: E501 + ] + for _file in _files_to_patch: + filter_file(r'#if YY_FLEX_SUBMINOR_VERSION < 34', + r'#if YY_FLEX_MAJOR_VERSION <= 2 && YY_FLEX_MINOR_VERSION <= 5 && YY_FLEX_SUBMINOR_VERSION < 34', # noqa: E501 + _file) + def setup_environment(self, spack_env, run_env): with working_dir(self.stage.path): spack_env.set('FOAM_INST_DIR', os.path.abspath('.')) @@ -240,6 +256,7 @@ class FoamExtend(Package): if '+source' in spec: install_tree('src', join_path(install_path, 'src')) + install_tree('tutorials', join_path(install_path, 'tutorials')) install_tree('lib', join_path(install_path, 'lib')) install_tree('bin', join_path(install_path, 'bin')) -- cgit v1.2.3-60-g2f50