Skip to content

Commit 38ca6af

Browse files
authored
Merge pull request #95 from TopRichard/more-eb_hooks.py-changes-for-GRASS
add pre-configure hook for GRASS that replaces paths of filtered dependencies
2 parents 93ed6c6 + a6c8c1c commit 38ca6af

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

eb_hooks.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,24 @@ def pre_configure_hook_CUDA_Samples_test_remove(self, *args, **kwargs):
784784
raise EasyBuildError("CUDA-Samples-specific hook triggered for non-CUDA-Samples easyconfig?!")
785785

786786

787+
def pre_configure_hook_grass(self, *args, **kwargs):
788+
"""
789+
Pre-configure hook for GRASS to remove filtered deps specific configopts lines for readline, zlib, and bzlib
790+
"""
791+
if self.name == 'GRASS':
792+
# determine path to Prefix installation in compat layer via $EPREFIX
793+
eprefix = get_eessi_envvar('EPREFIX')
794+
795+
# Dependencies for which the configuration options need to be replaced
796+
filtered_deps = ['readline', 'zlib', 'bzlib']
797+
for dep in filtered_deps:
798+
self.cfg['configopts'] = re.sub(fr'--with-{dep}-includes=\S*', f'--with-{dep}-includes=$EPREFIX/usr/include', self.cfg['configopts'])
799+
self.cfg['configopts'] = re.sub(fr'--with-{dep}-libs=\S*', f'--with-{dep}-libs=$EPREFIX/usr/lib64', self.cfg['configopts'])
800+
print_msg("Using custom configure options for %s", self.name)
801+
else:
802+
raise EasyBuildError("GRASS-specific hook triggered for non-GRASS easyconfig?!")
803+
804+
787805
def pre_configure_hook_score_p(self, *args, **kwargs):
788806
"""
789807
Pre-configure hook for Score-p
@@ -1604,6 +1622,7 @@ def post_easyblock_hook(self, *args, **kwargs):
16041622
'CUDA-Samples': pre_configure_hook_CUDA_Samples_test_remove,
16051623
'GObject-Introspection': pre_configure_hook_gobject_introspection,
16061624
'Extrae': pre_configure_hook_extrae,
1625+
'GRASS': pre_configure_hook_grass,
16071626
'GROMACS': pre_configure_hook_gromacs,
16081627
'libfabric': pre_configure_hook_libfabric_disable_psm3_x86_64_generic,
16091628
'LLVM': pre_configure_hook_llvm,

0 commit comments

Comments
 (0)