Date: Saturday, April 8, 2023 @ 13:05:08
  Author: dvzrv
Revision: 473314

upgpkg: subversion 1.14.2-7: Rebuild against Python 3.11.

Add patches for Python 3.11 and swig (thanks Fedora).
Prevent libtool from overlinking everything.
Abstract Python site-packages to not hardcode it.
Add all direct dependencies and sort them alphabetically.

Added:
  subversion/trunk/subversion-1.14.1-python-3.11-build.patch
  
subversion/trunk/subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch
Modified:
  subversion/trunk/PKGBUILD

------------------------------------------------------------------------------+
 PKGBUILD                                                                     | 
  35 +++--
 subversion-1.14.1-python-3.11-build.patch                                    | 
  14 ++
 subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch | 
  64 ++++++++++
 3 files changed, 102 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2023-04-08 12:35:35 UTC (rev 473313)
+++ PKGBUILD    2023-04-08 13:05:08 UTC (rev 473314)
@@ -6,13 +6,13 @@
 
 pkgname=subversion
 pkgver=1.14.2
-pkgrel=6
+pkgrel=7
 pkgdesc="A Modern Concurrent Version Control System"
 arch=('x86_64')
 url="https://subversion.apache.org/";
 license=('APACHE')
-depends=('glibc' 'file' 'libutf8proc' 'serf' 'sqlite' 'systemd' 'apr' 
'apr-util'
-         'zlib' 'lz4' 'expat' 'libsasl')
+depends=('apr' 'apr-util' 'bash' 'dbus' 'expat' 'file' 'gcc-libs' 'glibc' 
'libsasl' 'libutf8proc' 'lz4' 'serf' 'sqlite'
+         'systemd' 'zlib' )
 makedepends=('apache' 'python' 'python-py3c' 'perl' 'swig' 
'java-environment>=8'
              'libgnome-keyring' 'kwallet' 'kdelibs4support' 'ruby')
 optdepends=('libgnome-keyring: for GNOME Keyring for auth credentials'
@@ -31,7 +31,10 @@
         svnserve.tmpfiles
         svnserve.service
         subversion.rpath.fix.patch
-        ruby-frozen-nil.patch)
+        ruby-frozen-nil.patch
+        subversion-1.14.1-python-3.11-build.patch
+        
subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch
+)
 
