diff options
author | gutteridge <gutteridge@pkgsrc.org> | 2020-11-17 01:55:04 +0000 |
---|---|---|
committer | gutteridge <gutteridge@pkgsrc.org> | 2020-11-17 01:55:04 +0000 |
commit | d36af459fa2c6fdc53b50387e39dd17c824ec392 (patch) | |
tree | 1e5a9403f4d08f97c9b27513d0dd06e2bed889a7 | |
parent | eb751ba9e74fa5dd5fb7e6957830a69f8a19e72d (diff) | |
download | pkgsrc-d36af459fa2c6fdc53b50387e39dd17c824ec392.tar.gz |
calibre: fix build with ICU 68
This package depends on ICU headers that now unconditionally expect C99
features, so it requires C99 just as ICU does. Patch around ICU API
changes that caused related breakages.
-rw-r--r-- | misc/calibre/Makefile | 7 | ||||
-rw-r--r-- | misc/calibre/distinfo | 4 | ||||
-rw-r--r-- | misc/calibre/patches/patch-src_calibre_utils_icu.c | 23 | ||||
-rw-r--r-- | misc/calibre/patches/patch-src_calibre_utils_matcher.c | 73 |
4 files changed, 102 insertions, 5 deletions
diff --git a/misc/calibre/Makefile b/misc/calibre/Makefile index 602d879f41a..ea88c590f8a 100644 --- a/misc/calibre/Makefile +++ b/misc/calibre/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.243 2020/11/05 09:08:39 ryoon Exp $ +# $NetBSD: Makefile,v 1.244 2020/11/17 01:55:04 gutteridge Exp $ DISTNAME= calibre-3.40.1 -PKGREVISION= 20 +PKGREVISION= 21 CATEGORIES= misc #MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=calibre/} MASTER_SITES= http://download.calibre-ebook.com/${PKGVERSION_NOREV}/ @@ -42,7 +42,7 @@ EXTRACT_USING= bsdtar PYTHON_VERSIONS_ACCEPTED= 27 # as of 3.16.0 -USE_LANGUAGES= c c++ +USE_LANGUAGES= c99 c++ USE_LIBTOOL= yes USE_TOOLS+= pkg-config pax PYSETUPOPTARGS= # empty @@ -128,7 +128,6 @@ _PYSETUPTOOLSINSTALLARGS= # empty # Get rid of --root=${DESTDIR}, use our own version from above instead. # because the setup.py is not the standard one and behaves differently. _PYSETUPINSTALLARGS= ${PYSETUPINSTALLARGS} ${PYSETUPOPTARGS} ${_PYSETUPTOOLSINSTALLARGS} -BUILDLINK_API_DEPENDS.podofo+= podofo>=0.8.2 .include "../../print/podofo/buildlink3.mk" BUILDLINK_API_DEPENDS.poppler+= poppler>=0.20.2 .include "../../print/poppler-includes/buildlink3.mk" diff --git a/misc/calibre/distinfo b/misc/calibre/distinfo index b1a9903e368..98cc00eaaec 100644 --- a/misc/calibre/distinfo +++ b/misc/calibre/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.105 2020/07/05 12:09:08 rhialto Exp $ +$NetBSD: distinfo,v 1.106 2020/11/17 01:55:04 gutteridge Exp $ SHA1 (calibre-3.40.1.tar.xz) = 12cea0bed963dde2b58c9cdd4c3c25c735d6d15a RMD160 (calibre-3.40.1.tar.xz) = 72bf801e4164dcebec22ba36162fe034c9edad54 @@ -9,3 +9,5 @@ SHA1 (patch-setup_build__environment.py) = dd6160233c717e935205649ee685e71df3f18 SHA1 (patch-src_calibre_headless_fontconfig_database.cpp) = d794a9f1c94c85d3406384bf25ade4be8d2f8a1c SHA1 (patch-src_calibre_headless_headless__integration.cpp) = 62ab6f5aaf6bd8bcbb875ab56eac1a474d8b446b SHA1 (patch-src_calibre_linux.py) = 16c3122a612ec9996f774c5c2c9d40a475723662 +SHA1 (patch-src_calibre_utils_icu.c) = fd0172000b9ab5d52730f9e4a5c8cc6c2253d69b +SHA1 (patch-src_calibre_utils_matcher.c) = 1041dc748cec86c18f2438d284608f42f66fc282 diff --git a/misc/calibre/patches/patch-src_calibre_utils_icu.c b/misc/calibre/patches/patch-src_calibre_utils_icu.c new file mode 100644 index 00000000000..58328be0260 --- /dev/null +++ b/misc/calibre/patches/patch-src_calibre_utils_icu.c @@ -0,0 +1,23 @@ +$NetBSD: patch-src_calibre_utils_icu.c,v 1.1 2020/11/17 01:55:04 gutteridge Exp $ + +Fix build with ICU 68. + +--- src/calibre/utils/icu.c.orig 2019-03-08 06:09:34.000000000 +0000 ++++ src/calibre/utils/icu.c +@@ -243,14 +243,14 @@ icu_Collator_contains(icu_Collator *self + + a = python_to_icu(a_, &asz); + if (a == NULL) goto end; +- if (asz == 0) { found = TRUE; goto end; } ++ if (asz == 0) { found = true; goto end; } + b = python_to_icu(b_, &bsz); + if (b == NULL) goto end; + + search = usearch_openFromCollator(a, asz, b, bsz, self->collator, NULL, &status); + if (U_SUCCESS(status)) { + pos = usearch_first(search, &status); +- if (pos != USEARCH_DONE) found = TRUE; ++ if (pos != USEARCH_DONE) found = true; + } + end: + if (search != NULL) usearch_close(search); diff --git a/misc/calibre/patches/patch-src_calibre_utils_matcher.c b/misc/calibre/patches/patch-src_calibre_utils_matcher.c new file mode 100644 index 00000000000..0e9a11e9257 --- /dev/null +++ b/misc/calibre/patches/patch-src_calibre_utils_matcher.c @@ -0,0 +1,73 @@ +$NetBSD: patch-src_calibre_utils_matcher.c,v 1.1 2020/11/17 01:55:04 gutteridge Exp $ + +Fix build with ICU 68. + +--- src/calibre/utils/matcher.c.orig 2019-03-08 06:09:34.000000000 +0000 ++++ src/calibre/utils/matcher.c +@@ -15,9 +15,6 @@ + #define inline + #endif + +-typedef unsigned char bool; +-#define TRUE 1 +-#define FALSE 0 + #define MAX(x, y) ((x > y) ? x : y) + #define nullfree(x) if(x != NULL) free(x); x = NULL; + +@@ -240,10 +237,10 @@ static bool create_searches(UStringSearc + U16_FWD_1(needle, i, needle_len); + if (pos == i) break; + searches[pos] = usearch_openFromCollator(needle + pos, i - pos, haystack, haystack_len, collator, NULL, &status); +- if (U_FAILURE(status)) { PyErr_SetString(PyExc_ValueError, u_errorName(status)); searches[pos] = NULL; return FALSE; } ++ if (U_FAILURE(status)) { PyErr_SetString(PyExc_ValueError, u_errorName(status)); searches[pos] = NULL; return false; } + } + +- return TRUE; ++ return true; + } + + static void free_searches(UStringSearch **searches, int32_t count) { +@@ -259,14 +256,14 @@ static bool match(UChar **items, int32_t + int32_t i = 0, maxhl = 0; + int32_t r = 0, *positions = NULL; + MatchInfo *matches = NULL; +- bool ok = FALSE; ++ bool ok = false; + MemoryItem ***memo = NULL; + int32_t needle_len = u_strlen(needle); + UStringSearch **searches = NULL; + + if (needle_len <= 0 || item_count <= 0) { + for (i = 0; i < (int32_t)item_count; i++) match_results[i].score = 0.0; +- ok = TRUE; ++ ok = true; + goto end; + } + +@@ -289,7 +286,7 @@ static bool match(UChar **items, int32_t + + if (maxhl <= 0) { + for (i = 0; i < (int32_t)item_count; i++) match_results[i].score = 0.0; +- ok = TRUE; ++ ok = true; + goto end; + } + +@@ -308,7 +305,7 @@ static bool match(UChar **items, int32_t + convert_positions(positions, final_positions + i * needle_char_len, matches[i].haystack, needle_char_len, needle_len, match_results[i].score); + } + +- ok = TRUE; ++ ok = true; + end: + nullfree(positions); + nullfree(stack.items); +@@ -401,7 +398,7 @@ static PyObject * + Matcher_calculate_scores(Matcher *self, PyObject *args) { + int32_t *final_positions = NULL, *p; + Match *matches = NULL; +- bool ok = FALSE; ++ bool ok = false; + uint32_t i = 0, needle_char_len = 0, j = 0; + PyObject *items = NULL, *score = NULL, *positions = NULL, *pneedle = NULL; + UChar *needle = NULL; |