[packages/subversion] up to 1.9.3

atler atler at pld-linux.org
Tue Dec 29 13:19:27 CET 2015


commit 74465f3c19306bbf49b31f800540e4227e8f8f23
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Dec 29 13:03:03 2015 +0100

    up to 1.9.3
    
    - new patch to fix build with swig >= 3 (upstream revisions: r1721488
      r1721648 without one hunk on m4)
    - manually install csvn bindings using new %py_install macro

 subversion-swig_py.patch | 230 +++++++++++++++++++++++++++++++++++++++++++++++
 subversion.spec          |  16 ++--
 2 files changed, 241 insertions(+), 5 deletions(-)
---
diff --git a/subversion.spec b/subversion.spec
index 1a9d0db..3bc96b2 100644
--- a/subversion.spec
+++ b/subversion.spec
@@ -50,12 +50,12 @@ Summary:	A Concurrent Versioning system similar to but better than CVS
 Summary(pl.UTF-8):	System kontroli wersji podobny, ale lepszy, niż CVS
 Summary(pt_BR.UTF-8):	Sistema de versionamento concorrente
 Name:		subversion
-Version:	1.9.2
-Release:	5
+Version:	1.9.3
+Release:	1
 License:	Apache v2.0
 Group:		Development/Version Control
 Source0:	http://www.apache.org/dist/subversion/%{name}-%{version}.tar.bz2
-# Source0-md5:	0a7e55bb58fe77072f19e108a56b468b
+# Source0-md5:	243036eb28b50ce517fc228eb3250add
 Source1:	%{name}-dav_svn.conf
 Source2:	%{name}-authz_svn.conf
 Source3:	%{name}-svnserve.init
@@ -69,6 +69,7 @@ Patch1:		%{name}-DESTDIR.patch
 Patch2:		%{name}-ruby-datadir-path.patch
 Patch3:		%{name}-tests.patch
 Patch4:		x32-libdir.patch
+Patch5:		%{name}-swig_py.patch
 URL:		http://subversion.apache.org/
 %{?with_apache:BuildRequires:	apache-devel >= 2.4.14}
 BuildRequires:	apr-devel >= 1:1.3
@@ -444,6 +445,7 @@ uwierzytelniać się przy użyciu Portfela KDE.
 %patch2 -p0
 %patch3 -p1
 %patch4 -p1
+%patch5 -p0
 
 sed -i -e 's#serf_prefix/lib#serf_prefix/%{_lib}#g' build/ac-macros/serf.m4
 
@@ -570,10 +572,14 @@ install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,bash_completion.d} \
 	swig_pydir=%{py_sitedir}/libsvn \
 	swig_pydir_extra=%{py_sitedir}/svn \
 %endif
+	install-tools
+
 %if %{with csvn}
-	install-ctypes-python \
+# manually execute install-ctypes-python target
+cd subversion/bindings/ctypes-python
+%py_install
+cd ../../..
 %endif
-	install-tools
 
 %if %{with ruby}
 %{__make} -j1 install-swig-rb install-swig-rb-doc \
