Re: update: devel/subversion 1.14.0

2020-05-28 Thread Stefan Sperling
On Thu, May 28, 2020 at 08:36:26AM +0200, Stefan Sperling wrote:
> I will try to figure out how the bindings can be fixed for py2.

Fixed in this version.

diff 24cae81146b73ebd1005423a1e7a1b85981687f0 /usr/ports
blob - 3ca5215b4bf8aed2aaafd4b25271aec3c474a3af
file + devel/subversion/Makefile
--- devel/subversion/Makefile
+++ devel/subversion/Makefile
@@ -7,7 +7,7 @@ COMMENT-ruby=   ruby interface to subversion
 COMMENT-ap2=   apache2 subversion modules
 COMMENT-gnome-keyring= GNOME keyring support for subversion
 
-VERSION=   1.13.0
+VERSION=   1.14.0
 DISTNAME=  subversion-${VERSION:S/rc/-rc/}
 PKGNAME-main=  subversion-${VERSION}
 FULLPKGNAME-perl=  p5-SVN-${VERSION}
@@ -21,17 +21,15 @@ FULLPKGPATH-ap2=devel/subversion,-ap2
 FULLPKGNAME-gnome-keyring= gnome-keyring-subversion-${VERSION}
 FULLPKGPATH-gnome-keyring= devel/subversion,-gnome-keyring
 
