summaryrefslogtreecommitdiff
path: root/math/qalculate
diff options
context:
space:
mode:
authornros <nros@pkgsrc.org>2019-12-09 09:31:06 +0000
committernros <nros@pkgsrc.org>2019-12-09 09:31:06 +0000
commitd5696dc8da07aa2c85d847faee2538945d4f1a92 (patch)
tree15f3b7dcbc5fe829a268b854354fd50bba4af51a /math/qalculate
parent2db3970df93203267153ab1b6bb4d8c352bba4e0 (diff)
downloadpkgsrc-d5696dc8da07aa2c85d847faee2538945d4f1a92.tar.gz
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.
Diffstat (limited to 'math/qalculate')
-rw-r--r--math/qalculate/Makefile7
-rw-r--r--math/qalculate/distinfo5
-rw-r--r--math/qalculate/patches/patch-configure.ac14
-rw-r--r--math/qalculate/patches/patch-libqalculate_util.cc40
4 files changed, 31 insertions, 35 deletions
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 <iconv.h>
- #include <sys/types.h>
- #include <sys/stat.h>
-+#if defined(__NetBSD__)
-+#include <sys/param.h>
-+#endif
- #include <sstream>
- #include <fstream>
- #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));