tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-curses broken for python310


For lib/55220 I wanted to patch py-curses, i.e. the python39 code.
This worked and I committed it.

Then I wanted to do the same for python310 but the build failed.
This happens even before my (attached) patch.

creating build/temp.netbsd-9.99.92-amd64-3.10/Modules
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -fPIC -D_FORTIFY_SOURCE=2 -fstack-check -I/usr/include -I/usr/pkg/include -O2 -g -fPIC -D_FORTIFY_SOURCE=2 -fstack-check -I/usr/include -I/usr/pkg/include -O2 -g -fPIC -D_FORTIFY_SOURCE=2 -fstack-check -I/usr/include -I/usr/pkg/include -O2 -g -fPIC -D_FORTIFY_SOURCE=2 -fstack-check -I/usr/include -I/usr/pkg/include/python3.10 -g -I/usr/include -I/usr/pkg/include/python3.10 -fPIC -DHAVE_NCURSES_H -I/include -I/usr/pkg/include/python3.10 -c Modules/_cursesmodule.c -o build/temp.netbsd-9.99.92-amd64-3.10/Modules/_cursesmodule.o
Modules/_cursesmodule.c:106:10: fatal error: pycore_long.h: No such file or directory
  106 | #include "pycore_long.h"          // _PyLong_GetZero()
      |          ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/scratch/devel/py-curses/work/.cwrapper/bin/gcc' failed with exit code 1
*** Error code 1

Adding the path where pycore_long.h is installed to the compiler
include search paths just causes a different error.

1. can someone please fix that? or
2. should we just merge py-curses into python?

2 adds a curses dependency to python. On NetBSD that's a no-op, on
other system it causes ncurses to be built.

--- Modules/_cursesmodule.c.orig	2021-10-04 17:40:46.000000000 +0000
+++ Modules/_cursesmodule.c
@@ -1226,8 +1226,8 @@ PyCursesWindow_ChgAt(PyCursesWindowObjec
         return NULL;
-    color = (short)((attr >> 8) & 0xff);
-    attr = attr - (color << 8);
+    color = (short) PAIR_NUMBER(attr);
+    attr = attr & A_ATTRIBUTES;
     if (use_xy) {
         rtn = mvwchgat(self->win,y,x,num,attr,color,NULL);

Home | Main Index | Thread Index | Old Index