1
Index: newt/Makefile.in
2
Description: Patches for python3 support.
3
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=691240
4
Last-Updated: 2013-05-15
7
Index: newt-0.52.15/Makefile.in
2
8
===================================================================
3
--- newt.orig/Makefile.in 2012-12-23 17:44:17.187381000 +0900
4
+++ newt/Makefile.in 2012-12-23 17:44:17.187381000 +0900
9
--- newt-0.52.15.orig/Makefile.in 2013-05-15 16:05:52.000000000 +0100
10
+++ newt-0.52.15/Makefile.in 2013-05-15 16:05:52.000000000 +0100
6
12
TAG = r$(subst .,-,$(VERSION))
11
17
WHIPTCLSO = @WHIPTCLSO@
13
19
PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey
15
$(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
17
_snackmodule.so: snackmodule.c $(LIBNEWTSH)
19
[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
20
+ for variant in '' '-dbg'; do \
22
+ python3*) abitag=.$$($$ver$$variant -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))");; \
23
+ *) if [ -z "$$variant" ]; then abitag=; else abitag=_d; fi; \
26
- PCFLAGS=`$$ver-config --cflags`; \
27
- PIFLAGS=`$$ver-config --includes`; \
28
- PLDFLAGS=`$$ver-config --ldflags | sed -e 's/\-lpython[0-9.]*//'`; \
29
- PLFLAGS=`$$ver-config --libs | sed -e 's/\-lpython[0-9.]*//'`; \
30
- $(CC) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -fPIC -c -o $$ver/snackmodule.o snackmodule.c ;\
31
- $(CC) --shared -fPIC $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o $$ver/_snackmodule.so $$ver/snackmodule.o -L. -lnewt $(LIBS);\
32
- $(CC) $(subst -O2,-O0,$(CFLAGS)) -I/usr/include/$${ver}_d -fPIC -c -o $$ver/snackmodule_d.o snackmodule.c ;\
33
- $(CC) --shared -fPIC $(SHCFLAGS) -o $$ver/_snackmodule_d.so $$ver/snackmodule_d.o -L . -lnewt ;\
34
+ PCFLAGS=`$$ver$$variant-config --cflags`; \
35
+ PLDFLAGS=`$$ver$$variant-config --ldflags | sed -e 's/\-lpython[^ ]*//'`; \
36
+ $(CC) $(CPPFLAGS) $$PCFLAGS -fPIC -c -o $$ver/snackmodule.o snackmodule.c ;\
37
+ $(CC) --shared -fPIC $$PLDFLAGS $(LDFLAGS) -o $$ver/_snack$$abitag.so $$ver/snackmodule.o -L. -lnewt $(LIBS);\
43
ln -sf $(LIBNEWTSH) $(instroot)/$(libdir)/$(LIBNEWTSONAME)
44
[ -n "$(WHIPTCLSO)" ] && install -m 755 whiptcl.so $(instroot)/$(libdir) || :
45
[ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
46
+ for variant in '' '-dbg'; do \
48
+ python3*) abitag=.$$($$ver$$variant -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))");; \
49
+ *) if [ -z "$$variant" ]; then abitag=; else abitag=_d; fi; \
51
[ -d $(instroot)/$(libdir)/$$ver/site-packages ] || install -m 755 -d $(instroot)/$(libdir)/$$ver/site-packages ;\
52
- install -m 755 $$ver/_snackmodule.so $(instroot)/$(libdir)/$$ver/site-packages ;\
53
- install -m 755 $$ver/_snackmodule_d.so $(instroot)/$(libdir)/$$ver/site-packages ;\
54
+ install -m 755 $$ver/_snack$$abitag.so $(instroot)/$(libdir)/$$ver/site-packages ;\
56
install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
59
Index: newt/peanuts.py
20
Index: newt-0.52.15/peanuts.py
60
21
===================================================================
61
--- newt.orig/peanuts.py 2012-12-23 17:44:17.187381000 +0900
62
+++ newt/peanuts.py 2012-12-23 17:44:17.187381000 +0900
22
--- newt-0.52.15.orig/peanuts.py 2013-05-15 16:05:52.000000000 +0100
23
+++ newt-0.52.15/peanuts.py 2013-05-15 16:05:52.000000000 +0100
65
26
# Demo program to show use of python-newt module
82
43
+print("rb:", rb.getSelection())
83
44
+print("bb:", bb.buttonPressed(result))
84
45
+print("checkboxtree:", ct.getSelection())
85
Index: newt/popcorn.py
46
Index: newt-0.52.15/popcorn.py
86
47
===================================================================
87
--- newt.orig/popcorn.py 2012-12-23 17:44:17.187381000 +0900
88
+++ newt/popcorn.py 2012-12-23 17:44:17.187381000 +0900
48
--- newt-0.52.15.orig/popcorn.py 2013-05-15 16:05:52.000000000 +0100
49
+++ newt-0.52.15/popcorn.py 2013-05-15 16:05:52.000000000 +0100
126
87
+print('lbcw', lbcw)
127
88
+print("ct selected", ct.getSelection())
128
89
+print("ct current", ct.getCurrent())
129
Index: newt/snackmodule.c
90
Index: newt-0.52.15/snackmodule.c
130
91
===================================================================
131
--- newt.orig/snackmodule.c 2012-12-23 17:44:17.187381000 +0900
132
+++ newt/snackmodule.c 2012-12-23 17:44:17.187381000 +0900
92
--- newt-0.52.15.orig/snackmodule.c 2013-05-15 16:05:52.000000000 +0100
93
+++ newt-0.52.15/snackmodule.c 2013-05-15 16:05:52.000000000 +0100
133
94
@@ -12,10 +12,24 @@
134
95
#include <unistd.h>
356
317
newtGridSetField(grid->grid, x, y, NEWT_GRID_COMPONENT,
357
318
w->co, pLeft, pTop, pRight, pBottom, anchorFlags,
418
379
d = PyModule_GetDict(m);
420
PyDict_SetItemString(d, "ANCHOR_LEFT", PyInt_FromLong(NEWT_ANCHOR_LEFT));
421
@@ -1401,4 +1483,6 @@
422
PyDict_SetItemString(d, "COLORSET_COMPACTBUTTON", PyInt_FromLong(NEWT_COLORSET_COMPACTBUTTON));
423
PyDict_SetItemString(d, "COLORSET_ACTSELLISTBOX", PyInt_FromLong(NEWT_COLORSET_ACTSELLISTBOX));
424
PyDict_SetItemString(d, "COLORSET_SELLISTBOX", PyInt_FromLong(NEWT_COLORSET_SELLISTBOX));
381
setitemstring_decref(d, "ANCHOR_LEFT", PyInt_FromLong(NEWT_ANCHOR_LEFT));
382
@@ -1435,4 +1517,6 @@
383
setitemstring_decref(d, "COLORSET_COMPACTBUTTON", PyInt_FromLong(NEWT_COLORSET_COMPACTBUTTON));
384
setitemstring_decref(d, "COLORSET_ACTSELLISTBOX", PyInt_FromLong(NEWT_COLORSET_ACTSELLISTBOX));
385
setitemstring_decref(d, "COLORSET_SELLISTBOX", PyInt_FromLong(NEWT_COLORSET_SELLISTBOX));
426
387
+ return MOD_SUCCESS_VAL(m);
389
Index: newt-0.52.15/snack.py
429
390
===================================================================
430
--- newt.orig/snack.py 2012-12-23 17:44:17.187381000 +0900
431
+++ newt/snack.py 2012-12-23 17:51:13.355976796 +0900
391
--- newt-0.52.15.orig/snack.py 2013-05-15 16:05:52.000000000 +0100
392
+++ newt-0.52.15/snack.py 2013-05-15 16:05:52.000000000 +0100
432
393
@@ -39,9 +39,11 @@
486
447
self.gridmembers = []
488
449
colorsets = { "ROOT" : _snack.COLORSET_ROOT,
491
def helpCallback(self, cb):
493
- return _snack.helpcallback(self.doHelpCallback)
494
+ return _snack.helpcallback(self.doHelpCallback)
496
def suspendCallback(self, cb, data = None):
498
450
@@ -604,9 +606,9 @@
500
452
Grid.__init__(self, len(buttonlist), 1)