git: 7de1b4cba052 - 2022Q2 - textproc/{,py-}libxml2: switch back to autotools

From: Charlie Li <vishwin_at_FreeBSD.org>
Date: Sun, 10 Apr 2022 19:52:41 UTC
The branch 2022Q2 has been updated by vishwin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7de1b4cba052834d7149043d814c0bb415c97b34

commit 7de1b4cba052834d7149043d814c0bb415c97b34
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2022-04-10 18:43:18 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2022-04-10 19:47:04 +0000

    textproc/{,py-}libxml2: switch back to autotools
    
    See notes in Makefile and linked PRs.
    
    While here, disable the ICU option by default. CFLAGS for libicu
    are passed to libxml2's consumers when the option is enabled. As
    icu's API is not stable between versions, PORTREVISION bumps can
    get missed.
    
    Additionally, properly exclude all OPTIONS from py-libxml2 and
    prevent do-configure from unnecessarily running.
    
    Co-authored-by: diizzy
    PR: 262853, 262940, 262877
    Approved by: fluffy (mentor)
    
    (cherry picked from commit 57dd5abd6018e0bec9e5b7c406268b349da4b7e7)
---
 textproc/libxml2/Makefile                     | 59 +++++++++++++++++----------
 textproc/libxml2/distinfo                     |  6 +--
 textproc/libxml2/files/extra-patch-docs       | 11 -----
 textproc/libxml2/files/patch-CMakeLists.txt   | 29 -------------
 textproc/libxml2/files/patch-Makefile.in      | 47 +++++++++++++++++++++
 textproc/libxml2/files/patch-config.h.in      | 11 +++++
 textproc/libxml2/files/patch-configure        | 11 +++++
 textproc/libxml2/files/patch-libxml-2.0.pc.in | 11 -----
 textproc/libxml2/pkg-plist                    | 29 ++-----------
 textproc/libxslt/Makefile                     |  6 +--
 textproc/py-libxml2/Makefile                  | 38 ++++++-----------
 11 files changed, 128 insertions(+), 130 deletions(-)

diff --git a/textproc/libxml2/Makefile b/textproc/libxml2/Makefile
index 4c35a6fa4eb7..497eb56aa0d5 100644
--- a/textproc/libxml2/Makefile
+++ b/textproc/libxml2/Makefile
@@ -2,43 +2,57 @@
 
 PORTNAME=	libxml2
 DISTVERSION=	2.9.13
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES?=	textproc gnome
 MASTER_SITES=	GNOME/sources/${PORTNAME}/${DISTVERSION:R}/
-DIST_SUBDIR=	gnome2
+DIST_SUBDIR=	gnome
 
 MAINTAINER=	desktop@FreeBSD.org
 COMMENT?=	XML parser library for GNOME
 
 LICENSE=	MIT
 
-USES+=		cmake cpe iconv localbase:ldflags pkgconfig tar:xz
-
+# 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
 CPE_VENDOR=	xmlsoft
+GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 
+INSTALL_TARGET=	install-strip
+TEST_TARGET=	check
+
 PLIST_SUB+=	LIBVERSION=${DISTVERSION}
 
 # Don't build with Python support unless requested
-CMAKE_${LIBXML2_SLAVE:DON:UOFF}=LIBXML2_WITH_PYTHON
+CONFIGURE_ARGS=		--with-html-dir=${PREFIX}/share/doc \
+			--with-html-subdir=${PORTNAME} \
+			--with-lzma=/usr \
+			--${LIBXML2_SLAVE:Dwith:Uwithout}-python${LIBXML2_SLAVE:D=${PYTHON_CMD}:U}
 
-OPTIONS_DEFINE=		DOCS ICU MEM_DEBUG READLINE TEST THREAD_ALLOC
-OPTIONS_DEFAULT=	ICU READLINE
+OPTIONS_DEFINE=	DOCS ICU MEM_DEBUG READLINE THREAD_ALLOC
+OPTIONS_DEFAULT=	READLINE
 OPTIONS_SUB=		yes
 
 MEM_DEBUG_DESC=		Memory debugging (DEVELOPERS ONLY!)
