Thu Oct 24 22:28:46 2019 UTC ()
ocsync: Fix build on NetBSD 9.99.17

Adapt the local patch for the POSIX iconv(3) API change in new NetBSD.


(kamil)
diff -r1.3 -r1.4 pkgsrc/net/ocsync/distinfo
diff -r1.1 -r1.2 pkgsrc/net/ocsync/patches/patch-src_std_c__string.c

cvs diff -r1.3 -r1.4 pkgsrc/net/ocsync/distinfo (expand / switch to unified diff)

--- pkgsrc/net/ocsync/distinfo 2017/08/19 00:23:36 1.3
+++ pkgsrc/net/ocsync/distinfo 2019/10/24 22:28:46 1.4
@@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
1$NetBSD: distinfo,v 1.3 2017/08/19 00:23:36 jlam Exp $ 1$NetBSD: distinfo,v 1.4 2019/10/24 22:28:46 kamil Exp $
2 2
3SHA1 (ocsync-0.90.4.tar.bz2) = d53a64177addc9fcdd831a0a78786eca25b2588a 3SHA1 (ocsync-0.90.4.tar.bz2) = d53a64177addc9fcdd831a0a78786eca25b2588a
4RMD160 (ocsync-0.90.4.tar.bz2) = b6208a9c0ae452f16f0ced32c1b5635df06d3b99 4RMD160 (ocsync-0.90.4.tar.bz2) = b6208a9c0ae452f16f0ced32c1b5635df06d3b99
5SHA512 (ocsync-0.90.4.tar.bz2) = 74bf6b083ae4d4c09e3915d777d916a04ebb19aefb21a5a14a49e2079e02c5c60f1f274aa0cab5c227147883eaf1a5f91b6c0546b818c960cc3575cdcdd93d57 5SHA512 (ocsync-0.90.4.tar.bz2) = 74bf6b083ae4d4c09e3915d777d916a04ebb19aefb21a5a14a49e2079e02c5c60f1f274aa0cab5c227147883eaf1a5f91b6c0546b818c960cc3575cdcdd93d57
6Size (ocsync-0.90.4.tar.bz2) = 4630698 bytes 6Size (ocsync-0.90.4.tar.bz2) = 4630698 bytes
7SHA1 (patch-cmake_Modules_DefineInstallationPaths.cmake) = 1ce32ae21fe331d1ebf5bd5a5941e405a7eb4b06 7SHA1 (patch-cmake_Modules_DefineInstallationPaths.cmake) = 1ce32ae21fe331d1ebf5bd5a5941e405a7eb4b06
8SHA1 (patch-config_CMakeLists.txt) = b387f38a79d9f85e3f67060a2cb689bb13dd1c28 8SHA1 (patch-config_CMakeLists.txt) = b387f38a79d9f85e3f67060a2cb689bb13dd1c28
9SHA1 (patch-src_std_c__string.c) = 65927e8f7c222edfde66136a331ae81b0f4fcd4c 9SHA1 (patch-src_std_c__string.c) = 4f94ae5559fd0c19b11f3bcd751b5de89ad615a4

cvs diff -r1.1 -r1.2 pkgsrc/net/ocsync/patches/patch-src_std_c__string.c (expand / switch to unified diff)

--- pkgsrc/net/ocsync/patches/patch-src_std_c__string.c 2013/11/22 12:01:13 1.1
+++ pkgsrc/net/ocsync/patches/patch-src_std_c__string.c 2019/10/24 22:28:46 1.2
@@ -1,18 +1,34 @@ @@ -1,18 +1,34 @@
1$NetBSD: patch-src_std_c__string.c,v 1.1 2013/11/22 12:01:13 ryoon Exp $ 1$NetBSD: patch-src_std_c__string.c,v 1.2 2019/10/24 22:28:46 kamil Exp $
2 2
3* For NetBSD iconv(3), this should be fixed for GNU iconv and NetBSD case. 3* For NetBSD iconv(3), this should be fixed for GNU iconv and NetBSD case.
4 4
5--- src/std/c_string.c.orig 2013-10-18 13:11:09.000000000 +0000 5--- src/std/c_string.c.orig 2013-10-18 13:11:09.000000000 +0000
6+++ src/std/c_string.c 6+++ src/std/c_string.c
7@@ -83,7 +83,11 @@ enum iconv_direction { iconv_from_native 7@@ -40,6 +40,15 @@
 8 #include <windows.h>
 9 #endif
 10
 11+#if defined(__NetBSD__)
 12+#include <sys/param.h>
 13+#if __NetBSD_Prereq__(9,99,17)
 14+#define NETBSD_POSIX_ICONV 1
 15+#else
 16+#define NETBSD_POSIX_ICONV 0
 17+#endif
 18+#endif
 19+
 20 #ifdef WITH_ICONV
 21 #include <iconv.h>
 22
 23@@ -83,7 +92,11 @@ enum iconv_direction { iconv_from_native
8  24
9 static char *c_iconv(const char* str, enum iconv_direction dir) 25 static char *c_iconv(const char* str, enum iconv_direction dir)
10 { 26 {
11+#if !defined(__NetBSD__) 27+#if defined(__NetBSD__) && !NETBSD_POSIX_ICONV
12 char *in = (char*)str; 
13+#else 
14+ const char *in = (char*)str; 28+ const char *in = (char*)str;
 29+#else
 30 char *in = (char*)str;
15+#endif 31+#endif
16 size_t size; 32 size_t size;
17 size_t outsize; 33 size_t outsize;
18 char *out; 34 char *out;