Skip to content

Commit f940c71

Browse files
authored
Merge pull request #1 from boegel/hook-cmake-system
only remove `-DCURSES_.*_LIBRARY` configure options when building CMake…
2 parents 265f2bf + 2e9c060 commit f940c71

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

eb_hooks.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -942,23 +942,25 @@ def pre_configure_hook_LAMMPS_zen4(self, *args, **kwargs):
942942
else:
943943
raise EasyBuildError("LAMMPS-specific hook triggered for non-LAMMPS easyconfig?!")
944944

945+
945946
def pre_configure_hook_cmake_system(self, *args, **kwargs):
946947
"""
947-
pre-configure hook for cmake built with SYSTEM toolchain:
948-
- unset configopts for cmake easyconfigs using the SYSTEM toolchain
949-
- https://github.com/EESSI/software-layer/issues/1175
948+
pre-configure hook for CMake built with SYSTEM toolchain:
949+
- remove configure options that link to ncurses static libraries for CMake with system toolchain;
950+
see also https://github.com/EESSI/software-layer/issues/1175
950951
"""
951952

952953
if self.name == 'CMake':
953-
if self.toolchain.name == 'system':
954-
self.log.info("EESSI hook: unset configopts to build on top of EESSI compatibility layer")
955-
self.log.info("https://github.com/EESSI/software-layer/issues/1175")
956-
self.log.info(f"Current configopts before the EESSI custom hook: {self.cfg['configopts']}")
957-
self.cfg['configopts'] = ''
958-
self.log.info(f"Updated configopts after the EESSI custom hook: {self.cfg['configopts']}")
954+
if is_system_toolchain(self.toolchain.name):
955+
self.log.info("Removing configure options that require ncurses static libraries...")
956+
self.log.info(f"Original configopts value: {self.cfg['configopts']}")
957+
regex = re.compile("-DCURSES_[A-Z]+_LIBRARY=\$EBROOTNCURSES/lib/lib[a-z]+\.a")
958+
self.cfg['configopts'] = regex.sub(self.cfg['configopts'], '')
959+
self.log.info(f"Updated configopts value: {self.cfg['configopts']}")
959960
else:
960961
raise EasyBuildError("CMake-specific hook triggered for non-CMake easyconfig?!")
961962

963+
962964
def pre_test_hook(self, *args, **kwargs):
963965
"""Main pre-test hook: trigger custom functions based on software name."""
964966
if self.name in PRE_TEST_HOOKS:

0 commit comments

Comments
 (0)