~ubuntu-branches/ubuntu/utopic/newt/utopic

« back to all changes in this revision

Viewing changes to debian/patches/python3.patch

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-07-01 23:06:29 UTC
  • mfrom: (2.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20130701230629-vn7p5llzt03j09mv
Tags: 0.52.15-2ubuntu1
* Merge with Debian; remaining changes:
  - Fix python-* package descriptions.
  - Install/remove alternatives for the ubuntu palette.
  - Don't install python-newt example files.
  - Install whiptail in /bin instead of /usr/bin.
* Still build with tcl8.5 (8.6 is in universe).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: newt/Makefile.in
 
1
Author: Matthias Klose
 
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
 
5
Forwarded: no
 
6
 
 
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
5
11
@@ -12,7 +12,7 @@
6
12
 TAG = r$(subst .,-,$(VERSION))
7
13
 SONAME = @SONAME@
11
17
 WHIPTCLSO = @WHIPTCLSO@
12
18
 
13
19
 PROGS = test whiptail $(WHIPTCLSO) testgrid testtree showchars showkey
14
 
@@ -77,16 +77,19 @@
15
 
        $(CC) -g -o showkey showkey.o $(LIBNEWT) $(LDFLAGS) $(LIBS)
16
 
 
17
 
 _snackmodule.so:   snackmodule.c $(LIBNEWTSH)
18
 
+       set -ex; \
19
 
        [ -n "$(PYTHONVERS)" ] && for ver in $(PYTHONVERS) ; do \
20
 
+           for variant in '' '-dbg'; do \
21
 
+               case "$$ver" in \
22
 
+               python3*) abitag=.$$($$ver$$variant -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))");; \
23
 
+               *) if [ -z "$$variant" ]; then abitag=; else abitag=_d; fi; \
24
 
+               esac; \
25
 
                mkdir -p $$ver ;\
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);\
38
 
+           done; \
39
 
        done || :
40
 
        touch $@
41
 
 
42
 
@@ -144,9 +147,14 @@
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 \
47
 
+           case "$$ver" in \
48
 
+           python3*) abitag=.$$($$ver$$variant -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))");; \
49
 
+           *) if [ -z "$$variant" ]; then abitag=; else abitag=_d; fi; \
50
 
+           esac; \
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 ;\
55
 
+        done; \
56
 
           install -m 644 snack.py $(instroot)/$(libdir)/$$ver/site-packages ;\
57
 
        done || :
58
 
 
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
63
24
@@ -2,6 +2,7 @@
64
25
 
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
89
50
@@ -1,5 +1,6 @@
90
51
 #!/usr/bin/python
91
52
 
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>
135
96
 
336
297
 };
337
298
 
338
299
 static snackWidget * snackWidgetNew (void) {
339
 
@@ -843,10 +926,6 @@
 
300
@@ -863,10 +946,6 @@
340
301
     return grid;
341
302
 }
342
303
 
347
308
 static PyObject * gridPlace(snackGrid * grid, PyObject * args) {
348
309
     int x, y;
349
310
 
350
 
@@ -870,7 +949,7 @@
 
311
@@ -890,7 +969,7 @@
351
312
                                &anchorFlags, &growFlags)) 
352
313
        return NULL;
353
314
 
356
317
        newtGridSetField(grid->grid, x, y, NEWT_GRID_COMPONENT,
357
318
                         w->co, pLeft, pTop, pRight, pBottom, anchorFlags, 
358
319
                         growFlags);
359
 
@@ -885,10 +964,6 @@
 
320
@@ -905,10 +984,6 @@
360
321
     return Py_None;
361
322
 }
362
323
 
367
328
 static PyObject * formDraw(snackForm * s, PyObject * args) {
368
329
     newtDrawForm(s->fo);
369
330
 
370
 
@@ -980,20 +1055,18 @@
 
331
@@ -1000,20 +1075,18 @@
371
332
     return Py_None;
372
333
 }
373
334
 
397
358
 }
398
359
 
399
360
 static void widgetDestructor(PyObject * o) {
400
 
@@ -1321,10 +1394,19 @@
401
 
     return PyInt_FromLong(wstrlen(str, len));
 
361
@@ -1355,10 +1428,19 @@
 
362
     Py_DECREF(o);
402
363
 }
403
364
 
404
365
-void init_snack(void) {
417
378
+
418
379
     d = PyModule_GetDict(m);
419
380
 
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));
425
386
+
426
387
+    return MOD_SUCCESS_VAL(m);
427
388
 }
428
 
Index: newt/snack.py
 
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 @@
433
394
  - EntryWindow
434
395
 """
486
447
         self.gridmembers = []
487
448
 
488
449
 colorsets = { "ROOT" : _snack.COLORSET_ROOT,
489
 
@@ -481,7 +483,7 @@
490
 
     
491
 
     def helpCallback(self, cb):
492
 
        self.helpCb = cb
493
 
-        return _snack.helpcallback(self.doHelpCallback)
494
 
+       return _snack.helpcallback(self.doHelpCallback)
495
 
 
496
 
     def suspendCallback(self, cb, data = None):
497
 
         if data:
498
450
@@ -604,9 +606,9 @@
499
451
         self.item = 0
500
452
         Grid.__init__(self, len(buttonlist), 1)