From 9d0b9f086f9b490bfdb7361ea549ca5574a254af Mon Sep 17 00:00:00 2001 From: Sajid Ali Date: Tue, 20 Aug 2024 00:09:55 -0400 Subject: [PATCH] Fix linking for python with external ncurses (#45803) Co-authored-by: Adam J. Stewart --- var/spack/repos/builtin/packages/python/package.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 0392cda87b5303..34c1547cd2eded 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -641,10 +641,11 @@ def configure_args(self): else: config_args.append("--without-system-expat") - if "+ctypes" in spec: - config_args.append("--with-system-ffi") - else: - config_args.append("--without-system-ffi") + if self.version < Version("3.12.0"): + if "+ctypes" in spec: + config_args.append("--with-system-ffi") + else: + config_args.append("--without-system-ffi") if "+tkinter" in spec: config_args.extend( @@ -668,6 +669,9 @@ def configure_args(self): if cflags: config_args.append("CFLAGS={0}".format(" ".join(cflags))) + if self.version >= Version("3.12.0") and sys.platform == "darwin": + config_args.append("CURSES_LIBS={0}".format(spec["ncurses"].libs.link_flags)) + return config_args def configure(self, spec, prefix):