From d5696dc8da07aa2c85d847faee2538945d4f1a92 Mon Sep 17 00:00:00 2001 From: nros Date: Mon, 9 Dec 2019 09:31:06 +0000 Subject: Use ICONV_CONST from autotools instead of hardcoding OS versions Use ICONV_CONST instead of hardcoding osversions, this is more portable. Fixes build on SmartOS. --- math/qalculate/Makefile | 7 +++- math/qalculate/distinfo | 5 +-- math/qalculate/patches/patch-configure.ac | 14 ++++++++ math/qalculate/patches/patch-libqalculate_util.cc | 40 +++++------------------ 4 files changed, 31 insertions(+), 35 deletions(-) create mode 100644 math/qalculate/patches/patch-configure.ac (limited to 'math/qalculate') diff --git a/math/qalculate/Makefile b/math/qalculate/Makefile index 35324d60a1a..91ba8255e26 100644 --- a/math/qalculate/Makefile +++ b/math/qalculate/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.50 2019/11/20 22:15:28 markd Exp $ +# $NetBSD: Makefile,v 1.51 2019/12/09 09:31:06 nros Exp $ DISTNAME= libqalculate-3.5.0a PKGNAME= qalculate-3.5.0 @@ -17,6 +17,7 @@ WRKSRC= ${WRKDIR}/libqalculate-${PKGVERSION_NOREV} USE_LANGUAGES= c c++11 USE_LIBTOOL= yes USE_PKGLOCALEDIR= yes +USE_TOOLS+= autoconf automake USE_TOOLS+= gmake intltool msgfmt msgmerge xgettext pkg-config GNU_CONFIGURE= yes PKGCONFIG_OVERRIDE= ${WRKSRC}/libqalculate.pc.in @@ -25,6 +26,10 @@ UNLIMIT_RESOURCES= datasize CFLAGS.SunOS+= -D_LCONV_C99 +pre-configure: + set -e; cd ${WRKSRC}; \ + autoheader; automake -a --foreign -i; autoconf + .include "../../devel/readline/buildlink3.mk" .include "../../math/mpfr/buildlink3.mk" .include "../../textproc/icu/buildlink3.mk" diff --git a/math/qalculate/distinfo b/math/qalculate/distinfo index 9f24f22daf7..59ec7cfc7ee 100644 --- a/math/qalculate/distinfo +++ b/math/qalculate/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.24 2019/11/20 22:15:28 markd Exp $ +$NetBSD: distinfo,v 1.25 2019/12/09 09:31:06 nros Exp $ SHA1 (libqalculate-3.5.0a.tar.gz) = fcf76bc5a74236bff5b6ae6f0543ab13296bc34d RMD160 (libqalculate-3.5.0a.tar.gz) = 6152daebee96026ffae7349198e72f991d85f5eb SHA512 (libqalculate-3.5.0a.tar.gz) = 1af5cdbcac8161aaf3fec56830bebd933b60537d1a27beab01039a4232e20e54c044c799cb1681d31b63c1b8a31f5902bcfa328a25f313566bf6171577430071 Size (libqalculate-3.5.0a.tar.gz) = 2126070 bytes -SHA1 (patch-libqalculate_util.cc) = e8d7072391d1f75b6313273452079f8426777bf6 +SHA1 (patch-configure.ac) = f5241d62bbc3f278d30813d8305c28c10b207b00 +SHA1 (patch-libqalculate_util.cc) = 300e2dd75c28ae2fdfb95ece96b400d5d67a3aac diff --git a/math/qalculate/patches/patch-configure.ac b/math/qalculate/patches/patch-configure.ac new file mode 100644 index 00000000000..6f1e6a50971 --- /dev/null +++ b/math/qalculate/patches/patch-configure.ac @@ -0,0 +1,14 @@ +$NetBSD: patch-configure.ac,v 1.1 2019/12/09 09:31:06 nros Exp $ +* use AM_ICONV to get ICONV_CONST +* applied upstream https://github.com/Qalculate/libqalculate/pull/168 +--- configure.ac.orig 2019-11-05 09:31:45.000000000 +0000 ++++ configure.ac +@@ -129,7 +129,7 @@ PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= + AC_SUBST(LIBXML_CFLAGS) + AC_SUBST(LIBXML_LIBS) + +-AM_ICONV_LINK() ++AM_ICONV() + + dnl -------------------------------- + dnl | check for readline |----------------------------------------- diff --git a/math/qalculate/patches/patch-libqalculate_util.cc b/math/qalculate/patches/patch-libqalculate_util.cc index 22fc9e95cc5..f3b4781993e 100644 --- a/math/qalculate/patches/patch-libqalculate_util.cc +++ b/math/qalculate/patches/patch-libqalculate_util.cc @@ -1,47 +1,23 @@ -$NetBSD: patch-libqalculate_util.cc,v 1.1 2019/11/20 22:15:28 markd Exp $ - -Support NetBSD iconv variant (pre-9.99.17 and newer) - ---- libqalculate/util.cc.orig 2019-07-21 07:29:17.000000000 +0000 +$NetBSD: patch-libqalculate_util.cc,v 1.2 2019/12/09 09:31:06 nros Exp $ +* use ICONV_CONST from autotools to support const char** +* applied upstream https://github.com/Qalculate/libqalculate/pull/168 +--- libqalculate/util.cc.orig 2019-12-08 21:53:48.021366402 +0000 +++ libqalculate/util.cc -@@ -20,6 +20,9 @@ - #include - #include - #include -+#if defined(__NetBSD__) -+#include -+#endif - #include - #include - #ifdef HAVE_LIBCURL -@@ -686,6 +689,12 @@ bool removeDir(string dirpath) { - #endif - } - -+#if defined(__NetBSD__) && __NetBSD_Version__ < 999001700 -+#define ICONV_CHAR_TYPE const char ** -+#else -+#define ICONV_CHAR_TYPE char ** -+#endif -+ - char *locale_from_utf8(const char *str) { - iconv_t conv = iconv_open("", "UTF-8"); - if(conv == (iconv_t) -1) return NULL; -@@ -694,7 +703,7 @@ char *locale_from_utf8(const char *str) +@@ -706,7 +706,7 @@ char *locale_from_utf8(const char *str) char *dest, *buffer; buffer = dest = (char*) malloc((outlength + 4) * sizeof(char)); if(!buffer) return NULL; - size_t err = iconv(conv, (char **) &str, &inlength, &buffer, &outlength); -+ size_t err = iconv(conv, (ICONV_CHAR_TYPE) &str, &inlength, &buffer, &outlength); ++ size_t err = iconv(conv, (ICONV_CONST char **) &str, &inlength, &buffer, &outlength); if(err != (size_t) -1) err = iconv(conv, NULL, &inlength, &buffer, &outlength); iconv_close(conv); memset(buffer, 0, 4); -@@ -709,7 +718,7 @@ char *locale_to_utf8(const char *str) { +@@ -721,7 +721,7 @@ char *locale_to_utf8(const char *str) { char *dest, *buffer; buffer = dest = (char*) malloc((outlength + 4) * sizeof(char)); if(!buffer) return NULL; - size_t err = iconv(conv, (char**) &str, &inlength, &buffer, &outlength); -+ size_t err = iconv(conv, (ICONV_CHAR_TYPE) &str, &inlength, &buffer, &outlength); ++ size_t err = iconv(conv, (ICONV_CONST char**) &str, &inlength, &buffer, &outlength); if(err != (size_t) -1) err = iconv(conv, NULL, &inlength, &buffer, &outlength); iconv_close(conv); memset(buffer, 0, 4 * sizeof(char)); -- cgit v1.2.3