Fri Aug 9 13:09:32 2019 UTC ()
Pullup ticket #6013 - requested by bacon
devel/subversion: build fix

Revisions pulled up:
- devel/subversion/distinfo                                     1.113
- devel/subversion/patches/patch-configure                      1.5
- devel/subversion/patches/patch-subversion_bindings_swig_python_libsvn_swig_py_swigutil_py.c 1.1

---
   Module Name:    pkgsrc
   Committed By:   markd
   Date:           Wed Jul  3 10:42:54 UTC 2019

   Modified Files:
           pkgsrc/devel/subversion: distinfo
           pkgsrc/devel/subversion/patches: patch-configure
   Added Files:
           pkgsrc/devel/subversion/patches:
               patch-subversion_bindings_swig_python_libsvn_swig_py_swigutil_py.c

   Log Message:
   subversion: more reliable fix for APR 1.7.0

   From: Stefan Sperling <stsp%apache.org@localhost>
   Date: Fri, 12 Apr 2019 09:27:33 +0000
   Subject: [PATCH] Get rid of apr_int64_t format string check in swig py
    configure.

   This check relied on APR implementation details and broke with APR 1.7.0.
   Rather than trying to guess a perfect format string to use, just use the
   largest possible format and cast the argument accordingly.

   Should fix build against APR 1.7.0 and later.

   Suggested by: brane

   * build/ac-macros/swig.m4: Remove code related to SVN_APR_INT64_T_PYCFMT.

   * subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
     (svn_swig_py_client_blame_receiver_func): Stop relying on the
      SVN_APR_INT64_T_PYCFMT constant from configure. Use "L" and
      acast to PY_LONG_LONG instead.


(bsiegert)
diff -r1.112 -r1.112.2.1 pkgsrc/devel/subversion/distinfo
diff -r1.4 -r1.4.2.1 pkgsrc/devel/subversion/patches/patch-configure
diff -r0 -r1.1.2.2 pkgsrc/devel/subversion/patches/patch-subversion_bindings_swig_python_libsvn_swig_py_swigutil_py.c

cvs diff -r1.112 -r1.112.2.1 pkgsrc/devel/subversion/distinfo (expand / switch to context diff)
--- pkgsrc/devel/subversion/distinfo 2019/05/27 16:10:08 1.112
+++ pkgsrc/devel/subversion/distinfo 2019/08/09 13:09:32 1.112.2.1
@@ -1,10 +1,11 @@
-$NetBSD: distinfo,v 1.112 2019/05/27 16:10:08 ryoon Exp $
+$NetBSD: distinfo,v 1.112.2.1 2019/08/09 13:09:32 bsiegert Exp $
 
 SHA1 (subversion-1.12.0.tar.bz2) = 2dfecac56f18951182dbee4a4f14d27f27ebcdb7
 RMD160 (subversion-1.12.0.tar.bz2) = cd06e97d3e109796c3370cb7633081805ee4d957
 SHA512 (subversion-1.12.0.tar.bz2) = 87a00b23bdac63124fa00642e2ac7e6f7818b092bc6422cabdeb2ca8fbc8c481fb8c1e4fbd86aac94e8e1fc099fa163aa0609aca23265ceb96ef4ebe78a64c13
 Size (subversion-1.12.0.tar.bz2) = 8504473 bytes
 SHA1 (patch-Makefile.in) = 2df6c733d563c0bc7e0d1b4b6e6e00f82ea8c176
-SHA1 (patch-configure) = d0454b65964c6d37753e0b674c2e30205df193a1
+SHA1 (patch-configure) = 3a0650395111c400c9bf0418cd31510e7179f454
 SHA1 (patch-subversion_bindings_swig_perl_native_Makefile.PL.in) = 3fadde312693f2a304cd7e348c66cbd373c57854
+SHA1 (patch-subversion_bindings_swig_python_libsvn_swig_py_swigutil_py.c) = ed75c4d2fbc911a97bc47e78eaebc5b61078332b
 SHA1 (patch-tools_dev_benchmarks_large__dirs_create__bigdir.sh) = ff19087ff4d348fdcf904eb52406f6b717fe444a

cvs diff -r1.4 -r1.4.2.1 pkgsrc/devel/subversion/patches/patch-configure (expand / switch to context diff)
--- pkgsrc/devel/subversion/patches/patch-configure 2019/05/27 16:10:08 1.4
+++ pkgsrc/devel/subversion/patches/patch-configure 2019/08/09 13:09:32 1.4.2.1
@@ -1,78 +1,278 @@
-$NetBSD: patch-configure,v 1.4 2019/05/27 16:10:08 ryoon Exp $
+$NetBSD: patch-configure,v 1.4.2.1 2019/08/09 13:09:32 bsiegert Exp $
 
 * Fix build with devel/apr-1.7.0
 
 --- configure.orig	2019-04-11 13:21:28.000000000 +0000
 +++ configure