-REVISION-main= 1
-REVISION-perl= 0
-REVISION-python=   0
-REVISION-ruby= 0
-REVISION-ap2=  0
-
-MODRUBY_REV ?= 2.5
+MODRUBY_REV ?= 2.7
 # Work around for SHARED_LIBS not picking up MODRUBY_BINREV from ruby module
 MODRUBY_BINREV=${MODRUBY_REV:S/.//}
 
-SO_VERSION=5.0
+# Subversion supports either python2 or python3 bindings. Consumers in the
+# ports tree are not yet ready for python3. So keep using python 2.7 for now.
+MODPY_VERSION ?= 2.7
+
+SO_VERSION=6.0
 SVN_LIBS=  svn_client-1 svn_delta-1 svn_diff-1 svn_fs-1 \
svn_fs_base-1 svn_fs_fs-1 svn_fs_util-1 svn_fs_x-1 \
svn_ra-1 svn_ra_serf-1 svn_ra_local-1 \
@@ -69,7 +67,8 @@ MODULES=  lang/python
 
 WANTLIB=   expat iconv intl lz4 m pthread z
 
-BUILD_DEPENDS= devel/gettext,-tools
+BUILD_DEPENDS= devel/gettext,-tools \
+   devel/py3c
 
 MULTI_PACKAGES = -main -ap2 -perl -python -ruby -gnome-keyring
 
@@ -143,7 +142,7 @@ RUN_DEPENDS-gnome-keyring=
 
 MAKE_FLAGS=MAKE=${MAKE_PROGRAM}
 CONFIGURE_STYLE=gnu
-CONFIGURE_ENV= PYTHON2=${MODPY_BIN} MKDIR="/bin/mkdir -p"
+CONFIGURE_ENV= PYTHON=${MODPY_BIN} MKDIR="/bin/mkdir -p"
 CONFIGURE_ARGS+=--with-sasl=${LOCALBASE} \
--without-jikes \
--without-jdk \
@@ -195,12 +194,17 @@ SUBST_VARS+=  LOCALBASE SO_VERSION MODRUBY_BINREV 
LIBsv
 pre-patch:
@ln -s ${MODPY_BIN} ${WRKDIR}/bin/python
 
-pre-configure:
+post-patch:
@${SUBST_CMD} ${WRKSRC}/Makefile.in \
${WRKSRC}/subversion/libsvn_subr/auth.c
mv 
${WRKSRC}/subversion/bindings/swig/ruby/libsvn_swig_ruby{,${MODRUBY_BINREV}}
sed -i 's/libsvn_swig_ruby/libsvn_swig_ruby${MODRUBY_BINREV}/g' \
`fgrep -lr libsvn_swig_ruby ${WRKSRC}`
+
+# Before running ./configure we must run autogen.sh to regenerate Python3 SWIG
+# files shipped in the tarball for Python2: https://svn.apache.org/r1877960
+pre-configure:
+   @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./autogen.sh
 
 .if ${BUILD_PACKAGES:M-python}
 TEST_DEPENDS+= ${FULLPKGNAME-python}:${BUILD_PKGPATH},-python
blob - f3e9a934ed16ecc22fe06886f22fcc6fb457fe39
file + devel/subversion/distinfo
--- devel/subversion/distinfo
+++ devel/subversion/distinfo
@@ -1,2 +1,2 @@
-SHA256 (subversion-1.13.0.tar.bz2) = 
vFDOLD+qexrpEDxDIBffmN/ZicQjn5+CcLs6MU7Z5b0=
-SIZE (subversion-1.13.0.tar.bz2) = 8508122
+SHA256 (subversion-1.14.0.tar.bz2) = 
a6jiGPn5eoOnmeWKPG2hIh0DSxjZ2Mu8tuxSqxFyIQI=
+SIZE (subversion-1.14.0.tar.bz2) = 8497531
blob - facc9081810686bf9f2549d8846e28032e04b64b
file + devel/subversion/patches/patch-Makefile_in
--- devel/subversion/patches/patch-Makefile_in
+++ devel/subversion/patches/patch-Makefile_in
@@ -17,20 +17,14 @@ Index: Makefile.in
  
  # where to install pkg-config files
  pkgconfig_dir = $(datadir)/pkgconfig
-@@ -150,13 +150,13 @@ BOOST_TEST_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_UNIT_TEST_
+@@ -150,8 +150,8 @@ BOOST_TEST_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_UNIT_TEST_
  SWIG = @SWIG@
- SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@ -I$(SWIG_SRC_DIR)/python/libsvn_swig_py
+ SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@ @SVN_PY3C_INCLUDES@ 
-I$(SWIG_SRC_DIR)/python/libsvn_swig_py
  SWIG_PY_COMPILE = @SWIG_PY_COMPILE@
 -SWIG_PY_LINK = @SWIG_PY_LINK@
 -SWIG_PY_LIBS = @SWIG_PY_LIBS@
 +SWIG_PY_LINK = @SWIG_PY_LINK@ -L@libdir@
 +SWIG_PY_LIBS = -lpython${MODPY_VERSION}
+ SWIG_PY_ERRMSG = @SWIG_PY_ERRMSG@
  SWIG_PL_INCLUDES = @SWIG_PL_INCLUDES@
- SWIG_RB_INCLUDES = @SWIG_RB_INCLUDES@ -I$(SWIG_SRC_DIR)/ruby/libsvn_swig_ruby
- SWIG_RB_COMPILE = @SWIG_RB_COMPILE@
- SWIG_RB_LINK = @SWIG_RB_LINK@
--SWIG_RB_LIBS = @SWIG_RB_LIBS@
-+SWIG_RB_LIBS = -lruby${MODRUBY_BINREV}
- SWIG_RB_SITE_LIB_DIR = @SWIG_RB_SITE_LIB_DIR@
- SWIG_RB_SITE_ARCH_DIR = @SWIG_RB_SITE_ARCH_DIR@
- SWIG_RB_TEST_VERBOSE = @SWIG_RB_TEST_VERBOSE@
+ SWIG_PL_ERRMSG = @SWIG_PL_ERRMSG@



Re: update: devel/subversion 1.14.0

2020-05-27 Thread Stefan Sperling
On Thu, May 28, 2020 at 12:16:31AM +0100, Stuart Henderson wrote:
> ...not sure what in the build is causing the problem, but the bindings are
> definitely not working

> > Also I think I know how to add a python3 flavour so that it can be built
> > again with py3 bindings.
> 
> I have a diff for that but it should go on top of an existing commit
> rather than be stacked up

Thanks a lot for your input.

I like your idea of using flavours for this. And yes, we can add a py3
flavour later. Once 1.14 is in and works with py2 this will be easy to do.

I will try to figure out how the bindings can be fixed for py2.

The py3 ones are definitely working for me locally. I've done my release
verification test runs with py3 because I was naively assuming downstreams
could already flip over to py3. It felt like SVN was one of the last projects
in the universe to make that transition; apparently not :)