sha512sums=('20ada4688ca07d9fb8da4b7d53b5084568652a3b9418c65e688886bae950a16a3ff37710fcfc9c29ef14a89e75b2ceec4e9cf35d5876a7896ebc2b512cfb9ecc'
             'SKIP'
             
'3df59e92aa0314ff6adce26e2e1162bf2872ca03ff1f78891081a60e67b521b6046b4a2f85f718dcd27f9d5709594658817a09548cdb74e3976d371dbe47e7db'
@@ -39,7 +42,9 @@
             
'7775f4da5003970c9ebdc2f696ba090df194a77d9daed791875488c943f72ae496b5f9cc6f3ff9f3f4de9f352a3b518137babdea38947d1a2d5dd16aa1844036'
             
'8cc23ae71bd7ce7c337eaf12929f1af0a11b55250808e88f06397b874daf2efb9491c464be3d082d937a82c2b0b7c3ed06d6695cfd8a3fda1f803bbfd15837de'
             
'60d538160e738eb3b3e84a3881fe5a8d75c79053d3f31c4c29ef6ace6ccc5dd4367ed712766c911bae3436e9706e4dd144b270bb45161a6c1834a37e154d0440'
-            
'bb772e55acd9601121ad06b254c364e8d8cf772ca59b8df0cf4c5c5ecba110d4108d0363672f121f770550cdd052802474029e57643258f398aacd2b63ccb898')
+            
'bb772e55acd9601121ad06b254c364e8d8cf772ca59b8df0cf4c5c5ecba110d4108d0363672f121f770550cdd052802474029e57643258f398aacd2b63ccb898'
+            
'cad1ef6359c4eecce4fc44fb0c8a01a7b9b94cd8b1b3f9bdd9d72b3591f75bada814a9597cea039c6e045f3f07807f17bd720e27cf7d8a92640bb45faaa6a982'
+            
'9885226c2eea79712f316194fd9710bd940bce517cb2d3f1fcfbcb1edb8f10ae8496e7d03cd377cb991efa7259ff6930c488c603df206611bae4aa30a62cc596')
 validpgpkeys=('19BBCAEF7B19B280A0E2175E62D48FAD16A0DE01'
               '8BC4DAE0C5A4D65F404401074F7DBAA99A59B973'
               'BA3C15B1337CF0FB222BD41A1BCA6586A347943F'
@@ -60,11 +65,16 @@
    patch -Np0 -i ../subversion.rpath.fix.patch
    patch -p1 -i ../ruby-frozen-nil.patch
    rm subversion/bindings/swig/proxy/*.swg
+   # fix issues with Python 3.11 and swig
+   patch -Np1 -i ../subversion-1.14.1-python-3.11-build.patch
+   patch -Np1 -i 
../subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch
 
    ./autogen.sh
 }
 
 build() {
+   local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
+
    cd ${pkgname}-${pkgver}
    ./configure --prefix=/usr \
                --with-apxs \
@@ -76,25 +86,28 @@
                --with-ruby-sitedir=/usr/lib/ruby/vendor_ruby \
                --disable-static
 
+   # prevent excessive overlinking due to libtool
+   sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
    make LT_LDFLAGS="-L$Fdestdir/usr/lib"
-   local python_version=$(python -c 'import sys; print(".".join(map(str, 
sys.version_info[:2])))')
-   make swig_pydir=/usr/lib/python${python_version}/site-packages/libsvn \
-     swig_pydir_extra=/usr/lib/python${python_version}/site-packages/svn 
swig-py swig-pl javahl swig-rb
+   make swig_pydir=$site_packages/libsvn \
+     swig_pydir_extra=$site_packages/svn swig-py swig-pl javahl swig-rb
 }
 
 check() {
    cd ${pkgname}-${pkgver}
    export LANG=C LC_ALL=C
-   make check check-swig-pl check-swig-py check-swig-rb CLEANUP=yes # 
check-javahl
+   make check-swig-py check check-swig-pl check-swig-rb CLEANUP=yes # 
check-javahl
 }
 
 package() {
+   local site_packages=$(python -c "import site; 
print(site.getsitepackages()[0])")
+
    cd ${pkgname}-${pkgver}
 
    export LD_LIBRARY_PATH="${pkgdir}"/usr/lib:${LD_LIBRARY_PATH}
    make DESTDIR="${pkgdir}" INSTALLDIRS=vendor \
-     swig_pydir=/usr/lib/python3.10/site-packages/libsvn \
-     swig_pydir_extra=/usr/lib/python3.10/site-packages/svn \
+     swig_pydir=$site_packages/libsvn \
+     swig_pydir_extra=$site_packages/svn \
      install install-swig-py install-swig-pl install-javahl install-swig-rb
 
    install -dm755 "${pkgdir}"/usr/share/subversion

Added: subversion-1.14.1-python-3.11-build.patch
===================================================================
--- subversion-1.14.1-python-3.11-build.patch                           (rev 0)
+++ subversion-1.14.1-python-3.11-build.patch   2023-04-08 13:05:08 UTC (rev 
473314)
@@ -0,0 +1,14 @@
+Use read_file instead of deprecated readfp  - removed in Python 3.11 
+
+diff -ur subversion-1.14.1/build/generator/gen_base.py 
subversion-1.14.1-patched/build/generator/gen_base.py
+--- subversion-1.14.1/build/generator/gen_base.py      2019-11-04 
06:59:36.000000000 +0100
++++ subversion-1.14.1-patched/build/generator/gen_base.py      2021-12-15 
14:04:50.041649320 +0100
+@@ -76,7 +76,7 @@
+ 
+     # Now read and parse build.conf
+     parser = configparser.ConfigParser()
+-    parser.readfp(open(fname))
++    parser.read_file(open(fname))
+ 
+     self.conf = build_path(os.path.abspath(fname))
+ 

Added: 
subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch
===================================================================
--- 
subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch    
                            (rev 0)
+++ 
subversion-1.14.2-swig-py-Fix-conditionals-by-SWIG-version-and-by-Pyth.patch    
    2023-04-08 13:05:08 UTC (rev 473314)
@@ -0,0 +1,64 @@
+From 8ff4cfd06ce554e9df31a088c9d09f45278c6de4 Mon Sep 17 00:00:00 2001
+From: Yasuhito Futatsuki <[email protected]>
+Date: Tue, 20 Sep 2022 12:57:06 +0000
+Subject: [PATCH] swig-py: Fix conditionals by SWIG version and by Python
+version for proxy code.
+
+We are using different code for proxy object, by Python version and by SWIG
+version.  The distinguish between Python 2 and Python 3 was done by SWIG
+macro "SWIGPYTHON_PY3".  However, the macro was dropped since SWIG commit
+a343b7e[1], between SWIG 4.0.2 release and upcoming SWIG 4.1.0 release.
+
+As we already dropped support for the combination of SWIG >= 4.0 and Python 2,
+we should detect Python 2 only in SWIG < 4.0 case. So we can rely on the macro
+only in the case.
+
+* subversion/bindings/swig/include/proxy.swg ():
+Reorder the conditionals distinguish SWIG versions and Python versions,
+as described above.
+
+Found by: Jitka Plesnikova (jplesnik {_AT_} redhat.com)
+
+Suggested by: Julien Schueller (schueller {_AT_} phimeca.com) [2]
+
+[1] 
https://github.com/swig/swig/commit/a343b7e254567a64761bc1be7dc55b7b7424ec52
+[2] https://github.com/swig/swig/issues/2373#issuecomment-1250997124
+
+
+git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1904167 
13f79535-47bb-0310-9956-ffa450edef68
+---
+ subversion/bindings/swig/include/proxy.swg | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/subversion/bindings/swig/include/proxy.swg 
b/subversion/bindings/swig/include/proxy.swg
+index ac67d434ca..7d2d0dd033 100644
+--- a/subversion/bindings/swig/include/proxy.swg
++++ b/subversion/bindings/swig/include/proxy.swg
+@@ -66,7 +66,6 @@
+         fn()
+ 
+ %}
+-#if defined(SWIGPYTHON_PY3)
+ #if SWIG_VERSION >= 0x040000
+ %pythoncode %{
+   # -classic and -modern options have been dropped and this variable
+@@ -76,7 +75,7 @@
+   _set_instance_attr = 
_swig_setattr_nondynamic_instance_variable(object.__setattr__)
+ 
+ %}
+-#else
++#elif defined(SWIGPYTHON_PY3)
+ %pythoncode %{
+   # SWIG classes generated with -modern do not define this variable
+   try:
+@@ -90,7 +89,6 @@
+   _set_instance_attr = _swig_setattr_nondynamic_method(object.__setattr__)
+ 
+ %}
+-#endif
+ #else
+ %pythoncode %{
+   # SWIG classes generated with -classic do not define this variable,
+-- 
+2.37.3
+

Reply via email to