-THREAD_ALLOC_DESC=	Per-thread memory (DEVELOPERS ONLY!)
 READLINE_DESC=		History for xmllint
+THREAD_ALLOC_DESC=	Per-thread memory (DEVELOPERS ONLY!)
 
-DOCS_EXTRA_PATCHES_OFF=	${PATCHDIR}/extra-patch-docs
-ICU_LIB_DEPENDS=	libicudata.so:devel/icu
-ICU_CMAKE_BOOL=		LIBXML2_WITH_ICU
-MEM_DEBUG_CAKE_BOOL=	LIBXML2_WITH_MEM_DEBUG
-READLINE_LIB_DEPENDS=	libreadline.so:devel/readline
-READLINE_CMAKE_OFF=	-DHAVE_LIBHISTORY=false -DHAVE_LIBREADLINE=false
-THREAD_ALLOC_CMAKE_BOOL=LIBXML2_WITH_THREAD_ALLOC
-TEST_CMAKE_BOOL=	LIBXML2_WITH_TESTS
-TEST_TEST_TARGET=	test
+ICU_LIB_DEPENDS=		libicudata.so:devel/icu
+ICU_CONFIGURE_WITH=		icu
+MEM_DEBUG_CONFIGURE_WITH=	mem-debug
+READLINE_LIB_DEPENDS=		libreadline.so:devel/readline
+READLINE_CONFIGURE_WITH=	history \
+				readline
+THREAD_ALLOC_CONFIGURE_WITH=	thread-alloc
 
 post-patch:
 .for f in catalog.c xmlcatalog.c xmllint.c doc/xmllint.1
@@ -50,11 +64,12 @@ post-patch:
 
 .if !defined(LIBXML2_SLAVE)
 post-install:
-	${RM} ${STAGEDIR}${DOCSDIR}/xmlcatalog.1
-	${RM} ${STAGEDIR}${DOCSDIR}/xmllint.1.bak
-	${RM} ${STAGEDIR}${DOCSDIR}/xmllint.1
-	${RLN} ${STAGEDIR}${PREFIX}/lib/libxml2.so.${DISTVERSION} ${STAGEDIR}${PREFIX}/lib/libxml2.so.2
-	${INSTALL_DATA} ${WRKSRC}/libxml.m4 ${STAGEDIR}${PREFIX}/share/aclocal/libxml.m4
+# 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}
 .endif
 
 .include <bsd.port.mk>