Re: update: devel/subversion 1.14.0

2020-05-27 Thread Stuart Henderson
On 2020/05/27 22:38, Stuart Henderson wrote:
> On 2020/05/27 19:23, Stefan Sperling wrote:
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/client.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/client.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/core.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/core.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/delta.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/delta.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/diff.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/diff.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/fs.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/fs.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/ra.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/ra.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/repos.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/repos.pyc
> >  lib/python${MODPY_VERSION}/site-packages/libsvn/wc.py
> > -lib/python${MODPY_VERSION}/site-packages/libsvn/wc.pyc
> >  lib/python${MODPY_VERSION}/site-packages/svn/
> >  lib/python${MODPY_VERSION}/site-packages/svn/__init__.py
> >  lib/python${MODPY_VERSION}/site-packages/svn/__init__.pyc
> 
> I am looking at this, the missing .pyc files are a red flag - in build log
> you'll see some "SyntaxError: invalid syntax" which I think suggests it may
> be using swig in py3 mode.

...not sure what in the build is causing the problem, but the bindings are
definitely not working, this should return silently:

$ python2
Python 2.7.18 (default, Apr 24 2020, 15:52:16) 
[GCC 4.2.1 Compatible OpenBSD Clang 8.0.1 (tags/RELEASE_801/final)] on openbsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import svn.fs
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/site-packages/svn/fs.py", line 26, in 
from libsvn.fs import *
  File "/usr/local/lib/python2.7/site-packages/libsvn/fs.py", line 152
def svn_fs_version() -> "svn_version_t const *":
 ^
SyntaxError: invalid syntax
>>> 


Old version looks like this:

$ python2
Python 2.7.18 (default, Apr 24 2020, 15:52:16) 
[GCC 4.2.1 Compatible OpenBSD Clang 8.0.1 (tags/RELEASE_801/final)] on openbsd6
Type "help", "copyright", "credits" or "license" for more information.
>>> import svn.fs
>>> 

autoconf does seem to be setting up to use the right parameters for swig
but I'm not all that familiar with swig/python so I may have missed
something. Whatever ends up being needed to fix generation of the pyc
files should fix runtime too.

This is probably most easily fixed by someone who knows their way around
svn's swig build infrastructure..

> Also I think I know how to add a python3 flavour so that it can be built
> again with py3 bindings.

I have a diff for that but it should go on top of an existing commit
rather than be stacked up so I'll keep it local for now. I would like
this though because it will allow moving Trac without having to deal
with cvs2svn as well. (The py2 and py3 bindings will need to conflict
due to the libsvn_swig_py-1* libraries - I don't think that's really a
problem, the trac upgrade path will be a little messy but people will
cope, it just needs a current.html entry to tell them to pkg_delete and
reinstall).



Re: update: devel/subversion 1.14.0

2020-05-27 Thread Stuart Henderson
On 2020/05/27 19:23, Stefan Sperling wrote:
>  lib/python${MODPY_VERSION}/site-packages/libsvn/client.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/client.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/core.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/core.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/delta.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/delta.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/diff.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/diff.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/fs.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/fs.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/ra.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/ra.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/repos.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/repos.pyc
>  lib/python${MODPY_VERSION}/site-packages/libsvn/wc.py
> -lib/python${MODPY_VERSION}/site-packages/libsvn/wc.pyc
>  lib/python${MODPY_VERSION}/site-packages/svn/
>  lib/python${MODPY_VERSION}/site-packages/svn/__init__.py
>  lib/python${MODPY_VERSION}/site-packages/svn/__init__.pyc

