From 578cc415dfdeee8f2113ac9f820c2a739ae71c67 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Tue, 23 Jan 2024 13:10:07 +0100 Subject: [PATCH] use correct TCL configure options for Python 3.11+ --- easybuild/easyblocks/p/python.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/easybuild/easyblocks/p/python.py b/easybuild/easyblocks/p/python.py index d01cf50ae8..8fb8c06401 100644 --- a/easybuild/easyblocks/p/python.py +++ b/easybuild/easyblocks/p/python.py @@ -376,8 +376,6 @@ def configure_step(self): if tcltk_maj_min_ver != '.'.join(tkver.split('.')[:2]): raise EasyBuildError("Tcl and Tk major/minor versions don't match: %s vs %s", tclver, tkver) - self.cfg.update('configopts', "--with-tcltk-includes='-I%s/include -I%s/include'" % (tcl, tk)) - tcl_libdir = os.path.join(tcl, get_software_libdir('Tcl')) tk_libdir = os.path.join(tk, get_software_libdir('Tk')) tcltk_libs = "-L%(tcl_libdir)s -L%(tk_libdir)s -ltcl%(maj_min_ver)s -ltk%(maj_min_ver)s" % { @@ -385,7 +383,12 @@ def configure_step(self): 'tk_libdir': tk_libdir, 'maj_min_ver': tcltk_maj_min_ver, } - self.cfg.update('configopts', "--with-tcltk-libs='%s'" % tcltk_libs) + if LooseVersion(self.version) < '3.11': + self.cfg.update('configopts', "--with-tcltk-includes='-I%s/include -I%s/include'" % (tcl, tk)) + self.cfg.update('configopts', "--with-tcltk-libs='%s'" % tcltk_libs) + else: + env.setvar('TCLTK_CFLAGS', '-I%s/include -I%s/include' % (tcl, tk)) + env.setvar('TCLTK_LIBS', tcltk_libs) # don't add user site directory to sys.path (equivalent to python -s) # This matters e.g. when python installs the bundled pip & setuptools (for >= 3.4)