[Git][debian-gis-team/mapserver][master] 2 commits: Add upstream patch to fix FTBFS with SWIG 4.0.1. (closes: #951886)

Bas Couwenberg gitlab at salsa.debian.org
Sat Feb 22 18:42:58 GMT 2020



Bas Couwenberg pushed to branch master at Debian GIS Project / mapserver


Commits:
b2643d5c by Bas Couwenberg at 2020-02-22T19:24:59+01:00
Add upstream patch to fix FTBFS with SWIG 4.0.1. (closes: #951886)

- - - - -
2ce6d941 by Bas Couwenberg at 2020-02-22T19:25:13+01:00
Set distribution to unstable.

- - - - -


3 changed files:

- debian/changelog
- debian/patches/series
- + debian/patches/swig-4.0.1.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,10 @@
-mapserver (7.4.3-2) UNRELEASED; urgency=medium
+mapserver (7.4.3-2) unstable; urgency=medium
 
   * Bump Standards-Version to 4.5.0, no changes.
+  * Add upstream patch to fix FTBFS with SWIG 4.0.1.
+    (closes: #951886)
 
- -- Bas Couwenberg <sebastic at debian.org>  Sat, 25 Jan 2020 10:46:45 +0100
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 22 Feb 2020 19:25:03 +0100
 
 mapserver (7.4.3-1) unstable; urgency=medium
 


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,3 @@
 perl-mapscript-install.patch
 java-hardening.patch
+swig-4.0.1.patch


=====================================
debian/patches/swig-4.0.1.patch
=====================================
@@ -0,0 +1,206 @@
+Description: Updates to build MapScript with SWIG 4.0.1
+Author: sethg <sethg at geographika.co.uk>
+Origin: https://github.com/mapserver/mapserver/pull/5983
+Bug: https://github.com/mapserver/mapserver/issues/5982
+Bug-Debian: https://bugs.debian.org/951886
+
+--- a/mapscript/python/pyextend.i
++++ b/mapscript/python/pyextend.i
+@@ -13,6 +13,7 @@
+  *
+  *****************************************************************************/
+ 
++
+ /* fromstring: Factory for mapfile objects */
+ 
+ %pythoncode %{
+@@ -222,15 +223,13 @@ def fromstring(data, mappath=None):
+                         }
+                     }
+ 
+-        def getItemDefinitions(self):
+-            return self._item_definitions
++        @property
++        def itemdefinitions(self):
++            return self._item_definitions
+ 
+-        def setItemDefinitions(self, item_definitions):
++        @itemdefinitions.setter
++        def itemdefinitions(self, item_definitions):
+             self._item_definitions = item_definitions
+-
+-        __swig_getmethods__["itemdefinitions"] = getItemDefinitions
+-        __swig_setmethods__["itemdefinitions"] = setItemDefinitions
+-
+ %}
+ }
+ 
+@@ -426,25 +425,14 @@ def fromstring(data, mappath=None):
+         memcpy( *argout, self->pattern, sizeof(double) * *pnListSize);
+     }
+ 
+-    void patternlength_set2(int patternlength)
+-    {
+-        msSetError(MS_MISCERR, "pattern is read-only", "patternlength_set()");
+-    }
+ 
+ %pythoncode %{
+ 
+-    __swig_setmethods__["patternlength"] = _mapscript.styleObj_patternlength_set2
+-    __swig_getmethods__["patternlength"] = _mapscript.styleObj_patternlength_get
+-    if _newclass:patternlength = _swig_property(_mapscript.styleObj_patternlength_get, _mapscript.styleObj_patternlength_set2)
+-
+-    __swig_setmethods__["pattern"] = _mapscript.styleObj_pattern_set
+-    __swig_getmethods__["pattern"] = _mapscript.styleObj_pattern_get
+-    if _newclass:pattern = _swig_property(_mapscript.styleObj_pattern_get, _mapscript.styleObj_pattern_set)
+-%}
++pattern = property(pattern_get, pattern_set)
+ 
++%}
+ }
+ 
+-
+ /******************************************************************************
+  * Extensions to hashTableObj - add dict methods
+  *****************************************************************************/
+--- a/mapscript/python/pymodule.i
++++ b/mapscript/python/pymodule.i
+@@ -17,7 +17,7 @@
+  *****************************************************************************/
+ 
+ /* Translates Python None to C NULL for strings */
+-%typemap(in,parse="z") char * "";
++//%typemap(in,parse="z") char * "";
+ 
+ /* To support imageObj::getBytes */
+ %typemap(out) gdBuffer {
+@@ -210,33 +210,15 @@ MapServerError = _mapscript.MapServerErr
+ MapServerChildError = _mapscript.MapServerChildError
+ %}
+ 
+-/* The bogus "if 1:" is to introduce a new scope to work around indentation
+-   handling with pythonappend in different versions.  (#3180) */
+-%feature("pythonappend") layerObj %{if 1:
+-            self.p_map=None
+-            try:
+-                # python 2.5
+-                if args and len(args)!=0: 
+-                    self.p_map=args[0]
+-            except NameError:
+-                # python 2.6
+-                if map: 
+-                    self.p_map=map
+-       %}
+-
+-/* The bogus "if 1:" is to introduce a new scope to work around indentation
+-   handling with pythonappend in different versions. (#3180) */
+-%feature("pythonappend") classObj %{if 1:
+-            self.p_layer =None
+-            try:
+-                # python 2.5
+-                if args and len(args)!=0: 
+-                    self.p_layer=args[0]
+-            except NameError:
+-                # python 2.6
+-                if layer: 
+-                    self.p_layer=layer
+-       %}
++%feature("pythonappend") layerObj %{
++    self.p_map = None
++    if map: 
++        self.p_map = map%}
++
++%feature("pythonappend") classObj %{
++    self.p_layer = None
++    if layer: 
++        self.p_layer = layer%}
+ 
+ %feature("shadow") insertClass %{
+     def insertClass(*args):
+--- a/mapscript/python/tests/cases/style_test.py
++++ b/mapscript/python/tests/cases/style_test.py
+@@ -175,6 +175,53 @@ class NewStylesTestCase(MapTestCase):
+         self.assertRaises(mapscript.MapServerChildError,
+                           class0.insertStyle, None)
+ 
++    def testPattern(self):
++        """See https://github.com/mapserver/mapserver/issues/4943"""
++
++        si = mapscript.styleObj()
++        assert si.pattern == ()
++        assert si.patternlength == 0
++
++    def testPattern2(self):
++
++        si = mapscript.styleObj()
++        si.pattern = [2.0, 3, 4]
++        assert si.pattern == (2.0, 3.0, 4.0)
++        assert si.patternlength == 3
++
++    def testPattern3(self):
++        """a pattern must have at least 2 elements"""
++
++        si = mapscript.styleObj()
++        exception = None
++        try:
++            si.pattern = [1.0]
++        except Exception:
++            exception = True
++        assert exception is True
++
++    def testPattern4(self):
++        """a pattern can have a max of 10 elements
++        This is set in mapsymbol.h with #define MS_MAXPATTERNLENGTH 10"""
++
++        si = mapscript.styleObj()
++        exception = None
++        try:
++            si.pattern = [i for i in range(11)]
++        except Exception:
++            exception = True
++        assert exception is True
++
++    def testPattern5(self):
++        """pattern length is read-only"""
++        si = mapscript.styleObj()
++        exception = None
++        try:
++            si.patternlength = 0
++        except Exception:
++            exception = True
++        assert exception is True
++
+ 
+ class BrushCachingTestCase(MapTestCase):
+ 
+--- a/mapscript/csharp/swig_csharp_extensions.i
++++ b/mapscript/csharp/swig_csharp_extensions.i
+@@ -224,17 +224,20 @@
+   }
+ %}
+ 
++#if SWIG_VERSION < 0x040000
+ %typemap(csfinalize) SWIGTYPE %{
+   /* %typemap(csfinalize) SWIGTYPE */
+   ~$csclassname() {
+     Dispose();
+   }
+ %}
++#endif
+ 
+ %typemap(csconstruct, excode=SWIGEXCODE) SWIGTYPE %{: this($imcall, true, null) {$excode
+   }
+ %}
+ 
++#if SWIG_VERSION < 0x040000
+ %typemap(csdestruct, methodname="Dispose", methodmodifiers="public") SWIGTYPE {
+   lock(this) {
+       if(swigCPtr.Handle != System.IntPtr.Zero && swigCMemOwn) {
+@@ -246,6 +249,7 @@
+       System.GC.SuppressFinalize(this);
+     }
+   }
++#endif
+ 
+ %typemap(csdestruct_derived, methodname="Dispose", methodmodifiers="public") TYPE {
+   lock(this) {



View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/compare/24dc4f71de17038899196cd22761729921e05ed7...2ce6d941964a05c2de4742c68090af3d95b1cebc

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapserver/compare/24dc4f71de17038899196cd22761729921e05ed7...2ce6d941964a05c2de4742c68090af3d95b1cebc
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200222/a79d16eb/attachment-0001.html>


More information about the Pkg-grass-devel mailing list