I am looking at this, the missing .pyc files are a red flag - in build log
you'll see some "SyntaxError: invalid syntax" which I think suggests it may
be using swig in py3 mode.

Also I think I know how to add a python3 flavour so that it can be built
again with py3 bindings.



update: devel/subversion 1.14.0

2020-05-27 Thread Stefan Sperling
This updates devel/subversion to 1.14.0.

Release notes: https://subversion.apache.org/docs/release-notes/1.14.html
For the actual list of changes since 1.13.0, see the CHANGES file:
https://svn.apache.org/repos/asf/subversion/trunk/CHANGES
Not a lot has changed since 1.13.0, so this is really more of a
maintenance update from the point of view of our ports tree.

The big ticket item relative to 1.13.0 is much better Python3 support.
The new devel/py3c port which was imported today is now required.
However, the Python bindings in our port remain on Python 2.7 for now to
avoid problems with consumers in the ports tree which do not yet support
Python3. AFAIK those are cvs2svn and trac. I am now setting MODPY_VERSION
explicitly to make sure we don't flip this port to a newer version by
accident.

I am switching to Ruby 2.7 since Subversion's Ruby bindings can now work
with it.

ok?

diff 24cae81146b73ebd1005423a1e7a1b85981687f0 /usr/ports
blob - 3ca5215b4bf8aed2aaafd4b25271aec3c474a3af
file + devel/subversion/Makefile
--- devel/subversion/Makefile
+++ devel/subversion/Makefile
@@ -7,7 +7,7 @@ COMMENT-ruby=   ruby interface to subversion
 COMMENT-ap2=   apache2 subversion modules
 COMMENT-gnome-keyring= GNOME keyring support for subversion
 
-VERSION=   1.13.0
+VERSION=   1.14.0
 DISTNAME=  subversion-${VERSION:S/rc/-rc/}
 PKGNAME-main=  subversion-${VERSION}
 FULLPKGNAME-perl=  p5-SVN-${VERSION}
@@ -21,17 +21,15 @@ FULLPKGPATH-ap2=devel/subversion,-ap2
 FULLPKGNAME-gnome-keyring= gnome-keyring-subversion-${VERSION}
 FULLPKGPATH-gnome-keyring= devel/subversion,-gnome-keyring
 
