aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Engberg <diizzy@FreeBSD.org>2024-01-10 19:19:14 +0000
committerDaniel Engberg <diizzy@FreeBSD.org>2024-01-12 17:05:01 +0000
commit25e6f68a6661303c0c4f23a304d3e0f713e89e11 (patch)
tree35b2a3fb88b9a7ab97f3af1bebf9300fe53d8372
parent362c9e8606377442e20b33b3fdee20116b3b34c6 (diff)
downloadports-25e6f68a6661303c0c4f23a304d3e0f713e89e11.tar.gz
ports-25e6f68a6661303c0c4f23a304d3e0f713e89e11.zip
textproc/libxml2: Update to 2.11.6
Changelog: https://gitlab.gnome.org/GNOME/libxml2/-/blob/v2.11.6/NEWS PR: 273210 Reviewed by: fluffy Approved by: desktop (arrowd) Exp-run by: antoine
-rw-r--r--textproc/libxml2/Makefile54
-rw-r--r--textproc/libxml2/distinfo6
-rw-r--r--textproc/libxml2/files/patch-CMakeLists.txt33
-rw-r--r--textproc/libxml2/files/patch-Makefile.in38
-rw-r--r--textproc/libxml2/files/patch-config.h.in12
-rw-r--r--textproc/libxml2/files/patch-configure11
-rw-r--r--textproc/libxml2/files/patch-python_libxml.c24
-rw-r--r--textproc/libxml2/pkg-plist13
-rw-r--r--textproc/py-libxml2/Makefile22
9 files changed, 87 insertions, 126 deletions
diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
index 983593ef4719..b3be31b1c983 100644
--- a/textproc/libxml2/Makefile
+++ b/textproc/libxml2/Makefile
@@ -1,6 +1,6 @@
PORTNAME= libxml2
-DISTVERSION= 2.10.4
-PORTREVISION?= 2
+DISTVERSION= 2.11.6
+PORTREVISION?= 0
CATEGORIES?= textproc gnome
MASTER_SITES= GNOME/sources/${PORTNAME}/${DISTVERSION:R}/
DIST_SUBDIR= gnome
@@ -11,37 +11,27 @@ WWW= http://xmlsoft.org/
LICENSE= MIT
-# Upstream offers CMake in addition to autotools, but we use the latter.
-# CMake is a heavy build system, heavier than autotools, and this
-# port has many consumers of its core functionality. Some such
-# consumers, especially when optioned appropriately (and users have
-# a right to do so), may become dependencies of dependencies of CMake.
-# Additionally, some consumers rely on symbol versioning that CMake
-# does not support (as of Q2 2022) without a hack. Please consider the
-# effects of the ecosystem and technical merits before considering
-# switching build systems again. Any changes to this end not dogfooded
-# thoroughly may be reverted.
-USES+= cpe iconv libtool localbase pathfix pkgconfig tar:xz
+USES+= cmake:testing cpe iconv localbase:ldflags pathfix \
+ pkgconfig tar:xz
CPE_VENDOR= xmlsoft
USE_LDCONFIG= yes
-GNU_CONFIGURE= yes
# Don't build with Python support unless requested
-CONFIGURE_ARGS= --sysconfdir=${PREFIX}/share/ \
- --with-lzma=/usr \
- --${LIBXML2_SLAVE:Dwith:Uwithout}-python${LIBXML2_SLAVE:D=${PYTHON_CMD}:U}
+CMAKE_${LIBXML2_SLAVE:DON:UOFF}=LIBXML2_WITH_PYTHON
# Many symbols in the linker version script libxml2.syms are only defined when
# --with-xptr-locs is enabled at configure time. Suppress errors with lld >= 17
# due to these undefined symbols.
LDFLAGS+= -Wl,--undefined-version
-INSTALL_TARGET= install-strip
-TEST_TARGET= check
+CMAKE_TESTING_ON= LIBXML2_WITH_TESTS
+
+CMAKE_ARGS= -DCMAKE_INSTALL_SYSCONFDIR=share
+CMAKE_OFF+= LIBXML2_WITH_TESTS
PLIST_SUB+= LIBVERSION=${DISTVERSION}
-OPTIONS_DEFINE= DOCS ICU MEM_DEBUG READLINE STATIC THREAD_ALLOC
-OPTIONS_DEFAULT= READLINE STATIC
+OPTIONS_DEFINE= DOCS ICU MEM_DEBUG READLINE THREAD_ALLOC
+OPTIONS_DEFAULT= READLINE
OPTIONS_SUB= yes
MEM_DEBUG_DESC= Memory debugging (DEVELOPERS ONLY!)
@@ -49,13 +39,12 @@ READLINE_DESC= History for xmllint
THREAD_ALLOC_DESC= Per-thread memory (DEVELOPERS ONLY!)
ICU_LIB_DEPENDS= libicudata.so:devel/icu
-ICU_CONFIGURE_WITH= icu
-MEM_DEBUG_CONFIGURE_WITH= mem-debug
+ICU_CMAKE_BOOL= LIBXML2_WITH_ICU
+MEM_DEBUG_CONFIGURE_WITH= LIBXML2_WITH_MEM_DEBUG
READLINE_LIB_DEPENDS= libreadline.so:devel/readline
-READLINE_CONFIGURE_WITH= history \
- readline
-STATIC_CONFIGURE_ENABLE= static
-THREAD_ALLOC_CONFIGURE_WITH= thread-alloc
+READLINE_CMAKE_OFF= -DHAVE_LIBHISTORY=false \
+ -DHAVE_LIBREADLINE=false
+THREAD_ALLOC_CMAKE_BOOL= LIBXML2_WITH_THREAD_ALLOC
post-patch:
@${REINPLACE_CMD} -e \
@@ -64,15 +53,8 @@ post-patch:
${WRKSRC}/doc/xmllint.1
post-install:
-.if !defined(LIBXML2_SLAVE)
-# Documentation should be in DOCSDIR
- @${MV} ${STAGEDIR}${PREFIX}/share/gtk-doc/html/libxml2 \
- ${STAGEDIR}${DOCSDIR}/devhelp
- @${RM} -r ${STAGEDIR}${PREFIX}/share/gtk-doc
-# Install remaining documentation that's not connected to autotools
- ${INSTALL_MAN} ${WRKSRC}/doc/*.html ${STAGEDIR}${DOCSDIR}
-.else
- ${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/site-packages/libxml2mod${PYTHON_EXT_SUFFIX}.so
+.if defined(LIBXML2_SLAVE)
+ ${STRIP_CMD} ${STAGEDIR}${PYTHON_LIBDIR}/site-packages/libxml2mod.so
.endif
.include <bsd.port.mk>
diff --git a/textproc/libxml2/distinfo b/textproc/libxml2/distinfo
index 58f47a87615f..ebdcffce4e68 100644
--- a/textproc/libxml2/distinfo
+++ b/textproc/libxml2/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1681763197
-SHA256 (gnome/libxml2-2.10.4.tar.xz) = ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45
-SIZE (gnome/libxml2-2.10.4.tar.xz) = 2643600
+TIMESTAMP = 1700425627
+SHA256 (gnome/libxml2-2.11.6.tar.xz) = c90eee7506764abbe07bb616b82da452529609815aefef423d66ef080eb0c300
+SIZE (gnome/libxml2-2.11.6.tar.xz) = 2628652
diff --git a/textproc/libxml2/files/patch-CMakeLists.txt b/textproc/libxml2/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..6926e72e1e54
--- /dev/null
+++ b/textproc/libxml2/files/patch-CMakeLists.txt
@@ -0,0 +1,33 @@
+--- CMakeLists.txt.orig 2023-08-11 18:59:11 UTC
++++ CMakeLists.txt
+@@ -395,13 +395,17 @@ if(LIBXML2_WITH_ICU)
+ if(WIN32)
+ set(ICU_LIBS "-licudt -licuin -licuuc")
+ else()
+- set(ICU_LIBS "-licudata -licui18n -licuuc")
++ set(ICU_LIBS_DIR "${ICU_INCLUDE_DIRS}")
++ STRING(REGEX REPLACE "include" "lib" ICU_LIBS_DIR ${ICU_LIBS_DIR})
++ set(ICU_LIBS "-L${ICU_LIBS_DIR} -licudata -licui18n -licuuc")
+ endif()
+ endif()
+
+ if(LIBXML2_WITH_LZMA)
+ target_link_libraries(LibXml2 PRIVATE LibLZMA::LibLZMA)
+- set(LZMA_LIBS "-llzma")
++ set(LZMA_LIBS_DIR "${LIBLZMA_INCLUDE_DIRS}")
++ STRING(REGEX REPLACE "include" "lib" LZMA_LIBS_DIR ${LZMA_LIBS_DIR})
++ set(LZMA_LIBS "-L${LZMA_LIBS_DIR} -llzma")
+ endif()
+
+ if(LIBXML2_WITH_THREADS)
+@@ -411,7 +415,9 @@ endif()
+
+ if(LIBXML2_WITH_ZLIB)
+ target_link_libraries(LibXml2 PRIVATE ZLIB::ZLIB)
+- set(Z_LIBS "-lz")
++ set(Z_LIBS_DIR "${ZLIB_INCLUDE_DIRS}")
++ STRING(REGEX REPLACE "include" "lib" Z_LIBS_DIR ${Z_LIBS_DIR})
++ set(Z_LIBS "-L${Z_LIBS_DIR} -lz")
+ endif()
+
+ set_target_properties(
diff --git a/textproc/libxml2/files/patch-Makefile.in b/textproc/libxml2/files/patch-Makefile.in
deleted file mode 100644
index 5142015394f5..000000000000
--- a/textproc/libxml2/files/patch-Makefile.in
+++ /dev/null
@@ -1,38 +0,0 @@
---- Makefile.in.orig 2022-08-25 18:24:09 UTC
-+++ Makefile.in
-@@ -708,7 +708,7 @@ runtest_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS)
- m4data_DATA = libxml.m4
- runtest_SOURCES = runtest.c
- runtest_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS)
--runtest_LDFLAGS =
-+runtest_LDFLAGS = -pthread
- runtest_DEPENDENCIES = $(DEPS)
- runtest_LDADD = $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
- testrecurse_SOURCES = testrecurse.c
-@@ -741,7 +741,7 @@ testThreads_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS)
- xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
- testThreads_SOURCES = testThreads.c
- testThreads_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS)
--testThreads_LDFLAGS =
-+testThreads_LDFLAGS = -pthread
- testThreads_DEPENDENCIES = $(DEPS)
- testThreads_LDADD = $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
- testAutomata_SOURCES = testAutomata.c
-@@ -1146,7 +1146,7 @@ am--depfiles: $(am__depfiles_remade)
- @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
- .c.lo:
--@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -fPIC -DPIC -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
- @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
- @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@@ -1898,7 +1898,7 @@ check: check-recursive
- $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
- $(MAKE) $(AM_MAKEFLAGS) check-local
- check: check-recursive
--all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(DATA) \
-+all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(DATA) \
- config.h
- install-binPROGRAMS: install-libLTLIBRARIES
-
diff --git a/textproc/libxml2/files/patch-config.h.in b/textproc/libxml2/files/patch-config.h.in
deleted file mode 100644
index 0ac56e4df62f..000000000000
--- a/textproc/libxml2/files/patch-config.h.in
+++ /dev/null
@@ -1,12 +0,0 @@
---- config.h.in.orig 2022-08-25 11:16:02 UTC
-+++ config.h.in
-@@ -3,6 +3,9 @@
- /* A form that will not confuse apibuild.py */
- #undef ATTRIBUTE_DESTRUCTOR
-
-+/* XXX */
-+#define HAVE_VFSCANF
-+
- /* Type cast for the gethostbyname() argument */
- #undef GETHOSTBYNAME_ARG_CAST
-
diff --git a/textproc/libxml2/files/patch-configure b/textproc/libxml2/files/patch-configure
deleted file mode 100644
index 72722092990b..000000000000
--- a/textproc/libxml2/files/patch-configure
+++ /dev/null
@@ -1,11 +0,0 @@
---- configure.orig 2022-08-25 11:16:02 UTC
-+++ configure
-@@ -15204,6 +15204,8 @@ fi
- fi
- fi
- ;;
-+ *freebsd*) THREAD_LIBS=""
-+ ;;
- esac
- if test "$WITH_THREADS" = "1" ; then
- THREAD_CFLAGS="$THREAD_CFLAGS -D_REENTRANT"
diff --git a/textproc/libxml2/files/patch-python_libxml.c b/textproc/libxml2/files/patch-python_libxml.c
index caef687fc265..7bbc98d75033 100644
--- a/textproc/libxml2/files/patch-python_libxml.c
+++ b/textproc/libxml2/files/patch-python_libxml.c
@@ -1,9 +1,6 @@
-# Workaround https://bugzilla.gnome.org/show_bug.cgi?id=789714
-# Obtained from openSuse / Fedora
-
---- python/libxml.c.orig 2016-06-07 10:04:14 UTC
+--- python/libxml.c.orig 2023-08-11 20:30:35 UTC
+++ python/libxml.c
-@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+@@ -1606,12 +1606,19 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx,
PyObject *message;
PyObject *result;
char str[1000];
@@ -11,23 +8,26 @@
#ifdef DEBUG_ERROR
printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
-@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
- str[999] = 0;
- va_end(ap);
+ #endif
+#if PY_MAJOR_VERSION >= 3
-+ /* Ensure the error string doesn't start at UTF8 continuation. */
-+ while (*ptr && (*ptr & 0xc0) == 0x80)
-+ ptr++;
++ /* Ensure the error string doesn't start at UTF8 continuation. */
++ while (*ptr && (*ptr & 0xc0) == 0x80)
++ ptr++;
+#endif
+
+
+ if (libxml_xmlPythonErrorFuncHandler == NULL) {
+ va_start(ap, msg);
+ vfprintf(stderr, msg, ap);
+@@ -1625,9 +1632,11 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx,
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);
+ result = PyObject_CallObject(libxml_xmlPythonErrorFuncHandler, list);
+ /* Forget any errors caused in the error handler. */
+ PyErr_Clear();
Py_XDECREF(list);
diff --git a/textproc/libxml2/pkg-plist b/textproc/libxml2/pkg-plist
index 382f8b64fe39..8d53acb96cd1 100644
--- a/textproc/libxml2/pkg-plist
+++ b/textproc/libxml2/pkg-plist
@@ -47,15 +47,17 @@ include/libxml2/libxml/xmlwriter.h
include/libxml2/libxml/xpath.h
include/libxml2/libxml/xpathInternals.h
include/libxml2/libxml/xpointer.h
-lib/cmake/libxml2/libxml2-config.cmake
-%%STATIC%%lib/libxml2.a
+lib/cmake/libxml2-%%LIBVERSION%%/libxml2-config-version.cmake
+lib/cmake/libxml2-%%LIBVERSION%%/libxml2-config.cmake
+lib/cmake/libxml2-%%LIBVERSION%%/libxml2-export-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/libxml2-%%LIBVERSION%%/libxml2-export.cmake
lib/libxml2.so
lib/libxml2.so.2
lib/libxml2.so.%%LIBVERSION%%
libdata/pkgconfig/libxml-2.0.pc
-man/man1/xml2-config.1.gz
-man/man1/xmlcatalog.1.gz
-man/man1/xmllint.1.gz
+share/man/man1/xml2-config.1.gz
+share/man/man1/xmlcatalog.1.gz
+share/man/man1/xmllint.1.gz
share/aclocal/libxml.m4
%%PORTDOCS%%%%DOCSDIR%%/devhelp/general.html
%%PORTDOCS%%%%DOCSDIR%%/devhelp/home.png
@@ -125,7 +127,6 @@ share/aclocal/libxml.m4
%%PORTDOCS%%%%DOCSDIR%%/examples/testWriter.c
%%PORTDOCS%%%%DOCSDIR%%/examples/tree1.c
%%PORTDOCS%%%%DOCSDIR%%/examples/tree2.c
-%%PORTDOCS%%%%DOCSDIR%%/examples/xmllint.c
%%PORTDOCS%%%%DOCSDIR%%/examples/xpath1.c
%%PORTDOCS%%%%DOCSDIR%%/examples/xpath2.c
%%PORTDOCS%%%%DOCSDIR%%/tutorial/apa.html
diff --git a/textproc/py-libxml2/Makefile b/textproc/py-libxml2/Makefile
index 8432826bb1c2..33a8d506f52f 100644
--- a/textproc/py-libxml2/Makefile
+++ b/textproc/py-libxml2/Makefile
@@ -5,11 +5,15 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
COMMENT= Python interface for XML parser library for GNOME
MASTERDIR= ${.CURDIR}/../libxml2
-USES+= gettext-runtime gnome python shebangfix
+USES+= gnome python shebangfix
USE_GNOME= libxml2
-USE_PYTHON= autoplist distutils
+USE_PYTHON= flavors
SHEBANG_FILES= *.py doc/*.py python/*.py python/tests/*.py
+# Help CMake determine the correct version of Python if
+# multiple versions are installed
+CMAKE_ARGS= -DPython_EXECUTABLE=${PYTHON_CMD}
+
OPTIONS_EXCLUDE= ${OPTIONS_DEFINE}
# Tell master port we're a slave port
@@ -17,15 +21,17 @@ LIBXML2_SLAVE= python
# Grab pkg-descr from slave port
DESCR= ${.CURDIR}/pkg-descr
-BUILD_WRKSRC= ${WRKSRC}/python
-INSTALL_WRKSRC= ${BUILD_WRKSRC}
-
# Don't append pkg-plist from master port
PLIST=
-DOCSDIR= ${PREFIX}/share/doc/py-libxml2
-EXAMPLESDIR= ${PREFIX}/share/examples/py-libxml2
+PLIST_FILES= ${PYTHON_SITELIBDIR}/drv_libxml2.py \
+ ${PYTHON_SITELIBDIR}/libxml2.py \
+ ${PYTHON_SITELIBDIR}/libxml2mod.so
-#do-configure:
+do-install:
+ ${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/python/drv_libxml2.py ${STAGEDIR}${PYTHON_SITELIBDIR}
+ ${INSTALL_SCRIPT} ${BUILD_WRKSRC}/libxml2.py ${STAGEDIR}${PYTHON_SITELIBDIR}
+ ${INSTALL_LIB} ${BUILD_WRKSRC}/libxml2mod.so ${STAGEDIR}${PYTHON_SITELIBDIR}
.include "${MASTERDIR}/Makefile"