diff --git a/textproc/libxml2/distinfo b/textproc/libxml2/distinfo
index 110a410ff9e7..b2e520bd51cf 100644
--- a/textproc/libxml2/distinfo
+++ b/textproc/libxml2/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1645459375
-SHA256 (gnome2/libxml2-2.9.13.tar.xz) = 276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e
-SIZE (gnome2/libxml2-2.9.13.tar.xz) = 3243336
+TIMESTAMP = 1648572316
+SHA256 (gnome/libxml2-2.9.13.tar.xz) = 276130602d12fe484ecc03447ee5e759d0465558fbc9d6bd144e3745306ebf0e
+SIZE (gnome/libxml2-2.9.13.tar.xz) = 3243336
diff --git a/textproc/libxml2/files/extra-patch-docs b/textproc/libxml2/files/extra-patch-docs
deleted file mode 100644
index c571d9b8184e..000000000000
--- a/textproc/libxml2/files/extra-patch-docs
+++ /dev/null
@@ -1,11 +0,0 @@
---- CMakeLists.txt.orig	2022-02-22 00:19:24 UTC
-+++ CMakeLists.txt
-@@ -650,7 +650,7 @@ endif()
- install(FILES libxml.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
- install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
- install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
--install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE)
-+#install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE)
- 
- configure_package_config_file(
- 	libxml2-config.cmake.cmake.in libxml2-config.cmake
diff --git a/textproc/libxml2/files/patch-CMakeLists.txt b/textproc/libxml2/files/patch-CMakeLists.txt
deleted file mode 100644
index 3f45b65b7331..000000000000
--- a/textproc/libxml2/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
---- CMakeLists.txt.orig	2022-02-19 16:23:47 UTC
-+++ CMakeLists.txt
-@@ -691,7 +691,7 @@ if(LIBXML2_WITH_PYTHON)
- 	configure_file(python/setup.py.in setup.py @ONLY)
- endif()
- 
--set(XML_INCLUDEDIR "-I\${includedir}/libxml2")
-+set(XML_INCLUDEDIR "-I\${includedir}/libxml2 -I\${includedir}")
- set(XML_LIBDIR "-L\${libdir}")
- set(XML_LIBS "-lxml2")
- set(XML_PRIVATE_LIBS "${Z_LIBS} ${LZMA_LIBS} ${THREAD_LIBS} ${ICONV_LIBS} ${ICU_LIBS} ${M_LIBS}")
-@@ -699,14 +699,14 @@ set(XML_PRIVATE_LIBS "${Z_LIBS} ${LZMA_LIBS} ${THREAD_
- file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
- string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
- 
--set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
-+set(prefix ${CMAKE_INSTALL_PREFIX})
- set(exec_prefix "\${prefix}")
- set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
- set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
- configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY)
--install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
-+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}data/pkgconfig COMPONENT development)
- 
--set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
-+set(prefix ${CMAKE_INSTALL_PREFIX})
- configure_file(xml2-config.in xml2-config @ONLY)
- install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
- 
diff --git a/textproc/libxml2/files/patch-Makefile.in b/textproc/libxml2/files/patch-Makefile.in
new file mode 100644
index 000000000000..ad6ff8409168
--- /dev/null
+++ b/textproc/libxml2/files/patch-Makefile.in
@@ -0,0 +1,47 @@
+--- Makefile.in.orig	2021-06-09 19:53:33 UTC
++++ Makefile.in
+@@ -760,7 +760,7 @@ man_MANS = xml2-config.1 libxml.3
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = libxml.m4
+ runtest_SOURCES = runtest.c
+-runtest_LDFLAGS = 
++runtest_LDFLAGS = -pthread
+ runtest_DEPENDENCIES = $(DEPS)
+ runtest_LDADD = $(BASE_THREAD_LIBS) $(RDL_LIBS) $(LDADDS)
+ testrecurse_SOURCES = testrecurse.c
+@@ -808,7 +808,7 @@ testC14N_LDFLAGS = 
+ testC14N_DEPENDENCIES = $(DEPS)
+ testC14N_LDADD = $(LDADDS)
+ testThreads_SOURCES = testThreads.c
+-testThreads_LDFLAGS = 
++testThreads_LDFLAGS = -pthread
+ testThreads_DEPENDENCIES = $(DEPS)
+ testThreads_LDADD = $(BASE_THREAD_LIBS) $(LDADDS)
+ testURI_SOURCES = testURI.c
+@@ -1285,7 +1285,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@
+@@ -1774,7 +1774,7 @@ check-am: all-am
+ 	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ check: $(BUILT_SOURCES)
+ 	$(MAKE) $(AM_MAKEFLAGS) check-recursive
+-all-am: Makefile $(PROGRAMS) $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
++all-am: Makefile $(LTLIBRARIES) $(SCRIPTS) $(MANS) $(DATA) \
+ 		config.h
+ install-binPROGRAMS: install-libLTLIBRARIES
+ 
+@@ -1911,7 +1911,7 @@ info: info-recursive
+ 
+ info-am:
+ 
+-install-data-am: install-cmakeDATA install-data-local \
++install-data-am: install-cmakeDATA \
+ 	install-m4dataDATA install-man install-pkgconfigDATA
+ 
+ install-dvi: install-dvi-recursive
diff --git a/textproc/libxml2/files/patch-config.h.in b/textproc/libxml2/files/patch-config.h.in
new file mode 100644
index 000000000000..326dbd57c71e
--- /dev/null
+++ b/textproc/libxml2/files/patch-config.h.in
@@ -0,0 +1,11 @@
+--- config.h.in.orig	2018-03-05 15:54:17 UTC
++++ config.h.in
+@@ -1,5 +1,8 @@
+ /* config.h.in.  Generated from configure.ac by autoheader.  */
+ 
++/* 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
new file mode 100644
index 000000000000..59a6d53a2ef6
--- /dev/null
+++ b/textproc/libxml2/files/patch-configure
@@ -0,0 +1,11 @@
+--- configure.orig	2019-10-30 19:14:22 UTC
++++ configure
+@@ -15525,6 +15525,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-libxml-2.0.pc.in b/textproc/libxml2/files/patch-libxml-2.0.pc.in
deleted file mode 100644
index 2635302b12e1..000000000000
--- a/textproc/libxml2/files/patch-libxml-2.0.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- libxml-2.0.pc.in.orig	2022-03-08 22:00:47 UTC
-+++ libxml-2.0.pc.in
-@@ -8,6 +8,6 @@ Name: libXML
- Version: @VERSION@
- Description: libXML library version2.
- Requires:
--Libs: -L${libdir} -lxml2
--Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
-+Libs: -L${libdir} @XML_LIBS@
-+Libs.private: @XML_PRIVATE_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@
- Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
diff --git a/textproc/libxml2/pkg-plist b/textproc/libxml2/pkg-plist
index fe71e56cf861..fe7dbf5df243 100644
--- a/textproc/libxml2/pkg-plist
+++ b/textproc/libxml2/pkg-plist
@@ -48,15 +48,14 @@ include/libxml2/libxml/xmlwriter.h
 include/libxml2/libxml/xpath.h
 include/libxml2/libxml/xpathInternals.h
 include/libxml2/libxml/xpointer.h
-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/cmake/libxml2/libxml2-config.cmake
+lib/libxml2.a
 lib/libxml2.so
 lib/libxml2.so.2
 lib/libxml2.so.%%LIBVERSION%%
 lib/xml2Conf.sh
 libdata/pkgconfig/libxml-2.0.pc
+man/man1/xml2-config.1.gz
 man/man1/xmlcatalog.1.gz
 man/man1/xmllint.1.gz
 man/man3/libxml.3.gz
@@ -102,18 +101,12 @@ share/aclocal/libxml.m4
 %%PORTDOCS%%%%DOCSDIR%%/Libxml2-Logo-90x34.gif
 %%PORTDOCS%%%%DOCSDIR%%/XMLinfo.html
 %%PORTDOCS%%%%DOCSDIR%%/XSLT.html
-%%PORTDOCS%%%%DOCSDIR%%/api.xsl
-%%PORTDOCS%%%%DOCSDIR%%/apibuild.py
 %%PORTDOCS%%%%DOCSDIR%%/architecture.html
 %%PORTDOCS%%%%DOCSDIR%%/bugs.html
-%%PORTDOCS%%%%DOCSDIR%%/catalog.gif
 %%PORTDOCS%%%%DOCSDIR%%/catalog.html
-%%PORTDOCS%%%%DOCSDIR%%/checkapisym.xsl
 %%PORTDOCS%%%%DOCSDIR%%/contribs.html
-%%PORTDOCS%%%%DOCSDIR%%/devhelp/devhelp2.xsl
 %%PORTDOCS%%%%DOCSDIR%%/devhelp/general.html
 %%PORTDOCS%%%%DOCSDIR%%/devhelp/home.png
-%%PORTDOCS%%%%DOCSDIR%%/devhelp/html.xsl
 %%PORTDOCS%%%%DOCSDIR%%/devhelp/index.html
 %%PORTDOCS%%%%DOCSDIR%%/devhelp/left.png
 %%PORTDOCS%%%%DOCSDIR%%/devhelp/libxml2-DOCBparser.html
@@ -169,14 +162,12 @@ share/aclocal/libxml.m4
 %%PORTDOCS%%%%DOCSDIR%%/devhelp/up.png
 %%PORTDOCS%%%%DOCSDIR%%/docs.html
 %%PORTDOCS%%%%DOCSDIR%%/downloads.html
-%%PORTDOCS%%%%DOCSDIR%%/elfgcchack.xsl
 %%PORTDOCS%%%%DOCSDIR%%/encoding.html
 %%PORTDOCS%%%%DOCSDIR%%/entities.html
 %%PORTDOCS%%%%DOCSDIR%%/example.html
 %%PORTDOCS%%%%DOCSDIR%%/examples/examples.xml
 %%PORTDOCS%%%%DOCSDIR%%/examples/examples.xsl
 %%PORTDOCS%%%%DOCSDIR%%/examples/index.html
-%%PORTDOCS%%%%DOCSDIR%%/examples/index.py
 %%PORTDOCS%%%%DOCSDIR%%/examples/io1.c
 %%PORTDOCS%%%%DOCSDIR%%/examples/io1.res
 %%PORTDOCS%%%%DOCSDIR%%/examples/io2.c
@@ -263,27 +254,17 @@ share/aclocal/libxml.m4
 %%PORTDOCS%%%%DOCSDIR%%/html/right.png
 %%PORTDOCS%%%%DOCSDIR%%/html/up.png
 %%PORTDOCS%%%%DOCSDIR%%/index.html
-%%PORTDOCS%%%%DOCSDIR%%/index.py
 %%PORTDOCS%%%%DOCSDIR%%/interface.html
 %%PORTDOCS%%%%DOCSDIR%%/intro.html
 %%PORTDOCS%%%%DOCSDIR%%/library.html
 %%PORTDOCS%%%%DOCSDIR%%/libxml.gif
-%%PORTDOCS%%%%DOCSDIR%%/libxml2-api.xml
-%%PORTDOCS%%%%DOCSDIR%%/libxml2.xsa
 %%PORTDOCS%%%%DOCSDIR%%/namespaces.html
-%%PORTDOCS%%%%DOCSDIR%%/newapi.xsl
 %%PORTDOCS%%%%DOCSDIR%%/news.html
-%%PORTDOCS%%%%DOCSDIR%%/news.xsl
 %%PORTDOCS%%%%DOCSDIR%%/python.html
 %%PORTDOCS%%%%DOCSDIR%%/redhat.gif
-%%PORTDOCS%%%%DOCSDIR%%/search.php
 %%PORTDOCS%%%%DOCSDIR%%/searches.html
-%%PORTDOCS%%%%DOCSDIR%%/searches.xsl
-%%PORTDOCS%%%%DOCSDIR%%/site.xsl
 %%PORTDOCS%%%%DOCSDIR%%/smallfootonly.gif
 %%PORTDOCS%%%%DOCSDIR%%/structure.gif
-%%PORTDOCS%%%%DOCSDIR%%/symbols.xml
-%%PORTDOCS%%%%DOCSDIR%%/syms.xsl
 %%PORTDOCS%%%%DOCSDIR%%/threads.html
 %%PORTDOCS%%%%DOCSDIR%%/tree.html
 %%PORTDOCS%%%%DOCSDIR%%/tutorial/apa.html
@@ -337,14 +318,10 @@ share/aclocal/libxml.m4
 %%PORTDOCS%%%%DOCSDIR%%/tutorial/ix01.html
 %%PORTDOCS%%%%DOCSDIR%%/upgrade.html
 %%PORTDOCS%%%%DOCSDIR%%/w3c.png
-%%PORTDOCS%%%%DOCSDIR%%/wiki.xsl
 %%PORTDOCS%%%%DOCSDIR%%/xml.html
 %%PORTDOCS%%%%DOCSDIR%%/xmlcatalog_man.html
-%%PORTDOCS%%%%DOCSDIR%%/xmlcatalog_man.xml
 %%PORTDOCS%%%%DOCSDIR%%/xmldtd.html
 %%PORTDOCS%%%%DOCSDIR%%/xmlio.html
 %%PORTDOCS%%%%DOCSDIR%%/xmllint.html
-%%PORTDOCS%%%%DOCSDIR%%/xmllint.xml
 %%PORTDOCS%%%%DOCSDIR%%/xmlmem.html
 %%PORTDOCS%%%%DOCSDIR%%/xmlreader.html
-%%PORTDOCS%%%%DOCSDIR%%/xsa.xsl
diff --git a/textproc/libxslt/Makefile b/textproc/libxslt/Makefile
index 4b2701651018..0d769c3d7e09 100644
--- a/textproc/libxslt/Makefile
+++ b/textproc/libxslt/Makefile
@@ -2,7 +2,7 @@
 
 PORTNAME=	libxslt
 DISTVERSION=	1.1.35
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	textproc gnome
 MASTER_SITES=	GNOME/sources/${PORTNAME}/${DISTVERSION:R}/
 DIST_SUBDIR=	gnome
@@ -13,10 +13,10 @@ COMMENT=	XML stylesheet transformation library
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-LIB_DEPENDS=	libicudata.so:devel/icu
+# See note in textproc/libxml2 for why this port uses autotools
+# from the choices of that and CMake.
 USES=		cpe gmake gnome libtool localbase:ldflags pathfix pkgconfig tar:xz
 CPE_VENDOR=	xmlsoft
-# many ports use xsltproc as a BUILD_DEPENDS, using cmake can cause dependency loops
 GNU_CONFIGURE=	yes
 USE_GNOME=	libxml2
 USE_LDCONFIG=	yes
diff --git a/textproc/py-libxml2/Makefile b/textproc/py-libxml2/Makefile
index fa8aaffa0b7e..9d94c8735821 100644
--- a/textproc/py-libxml2/Makefile
+++ b/textproc/py-libxml2/Makefile
@@ -1,45 +1,33 @@
 # Created by: Alexander Nedotsukov <bland@FreeBSD.org>
 
-PORTREVISION=	2
+PORTREVISION=	4
 CATEGORIES=	textproc gnome python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 COMMENT=	Python interface for XML parser library for GNOME
 MASTERDIR=	${.CURDIR}/../libxml2
 
-USES+=		gnome python shebangfix
+USES+=		gettext-runtime gnome python shebangfix
 USE_GNOME=	libxml2
-USE_PYTHON=	flavors
+USE_PYTHON=	autoplist distutils
 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_SLAVE=	${OPTIONS_DEFINE:NTEST}
+OPTIONS_EXCLUDE=	${OPTIONS_DEFINE}
 
 # Tell master port we're a slave port
 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=
-PLIST_FILES=	${PYTHON_SITELIBDIR}/__pycache__/drv_libxml2.cpython-${PYTHON_SUFFIX}.opt-1.pyc \
-		${PYTHON_SITELIBDIR}/__pycache__/drv_libxml2.cpython-${PYTHON_SUFFIX}.pyc \
-		${PYTHON_SITELIBDIR}/__pycache__/libxml2.cpython-${PYTHON_SUFFIX}.opt-1.pyc \
-		${PYTHON_SITELIBDIR}/__pycache__/libxml2.cpython-${PYTHON_SUFFIX}.pyc \
-		${PYTHON_SITELIBDIR}/drv_libxml2.py \
-		${PYTHON_SITELIBDIR}/libxml2.py \
-		${PYTHON_SITELIBDIR}/libxml2mod.so \
-		${PYTHON_SITELIBDIR}/libxml2mod.so.${DISTVERSION}
-
-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}
-	${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
-	${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}
-	${INSTALL_LIB} ${BUILD_WRKSRC}/libxml2mod.so ${STAGEDIR}${PYTHON_SITELIBDIR}
-	${RLN} ${STAGEDIR}${PYTHON_SITELIBDIR}/libxml2mod.so ${STAGEDIR}${PYTHON_SITELIBDIR}/libxml2mod.so.${DISTVERSION}
+
+DOCSDIR=	${PREFIX}/share/doc/py-libxml2
+EXAMPLESDIR=	${PREFIX}/share/examples/py-libxml2
+
+do-configure:
 
 .include "${MASTERDIR}/Makefile"