summarylogtreecommitdiffstats
path: root/0102-build-Fix-ncursesw-include-lookup.patch
diff options
context:
space:
mode:
authoratomlong2021-10-23 17:55:22 +0800
committeratomlong2021-10-23 18:06:15 +0800
commit80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch)
treeb48dd1e73de9ea35a4709fb6b93deb16331ec514 /0102-build-Fix-ncursesw-include-lookup.patch
parent89a67c05174951d172252b1db96ff93cc4ec4bcd (diff)
downloadaur-mingw-w64-python.tar.gz
update to 3.9.7
Diffstat (limited to '0102-build-Fix-ncursesw-include-lookup.patch')
-rw-r--r--0102-build-Fix-ncursesw-include-lookup.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/0102-build-Fix-ncursesw-include-lookup.patch b/0102-build-Fix-ncursesw-include-lookup.patch
new file mode 100644
index 000000000000..e25e92f126d2
--- /dev/null
+++ b/0102-build-Fix-ncursesw-include-lookup.patch
@@ -0,0 +1,65 @@
+From 7f0e7c96729a306b58ab87ecb4e051b460bec6ce Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:52:09 +0530
+Subject: [PATCH 102/N] build: Fix ncursesw include lookup
+
+Mirror what is already done for libffi; Look it up via
+pkg-config and use the exported path via sysconfig in setup.py
+---
+ Makefile.pre.in | 1 +
+ configure.ac | 9 ++++++++-
+ setup.py | 2 +-
+ 3 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.pre.in b/Makefile.pre.in
+index a8aecc2..3aca037 100644
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -313,6 +313,7 @@ IO_OBJS= \
+ ##########################################################################
+
+ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
++NCURSESW_INCLUDEDIR= @NCURSESW_INCLUDEDIR@
+
+ ##########################################################################
+ # Parser
+diff --git a/configure.ac b/configure.ac
+index 69cb8fb..6b21b79 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -5557,10 +5557,17 @@ then
+ [Define if you have struct stat.st_mtimensec])
+ fi
+
++if test -n "$PKG_CONFIG"; then
++ NCURSESW_INCLUDEDIR="`"$PKG_CONFIG" ncursesw --cflags-only-I 2>/dev/null | sed -e 's/^-I//;s/ *$//'`"
++else
++ NCURSESW_INCLUDEDIR=""
++fi
++AC_SUBST(NCURSESW_INCLUDEDIR)
++
+ # first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+ if test "$cross_compiling" = no; then
+- CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++ CPPFLAGS="$CPPFLAGS -I$NCURSESW_INCLUDEDIR"
+ fi
+
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+diff --git a/setup.py b/setup.py
+index d161108..46de8be 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1104,7 +1104,7 @@ class PyBuildExt(build_ext):
+ if curses_library == 'ncursesw':
+ curses_defines.append(('HAVE_NCURSESW', '1'))
+ if not CROSS_COMPILING:
+- curses_includes.append('/usr/include/ncursesw')
++ curses_includes.append(sysconfig.get_config_var("NCURSESW_INCLUDEDIR"))
+ # Bug 1464056: If _curses.so links with ncursesw,
+ # _curses_panel.so must link with panelw.
+ panel_library = 'panelw'
+--
+2.33.0
+