@@ -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+
945946def 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+
962964def 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