r15755 - in packages/trunk/adonthell/debian: . patches
Markus Koschany
apo at moszumanska.debian.org
Thu Apr 14 18:49:34 UTC 2016
Author: apo
Date: 2016-04-14 18:49:34 +0000 (Thu, 14 Apr 2016)
New Revision: 15755
Added:
packages/trunk/adonthell/debian/patches/disable-swig.patch
packages/trunk/adonthell/debian/patches/format-security.patch
packages/trunk/adonthell/debian/patches/typemap-bool.patch
Modified:
packages/trunk/adonthell/debian/README.source
packages/trunk/adonthell/debian/changelog
packages/trunk/adonthell/debian/control
packages/trunk/adonthell/debian/patches/series
packages/trunk/adonthell/debian/rules
Log:
Release 0.3.5-11
Modified: packages/trunk/adonthell/debian/README.source
===================================================================
--- packages/trunk/adonthell/debian/README.source 2016-04-13 20:19:05 UTC (rev 15754)
+++ packages/trunk/adonthell/debian/README.source 2016-04-14 18:49:34 UTC (rev 15755)
@@ -1,58 +1,50 @@
-This package uses quilt to manage all modifications to the upstream
-source. Changes are stored in the source package as diffs in
-debian/patches and applied during the build.
+Adonthell for Debian
+====================
-To configure quilt to use debian/patches instead of patches, you want
-either to export QUILT_PATCHES=debian/patches in your environment
-or use this snippet in your ~/.quiltrc:
+As of 0.3.5-11 rebuilding of adonthell.py and py_adonthell_wrap.cc
+(disable-swig.patch) has been disabled.
- for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do
- if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then
- export QUILT_PATCHES=debian/patches
- break
- fi
- done
+The latest version of Swig (>= 3) changed its default behaviour in wrapping C++
+bool. You would see a TypeError on startup like:
-To get the fully patched source after unpacking the source package, cd to
-the root level of the source package and run:
+Traceback (most recent call last):
+ File "/usr/share/games/adonthell/games/wastesedge/scripts/init.py", line 229, in
+ <module> title = title_screen ()
+ File "/usr/share/games/adonthell/games/wastesedge/scripts/init.py", line 43, in
+ __init__ self.bag_o.set_visible (0)
+ File "/usr/share/games/adonthell/modules/adonthell.py", line 3420, in set_visible
+ return _adonthell.win_base_set_visible(self, b)
+ TypeError: in method 'win_base_set_visible', argument 2 of type 'bool'
- quilt push -a
+See http://www.swig.org/Release/CHANGES (2014-03-06) for more information about
+this new behaviour.
-The last patch listed in debian/patches/series will become the current
-patch.
+There are three solutions to overcome this issue.
-To add a new set of changes, first run quilt push -a, and then run:
+1. Enable typemap-bool.patch in debian/patches/series.
+2. Pass -DSWIG_PYTHON_LEGACY_BOOL to swig on the command line. (src/Makefile.in)
+3. Change all occurences of Python expressions for bool in adonthell-data like
+ that
- quilt new <patch>
+ OLD:
-where <patch> is a descriptive name for the patch, used as the filename in
-debian/patches. Then, for every file that will be modified by this patch,
-run:
+ adonthell.audio_play_background (0)
+ self.c_bag.set_visible (1)
- quilt add <file>
+ NEW:
-before editing those files. You must tell quilt with quilt add what files
-will be part of the patch before making changes or quilt will not work
-properly. After editing the files, run:
+ adonthell.audio_play_background (False)
+ self.c_bag.set_visible (True)
- quilt refresh
+Unfortunately there is more work needed.
-to save the results as a patch.
+TypeError: on_update() takes exactly 1 argument (2 given)
-Alternately, if you already have an external patch and you just want to
-add it to the build system, run quilt push -a and then:
+Multiple error messages appear later because several methods expect one
+argument instead of two. The correct fix would probably be to update the Swig
+interface file and files like win_event.{h,cc} and to rebuild adonthell.py
+again.
- quilt import -P <patch> /path/to/patch
- quilt push -a
+Any help to fix those issues is much appreciated.
-(add -p 0 to quilt import if needed). <patch> as above is the filename to
-use in debian/patches. The last quilt push -a will apply the patch to
-make sure it works properly.
-To remove an existing patch from the list of patches that will be applied,
-run:
-
- quilt delete <patch>
-
-You may need to run quilt pop -a to unapply patches first before running
-this command.
Modified: packages/trunk/adonthell/debian/changelog
===================================================================
--- packages/trunk/adonthell/debian/changelog 2016-04-13 20:19:05 UTC (rev 15754)
+++ packages/trunk/adonthell/debian/changelog 2016-04-14 18:49:34 UTC (rev 15755)
@@ -1,3 +1,17 @@
+adonthell (0.3.5-11) unstable; urgency=medium
+
+ * Team upload.
+ * Add disable-swig.patch and stop rebuilding adonthell.py from source due to
+ incompatible changes in Swig >= 3 that would cause runtime errors on
+ startup and make the game unusable. See README.source for more information
+ and work in progress.
+ * Add typemap-bool.patch but disable it by default. (See README.source)
+ * Add format-security.patch to fix FTBFS due to use of format-security flag.
+ * Build-Depend on dh-python and dh-autoreconf.
+ * Build with parallel and autoreconf.
+
+ -- Markus Koschany <apo at debian.org> Thu, 14 Apr 2016 20:04:46 +0200
+
adonthell (0.3.5-10) unstable; urgency=medium
* Team upload.
Modified: packages/trunk/adonthell/debian/control
===================================================================
--- packages/trunk/adonthell/debian/control 2016-04-13 20:19:05 UTC (rev 15754)
+++ packages/trunk/adonthell/debian/control 2016-04-14 18:49:34 UTC (rev 15755)
@@ -5,8 +5,9 @@
Uploaders:
Barry deFreese <bdefreese at debian.org>
Build-Depends:
- autotools-dev,
debhelper (>= 9),
+ dh-autoreconf,
+ dh-python,
dpkg-dev (>= 1.16.1~),
libaa1-dev,
libfreetype6-dev,
Added: packages/trunk/adonthell/debian/patches/disable-swig.patch
===================================================================
--- packages/trunk/adonthell/debian/patches/disable-swig.patch (rev 0)
+++ packages/trunk/adonthell/debian/patches/disable-swig.patch 2016-04-14 18:49:34 UTC (rev 15755)
@@ -0,0 +1,29 @@
+From: Markus Koschany <apo at debian.org>
+Date: Thu, 14 Apr 2016 18:59:31 +0200
+Subject: disable swig
+
+Do not rebuild adonthell.py and py_adonthell_wrap.cc. As of Swig >= 3.x this
+would cause runtime errors on startup.
+
+See README.source for more information and ideas to fix this issue.
+
+Forwarded: not-needed
+---
+ src/Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index f18477d..5b74fa0 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -768,8 +768,8 @@ uninstall-am: uninstall-binPROGRAMS
+
+
+ # Note: adonthell.py is also built by this target.
+-py_adonthell_wrap.cc : py_adonthell.i $(headers)
+- @if test "${P_SWIG}"; then \
++#py_adonthell_wrap.cc : py_adonthell.i $(headers)
++# @if test "${P_SWIG}"; then \
+ echo ${P_SWIG} -python -modern -shadow ${SDL_CFLAGS} -I$(srcdir) -I$(top_srcdir) -c++ -makedefault -o $(srcdir)/$*.cc $(srcdir)/py_adonthell.i; \
+ ${P_SWIG} -python -modern -shadow ${SDL_CFLAGS} -I$(srcdir) -I$(top_srcdir) -c++ -makedefault -o $(srcdir)/$*.cc $(srcdir)/py_adonthell.i; \
+ mv $(srcdir)/adonthell.py modules/adonthell.py; \
Added: packages/trunk/adonthell/debian/patches/format-security.patch
===================================================================
--- packages/trunk/adonthell/debian/patches/format-security.patch (rev 0)
+++ packages/trunk/adonthell/debian/patches/format-security.patch 2016-04-14 18:49:34 UTC (rev 15755)
@@ -0,0 +1,24 @@
+From: Markus Koschany <apo at debian.org>
+Date: Thu, 14 Apr 2016 19:20:53 +0200
+Subject: format security
+
+Fix FTBFS due to format-security flag.
+
+Forwarded: no, project is no longer active
+---
+ src/py_adonthell_wrap.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/py_adonthell_wrap.cc b/src/py_adonthell_wrap.cc
+index 048f0af..2a73207 100644
+--- a/src/py_adonthell_wrap.cc
++++ b/src/py_adonthell_wrap.cc
+@@ -867,7 +867,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
+ Py_DECREF(old_str);
+ Py_DECREF(value);
+ } else {
+- PyErr_Format(PyExc_RuntimeError, mesg);
++ PyErr_Format(PyExc_RuntimeError, "%s", mesg);
+ }
+ }
+
Modified: packages/trunk/adonthell/debian/patches/series
===================================================================
--- packages/trunk/adonthell/debian/patches/series 2016-04-13 20:19:05 UTC (rev 15754)
+++ packages/trunk/adonthell/debian/patches/series 2016-04-14 18:49:34 UTC (rev 15755)
@@ -2,3 +2,6 @@
10_ftbfs_with_gcc-4.4.diff
11_ftbfs_with_gcc-4.6.diff
12_no_sparc_bytecompile.patch
+#typemap-bool.patch
+disable-swig.patch
+format-security.patch
Added: packages/trunk/adonthell/debian/patches/typemap-bool.patch
===================================================================
--- packages/trunk/adonthell/debian/patches/typemap-bool.patch (rev 0)
+++ packages/trunk/adonthell/debian/patches/typemap-bool.patch 2016-04-14 18:49:34 UTC (rev 15755)
@@ -0,0 +1,28 @@
+From: Markus Koschany <apo at debian.org>
+Date: Thu, 14 Apr 2016 07:57:12 +0200
+Subject: typemap bool
+
+---
+ src/py_adonthell.i | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/py_adonthell.i b/src/py_adonthell.i
+index d5ae9a9..68e4b00 100644
+--- a/src/py_adonthell.i
++++ b/src/py_adonthell.i
+@@ -94,6 +94,15 @@ enum {Python = 1, C = 0};
+ $1 = $input;
+ }
+
++%typemap(in) bool{
++ $1 = false; // any type other than numeric is automatically false
++ if(PyInt_Check($input))
++ $1 = !(PyInt_AsLong($input) == (long)0);
++ else if(PyFloat_Check($input))
++ $1 = !(PyFloat_AsDouble($input) == 0.0);
++}
++
++
+ %include "types.h"
+ %include "fileops.h"
+ %include "event.h"
Modified: packages/trunk/adonthell/debian/rules
===================================================================
--- packages/trunk/adonthell/debian/rules 2016-04-13 20:19:05 UTC (rev 15754)
+++ packages/trunk/adonthell/debian/rules 2016-04-14 18:49:34 UTC (rev 15755)
@@ -1,4 +1,5 @@
#!/usr/bin/make -f
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
#export DH_VERBOSE=1
@@ -7,7 +8,11 @@
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-CXXFLAGS += -Wall -fno-exceptions -DSWIG_GLOBAL -DDATA_DIR=\"\\\"/usr/share/games/adonthell\"\\\"
+# If you manage to fix the issues mentioned in README.source, you should
+# probably replace the current CXXFLAGS variable with the old one again and
+# remove src/modules/adonthell.py src/py_adonthell_wrap.cc in override_dh_clean.
+# CXXFLAGS += -Wall -fno-exceptions -DSWIG_GLOBAL -DDATA_DIR=\"\\\"/usr/share/games/adonthell\"\\\"
+CXXFLAGS += -Wall -fno-exceptions -DDATA_DIR=\"\\\"/usr/share/games/adonthell\"\\\"
CFGDEBUG = ""
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL} -p -o root -g root -m 755
@@ -29,26 +34,21 @@
endif
%:
- dh $@ --with python2
+ dh $@ --parallel --with autoreconf,python2
override_dh_auto_configure:
- -test -r /usr/share/misc/config.sub && \
- cp -f /usr/share/misc/config.sub config.sub
- -test -r /usr/share/misc/config.guess && \
- cp -f /usr/share/misc/config.guess config.guess
+ dh_auto_configure -- \
+ --host=$(DEB_HOST_GNU_TYPE) \
+ --build=$(DEB_BUILD_GNU_TYPE) \
+ --prefix=/usr \
+ --mandir=\$${prefix}/share/man \
+ --bindir=\$${prefix}/games \
+ --datadir=\$${prefix}/share/games \
+ --with-py-libs="-Wl,-E -L/usr/lib/$(PYVERSION)/config -l$(PYVERSION) -lpthread -lSDL -lSDL_ttf -lSDL_mixer" \
+ --with-py-cflags="-I/usr/include/$(PYVERSION)" \
+ $(CFGDEBUG)
- ./configure --host=$(DEB_HOST_GNU_TYPE) \
- --build=$(DEB_BUILD_GNU_TYPE) \
- --prefix=/usr \
- --mandir=\$${prefix}/share/man \
- --bindir=\$${prefix}/games \
- --datadir=\$${prefix}/share/games \
- --with-py-libs="-Wl,-E -L/usr/lib/$(PYVERSION)/config -l$(PYVERSION) -lpthread -lSDL -lSDL_ttf -lSDL_mixer" \
- --with-py-cflags="-I/usr/include/$(PYVERSION)" \
- $(CFGDEBUG)
-
-
override_dh_auto_build:
$(MAKE) CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" INSTALL_PROGRAM="$(INSTALL_PROGRAM)"
@@ -66,9 +66,7 @@
[ ! -f Makefile ] || $(MAKE) distclean
-rm -f `find . -name "*~"`
-rm -f src/adonthell.pyc
-
rm -f config.guess config.sub
-
# drop files generated by SWIG
- rm -f src/modules/adonthell.py src/py_adonthell_wrap.cc
+ #rm -f src/modules/adonthell.py src/py_adonthell_wrap.cc
dh_clean
More information about the Pkg-games-commits
mailing list