-REVISION-main= 1
-REVISION-perl= 0
-REVISION-python=   0
-REVISION-ruby= 0
-REVISION-ap2=  0
-
-MODRUBY_REV ?= 2.5
+MODRUBY_REV ?= 2.7
 # Work around for SHARED_LIBS not picking up MODRUBY_BINREV from ruby module
 MODRUBY_BINREV=${MODRUBY_REV:S/.//}
 
-SO_VERSION=5.0
+# Subversion supports either python2 or python3 bindings. Consumers in the
+# ports tree are not yet ready for python3. So keep using python 2.7 for now.
+MODPY_VERSION ?= 2.7
+
+SO_VERSION=6.0
 SVN_LIBS=  svn_client-1 svn_delta-1 svn_diff-1 svn_fs-1 \
svn_fs_base-1 svn_fs_fs-1 svn_fs_util-1 svn_fs_x-1 \
svn_ra-1 svn_ra_serf-1 svn_ra_local-1 \
@@ -69,7 +67,8 @@ MODULES=  lang/python
 
 WANTLIB=   expat iconv intl lz4 m pthread z
 
-BUILD_DEPENDS= devel/gettext,-tools
+BUILD_DEPENDS= devel/gettext,-tools \
+   devel/py3c
 
 MULTI_PACKAGES = -main -ap2 -perl -python -ruby -gnome-keyring
 
@@ -143,7 +142,7 @@ RUN_DEPENDS-gnome-keyring=
 
 MAKE_FLAGS=MAKE=${MAKE_PROGRAM}
 CONFIGURE_STYLE=gnu
-CONFIGURE_ENV= PYTHON2=${MODPY_BIN} MKDIR="/bin/mkdir -p"
+CONFIGURE_ENV= PYTHON=${MODPY_BIN} MKDIR="/bin/mkdir -p"
 CONFIGURE_ARGS+=--with-sasl=${LOCALBASE} \
--without-jikes \
--without-jdk \
blob - f3e9a934ed16ecc22fe06886f22fcc6fb457fe39
file + devel/subversion/distinfo
--- devel/subversion/distinfo
+++ devel/subversion/distinfo
@@ -1,2 +1,2 @@
-SHA256 (subversion-1.13.0.tar.bz2) = 
vFDOLD+qexrpEDxDIBffmN/ZicQjn5+CcLs6MU7Z5b0=
-SIZE (subversion-1.13.0.tar.bz2) = 8508122
+SHA256 (subversion-1.14.0.tar.bz2) = 
a6jiGPn5eoOnmeWKPG2hIh0DSxjZ2Mu8tuxSqxFyIQI=
+SIZE (subversion-1.14.0.tar.bz2) = 8497531
blob - facc9081810686bf9f2549d8846e28032e04b64b
file + devel/subversion/patches/patch-Makefile_in
--- devel/subversion/patches/patch-Makefile_in
+++ devel/subversion/patches/patch-Makefile_in
@@ -17,20 +17,14 @@ Index: Makefile.in
  
  # where to install pkg-config files
  pkgconfig_dir = $(datadir)/pkgconfig
-@@ -150,13 +150,13 @@ BOOST_TEST_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_UNIT_TEST_
+@@ -150,8 +150,8 @@ BOOST_TEST_LDFLAGS = @BOOST_LDFLAGS@ @BOOST_UNIT_TEST_
  SWIG = @SWIG@
- SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@ -I$(SWIG_SRC_DIR)/python/libsvn_swig_py
+ SWIG_PY_INCLUDES = @SWIG_PY_INCLUDES@ @SVN_PY3C_INCLUDES@ 
-I$(SWIG_SRC_DIR)/python/libsvn_swig_py
  SWIG_PY_COMPILE = @SWIG_PY_COMPILE@
 -SWIG_PY_LINK = @SWIG_PY_LINK@
 -SWIG_PY_LIBS = @SWIG_PY_LIBS@
 +SWIG_PY_LINK = @SWIG_PY_LINK@ -L@libdir@
 +SWIG_PY_LIBS = -lpython${MODPY_VERSION}
+ SWIG_PY_ERRMSG = @SWIG_PY_ERRMSG@
  SWIG_PL_INCLUDES = @SWIG_PL_INCLUDES@
- SWIG_RB_INCLUDES = @SWIG_RB_INCLUDES@ -I$(SWIG_SRC_DIR)/ruby/libsvn_swig_ruby
- SWIG_RB_COMPILE = @SWIG_RB_COMPILE@
- SWIG_RB_LINK = @SWIG_RB_LINK@
--SWIG_RB_LIBS = @SWIG_RB_LIBS@
-+SWIG_RB_LIBS = -lruby${MODRUBY_BINREV}
- SWIG_RB_SITE_LIB_DIR = @SWIG_RB_SITE_LIB_DIR@
- SWIG_RB_SITE_ARCH_DIR = @SWIG_RB_SITE_ARCH_DIR@
- SWIG_RB_TEST_VERBOSE = @SWIG_RB_TEST_VERBOSE@
+ SWIG_PL_ERRMSG = @SWIG_PL_ERRMSG@
blob - 10f71448f892f604a77d21e8a59dc1e1d0840cc2
file + devel/subversion/pkg/PLIST-python
--- devel/subversion/pkg/PLIST-python
+++ devel/subversion/pkg/PLIST-python
@@ -31,21 +31,13 @@ lib/python${MODPY_VERSION}/site-packages/libsvn/_wc.a
 lib/python${MODPY_VERSION}/site-packages/l