diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile index 37784658a02d..51fd77de5899 100644 --- a/textproc/libxml2/Makefile +++ b/textproc/libxml2/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.165 2022/11/23 16:19:03 adam Exp $ +# $NetBSD: Makefile,v 1.165.2.1 2023/03/04 12:54:51 spz Exp $ -PKGREVISION= 1 .include "../../textproc/libxml2/Makefile.common" +PKGREVISION= 2 COMMENT= XML parser library from the GNOME project LICENSE= modified-bsd @@ -10,6 +10,7 @@ USE_FEATURES= glob USE_LIBTOOL= yes USE_TOOLS+= gmake GNU_CONFIGURE= yes +CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR} CONFIGURE_ARGS+= --with-html-dir=${PREFIX}/share/doc/libxml2 CONFIGURE_ARGS+= --with-iconv=${BUILDLINK_PREFIX.iconv} CONFIGURE_ARGS+= --with-zlib=${BUILDLINK_PREFIX.zlib} @@ -20,29 +21,9 @@ PKGCONFIG_OVERRIDE= libxml-2.0.pc.in USE_LANGUAGES+= c99 -.include "options.mk" - -# allow thread-awareness, but make sure the library is not -# linked against libpthread -#CONFIGURE_ARGS+= --without-threads - -MAKE_ENV+= PAX=${PAX:Q} - TEST_TARGET= check -SUBST_CLASSES+= cat -SUBST_STAGE.cat= pre-configure -SUBST_FILES.cat= catalog.c xmlcatalog.c -SUBST_SED.cat= -e "s,@@SGML_DEFAULT_CATALOG@@,${SGML_DEFAULT_CATALOG},g" -SUBST_SED.cat+= -e "s,@@XML_DEFAULT_CATALOG@@,${XML_DEFAULT_CATALOG},g" - -BUILDLINK_TRANSFORM.Darwin+= rm:-Wno-array-bounds -BUILDLINK_TRANSFORM.SunOS+= rm:-Werror=format=2 - -LDFLAGS.SCO_SV+= -lm - -post-install: - ${RM} -f ${DESTDIR}${PREFIX}/share/examples/libxml2/README +.include "options.mk" .include "../../archivers/xz/buildlink3.mk" .include "../../converters/libiconv/buildlink3.mk" diff --git a/textproc/libxml2/Makefile.common b/textproc/libxml2/Makefile.common index eb83faa21596..07d7265f2b9d 100644 --- a/textproc/libxml2/Makefile.common +++ b/textproc/libxml2/Makefile.common @@ -1,9 +1,9 @@ -# $NetBSD: Makefile.common,v 1.16 2022/05/06 00:55:54 gutteridge Exp $ +# $NetBSD: Makefile.common,v 1.16.6.1 2023/03/04 12:54:51 spz Exp $ # # used by textproc/libxml2/Makefile # used by textproc/py-libxml2/Makefile -DISTNAME= libxml2-2.9.14 +DISTNAME= libxml2-2.10.3 CATEGORIES= textproc MASTER_SITES= ${MASTER_SITE_GNOME:=sources/libxml2/${PKGVERSION_NOREV:R}/} EXTRACT_SUFX= .tar.xz diff --git a/textproc/libxml2/PLIST b/textproc/libxml2/PLIST index 10118e4bd4f7..3702393b910c 100644 --- a/textproc/libxml2/PLIST +++ b/textproc/libxml2/PLIST @@ -1,8 +1,7 @@ -@comment $NetBSD: PLIST,v 1.47 2022/03/12 07:33:22 kim Exp $ +@comment $NetBSD: PLIST,v 1.47.8.1 2023/03/04 12:54:51 spz Exp $ bin/xml2-config bin/xmlcatalog bin/xmllint -include/libxml2/libxml/DOCBparser.h include/libxml2/libxml/HTMLparser.h include/libxml2/libxml/HTMLtree.h include/libxml2/libxml/SAX.h @@ -52,102 +51,27 @@ include/libxml2/libxml/xpointer.h lib/cmake/libxml2/libxml2-config.cmake lib/libxml2.la lib/pkgconfig/libxml-2.0.pc -lib/xml2Conf.sh man/man1/xml2-config.1 man/man1/xmlcatalog.1 man/man1/xmllint.1 -man/man3/libxml.3 share/aclocal/libxml.m4 -share/doc/libxml2/Copyright -share/doc/libxml2/DOM.gif -share/doc/libxml2/FAQ.html -share/doc/libxml2/Libxml2-Logo-180x168.gif -share/doc/libxml2/Libxml2-Logo-90x34.gif -share/doc/libxml2/encoding.html -share/doc/libxml2/examples.xml -share/doc/libxml2/examples.xsl -share/doc/libxml2/html/book1.html -share/doc/libxml2/html/home.png -share/doc/libxml2/html/index.html -share/doc/libxml2/html/left.png -share/doc/libxml2/html/libxml-DOCBparser.html -share/doc/libxml2/html/libxml-HTMLparser.html -share/doc/libxml2/html/libxml-HTMLtree.html -share/doc/libxml2/html/libxml-SAX.html -share/doc/libxml2/html/libxml-SAX2.html -share/doc/libxml2/html/libxml-c14n.html -share/doc/libxml2/html/libxml-catalog.html -share/doc/libxml2/html/libxml-chvalid.html -share/doc/libxml2/html/libxml-debugXML.html -share/doc/libxml2/html/libxml-dict.html -share/doc/libxml2/html/libxml-encoding.html -share/doc/libxml2/html/libxml-entities.html -share/doc/libxml2/html/libxml-globals.html -share/doc/libxml2/html/libxml-hash.html -share/doc/libxml2/html/libxml-lib.html -share/doc/libxml2/html/libxml-list.html -share/doc/libxml2/html/libxml-nanoftp.html -share/doc/libxml2/html/libxml-nanohttp.html -share/doc/libxml2/html/libxml-parser.html -share/doc/libxml2/html/libxml-parserInternals.html -share/doc/libxml2/html/libxml-pattern.html -share/doc/libxml2/html/libxml-relaxng.html -share/doc/libxml2/html/libxml-schemasInternals.html -share/doc/libxml2/html/libxml-schematron.html -share/doc/libxml2/html/libxml-threads.html -share/doc/libxml2/html/libxml-tree.html -share/doc/libxml2/html/libxml-uri.html -share/doc/libxml2/html/libxml-valid.html -share/doc/libxml2/html/libxml-xinclude.html -share/doc/libxml2/html/libxml-xlink.html -share/doc/libxml2/html/libxml-xmlIO.html -share/doc/libxml2/html/libxml-xmlautomata.html -share/doc/libxml2/html/libxml-xmlerror.html -share/doc/libxml2/html/libxml-xmlexports.html -share/doc/libxml2/html/libxml-xmlmemory.html -share/doc/libxml2/html/libxml-xmlmodule.html -share/doc/libxml2/html/libxml-xmlreader.html -share/doc/libxml2/html/libxml-xmlregexp.html -share/doc/libxml2/html/libxml-xmlsave.html -share/doc/libxml2/html/libxml-xmlschemas.html -share/doc/libxml2/html/libxml-xmlschemastypes.html -share/doc/libxml2/html/libxml-xmlstring.html -share/doc/libxml2/html/libxml-xmlunicode.html -share/doc/libxml2/html/libxml-xmlversion.html -share/doc/libxml2/html/libxml-xmlwriter.html -share/doc/libxml2/html/libxml-xpath.html -share/doc/libxml2/html/libxml-xpathInternals.html -share/doc/libxml2/html/libxml-xpointer.html -share/doc/libxml2/html/right.png -share/doc/libxml2/html/up.png -share/doc/libxml2/io1.c -share/doc/libxml2/io1.res -share/doc/libxml2/io2.c -share/doc/libxml2/io2.res -share/doc/libxml2/libxml.gif -share/doc/libxml2/parse1.c -share/doc/libxml2/parse2.c -share/doc/libxml2/parse3.c -share/doc/libxml2/parse4.c -share/doc/libxml2/reader1.c -share/doc/libxml2/reader1.res -share/doc/libxml2/reader2.c -share/doc/libxml2/reader3.c -share/doc/libxml2/reader3.res -share/doc/libxml2/reader4.c -share/doc/libxml2/reader4.res -share/doc/libxml2/redhat.gif -share/doc/libxml2/smallfootonly.gif -share/doc/libxml2/structure.gif -share/doc/libxml2/test1.xml -share/doc/libxml2/test2.xml -share/doc/libxml2/test3.xml -share/doc/libxml2/testWriter.c -share/doc/libxml2/tree1.c -share/doc/libxml2/tree1.res -share/doc/libxml2/tree2.c -share/doc/libxml2/tree2.res -share/doc/libxml2/tst.xml +share/doc/libxml2/examples/index.html +share/doc/libxml2/examples/io1.c +share/doc/libxml2/examples/io2.c +share/doc/libxml2/examples/parse1.c +share/doc/libxml2/examples/parse2.c +share/doc/libxml2/examples/parse3.c +share/doc/libxml2/examples/parse4.c +share/doc/libxml2/examples/reader1.c +share/doc/libxml2/examples/reader2.c +share/doc/libxml2/examples/reader3.c +share/doc/libxml2/examples/reader4.c +share/doc/libxml2/examples/testWriter.c +share/doc/libxml2/examples/tree1.c +share/doc/libxml2/examples/tree2.c +share/doc/libxml2/examples/xmllint.c +share/doc/libxml2/examples/xpath1.c +share/doc/libxml2/examples/xpath2.c share/doc/libxml2/tutorial/apa.html share/doc/libxml2/tutorial/apb.html share/doc/libxml2/tutorial/apc.html @@ -197,22 +121,12 @@ share/doc/libxml2/tutorial/includekeyword.c share/doc/libxml2/tutorial/includexpath.c share/doc/libxml2/tutorial/index.html share/doc/libxml2/tutorial/ix01.html -share/doc/libxml2/w3c.png -share/doc/libxml2/writer.xml -share/doc/libxml2/xml.html -share/doc/libxml2/xpath1.c -share/doc/libxml2/xpath1.res -share/doc/libxml2/xpath2.c -share/doc/libxml2/xpath2.res -share/examples/libxml2/testHTML.c -share/examples/libxml2/testSAX.c -share/examples/libxml2/testXPath.c -share/examples/libxml2/xmllint.c +share/doc/libxml2/xmlcatalog.html +share/doc/libxml2/xmllint.html share/gtk-doc/html/libxml2/general.html share/gtk-doc/html/libxml2/home.png share/gtk-doc/html/libxml2/index.html share/gtk-doc/html/libxml2/left.png -share/gtk-doc/html/libxml2/libxml2-DOCBparser.html share/gtk-doc/html/libxml2/libxml2-HTMLparser.html share/gtk-doc/html/libxml2/libxml2-HTMLtree.html share/gtk-doc/html/libxml2/libxml2-SAX.html diff --git a/textproc/libxml2/distinfo b/textproc/libxml2/distinfo index 32f711ef4948..4a4d7c8167f2 100644 --- a/textproc/libxml2/distinfo +++ b/textproc/libxml2/distinfo @@ -1,15 +1,8 @@ -$NetBSD: distinfo,v 1.141 2022/05/06 00:55:54 gutteridge Exp $ +$NetBSD: distinfo,v 1.141.6.1 2023/03/04 12:54:51 spz Exp $ -BLAKE2s (libxml2-2.9.14.tar.xz) = 0d3a2a64a9f0253171fd0adfa1eb3c28997f92c306aa3668e787e0b71b4ca654 -SHA512 (libxml2-2.9.14.tar.xz) = d08e6cafb289c499fdc5b3a12181e032a34f7a249bc66758859f964d3e71e19fd69be79921e1a9d8ab1e692d15b13f5fae95eeb10c3236974d89e218f5107606 -Size (libxml2-2.9.14.tar.xz) = 3129968 bytes -SHA1 (patch-Makefile.in) = 4e3a3c20ce388de040b865dab73b0190ed6bdf0a -SHA1 (patch-catalog.c) = 34afe787f6012b460a85be993048e133907a1621 -SHA1 (patch-configure) = 3b4cbb36602c11fe73ba1a6e327fd4810b835380 -SHA1 (patch-doc_examples_Makefile.in) = d81b7b9285e207fc53acc6981c67768b686ff5fb -SHA1 (patch-encoding.c) = 62b3343f0a0ea51e3fb8eb693e495520eefb6ffd -SHA1 (patch-python_libxml.c) = a8d89922589f51db99c2b8960b32d37ddda8a7a9 -SHA1 (patch-python_libxml.py) = 869a72ae5ba2e27e6d46552878890acb22337675 -SHA1 (patch-python_libxml2.py) = 209d105b0f3aedb834091390a7c6819705108e34 -SHA1 (patch-python_setup.py) = 2e712778a35cad9a167eeec7884748cf3f2090a9 -SHA1 (patch-xmlcatalog.c) = d65b7e3be9694147e96ce4bb70a1739e2279ba81 +BLAKE2s (libxml2-2.10.3.tar.xz) = e46e6337acb5ff88e6206d1d61ee8b27d66c5f716c98e830c3504a01dc178ad6 +SHA512 (libxml2-2.10.3.tar.xz) = 33bb87ae9a45c475c3de09477e5d94840d8f687f893ef7839408bc7267e57611c4f2b863ed8ec819a4b5f1ebd6a122db9f6054c73bceed427d37f3e67f62620c +Size (libxml2-2.10.3.tar.xz) = 2639908 bytes +SHA1 (patch-configure) = 3d73d05780562dccd5f9621d9e9f15f2d62cfa87 +SHA1 (patch-encoding.c) = 7fe0f67db061a2f46abe1c4b6b4d8a0402f82830 +SHA1 (patch-error.c) = 77561e820e0da96acb572378c2f2a0b9b84112e1 diff --git a/textproc/libxml2/patches/patch-Makefile.in b/textproc/libxml2/patches/patch-Makefile.in deleted file mode 100644 index 3c301cd7446b..000000000000 --- a/textproc/libxml2/patches/patch-Makefile.in +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-Makefile.in,v 1.2 2022/03/12 07:33:22 kim Exp $ - -Move EXAMPLES_DIR to fit pkgsrc. - ---- Makefile.in.orig 2022-02-20 12:11:09.000000000 +0000 -+++ Makefile.in 2022-03-12 06:35:56.019772087 +0000 -@@ -877,7 +877,7 @@ - # - # Install the tests program sources as examples - # --EXAMPLES_DIR = $(docdir)/examples -+EXAMPLES_DIR = $(datadir)/examples/libxml2 - - # - # Coverage support, largely borrowed from libvirt diff --git a/textproc/libxml2/patches/patch-catalog.c b/textproc/libxml2/patches/patch-catalog.c deleted file mode 100644 index 1f1339f2897d..000000000000 --- a/textproc/libxml2/patches/patch-catalog.c +++ /dev/null @@ -1,19 +0,0 @@ -$NetBSD: patch-catalog.c,v 1.1 2019/01/09 19:09:03 adam Exp $ - -Parametrize XML and SGML catalog directories. - ---- catalog.c.orig 2014-10-03 11:28:05.000000000 +0000 -+++ catalog.c -@@ -70,10 +70,10 @@ - #define XML_URN_PUBID "urn:publicid:" - #define XML_CATAL_BREAK ((xmlChar *) -1) - #ifndef XML_XML_DEFAULT_CATALOG --#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog" -+#define XML_XML_DEFAULT_CATALOG "file://@@XML_DEFAULT_CATALOG@@" - #endif - #ifndef XML_SGML_DEFAULT_CATALOG --#define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog" -+#define XML_SGML_DEFAULT_CATALOG "file://@@SGML_DEFAULT_CATALOG@@" - #endif - - #if defined(_WIN32) && defined(_MSC_VER) diff --git a/textproc/libxml2/patches/patch-configure b/textproc/libxml2/patches/patch-configure index ebc3c868d31e..e73a1b348e0a 100644 --- a/textproc/libxml2/patches/patch-configure +++ b/textproc/libxml2/patches/patch-configure @@ -1,17 +1,10 @@ -$NetBSD: patch-configure,v 1.4 2022/03/12 07:33:22 kim Exp $ +$NetBSD: patch-configure,v 1.4.8.1 2023/03/04 12:54:51 spz Exp $ -Various configure fixes: - * Don't leak non-existent include directories to xml2-config. - Important for CMake on Darwin. * Add run-path to XML_LIBDIR - * Fix handling of pthreads - * Add portability to OpenBSD, MirBSD, FreeBSD, NetBSD and DragonFly - * Fix test for SAX - Submitted as https://bugzilla.gnome.org/show_bug.cgi?id=766859 ---- configure.orig 2022-02-20 12:11:10.000000000 +0000 -+++ configure 2022-03-12 06:29:48.961424860 +0000 -@@ -14898,7 +14898,7 @@ +--- configure.orig 2022-10-14 12:41:28.000000000 +0000 ++++ configure +@@ -15171,7 +15171,7 @@ printf "%s\n" "#define HAVE_GETADDRINFO fi @@ -20,73 +13,3 @@ Various configure fixes: XML_INCLUDEDIR='-I${includedir}/libxml2' XML_CFLAGS="" -@@ -15371,13 +15371,13 @@ - if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" - if test "x$ac_cv_header_pthread_h" = xyes; then : -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in -lpthread" >&5 --$as_echo_n "checking for pthread_join in -lpthread... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" >&5 -+$as_echo_n "checking for pthread_join in ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}... " >&6; } - if ${ac_cv_lib_pthread_pthread_join+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lpthread $LIBS" -+LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS} $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -15409,7 +15409,7 @@ - $as_echo "$ac_cv_lib_pthread_pthread_join" >&6; } - if test "x$ac_cv_lib_pthread_pthread_join" = xyes; then : - -- THREAD_LIBS="-lpthread" -+ THREAD_LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" - - $as_echo "#define HAVE_PTHREAD_H /**/" >>confdefs.h - -@@ -15428,12 +15428,12 @@ - *beos*) WITH_THREADS="1" - THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_BEOS_THREADS" - ;; -- *linux*) -+ *linux* | *openbsd* | *mirbsd*) - if test "${GCC}" = "yes" ; then - GCC_VERSION=`${CC} --version | head -1 | awk '{print $3}'` - GCC_MAJOR=`echo ${GCC_VERSION} | sed 's+\..*++'` - GCC_MEDIUM=`echo ${GCC_VERSION} | sed 's+[0-9]*\.++' | sed 's+\..*++'` -- if test "${THREAD_LIBS}" = "-lpthread" ; then -+ if test "${THREAD_LIBS}" = "${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" ; then - if expr ${GCC_MEDIUM} \> 2 \& ${GCC_MAJOR} = 3 > /dev/null - then - THREAD_LIBS="" -@@ -15450,6 +15450,10 @@ - fi - fi - ;; -+ *freebsd* | *netbsd* | *dragonfly*) -+ THREAD_LIBS="" -+ BASE_THREAD_LIBS="${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}" -+ ;; - esac - if test "$WITH_THREADS" = "1" ; then - THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT" -@@ -15720,7 +15724,7 @@ - TEST_SAX=SAXtests - fi - -- if test "${WITH_TRIO}" = "1"; then -+ if test "${WITH_SAX1}" = "1"; then - WITH_SAX1_SOURCES_TRUE= - WITH_SAX1_SOURCES_FALSE='#' - else -@@ -15905,7 +15909,7 @@ - if test "$with_iconv" = "no" ; then - echo Disabling ICONV support - else -- if test "$with_iconv" != "yes" -a "$with_iconv" != "" ; then -+ if test -e "$with_iconv/include" ; then - CPPFLAGS="${CPPFLAGS} -I$with_iconv/include" - # Export this since our headers include iconv.h - XML_INCLUDEDIR="${XML_INCLUDEDIR} -I$with_iconv/include" diff --git a/textproc/libxml2/patches/patch-doc_examples_Makefile.in b/textproc/libxml2/patches/patch-doc_examples_Makefile.in deleted file mode 100644 index fd66052030d0..000000000000 --- a/textproc/libxml2/patches/patch-doc_examples_Makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-doc_examples_Makefile.in,v 1.2 2022/03/12 07:33:22 kim Exp $ - -Don't install html files. - ---- doc/examples/Makefile.in.orig 2022-02-20 12:11:09.000000000 +0000 -+++ doc/examples/Makefile.in 2022-03-12 06:46:08.723880132 +0000 -@@ -974,8 +974,8 @@ - @REBUILD_DOCS_TRUE@ -cd $(srcdir) && xmllint --valid --noout index.html - - install-data-local: -- $(MKDIR_P) $(DESTDIR)$(HTML_DIR)/examples -- -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)/examples/ -+ $(MKDIR_P) $(DESTDIR)$(HTML_DIR) -+ -$(INSTALL) -m 0644 $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)/ - - clean-local: - test -f Makefile.am || rm -f test?.xml diff --git a/textproc/libxml2/patches/patch-encoding.c b/textproc/libxml2/patches/patch-encoding.c index c8aaa608e766..05b2d8945ecd 100644 --- a/textproc/libxml2/patches/patch-encoding.c +++ b/textproc/libxml2/patches/patch-encoding.c @@ -1,27 +1,13 @@ -$NetBSD: patch-encoding.c,v 1.3 2020/11/05 17:45:55 adam Exp $ +$NetBSD: patch-encoding.c,v 1.3.18.1 2023/03/04 12:54:51 spz Exp $ -Fix building with ICU 68.1. Avoid potential undefined behaviour by casting arg to toupper() to an appropriate value range. -https://bugzilla.gnome.org/show_bug.cgi?id=766838 Also, on NetBSD, add CP1141 encoding alias. ---- encoding.c.orig 2019-10-22 18:46:01.000000000 +0000 -+++ encoding.c -@@ -48,6 +48,11 @@ - #include "buf.h" - #include "enc.h" - -+#if !defined(FALSE) -+# define FALSE (1 == 0) -+# define TRUE (! FALSE) -+#endif -+ - static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL; - static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL; - -@@ -1027,7 +1032,7 @@ xmlGetEncodingAlias(const char *alias) { +--- encoding.c.orig 2022-10-14 12:20:48.000000000 +0000 ++++ encoding.c 2023-01-21 13:21:59.140034252 +0000 +@@ -1047,7 +1047,7 @@ return(NULL); for (i = 0;i < 99;i++) { @@ -30,7 +16,7 @@ Also, on NetBSD, add CP1141 encoding alias. if (upper[i] == 0) break; } upper[i] = 0; -@@ -1062,7 +1067,7 @@ xmlAddEncodingAlias(const char *name, co +@@ -1082,7 +1082,7 @@ return(-1); for (i = 0;i < 99;i++) { @@ -39,7 +25,7 @@ Also, on NetBSD, add CP1141 encoding alias. if (upper[i] == 0) break; } upper[i] = 0; -@@ -1164,7 +1169,7 @@ xmlParseCharEncoding(const char* name) +@@ -1184,7 +1184,7 @@ name = alias; for (i = 0;i < 499;i++) { @@ -48,7 +34,7 @@ Also, on NetBSD, add CP1141 encoding alias. if (upper[i] == 0) break; } upper[i] = 0; -@@ -1340,7 +1345,7 @@ xmlNewCharEncodingHandler(const char *na +@@ -1360,7 +1360,7 @@ return(NULL); } for (i = 0;i < 499;i++) { @@ -57,7 +43,7 @@ Also, on NetBSD, add CP1141 encoding alias. if (upper[i] == 0) break; } upper[i] = 0; -@@ -1442,6 +1447,9 @@ xmlInitCharEncodingHandlers(void) { +@@ -1465,6 +1465,9 @@ xmlRegisterCharEncodingHandlersISO8859x (); #endif #endif @@ -67,7 +53,7 @@ Also, on NetBSD, add CP1141 encoding alias. } -@@ -1669,7 +1677,7 @@ xmlFindCharEncodingHandler(const char *n +@@ -1706,7 +1709,7 @@ * Check first for directly registered encoding names */ for (i = 0;i < 99;i++) { diff --git a/textproc/libxml2/patches/patch-error.c b/textproc/libxml2/patches/patch-error.c new file mode 100644 index 000000000000..dd7fc71e8fc9 --- /dev/null +++ b/textproc/libxml2/patches/patch-error.c @@ -0,0 +1,63 @@ +$NetBSD: patch-error.c,v 1.1.2.2 2023/03/04 12:54:51 spz Exp $ + +Make sure that error messages are valid UTF-8. Fixes itstool segfaults. +https://gitlab.gnome.org/GNOME/libxml2/-/commit/76c6da420923f2721a2e16adfcef8707a2454a1b + +--- error.c.orig 2022-10-14 12:20:48.000000000 +0000 ++++ error.c +@@ -163,7 +163,7 @@ xmlParserPrintFileInfo(xmlParserInputPtr + } + + /** +- * xmlParserPrintFileContext: ++ * xmlParserPrintFileContextInternal: + * @input: an xmlParserInputPtr input + * + * Displays current context within the input content for error tracking +@@ -172,7 +172,7 @@ xmlParserPrintFileInfo(xmlParserInputPtr + static void + xmlParserPrintFileContextInternal(xmlParserInputPtr input , + xmlGenericErrorFunc channel, void *data ) { +- const xmlChar *cur, *base; ++ const xmlChar *cur, *base, *start; + unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */ + xmlChar content[81]; /* space for 80 chars + line terminator */ + xmlChar *ctnt; +@@ -191,19 +191,30 @@ xmlParserPrintFileContextInternal(xmlPar + while ((n++ < (sizeof(content)-1)) && (cur > base) && + (*(cur) != '\n') && (*(cur) != '\r')) + cur--; +- if ((*(cur) == '\n') || (*(cur) == '\r')) cur++; ++ if ((*(cur) == '\n') || (*(cur) == '\r')) { ++ cur++; ++ } else { ++ /* skip over continuation bytes */ ++ while ((cur < input->cur) && ((*cur & 0xC0) == 0x80)) ++ cur++; ++ } + /* calculate the error position in terms of the current position */ + col = input->cur - cur; + /* search forward for end-of-line (to max buff size) */ + n = 0; +- ctnt = content; ++ start = cur; + /* copy selected text to our buffer */ +- while ((*cur != 0) && (*(cur) != '\n') && +- (*(cur) != '\r') && (n < sizeof(content)-1)) { +- *ctnt++ = *cur++; +- n++; ++ while ((*cur != 0) && (*(cur) != '\n') && (*(cur) != '\r')) { ++ int len = input->end - cur; ++ int c = xmlGetUTF8Char(cur, &len); ++ ++ if ((c < 0) || (n + len > sizeof(content)-1)) ++ break; ++ cur += len; ++ n += len; + } +- *ctnt = 0; ++ memcpy(content, start, n); ++ content[n] = 0; + /* print out the selected text */ + channel(data ,"%s\n", content); + /* create blank line with problem pointer */ diff --git a/textproc/libxml2/patches/patch-python_libxml.c b/textproc/libxml2/patches/patch-python_libxml.c deleted file mode 100644 index 8c79c1470c12..000000000000 --- a/textproc/libxml2/patches/patch-python_libxml.c +++ /dev/null @@ -1,32 +0,0 @@ -$NetBSD: patch-python_libxml.c,v 1.4 2021/06/12 17:02:51 gutteridge Exp $ - -Avoid returning invalid UTF-8 strings to Python. -Based on https://bugzilla.opensuse.org/attachment.cgi?id=746044&action=edit -Fixes https://github.com/itstool/itstool/issues/22 - ---- python/libxml.c.orig 2016-06-07 10:04:14.000000000 +0000 -+++ python/libxml.c -@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU - PyObject *message; - PyObject *result; - char str[1000]; -+ unsigned char *ptr = (unsigned char *)str; - - #ifdef DEBUG_ERROR - printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg); -@@ -1636,10 +1637,14 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU - str[999] = 0; - va_end(ap); - -+ /* Ensure the error string doesn't start at UTF8 continuation. */ -+ while (*ptr && (*ptr & 0xc0) == 0x80) -+ ptr++; -+ - list = PyTuple_New(2); - PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt); - Py_XINCREF(libxml_xmlPythonErrorFuncCtxt); -- message = libxml_charPtrConstWrap(str); -+ message = libxml_charPtrConstWrap(ptr); - PyTuple_SetItem(list, 1, message); - result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list); - Py_XDECREF(list); diff --git a/textproc/libxml2/patches/patch-python_libxml.py b/textproc/libxml2/patches/patch-python_libxml.py deleted file mode 100644 index 35ec35e423c0..000000000000 --- a/textproc/libxml2/patches/patch-python_libxml.py +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-python_libxml.py,v 1.1 2017/10/31 13:15:44 fhajny Exp $ - ---- python/libxml.py.orig 2004-09-28 05:59:58.000000000 -0500 -+++ python/libxml.py -@@ -281,7 +281,7 @@ class xmlCore: - # defined as python2 properties - # - import sys -- if float(sys.version[0:3]) < 2.2: -+ if float(sys.version[0:3].replace('p', '.')) < 2.2: - def __getattr__(self, attr): - if attr == "parent": - ret = libxml2mod.parent(self._o) diff --git a/textproc/libxml2/patches/patch-python_libxml2.py b/textproc/libxml2/patches/patch-python_libxml2.py deleted file mode 100644 index c53582744bfd..000000000000 --- a/textproc/libxml2/patches/patch-python_libxml2.py +++ /dev/null @@ -1,16 +0,0 @@ -$NetBSD: patch-python_libxml2.py,v 1.1 2017/11/08 22:51:54 prlw1 Exp $ - -name[0:8] will fail if name is None. -https://bugzilla.gnome.org/show_bug.cgi?id=790071 - ---- python/libxml2.py.orig 2017-10-30 07:39:09.000000000 +0000 -+++ python/libxml2.py -@@ -573,6 +573,8 @@ class xmlCoreBreadthFirstItertor: - def nodeWrap(o): - # TODO try to cast to the most appropriate node class - name = libxml2mod.type(o) -+ if name is None: -+ return xmlNode(_obj=o) - if name == "element" or name == "text": - return xmlNode(_obj=o) - if name == "attribute": diff --git a/textproc/libxml2/patches/patch-python_setup.py b/textproc/libxml2/patches/patch-python_setup.py deleted file mode 100644 index ccc695db27f4..000000000000 --- a/textproc/libxml2/patches/patch-python_setup.py +++ /dev/null @@ -1,21 +0,0 @@ -$NetBSD: patch-python_setup.py,v 1.2 2022/03/12 07:33:22 kim Exp $ - -Trust pkgsrc to know which iconv to use. -It will be either in the buildlink directory, or in the compiler's -default search path. - ---- python/setup.py.orig 2022-02-20 12:11:17.000000000 +0000 -+++ python/setup.py 2022-03-12 06:40:36.426429987 +0000 -@@ -66,11 +66,7 @@ - # - libxml2/libxml/tree.h - # - libxslt/xsltconfig.h - includes_dir = [ --"/usr/include", --"/usr/local/include", --"/opt/include", --os.path.join(ROOT,'include'), --HOME -+os.path.join(ROOT,'include') - ]; - - xml_includes="" diff --git a/textproc/libxml2/patches/patch-xmlcatalog.c b/textproc/libxml2/patches/patch-xmlcatalog.c deleted file mode 100644 index ad071353a441..000000000000 --- a/textproc/libxml2/patches/patch-xmlcatalog.c +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-xmlcatalog.c,v 1.1 2019/01/09 19:09:03 adam Exp $ - -Parametrize SGML catalog directory. - ---- xmlcatalog.c.orig 2014-10-03 11:28:06.000000000 +0000 -+++ xmlcatalog.c -@@ -43,7 +43,7 @@ static char *filename = NULL; - - - #ifndef XML_SGML_DEFAULT_CATALOG --#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog" -+#define XML_SGML_DEFAULT_CATALOG "@@SGML_DEFAULT_CATALOG@@" - #endif - - /************************************************************************