diff --git a/subversion-swig_py.patch b/subversion-swig_py.patch
new file mode 100644
index 0000000..0fa3a8a
--- /dev/null
+++ b/subversion-swig_py.patch
@@ -0,0 +1,230 @@
+------------------------------------------------------------------------
+r1721488 | jamessan | 2015-12-23 05:46:42 +0100 (śro, 23 gru 2015) | 13 lines
+
+Enable building bindings with SWIG >= 3.0.6
+
+This reinstates r1690591 and adds the minimum version checks for SWIG
+proposed by Joe Orton in http://svn.haxx.se/dev/archive-2015-07/0028.shtml.
+
+* build/ac-macros/swig.m4,
+  subversion/bindings/swig/INSTALL:
+  Change version check and documentation to allow SWIG >= 3.0.6
+
+* subversion/bindings/swig/include/proxy.swg:
+  Use %{ %} with %pythoncode so comments avoid the SWIG processor,
+  fixing the bindings with SWIG >= 3.0.6.
+
+
+Index: subversion/bindings/swig/include/proxy.swg
+===================================================================
+--- subversion/bindings/swig/include/proxy.swg	(revision 1721487)
++++ subversion/bindings/swig/include/proxy.swg	(revision 1721488)
+@@ -62,7 +62,7 @@
+ 
+ /* Default code for all wrapped proxy classes in Python */
+ %define %proxy_pythoncode(TYPE)
+-%pythoncode {
++%pythoncode %{
+   def set_parent_pool(self, parent_pool=None):
+     """Create a new proxy object for TYPE"""
+     import libsvn.core, weakref
+@@ -104,7 +104,7 @@
+     self.__dict__.setdefault("_members",{})[name] = value
+ 
+     return _swig_setattr(self, self.__class__, name, value)
+-}
++%}
+ %enddef
+ 
+ /* Define a proxy for wrapping an existing struct */
+Index: subversion/bindings/swig/INSTALL
+===================================================================
+--- subversion/bindings/swig/INSTALL	(revision 1721487)
++++ subversion/bindings/swig/INSTALL	(revision 1721488)
+@@ -65,7 +65,7 @@
+ 
+ 
+ Step 1:  Install a suitable version of SWIG (which is
+-         currently SWIG version 1.3.24 or later, but not SWIG 3.0.0 or newer).
++         currently SWIG version 1.3.24 or later, excluding SWIG 3.0.0 through 3.0.5).
+ 
+     * Perhaps your distribution packages a suitable version - if it does
+       install it, and skip to the last bullet point in this section.
+Index: build/ac-macros/swig.m4
+===================================================================
+--- build/ac-macros/swig.m4	(revision 1721487)
++++ build/ac-macros/swig.m4	(revision 1721488)
+@@ -92,12 +92,12 @@
+     # If you change the required swig version number, don't forget to update:
+     #   subversion/bindings/swig/INSTALL
+     if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \
+-       test "$SWIG_VERSION" -lt "300000"; then
++       ( test "$SWIG_VERSION" -lt "300000" || test "$SWIG_VERSION" -ge "300006" ); then
+       SWIG_SUITABLE=yes
+     else
+       SWIG_SUITABLE=no
+       AC_MSG_WARN([Detected SWIG version $SWIG_VERSION_RAW])
+-      AC_MSG_WARN([Subversion requires SWIG >= 1.3.24 and < 3.0.0 ])
++      AC_MSG_WARN([Subversion requires SWIG >= 1.3.24 and < 3.0.0, or >= 3.0.6 ])
+     fi
+   fi
+  
+
+------------------------------------------------------------------------
+r1721648 | jamessan | 2015-12-24 19:33:13 +0100 (czw, 24 gru 2015) | 27 lines
+
+Fix Python bindings with SWIG < 3.0.6, followup on 1721488.
+
+“%pythoncode { ... }” had to be changed to “%pythoncode %{ ... %}” to avoid
+macro expansion (done in r1721488).  This was a latent bug in the bindings
+exposed by stricter parsing in SWIG 3.x.
+
+However, there was a bug in SWIG through 3.0.6 which would remove part of the
+commented lines inside the “%pythoncode %{ ... %}” block.  This caused the
+"right" fix to break everywhere except 3.0.6+.
+
+As discussed in the SWIG bug tracker[0], an alternative form of the pythoncode
+directive can be used to inline the contents of a specified file.  Use of this
+form works in all supported SWIG versions.
+
+[0]: https://github.com/swig/swig/issues/379#issuecomment-107664345
+
+* subversion/bindings/swig/include/proxy.swg:
+  (proxy_pythoncode): Copy %pythoncode contents to ...
+
+* subversion/bindings/swig/include/proxy.py:
+  ... new file which is included in proxy.swg via “%pythoncode "..."”
+  directive.
+
+* build/ac-macros/swig.m4
+  subversion/bindings/swig/INSTALL:
+  Remove 3.x related SWIG restrictions.  All SWIG versions are supported again.
+
+
+Index: subversion/bindings/swig/include/proxy.py
+===================================================================
+--- subversion/bindings/swig/include/proxy.py	(nonexistent)
++++ subversion/bindings/swig/include/proxy.py	(revision 1721648)
+@@ -0,0 +1,41 @@
++  def set_parent_pool(self, parent_pool=None):
++    """Create a new proxy object for TYPE"""
++    import libsvn.core, weakref
++    self.__dict__["_parent_pool"] = \
++      parent_pool or libsvn.core.application_pool;
++    if self.__dict__["_parent_pool"]:
++      self.__dict__["_is_valid"] = weakref.ref(
++        self.__dict__["_parent_pool"]._is_valid)
++
++  def assert_valid(self):
++    """Assert that this object is using valid pool memory"""
++    if "_is_valid" in self.__dict__:
++      assert self.__dict__["_is_valid"](), "Variable has already been deleted"
++
++  def __getattr__(self, name):
++    """Get an attribute from this object"""
++    self.assert_valid()
++
++    value = _swig_getattr(self, self.__class__, name)
++
++    # If we got back a different object than we have, we need to copy all our
++    # metadata into it, so that it looks identical
++    members = self.__dict__.get("_members")
++    if members is not None:
++      _copy_metadata_deep(value, members.get(name))
++
++    # Verify that the new object is good
++    _assert_valid_deep(value)
++
++    return value
++
++  def __setattr__(self, name, value):
++    """Set an attribute on this object"""
++    self.assert_valid()
++
++    # Save a copy of the object, so that the garbage
++    # collector won't kill the object while it's in
++    # SWIG-land
++    self.__dict__.setdefault("_members",{})[name] = value
++
++    return _swig_setattr(self, self.__class__, name, value)
+
+Property changes on: subversion/bindings/swig/include/proxy.py
+___________________________________________________________________
+Added: svn:eol-style
+## -0,0 +1 ##
++native
+\ No newline at end of property
+Index: subversion/bindings/swig/include/proxy.swg
+===================================================================
+--- subversion/bindings/swig/include/proxy.swg	(revision 1721647)
++++ subversion/bindings/swig/include/proxy.swg	(revision 1721648)
+@@ -60,51 +60,11 @@
+         value.assert_valid()
+ %}
+ 
+-/* Default code for all wrapped proxy classes in Python */
++/* Default code for all wrapped proxy classes in Python.
++ * Inline the code from a separate file to avoid issues with
++ * SWIG mis-parsing the comments as preprocessor directives. */
+ %define %proxy_pythoncode(TYPE)
+-%pythoncode %{
+-  def set_parent_pool(self, parent_pool=None):
+-    """Create a new proxy object for TYPE"""
+-    import libsvn.core, weakref
+-    self.__dict__["_parent_pool"] = \
+-      parent_pool or libsvn.core.application_pool;
+-    if self.__dict__["_parent_pool"]:
+-      self.__dict__["_is_valid"] = weakref.ref(
+-        self.__dict__["_parent_pool"]._is_valid)
+-
+-  def assert_valid(self):
+-    """Assert that this object is using valid pool memory"""
+-    if "_is_valid" in self.__dict__:
+-      assert self.__dict__["_is_valid"](), "Variable has already been deleted"
+-
+-  def __getattr__(self, name):
+-    """Get an attribute from this object"""
+-    self.assert_valid()
+-
+-    value = _swig_getattr(self, self.__class__, name)
+-
+-    # If we got back a different object than we have, we need to copy all our
+-    # metadata into it, so that it looks identical
+-    members = self.__dict__.get("_members")
+-    if members is not None:
+-      _copy_metadata_deep(value, members.get(name))
+-        
+-    # Verify that the new object is good
+-    _assert_valid_deep(value)
+-
+-    return value
+-
+-  def __setattr__(self, name, value):
+-    """Set an attribute on this object"""
+-    self.assert_valid()
+-
+-    # Save a copy of the object, so that the garbage
+-    # collector won't kill the object while it's in
+-    # SWIG-land
+-    self.__dict__.setdefault("_members",{})[name] = value
+-
+-    return _swig_setattr(self, self.__class__, name, value)
+-%}
++%pythoncode "proxy.py"
+ %enddef
+ 
+ /* Define a proxy for wrapping an existing struct */
+Index: subversion/bindings/swig/INSTALL
+===================================================================
+--- subversion/bindings/swig/INSTALL	(revision 1721647)
++++ subversion/bindings/swig/INSTALL	(revision 1721648)
+@@ -65,7 +65,7 @@
+ 
+ 
+ Step 1:  Install a suitable version of SWIG (which is
+-         currently SWIG version 1.3.24 or later, excluding SWIG 3.0.0 through 3.0.5).
++         currently SWIG version 1.3.24 or later).
+ 
+     * Perhaps your distribution packages a suitable version - if it does
+       install it, and skip to the last bullet point in this section.
+------------------------------------------------------------------------
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/subversion.git/commitdiff/74465f3c19306bbf49b31f800540e4227e8f8f23



More information about the pld-cvs-commit mailing list