gnucash-on-osx master: Patch AQBanking so that it builds without a system strndup.

John Ralls jralls at code.gnucash.org
Fri Jun 24 18:28:03 EDT 2016


Updated	 via  https://github.com/Gnucash/gnucash-on-osx/commit/97c8973e (commit)
	from  https://github.com/Gnucash/gnucash-on-osx/commit/f9134291 (commit)



commit 97c8973e0c0410827b38fda840c6a927f2521f8e
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Jun 24 15:25:34 2016 -0700

    Patch AQBanking so that it builds without a system strndup.

diff --git a/modulesets/gnucash.modules b/modulesets/gnucash.modules
index 181fca9..afb73ff 100644
--- a/modulesets/gnucash.modules
+++ b/modulesets/gnucash.modules
@@ -80,7 +80,9 @@
   <autotools id="aqbanking" autogen-sh="configure" makeargs="-j1"
 	     autogenargs="--enable-local-install">
     <branch module="gnucash/Dependencies/aqbanking-5.6.10.tar.gz" version="5.6.10"
-	    repo="sourceforge"/>
+	    repo="sourceforge">
+            <patch file="https://raw.githubusercontent.com/gnucash/gnucash-on-osx/master/patches/swift940-strndup.patch" strip='1'/>
+    </branch>
     <dependencies>
       <dep package="gwenhywfar"/>
       <dep package="gmp"/>
@@ -210,7 +212,11 @@
     </dependencies>
   </autotools>
 
-<!--./b2 toolset=darwin address-model=32 cxxflags="$CPPFLAGS" cflags="$CPPFLAGS" linkflags="$LDFLAGS" -\-prefix=$PREFIX -\-build-dir=$PREFIX/../build/boost_1_56_0-->
+<!--./b2 toolset=darwin address-model=32 cxxflags="$CPPFLAGS" cflags="$CPPFLAGS" linkflags="$LDFLAGS" dll-path=$PREFIX/lib -\-prefix=$PREFIX -\-build-dir=$PREFIX/../build/boost_1_56_0
+
+After which one must run 
+for i in `ls $PREFIX/lib/libboost*`; do install_name_tool -id $i $i; done
+-->
   <autotools id="boost" supports-non-srcdir-builds="no">
     <branch module="boost/boost_1_56_0.tar.bz2" repo="sourceforge"
 	    version="1.56.0"/>
diff --git a/patches/swift940-strndup.patch b/patches/swift940-strndup.patch
new file mode 100644
index 0000000..a63ae85
--- /dev/null
+++ b/patches/swift940-strndup.patch
@@ -0,0 +1,45 @@
+--- a/src/plugins/parsers/swift/swift940.c     2015-06-01 10:16:28.000000000 -0700
++++ b/src/plugins/parsers/swift/swift940.c     2016-06-20 16:45:18.000000000 -0700
+@@ -31,9 +31,20 @@
+ 
+ 
+ /* #define ENABLE_FULL_SEPA_LOG */
++#ifndef HAVE_STRNDUP
++inline char* strndup_impl(char* instr, size_t len)
++{
++     char *outstr = malloc(len +1);
++     if (outstr)
++     {
++          memset(outstr, 0, len);
++          memcpy(outstr, instr, len);
++     }
++     return outstr;
++}
+ 
+-
+-
++#define strndup(str, len) strndup_impl(str, len)
++#endif
+ #define CENTURY_CUTOFF_YEAR 79
+ 
+ 
+@@ -266,7 +277,7 @@
+ 
+ 	    /* found begin of the next SEPA field or end of buffer */
+ 	    if (s > sLastTagStart) {
+-	      int tagLen;
++	      size_t tagLen;
+ 
+ 	      /* we currently have a field, close that first */
+ 	      tagLen=s-sLastTagStart;
+--- a/configure.ac	2016-04-23 09:29:09.000000000 -0700
++++ b/configure.ac	2016-06-20 16:48:10.000000000 -0700
+@@ -384,7 +384,7 @@
+ # Checks for library functions.
+ #
+ AC_FUNC_STRFTIME
+-AC_CHECK_FUNCS([memmove memset strcasecmp strdup strerror snprintf])
++AC_CHECK_FUNCS([memmove memset strcasecmp strdup strndup strerror snprintf])
+ AC_CHECK_FUNCS([setlocale])
+ 
+ 



Summary of changes:
 modulesets/gnucash.modules     | 10 ++++++++--
 patches/swift940-strndup.patch | 45 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 patches/swift940-strndup.patch



More information about the gnucash-changes mailing list