[adonthell] 36/65: Release 0.3.5-11

Markus Koschany apo at moszumanska.debian.org
Tue Jul 12 19:53:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

apo pushed a commit to branch master
in repository adonthell.

commit 310eb9bd357faa4c2924f9294f659cb2685f4d42
Author: Markus Koschany <apo at gambaru.de>
Date:   Thu Apr 14 18:49:34 2016 +0000

    Release 0.3.5-11
---
 debian/README.source                 | 76 ++++++++++++++++--------------------
 debian/changelog                     | 14 +++++++
 debian/control                       |  3 +-
 debian/patches/disable-swig.patch    | 29 ++++++++++++++
 debian/patches/format-security.patch | 24 ++++++++++++
 debian/patches/series                |  3 ++
 debian/patches/typemap-bool.patch    | 28 +++++++++++++
 debian/rules                         | 38 +++++++++---------
 8 files changed, 152 insertions(+), 63 deletions(-)

diff --git a/debian/README.source b/debian/README.source
index 5dde0bf..fefd7a8 100644
--- a/debian/README.source
+++ b/debian/README.source
@@ -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.
diff --git a/debian/changelog b/debian/changelog
index e16c788..1112c2c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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.
diff --git a/debian/control b/debian/control
index 76d59f6..1e0efc0 100644
--- a/debian/control
+++ b/debian/control
@@ -5,8 +5,9 @@ Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
 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,
diff --git a/debian/patches/disable-swig.patch b/debian/patches/disable-swig.patch
new file mode 100644
index 0000000..0b0c0ce
--- /dev/null
+++ b/debian/patches/disable-swig.patch
@@ -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; \
diff --git a/debian/patches/format-security.patch b/debian/patches/format-security.patch
new file mode 100644
index 0000000..0bc7ba9
--- /dev/null
+++ b/debian/patches/format-security.patch
@@ -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);
+   }
+ }
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 83a08e6..10c2562 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -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
diff --git a/debian/patches/typemap-bool.patch b/debian/patches/typemap-bool.patch
new file mode 100644
index 0000000..e6c9ff9
--- /dev/null
+++ b/debian/patches/typemap-bool.patch
@@ -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"
diff --git a/debian/rules b/debian/rules
index 902f0d8..27b76a4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,4 +1,5 @@
 #!/usr/bin/make -f
+export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 #export DH_VERBOSE=1
 
@@ -7,7 +8,11 @@ include /usr/share/dpkg/buildflags.mk
 
 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,24 +34,19 @@ else
 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
-
-
-	./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)
+	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)
 
 
 override_dh_auto_build:
@@ -66,9 +66,7 @@ override_dh_clean:
 	[ ! -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

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/adonthell.git



More information about the Pkg-games-commits mailing list