-@@ -24344,7 +24344,7 @@ else
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+@@ -24329,67 +24329,6 @@ $as_echo "$ac_cv_python_libs" >&6; }
+   fi
+ `"
+ 
+-                SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_int64_t Python/C API format string" >&5
+-$as_echo_n "checking for apr_int64_t Python/C API format string... " >&6; }
+-if ${svn_cv_pycfmt_apr_int64_t+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"lld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"ll(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="L"
- fi
- rm -f conftest*
-@@ -24358,7 +24358,7 @@ r
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="L"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-r
+-                     #include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"ld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"l(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="l"
- fi
- rm -f conftest*
-@@ -24859,7 +24859,7 @@ else
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="l"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "MaTcHtHiS +\"d\" +EnDeNd" >/dev/null 2>&1; then :
+-  svn_cv_pycfmt_apr_int64_t="i"
+-fi
+-rm -f conftest*
+-
+-      fi
+-
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $svn_cv_pycfmt_apr_int64_t" >&5
+-$as_echo "$svn_cv_pycfmt_apr_int64_t" >&6; }
+-    CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
+-    if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-      as_fn_error $? "failed to recognize APR_INT64_T_FMT on this platform" "$LINENO" 5
+-    fi
+-
+-cat >>confdefs.h <<_ACEOF
+-#define SVN_APR_INT64_T_PYCFMT "$svn_cv_pycfmt_apr_int64_t"
+-_ACEOF
+-
+   fi
+ 
+   if test "$PERL" != "none"; then
+@@ -24844,67 +24783,6 @@ $as_echo "$ac_cv_python_libs" >&6; }
+   fi
+ `"
+ 
+-                SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_int64_t Python/C API format string" >&5
+-$as_echo_n "checking for apr_int64_t Python/C API format string... " >&6; }
+-if ${svn_cv_pycfmt_apr_int64_t+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"lld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"ll(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="L"
- fi
- rm -f conftest*
-@@ -24873,7 +24873,7 @@ r
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="L"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-r
+-                     #include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"ld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"l(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="l"
- fi
- rm -f conftest*
-@@ -25374,7 +25374,7 @@ else
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="l"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "MaTcHtHiS +\"d\" +EnDeNd" >/dev/null 2>&1; then :
+-  svn_cv_pycfmt_apr_int64_t="i"
+-fi
+-rm -f conftest*
+-
+-      fi
+-
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $svn_cv_pycfmt_apr_int64_t" >&5
+-$as_echo "$svn_cv_pycfmt_apr_int64_t" >&6; }
+-    CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
+-    if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-      as_fn_error $? "failed to recognize APR_INT64_T_FMT on this platform" "$LINENO" 5
+-    fi
+-
+-cat >>confdefs.h <<_ACEOF
+-#define SVN_APR_INT64_T_PYCFMT "$svn_cv_pycfmt_apr_int64_t"
+-_ACEOF
+-
+   fi
+ 
+   if test "$PERL" != "none"; then
+@@ -25359,67 +25237,6 @@ $as_echo "$ac_cv_python_libs" >&6; }
+   fi
+ `"
+ 
+-                SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_int64_t Python/C API format string" >&5
+-$as_echo_n "checking for apr_int64_t Python/C API format string... " >&6; }
+-if ${svn_cv_pycfmt_apr_int64_t+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"lld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"ll(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="L"
- fi
- rm -f conftest*
-@@ -25388,7 +25388,7 @@ r
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="L"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-r
+-                     #include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"ld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"l(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="l"
- fi
- rm -f conftest*
-@@ -25892,7 +25892,7 @@ else
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="l"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "MaTcHtHiS +\"d\" +EnDeNd" >/dev/null 2>&1; then :
+-  svn_cv_pycfmt_apr_int64_t="i"
+-fi
+-rm -f conftest*
+-
+-      fi
+-
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $svn_cv_pycfmt_apr_int64_t" >&5
+-$as_echo "$svn_cv_pycfmt_apr_int64_t" >&6; }
+-    CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
+-    if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-      as_fn_error $? "failed to recognize APR_INT64_T_FMT on this platform" "$LINENO" 5
+-    fi
+-
+-cat >>confdefs.h <<_ACEOF
+-#define SVN_APR_INT64_T_PYCFMT "$svn_cv_pycfmt_apr_int64_t"
+-_ACEOF
+-
+   fi
+ 
+   if test "$PERL" != "none"; then
+@@ -25877,67 +25694,6 @@ $as_echo "$ac_cv_python_libs" >&6; }
+   fi
+ `"
+ 
+-                SVN_PYCFMT_SAVE_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS $SVN_APR_INCLUDES"
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for apr_int64_t Python/C API format string" >&5
+-$as_echo_n "checking for apr_int64_t Python/C API format string... " >&6; }
+-if ${svn_cv_pycfmt_apr_int64_t+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"lld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"ll(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
-   svn_cv_pycfmt_apr_int64_t="L"
- fi
- rm -f conftest*
-@@ -25906,7 +25906,7 @@ r
-                       MaTcHtHiS APR_INT64_T_FMT EnDeNd
- _ACEOF
- if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  svn_cv_pycfmt_apr_int64_t="L"
+-fi
+-rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-r
+-                     #include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 -  $EGREP "MaTcHtHiS +\"ld\" +EnDeNd" >/dev/null 2>&1; then :
-+  $EGREP "MaTcHtHiS +\"l(\" *\")?d\" +EnDeNd" >/dev/null 2>&1; then :
+-  svn_cv_pycfmt_apr_int64_t="l"
-   svn_cv_pycfmt_apr_int64_t="l"
+-fi
- fi
+-rm -f conftest*
- rm -f conftest*
+-
+-      fi
+-      if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-#include <apr.h>
+-                      MaTcHtHiS APR_INT64_T_FMT EnDeNd
+-_ACEOF
+-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "MaTcHtHiS +\"d\" +EnDeNd" >/dev/null 2>&1; then :
+-  svn_cv_pycfmt_apr_int64_t="i"
+-fi
+-rm -f conftest*
+-
+-      fi
+-
+-fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $svn_cv_pycfmt_apr_int64_t" >&5
+-$as_echo "$svn_cv_pycfmt_apr_int64_t" >&6; }
+-    CPPFLAGS="$SVN_PYCFMT_SAVE_CPPFLAGS"
+-    if test "x$svn_cv_pycfmt_apr_int64_t" = "x"; then
+-      as_fn_error $? "failed to recognize APR_INT64_T_FMT on this platform" "$LINENO" 5
+-    fi
+-
+-cat >>confdefs.h <<_ACEOF
+-#define SVN_APR_INT64_T_PYCFMT "$svn_cv_pycfmt_apr_int64_t"
+-_ACEOF
+-
+   fi
+ 
+   if test "$PERL" != "none"; then

File Added: pkgsrc/devel/subversion/patches/Attic/patch-subversion_bindings_swig_python_libsvn_swig_py_swigutil_py.c
$NetBSD: patch-subversion_bindings_swig_python_libsvn_swig_py_swigutil_py.c,v 1.1.2.2 2019/08/09 13:09:32 bsiegert Exp $

From: Stefan Sperling <stsp@apache.org>
Date: Fri, 12 Apr 2019 09:27:33 +0000
Subject: [PATCH] Get rid of apr_int64_t format string check in swig py
 configure.

This check relied on APR implementation details and broke with APR 1.7.0.
Rather than trying to guess a perfect format string to use, just use the
largest possible format and cast the argument accordingly.

Should fix build against APR 1.7.0 and later.

Suggested by: brane

* build/ac-macros/swig.m4: Remove code related to SVN_APR_INT64_T_PYCFMT.

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
  (svn_swig_py_client_blame_receiver_func): Stop relying on the
   SVN_APR_INT64_T_PYCFMT constant from configure. Use "L" and
   acast to PY_LONG_LONG instead.

--- subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c.orig	2018-12-12 13:57:17.000000000 +0000
+++ subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c
@@ -46,7 +46,7 @@
 #include "svn_mergeinfo.h"
 #include "svn_types.h"
 
-#include "svn_private_config.h" /* for SVN_APR_INT64_T_PYCFMT */
+#include "svn_private_config.h"
 
 #include "swig_python_external_runtime.swg"
 #include "swigutil_py.h"
@@ -3394,10 +3394,9 @@ svn_error_t *svn_swig_py_client_blame_re
   svn_swig_py_acquire_py_lock();
 
   if ((result = PyObject_CallFunction(receiver,
-                                      (char *)
-                                      (SVN_APR_INT64_T_PYCFMT "lsssO&"),
-                                      line_no, revision, author, date, line,
-                                      make_ob_pool, pool)) == NULL)
+                                      (char *)"LlsssO&",
+                                      (PY_LONG_LONG)line_no, revision, author,
+                                      date, line, make_ob_pool, pool)) == NULL)
     {
       err = callback_exception_error();
     }