git: 8c77316ede83 - main - devel/xsd: Update to 4.2.0

From: Jason E. Hale <jhale_at_FreeBSD.org>
Date: Sat, 30 Dec 2023 20:59:30 UTC
The branch main has been updated by jhale:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8c77316ede832a0c503e1434a36ba3822efefbd7

commit 8c77316ede832a0c503e1434a36ba3822efefbd7
Author:     Jason E. Hale <jhale@FreeBSD.org>
AuthorDate: 2023-12-16 22:39:14 +0000
Commit:     Jason E. Hale <jhale@FreeBSD.org>
CommitDate: 2023-12-30 20:59:02 +0000

    devel/xsd: Update to 4.2.0
    
    Add two new support ports: devel/libxsd and devel/libxsd-frontend.
    
    The runtime library was moved out of devel/xsd to devel/libxsd which is
    why the headers are gone. The compiler frontend, which following a
    previous comment in the devel/xsd Makefile suggesting that it should be a
    separate port, but more out of necessity for compatibility with the
    build2 build system, is now devel/libxsd-frontend.
    
    The examples are now a separate distribution and I didn't really see any
    urgent need to reincorporate them, as they would require yet another port
    that the majority of our userbase would probably not be interested in as
    xsd is ultimately just a build dependency for textproc/libkolabxml.
    
    Update devel/libcutl to 1.11.0 due to header relocation.
    
    Update textproc/libkolabxml to HEAD for C++11 compatibility.
    
    Differential Revision:  https://reviews.freebsd.org/D43080
---
 devel/Makefile                                     |   2 +
 devel/libcutl/Makefile                             |  48 +--
 devel/libcutl/distinfo                             |   5 +-
 devel/libcutl/files/patch-configure                |  38 --
 devel/libcutl/files/patch-cutl_re_re.cxx           | 141 -------
 devel/libcutl/pkg-plist                            | 107 +++--
 devel/libxsd-frontend/Makefile                     |  36 ++
 devel/libxsd-frontend/distinfo                     |   3 +
 devel/libxsd-frontend/pkg-descr                    |   2 +
 devel/libxsd-frontend/pkg-plist                    |  57 +++
 devel/libxsd/Makefile                              |  43 ++
 devel/libxsd/distinfo                              |   3 +
 devel/libxsd/pkg-descr                             |  10 +
 devel/libxsd/pkg-plist                             | 185 +++++++++
 devel/xsd/Makefile                                 |  67 ++-
 devel/xsd/distinfo                                 |   6 +-
 ...-xsd_doc_xsd.1 => patch-doc_pregenerated_xsd.1} |  11 +-
 ..._xsd.xhtml => patch-doc_pregenerated_xsd.xhtml} |  24 +-
 devel/xsd/files/patch-xsd_doc_makefile             |  13 -
 devel/xsd/files/patch-xsd_libxsd_makefile          |  18 -
 devel/xsd/files/patch-xsd_xsd_makefile             |  13 -
 devel/xsd/pkg-plist                                | 455 +--------------------
 textproc/libkolabxml/Makefile                      |  17 +-
 textproc/libkolabxml/distinfo                      |   6 +-
 .../files/patch-src_shared__conversions.h          |  13 +
 25 files changed, 491 insertions(+), 832 deletions(-)

diff --git a/devel/Makefile b/devel/Makefile
index cb4d04ddf339..cd3a6dae3f14 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -1463,6 +1463,8 @@
     SUBDIR += libxalloc
     SUBDIR += libxo
     SUBDIR += libxs
+    SUBDIR += libxsd
+    SUBDIR += libxsd-frontend
     SUBDIR += libxtend
     SUBDIR += libzakalwe
     SUBDIR += libzim
diff --git a/devel/libcutl/Makefile b/devel/libcutl/Makefile
index 7c7950f10ebf..04658ed53497 100644
--- a/devel/libcutl/Makefile
+++ b/devel/libcutl/Makefile
@@ -1,8 +1,7 @@
 PORTNAME=	libcutl
-PORTVERSION=	1.10.0
-PORTREVISION=	22
+PORTVERSION=	1.11.0
 CATEGORIES=	devel
-MASTER_SITES=	https://www.codesynthesis.com/download/${PORTNAME}/${PORTVERSION:R}/
+MASTER_SITES=	https://www.codesynthesis.com/download/xsd/4.2/
 
 MAINTAINER=	rakuco@FreeBSD.org
 COMMENT=	C++ utility library with generic and independent components
@@ -11,36 +10,25 @@ WWW=		https://www.codesynthesis.com/projects/libcutl/
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BROKEN_sparc64=	Does not build: cannot configure with boost
+BUILD_DEPENDS=	build2>=0.16.0:devel/build2
 
-LIB_DEPENDS=	libboost_system.so:devel/boost-libs \
-		libexpat.so:textproc/expat2
-
-USES=		compiler:c++11-lib libtool
-# libcutl 1.10.0 is not compatible with C++17, which is the default since clang
-# 16. This means ports depending on it also need to use at most C++14.
-USE_CXXSTD=	c++11
-GNU_CONFIGURE=	yes
-INSTALL_TARGET=	install-strip
-
-# The checks for external boost and external expat are quite limited and do not
-# add the ${LOCALBASE} paths correctly (libboost.m4 uses wrong paths and
-# libexpat.m4 does nothing at all).
-CPPFLAGS+=	-I${LOCALBASE}/include
-LDFLAGS+=	-L${LOCALBASE}/lib
-
-CONFIGURE_ARGS=	--disable-static \
-		--with-boost=${LOCALBASE} \
-		--with-external-boost \
-		--with-external-expat \
-		--with-pkgconfigdir=${PREFIX}/libdata/pkgconfig
+USES=		compiler:c++2b-lang
 
 OPTIONS_DEFINE=	DOCS
 
-post-patch:
-# Avoid conflict with C++20 <version> by adding .txt suffix
-	@${MV} ${WRKSRC}/version ${WRKSRC}/version.txt
-	@${REINPLACE_CMD} -i .c++20 '/doc_DATA/s/version/&.txt/' \
-		${WRKSRC}/Makefile.in
+B_CMD=		${LOCALBASE}/bin/b
+B_ARGS=		-V -j ${MAKE_JOBS_NUMBER} -J ${MAKE_JOBS_NUMBER}
+
+do-build:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} configure ${B_ARGS} \
+		config.cxx=${CXX} \
+		config.cxx.coptions="${CXXFLAGS}" \
+		config.cxx.loptions="${LDFLAGS} ${STRIP}" \
+		config.bin.lib=shared \
+		config.bin.rpath=${PREFIX}/lib \
+		config.install.chroot=${STAGEDIR} \
+		config.install.root=${PREFIX}
+do-install:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} install ${B_ARGS}
 
 .include <bsd.port.mk>
diff --git a/devel/libcutl/distinfo b/devel/libcutl/distinfo
index 797999d8d8e4..1bec1989a0c1 100644
--- a/devel/libcutl/distinfo
+++ b/devel/libcutl/distinfo
@@ -1,2 +1,3 @@
-SHA256 (libcutl-1.10.0.tar.gz) = bdee4b10ce621f18ec91e9ba63d539a2d74542a1d443e0e3f819861ab689d2f6
-SIZE (libcutl-1.10.0.tar.gz) = 1024621
+TIMESTAMP = 1702595107
+SHA256 (libcutl-1.11.0.tar.gz) = bb78ff87d6cb1a2544543ffe7941f0aeb8f9dcaf7dd46e9acef3e032ed7881dc
+SIZE (libcutl-1.11.0.tar.gz) = 35415
diff --git a/devel/libcutl/files/patch-configure b/devel/libcutl/files/patch-configure
deleted file mode 100644
index 432051d95751..000000000000
--- a/devel/libcutl/files/patch-configure
+++ /dev/null
@@ -1,38 +0,0 @@
-Use regex from C++11 instead of boost/tr1's version (the latter is gone as of
-boost 1.65).
---- configure.orig	2015-11-24 13:45:55 UTC
-+++ configure
-@@ -17554,13 +17554,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- 
--#include <boost/tr1/regex.hpp>
-+#include <regex>
- 
- int
- main ()
- {
--  std::tr1::regex r ("te.t", std::tr1::regex_constants::ECMAScript);
--  return std::tr1::regex_match ("test", r) ? 0 : 1;
-+  std::regex r ("te.t", std::regex_constants::ECMAScript);
-+  return std::regex_match ("test", r) ? 0 : 1;
- }
- 
- _ACEOF
-@@ -17631,13 +17631,13 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
- /* end confdefs.h.  */
- 
- 
--#include <boost/tr1/regex.hpp>
-+#include <regex>
- 
- int
- main ()
- {
--  std::tr1::regex r ("te.t", std::tr1::regex_constants::ECMAScript);
--  return std::tr1::regex_match ("test", r) ? 0 : 1;
-+  std::regex r ("te.t", std::regex_constants::ECMAScript);
-+  return std::regex_match ("test", r) ? 0 : 1;
- }
- 
- _ACEOF
diff --git a/devel/libcutl/files/patch-cutl_re_re.cxx b/devel/libcutl/files/patch-cutl_re_re.cxx
deleted file mode 100644
index 1a2a30fc886a..000000000000
--- a/devel/libcutl/files/patch-cutl_re_re.cxx
+++ /dev/null
@@ -1,141 +0,0 @@
-Use regex from C++11 instead of boost/tr1's version (the latter is gone as of
-boost 1.65).
---- cutl/re/re.cxx.orig	2017-07-14 14:59:43 UTC
-+++ cutl/re/re.cxx
-@@ -9,7 +9,7 @@
- #ifndef LIBCUTL_EXTERNAL_BOOST
- #  include <cutl/details/boost/tr1/regex.hpp>
- #else
--#  include <boost/tr1/regex.hpp>
-+#  include <regex>
- #endif
- 
- using namespace std;
-@@ -40,17 +40,17 @@ namespace cutl
-     struct basic_regex<C>::impl
-     {
-       typedef basic_string<C> string_type;
--      typedef tr1::basic_regex<C> regex_type;
-+      typedef std::basic_regex<C> regex_type;
-       typedef typename regex_type::flag_type flag_type;
- 
-       impl () {}
-       impl (regex_type const& r): r (r) {}
-       impl (string_type const& s, bool icase)
-       {
--        flag_type f (tr1::regex_constants::ECMAScript);
-+        flag_type f (std::regex_constants::ECMAScript);
- 
-         if (icase)
--          f |= tr1::regex_constants::icase;
-+          f |= std::regex_constants::icase;
- 
-         r.assign (s, f);
-       }
-@@ -118,15 +118,15 @@ namespace cutl
-           impl_ = s == 0 ? new impl : new impl (*s, icase);
-         else
-         {
--          impl::flag_type f (tr1::regex_constants::ECMAScript);
-+          impl::flag_type f (std::regex_constants::ECMAScript);
- 
-           if (icase)
--            f |= tr1::regex_constants::icase;
-+            f |= std::regex_constants::icase;
- 
-           impl_->r.assign (*s, f);
-         }
-       }
--      catch (tr1::regex_error const& e)
-+      catch (std::regex_error const& e)
-       {
-         throw basic_format<char> (s == 0 ? "" : *s, e.what ());
-       }
-@@ -146,15 +146,15 @@ namespace cutl
-           impl_ = s == 0 ? new impl : new impl (*s, icase);
-         else
-         {
--          impl::flag_type f (tr1::regex_constants::ECMAScript);
-+          impl::flag_type f (std::regex_constants::ECMAScript);
- 
-           if (icase)
--            f |= tr1::regex_constants::icase;
-+            f |= std::regex_constants::icase;
- 
-           impl_->r.assign (*s, f);
-         }
-       }
--      catch (tr1::regex_error const& e)
-+      catch (std::regex_error const& e)
-       {
-         throw basic_format<wchar_t> (s == 0 ? L"" : *s, e.what ());
-       }
-@@ -166,28 +166,28 @@ namespace cutl
-     bool basic_regex<char>::
-     match (string_type const& s) const
-     {
--      return tr1::regex_match (s, impl_->r);
-+      return std::regex_match (s, impl_->r);
-     }
- 
-     template <>
-     bool basic_regex<wchar_t>::
-     match (string_type const& s) const
-     {
--      return tr1::regex_match (s, impl_->r);
-+      return std::regex_match (s, impl_->r);
-     }
- 
-     template <>
-     bool basic_regex<char>::
-     search (string_type const& s) const
-     {
--      return tr1::regex_search (s, impl_->r);
-+      return std::regex_search (s, impl_->r);
-     }
- 
-     template <>
-     bool basic_regex<wchar_t>::
-     search (string_type const& s) const
-     {
--      return tr1::regex_search (s, impl_->r);
-+      return std::regex_search (s, impl_->r);
-     }
- 
-     template <>
-@@ -196,13 +196,13 @@ namespace cutl
-              string_type const& sub,
-              bool first_only) const
-     {
--      tr1::regex_constants::match_flag_type f (
--        tr1::regex_constants::format_default);
-+      std::regex_constants::match_flag_type f (
-+        std::regex_constants::format_default);
- 
-       if (first_only)
--        f |= tr1::regex_constants::format_first_only;
-+        f |= std::regex_constants::format_first_only;
- 
--      return tr1::regex_replace (s, impl_->r, sub, f);
-+      return std::regex_replace (s, impl_->r, sub, f);
-     }
- 
-     template <>
-@@ -211,13 +211,13 @@ namespace cutl
-              string_type const& sub,
-              bool first_only) const
-     {
--      tr1::regex_constants::match_flag_type f (
--        tr1::regex_constants::format_default);
-+      std::regex_constants::match_flag_type f (
-+        std::regex_constants::format_default);
- 
-       if (first_only)
--        f |= tr1::regex_constants::format_first_only;
-+        f |= std::regex_constants::format_first_only;
- 
--      return tr1::regex_replace (s, impl_->r, sub, f);
-+      return std::regex_replace (s, impl_->r, sub, f);
-     }
-   }
- }
diff --git a/devel/libcutl/pkg-plist b/devel/libcutl/pkg-plist
index 367b677f6f57..db6c8f8a3e7f 100644
--- a/devel/libcutl/pkg-plist
+++ b/devel/libcutl/pkg-plist
@@ -1,64 +1,53 @@
-include/cutl/compiler/code-stream.hxx
-include/cutl/compiler/code-stream.txx
-include/cutl/compiler/context.hxx
-include/cutl/compiler/context.txx
-include/cutl/compiler/cxx-indenter.hxx
-include/cutl/compiler/cxx-indenter.ixx
-include/cutl/compiler/cxx-indenter.txx
-include/cutl/compiler/sloc-counter.hxx
-include/cutl/compiler/sloc-counter.txx
-include/cutl/compiler/traversal.hxx
-include/cutl/compiler/traversal.txx
-include/cutl/compiler/type-id.hxx
-include/cutl/compiler/type-id.ixx
-include/cutl/compiler/type-id.txx
-include/cutl/compiler/type-info.hxx
-include/cutl/compiler/type-info.ixx
-include/cutl/container/any.hxx
-include/cutl/container/graph.hxx
-include/cutl/container/graph.txx
-include/cutl/container/key.hxx
-include/cutl/container/map-iterator.hxx
-include/cutl/container/multi-index.hxx
-include/cutl/container/pointer-iterator.hxx
-include/cutl/details/config.h
-include/cutl/details/config.hxx
-include/cutl/details/export.hxx
-include/cutl/details/genx/genx.h
-include/cutl/exception.hxx
-include/cutl/fs/auto-remove.hxx
-include/cutl/fs/exception.hxx
-include/cutl/fs/path.hxx
-include/cutl/fs/path.ixx
-include/cutl/fs/path.txx
-include/cutl/meta/answer.hxx
-include/cutl/meta/class-p.hxx
-include/cutl/meta/polymorphic-p.hxx
-include/cutl/meta/remove-c.hxx
-include/cutl/meta/remove-cv.hxx
-include/cutl/meta/remove-p.hxx
-include/cutl/meta/remove-v.hxx
-include/cutl/re.hxx
-include/cutl/re/re.txx
-include/cutl/shared-ptr.hxx
-include/cutl/shared-ptr/base.hxx
-include/cutl/shared-ptr/base.ixx
-include/cutl/shared-ptr/base.txx
-include/cutl/static-ptr.hxx
-include/cutl/xml/exception.hxx
-include/cutl/xml/parser.hxx
-include/cutl/xml/parser.ixx
-include/cutl/xml/parser.txx
-include/cutl/xml/qname.hxx
-include/cutl/xml/serializer.hxx
-include/cutl/xml/serializer.ixx
-include/cutl/xml/value-traits.hxx
-include/cutl/xml/value-traits.txx
-lib/libcutl-1.10.so
+include/libcutl/compiler/code-stream.hxx
+include/libcutl/compiler/code-stream.txx
+include/libcutl/compiler/context.hxx
+include/libcutl/compiler/context.txx
+include/libcutl/compiler/cxx-indenter.hxx
+include/libcutl/compiler/cxx-indenter.ixx
+include/libcutl/compiler/cxx-indenter.txx
+include/libcutl/compiler/sloc-counter.hxx
+include/libcutl/compiler/sloc-counter.txx
+include/libcutl/compiler/traversal.hxx
+include/libcutl/compiler/traversal.txx
+include/libcutl/compiler/type-id.hxx
+include/libcutl/compiler/type-id.ixx
+include/libcutl/compiler/type-id.txx
+include/libcutl/compiler/type-info.hxx
+include/libcutl/compiler/type-info.ixx
+include/libcutl/container/any.hxx
+include/libcutl/container/graph.hxx
+include/libcutl/container/graph.txx
+include/libcutl/container/key.hxx
+include/libcutl/container/map-iterator.hxx
+include/libcutl/container/multi-index.hxx
+include/libcutl/container/pointer-iterator.hxx
+include/libcutl/exception.hxx
+include/libcutl/export.hxx
+include/libcutl/fs/auto-remove.hxx
+include/libcutl/fs/exception.hxx
+include/libcutl/fs/path.hxx
+include/libcutl/fs/path.ixx
+include/libcutl/fs/path.txx
+include/libcutl/meta/answer.hxx
+include/libcutl/meta/class-p.hxx
+include/libcutl/meta/polymorphic-p.hxx
+include/libcutl/meta/remove-c.hxx
+include/libcutl/meta/remove-cv.hxx
+include/libcutl/meta/remove-p.hxx
+include/libcutl/meta/remove-v.hxx
+include/libcutl/re.hxx
+include/libcutl/re/re.txx
+include/libcutl/shared-ptr.hxx
+include/libcutl/shared-ptr/base.hxx
+include/libcutl/shared-ptr/base.ixx
+include/libcutl/shared-ptr/base.txx
+include/libcutl/static-ptr.hxx
+include/libcutl/version.hxx
+lib/libcutl-1.11.so
 lib/libcutl.so
 libdata/pkgconfig/libcutl.pc
-%%PORTDOCS%%%%DOCSDIR%%/INSTALL
+libdata/pkgconfig/libcutl.shared.pc
 %%PORTDOCS%%%%DOCSDIR%%/LICENSE
 %%PORTDOCS%%%%DOCSDIR%%/NEWS
 %%PORTDOCS%%%%DOCSDIR%%/README
-%%PORTDOCS%%%%DOCSDIR%%/version.txt
+%%PORTDOCS%%%%DOCSDIR%%/manifest
diff --git a/devel/libxsd-frontend/Makefile b/devel/libxsd-frontend/Makefile
new file mode 100644
index 000000000000..431ac807e94d
--- /dev/null
+++ b/devel/libxsd-frontend/Makefile
@@ -0,0 +1,36 @@
+PORTNAME=	libxsd-frontend
+DISTVERSION=	2.1.0
+CATEGORIES=	devel
+MASTER_SITES=	https://www.codesynthesis.com/download/xsd/4.2/
+
+MAINTAINER=	kde@FreeBSD.org
+COMMENT=	W3C XML Schema compiler frontend
+WWW=		https://www.codesynthesis.com/projects/libxsd-frontend/
+
+LICENSE=	GPLv2
+LICENSE_FILE=	${WRKSRC}/GPLv2
+
+BUILD_DEPENDS=	build2>=0.16.0:devel/build2
+LIB_DEPENDS=	libcutl.so:devel/libcutl \
+		libxerces-c.so:textproc/xerces-c3
+
+USES=		compiler:c++2b-lang pkgconfig
+
+OPTIONS_DEFINE=	DOCS
+
+B_CMD=		${LOCALBASE}/bin/b
+B_ARGS=		-V -j ${MAKE_JOBS_NUMBER} -J ${MAKE_JOBS_NUMBER}
+
+do-build:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} configure ${B_ARGS} \
+		config.cxx=${CXX} \
+		config.cxx.coptions="${CXXFLAGS}" \
+		config.cxx.loptions="${LDFLAGS} ${STRIP}" \
+		config.bin.lib=shared \
+		config.bin.rpath=${PREFIX}/lib \
+		config.install.chroot=${STAGEDIR} \
+		config.install.root=${PREFIX}
+do-install:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} install ${B_ARGS}
+
+.include <bsd.port.mk>
diff --git a/devel/libxsd-frontend/distinfo b/devel/libxsd-frontend/distinfo
new file mode 100644
index 000000000000..b24d8ed7e105
--- /dev/null
+++ b/devel/libxsd-frontend/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1702598278
+SHA256 (libxsd-frontend-2.1.0.tar.gz) = 98321b9c2307d7c4e1eba49da6a522ffa81bdf61f7e3605e469aa85bfcab90b1
+SIZE (libxsd-frontend-2.1.0.tar.gz) = 79844
diff --git a/devel/libxsd-frontend/pkg-descr b/devel/libxsd-frontend/pkg-descr
new file mode 100644
index 000000000000..b81e9a273fb3
--- /dev/null
+++ b/devel/libxsd-frontend/pkg-descr
@@ -0,0 +1,2 @@
+libxsd-frontend is a compiler frontend for the W3C XML Schema definition
+language. It includes parser, semantic graph types and traversal mechanism.
diff --git a/devel/libxsd-frontend/pkg-plist b/devel/libxsd-frontend/pkg-plist
new file mode 100644
index 000000000000..dbfbd3c557ad
--- /dev/null
+++ b/devel/libxsd-frontend/pkg-plist
@@ -0,0 +1,57 @@
+include/libxsd-frontend/export.hxx
+include/libxsd-frontend/generators/dependencies.hxx
+include/libxsd-frontend/parser.hxx
+include/libxsd-frontend/schema-dom-parser.hxx
+include/libxsd-frontend/semantic-graph.hxx
+include/libxsd-frontend/semantic-graph/annotation.hxx
+include/libxsd-frontend/semantic-graph/any-attribute.hxx
+include/libxsd-frontend/semantic-graph/any.hxx
+include/libxsd-frontend/semantic-graph/attribute-group.hxx
+include/libxsd-frontend/semantic-graph/attribute.hxx
+include/libxsd-frontend/semantic-graph/complex.hxx
+include/libxsd-frontend/semantic-graph/compositors.hxx
+include/libxsd-frontend/semantic-graph/element-group.hxx
+include/libxsd-frontend/semantic-graph/element.hxx
+include/libxsd-frontend/semantic-graph/elements.hxx
+include/libxsd-frontend/semantic-graph/enumeration.hxx
+include/libxsd-frontend/semantic-graph/fundamental.hxx
+include/libxsd-frontend/semantic-graph/list.hxx
+include/libxsd-frontend/semantic-graph/namespace.hxx
+include/libxsd-frontend/semantic-graph/particle.hxx
+include/libxsd-frontend/semantic-graph/schema.hxx
+include/libxsd-frontend/semantic-graph/union.hxx
+include/libxsd-frontend/transformations/anonymous.hxx
+include/libxsd-frontend/transformations/enum-synthesis.hxx
+include/libxsd-frontend/transformations/restriction.hxx
+include/libxsd-frontend/transformations/schema-per-type.hxx
+include/libxsd-frontend/transformations/simplifier.hxx
+include/libxsd-frontend/traversal.hxx
+include/libxsd-frontend/traversal/any-attribute.hxx
+include/libxsd-frontend/traversal/any.hxx
+include/libxsd-frontend/traversal/attribute-group.hxx
+include/libxsd-frontend/traversal/attribute.hxx
+include/libxsd-frontend/traversal/complex.hxx
+include/libxsd-frontend/traversal/compositors.hxx
+include/libxsd-frontend/traversal/element-group.hxx
+include/libxsd-frontend/traversal/element.hxx
+include/libxsd-frontend/traversal/elements.hxx
+include/libxsd-frontend/traversal/elements.txx
+include/libxsd-frontend/traversal/enumeration.hxx
+include/libxsd-frontend/traversal/fundamental.hxx
+include/libxsd-frontend/traversal/list.hxx
+include/libxsd-frontend/traversal/namespace.hxx
+include/libxsd-frontend/traversal/particle.hxx
+include/libxsd-frontend/traversal/schema.hxx
+include/libxsd-frontend/traversal/union.hxx
+include/libxsd-frontend/types.hxx
+include/libxsd-frontend/version.hxx
+include/libxsd-frontend/xml.hxx
+lib/libxsd-frontend-2.1.so
+lib/libxsd-frontend.so
+libdata/pkgconfig/libxsd-frontend.pc
+libdata/pkgconfig/libxsd-frontend.shared.pc
+%%PORTDOCS%%%%DOCSDIR%%/GPLv2
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE
+%%PORTDOCS%%%%DOCSDIR%%/NEWS
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/manifest
diff --git a/devel/libxsd/Makefile b/devel/libxsd/Makefile
new file mode 100644
index 000000000000..5acc899aa5ea
--- /dev/null
+++ b/devel/libxsd/Makefile
@@ -0,0 +1,43 @@
+PORTNAME=	libxsd
+DISTVERSION=	4.2.0
+CATEGORIES=	devel
+MASTER_SITES=	https://www.codesynthesis.com/download/xsd/${DISTVERSION:R}/
+
+MAINTAINER=	kde@FreeBSD.org
+COMMENT=	XSD runtime library
+WWW=		https://www.codesynthesis.com/projects/xsd/
+
+LICENSE=		FLOSSE GPLv2
+LICENSE_COMB=		dual
+LICENSE_NAME_FLOSSE=	FLOSS Exception
+LICENSE_FILE_FLOSSE=	${WRKSRC}/FLOSSE
+LICENSE_PERMS_FLOSSE=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+BUILD_DEPENDS=	build2>=0:devel/build2
+RUN_DEPENDS=	expat>=2.4.9:textproc/expat2 \
+		xerces-c3>=3.2.4:textproc/xerces-c3
+
+USES=		pkgconfig
+
+NO_ARCH=	yes
+NO_CCACHE=	yes
+
+OPTIONS_DEFINE=	DOCS
+
+B_CMD=		${LOCALBASE}/bin/b
+B_ARGS=		-V -j ${MAKE_JOBS_NUMBER} -J ${MAKE_JOBS_NUMBER}
+
+do-build:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} configure ${B_ARGS} \
+		config.cxx=${CXX} \
+		config.cxx.coptions="${CXXFLAGS}" \
+		config.cxx.loptions="${LDFLAGS} ${STRIP}" \
+		config.bin.lib=shared \
+		config.bin.rpath=${PREFIX}/lib \
+		config.install.chroot=${STAGEDIR} \
+		config.install.root=${PREFIX}
+
+do-install:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} install ${B_ARGS}
+
+.include <bsd.port.mk>
diff --git a/devel/libxsd/distinfo b/devel/libxsd/distinfo
new file mode 100644
index 000000000000..c36665db5057
--- /dev/null
+++ b/devel/libxsd/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1702699632
+SHA256 (libxsd-4.2.0.tar.gz) = 55caf0038603883eb39ac4caeaacda23a09cf81cffc8eb55a854b6b06ef2c52e
+SIZE (libxsd-4.2.0.tar.gz) = 189158
diff --git a/devel/libxsd/pkg-descr b/devel/libxsd/pkg-descr
new file mode 100644
index 000000000000..1ed4df309fe1
--- /dev/null
+++ b/devel/libxsd/pkg-descr
@@ -0,0 +1,10 @@
+libxsd is the runtime library for the XSD XML Schema to C++ data binding
+compiler.
+
+XSD is an open-source, cross-platform XML Schema to C++ data binding
+compiler. Provided with an XML document specification (XML Schema), it
+generates C++ classes that represent the given vocabulary as well as XML
+parsing and serialization code. You can then access the data stored in
+XML using types and functions that semantically correspond to your
+application domain rather than dealing with generic elements/attributes
+and raw strings.
diff --git a/devel/libxsd/pkg-plist b/devel/libxsd/pkg-plist
new file mode 100644
index 000000000000..6caba5992342
--- /dev/null
+++ b/devel/libxsd/pkg-plist
@@ -0,0 +1,185 @@
+include/xsd/cxx/auto-array.hxx
+include/xsd/cxx/compilers/vc-8/post.hxx
+include/xsd/cxx/compilers/vc-8/pre.hxx
+include/xsd/cxx/config.hxx
+include/xsd/cxx/exceptions.hxx
+include/xsd/cxx/parser/document.hxx
+include/xsd/cxx/parser/document.txx
+include/xsd/cxx/parser/elements.hxx
+include/xsd/cxx/parser/elements.txx
+include/xsd/cxx/parser/error-handler.hxx
+include/xsd/cxx/parser/error-handler.txx
+include/xsd/cxx/parser/exceptions.hxx
+include/xsd/cxx/parser/exceptions.ixx
+include/xsd/cxx/parser/exceptions.txx
+include/xsd/cxx/parser/expat/elements.hxx
+include/xsd/cxx/parser/expat/elements.txx
+include/xsd/cxx/parser/map.hxx
+include/xsd/cxx/parser/map.ixx
+include/xsd/cxx/parser/map.txx
+include/xsd/cxx/parser/non-validating/parser.hxx
+include/xsd/cxx/parser/non-validating/parser.txx
+include/xsd/cxx/parser/non-validating/xml-schema-pimpl.hxx
+include/xsd/cxx/parser/non-validating/xml-schema-pimpl.ixx
+include/xsd/cxx/parser/non-validating/xml-schema-pimpl.txx
+include/xsd/cxx/parser/non-validating/xml-schema-pskel.hxx
+include/xsd/cxx/parser/non-validating/xml-schema-pskel.ixx
+include/xsd/cxx/parser/non-validating/xml-schema-pskel.txx
+include/xsd/cxx/parser/schema-exceptions.hxx
+include/xsd/cxx/parser/schema-exceptions.ixx
+include/xsd/cxx/parser/schema-exceptions.txx
+include/xsd/cxx/parser/substitution-map.hxx
+include/xsd/cxx/parser/substitution-map.txx
+include/xsd/cxx/parser/validating/exceptions.hxx
+include/xsd/cxx/parser/validating/exceptions.ixx
+include/xsd/cxx/parser/validating/exceptions.txx
+include/xsd/cxx/parser/validating/inheritance-map.hxx
+include/xsd/cxx/parser/validating/inheritance-map.txx
+include/xsd/cxx/parser/validating/parser.hxx
+include/xsd/cxx/parser/validating/parser.txx
+include/xsd/cxx/parser/validating/xml-schema-pimpl.hxx
+include/xsd/cxx/parser/validating/xml-schema-pimpl.ixx
+include/xsd/cxx/parser/validating/xml-schema-pimpl.txx
+include/xsd/cxx/parser/validating/xml-schema-pskel.hxx
+include/xsd/cxx/parser/validating/xml-schema-pskel.ixx
+include/xsd/cxx/parser/validating/xml-schema-pskel.txx
+include/xsd/cxx/parser/xerces/elements.hxx
+include/xsd/cxx/parser/xerces/elements.txx
+include/xsd/cxx/parser/xml-schema.hxx
+include/xsd/cxx/parser/xml-schema.ixx
+include/xsd/cxx/parser/xml-schema.txx
+include/xsd/cxx/post.hxx
+include/xsd/cxx/pre.hxx
+include/xsd/cxx/ro-string.hxx
+include/xsd/cxx/ro-string.txx
+include/xsd/cxx/tree/ace-cdr-stream-common.hxx
+include/xsd/cxx/tree/ace-cdr-stream-extraction.hxx
+include/xsd/cxx/tree/ace-cdr-stream-insertion.hxx
+include/xsd/cxx/tree/bits/literals.hxx
+include/xsd/cxx/tree/bits/literals.ixx
+include/xsd/cxx/tree/buffer.hxx
+include/xsd/cxx/tree/buffer.txx
+include/xsd/cxx/tree/comparison-map.hxx
+include/xsd/cxx/tree/comparison-map.txx
+include/xsd/cxx/tree/containers-wildcard.hxx
+include/xsd/cxx/tree/containers.hxx
+include/xsd/cxx/tree/containers.txx
+include/xsd/cxx/tree/date-time-extraction.txx
+include/xsd/cxx/tree/date-time-insertion.txx
+include/xsd/cxx/tree/date-time-ostream.txx
+include/xsd/cxx/tree/date-time.hxx
+include/xsd/cxx/tree/date-time.ixx
+include/xsd/cxx/tree/date-time.txx
+include/xsd/cxx/tree/element-map.hxx
+include/xsd/cxx/tree/element-map.txx
+include/xsd/cxx/tree/elements.hxx
+include/xsd/cxx/tree/elements.ixx
+include/xsd/cxx/tree/elements.txx
+include/xsd/cxx/tree/error-handler.hxx
+include/xsd/cxx/tree/error-handler.txx
+include/xsd/cxx/tree/exceptions.hxx
+include/xsd/cxx/tree/exceptions.txx
+include/xsd/cxx/tree/facet.hxx
+include/xsd/cxx/tree/istream-fwd.hxx
+include/xsd/cxx/tree/istream.hxx
+include/xsd/cxx/tree/iterator-adapter.hxx
+include/xsd/cxx/tree/list.hxx
+include/xsd/cxx/tree/ostream.hxx
+include/xsd/cxx/tree/parsing.hxx
+include/xsd/cxx/tree/parsing.txx
+include/xsd/cxx/tree/parsing/boolean.hxx
+include/xsd/cxx/tree/parsing/byte.hxx
+include/xsd/cxx/tree/parsing/date-time.txx
+include/xsd/cxx/tree/parsing/decimal.hxx
+include/xsd/cxx/tree/parsing/double.hxx
+include/xsd/cxx/tree/parsing/element-map.txx
+include/xsd/cxx/tree/parsing/float.hxx
+include/xsd/cxx/tree/parsing/int.hxx
+include/xsd/cxx/tree/parsing/long.hxx
+include/xsd/cxx/tree/parsing/short.hxx
+include/xsd/cxx/tree/parsing/unsigned-byte.hxx
+include/xsd/cxx/tree/parsing/unsigned-int.hxx
+include/xsd/cxx/tree/parsing/unsigned-long.hxx
+include/xsd/cxx/tree/parsing/unsigned-short.hxx
+include/xsd/cxx/tree/serialization.hxx
+include/xsd/cxx/tree/serialization.txx
+include/xsd/cxx/tree/serialization/boolean.hxx
+include/xsd/cxx/tree/serialization/byte.hxx
+include/xsd/cxx/tree/serialization/date-time.txx
+include/xsd/cxx/tree/serialization/decimal.hxx
+include/xsd/cxx/tree/serialization/double.hxx
+include/xsd/cxx/tree/serialization/element-map.txx
+include/xsd/cxx/tree/serialization/float.hxx
+include/xsd/cxx/tree/serialization/int.hxx
+include/xsd/cxx/tree/serialization/long.hxx
+include/xsd/cxx/tree/serialization/short.hxx
+include/xsd/cxx/tree/serialization/unsigned-byte.hxx
+include/xsd/cxx/tree/serialization/unsigned-int.hxx
+include/xsd/cxx/tree/serialization/unsigned-long.hxx
+include/xsd/cxx/tree/serialization/unsigned-short.hxx
+include/xsd/cxx/tree/std-ostream-map.hxx
+include/xsd/cxx/tree/std-ostream-map.txx
+include/xsd/cxx/tree/std-ostream-operators.hxx
+include/xsd/cxx/tree/stream-extraction-map.hxx
+include/xsd/cxx/tree/stream-extraction-map.txx
+include/xsd/cxx/tree/stream-extraction.hxx
+include/xsd/cxx/tree/stream-insertion-map.hxx
+include/xsd/cxx/tree/stream-insertion-map.txx
+include/xsd/cxx/tree/stream-insertion.hxx
+include/xsd/cxx/tree/text.hxx
+include/xsd/cxx/tree/text.txx
+include/xsd/cxx/tree/type-factory-map.hxx
+include/xsd/cxx/tree/type-factory-map.txx
+include/xsd/cxx/tree/type-serializer-map.hxx
+include/xsd/cxx/tree/type-serializer-map.txx
+include/xsd/cxx/tree/types.hxx
+include/xsd/cxx/tree/types.txx
+include/xsd/cxx/tree/xdr-stream-common.hxx
+include/xsd/cxx/tree/xdr-stream-extraction.hxx
+include/xsd/cxx/tree/xdr-stream-insertion.hxx
+include/xsd/cxx/version.hxx
+include/xsd/cxx/xml/bits/literals.hxx
+include/xsd/cxx/xml/bits/literals.ixx
+include/xsd/cxx/xml/char-iso8859-1.hxx
+include/xsd/cxx/xml/char-iso8859-1.txx
+include/xsd/cxx/xml/char-lcp.hxx
+include/xsd/cxx/xml/char-lcp.txx
+include/xsd/cxx/xml/char-utf8.hxx
+include/xsd/cxx/xml/char-utf8.txx
+include/xsd/cxx/xml/dom/auto-ptr.hxx
+include/xsd/cxx/xml/dom/bits/error-handler-proxy.hxx
+include/xsd/cxx/xml/dom/bits/error-handler-proxy.txx
+include/xsd/cxx/xml/dom/elements.hxx
+include/xsd/cxx/xml/dom/elements.txx
+include/xsd/cxx/xml/dom/parsing-header.hxx
+include/xsd/cxx/xml/dom/parsing-source.hxx
+include/xsd/cxx/xml/dom/parsing-source.txx
+include/xsd/cxx/xml/dom/serialization-header.hxx
+include/xsd/cxx/xml/dom/serialization-header.txx
+include/xsd/cxx/xml/dom/serialization-source.hxx
+include/xsd/cxx/xml/dom/serialization-source.txx
+include/xsd/cxx/xml/dom/wildcard-source.hxx
+include/xsd/cxx/xml/dom/wildcard-source.txx
+include/xsd/cxx/xml/elements.hxx
+include/xsd/cxx/xml/elements.txx
+include/xsd/cxx/xml/error-handler.hxx
+include/xsd/cxx/xml/exceptions.hxx
+include/xsd/cxx/xml/qualified-name.hxx
+include/xsd/cxx/xml/sax/bits/error-handler-proxy.hxx
+include/xsd/cxx/xml/sax/bits/error-handler-proxy.txx
+include/xsd/cxx/xml/sax/std-input-source.hxx
+include/xsd/cxx/xml/std-memory-manager.hxx
+include/xsd/cxx/xml/string.hxx
+include/xsd/cxx/xml/string.ixx
+include/xsd/cxx/xml/string.txx
+include/xsd/cxx/zc-istream.hxx
+include/xsd/cxx/zc-istream.txx
+libdata/pkgconfig/libxsd.pc
+libdata/pkgconfig/libxsd.shared.pc
+%%PORTDOCS%%%%DOCSDIR%%/FLOSSE
+%%PORTDOCS%%%%DOCSDIR%%/GPLv2
+%%PORTDOCS%%%%DOCSDIR%%/LICENSE
+%%PORTDOCS%%%%DOCSDIR%%/NEWS
+%%PORTDOCS%%%%DOCSDIR%%/PACKAGE-README.md
+%%PORTDOCS%%%%DOCSDIR%%/README.md
+%%PORTDOCS%%%%DOCSDIR%%/manifest
diff --git a/devel/xsd/Makefile b/devel/xsd/Makefile
index d540d4f7a0b1..487e0c91f60e 100644
--- a/devel/xsd/Makefile
+++ b/devel/xsd/Makefile
@@ -1,9 +1,7 @@
 PORTNAME=	xsd
-DISTVERSION=	4.1.0.a11
-PORTREVISION=	2
-DISTVERSIONSUFFIX=	+dep
+DISTVERSION=	4.2.0
 CATEGORIES=	devel
-MASTER_SITES=	https://codesynthesis.com/~boris/tmp/${PORTNAME}/${DISTVERSION}/
+MASTER_SITES=	https://www.codesynthesis.com/download/${PORTNAME}/${DISTVERSION:R}/
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	W3C XML Schema to C++ translator
@@ -12,43 +10,38 @@ WWW=		https://www.codesynthesis.com/projects/xsd/
 LICENSE=		FLOSSE GPLv2
 LICENSE_COMB=		dual
 LICENSE_NAME_FLOSSE=	FLOSS Exception
-LICENSE_FILE_FLOSSE=	${WRKSRC}/xsd/FLOSSE
+LICENSE_FILE_FLOSSE=	${WRKSRC}/FLOSSE
 LICENSE_PERMS_FLOSSE=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
-BUILD_DEPENDS=	${LOCALBASE}/include/build-0.3/abspath.make:devel/build
-# libxsd-frontend should come from a separate port as well, but at the moment
-# its distribution as a separate tarball is so poor that it does not even have
-# a `make install'.
+BUILD_DEPENDS=	build2>=0:devel/build2
 LIB_DEPENDS=	libcutl.so:devel/libcutl \
-		libxerces-c.so:textproc/xerces-c3
-
-USES=		compiler:c++11-lang ghostscript:build gmake localbase:ldflags tar:bzip2
-# devel/libcutl 1.10.0 does not work with C++17 which is the default since
-# clang 16. This can be removed once that port starts working with C++17 and
-# has its own USE_CXXSTD removed.
-USE_CXXSTD=	c++11
-
-MAKEFILE=	makefile
-MAKE_ARGS=	EXTERNAL_LIBCUTL=y \
-		install_prefix=${STAGEDIR}${PREFIX} \
-		install_man_dir=${STAGEDIR}${MANPREFIX}/man \
-		verbose=1
-ALL_TARGET=	# no default target should be passed to gmake.
-
-OPTIONS_DEFINE=	DOCS EXAMPLES
-
-post-patch:
-# Use devel/build instead of the port's bundled copy.
-	${RM} -r ${WRKSRC}/build-0.3
-	${LN} -s ${LOCALBASE}/include/build-0.3 ${WRKSRC}/build-0.3
-# Avoid conflict with C++20 <version> by adding .txt suffix
-	@${MV} ${WRKSRC}/libxsd-frontend/version \
-		${WRKSRC}/libxsd-frontend/version.txt
+		libxerces-c.so:textproc/xerces-c3 \
+		libxsd-frontend.so:devel/libxsd-frontend
+
+USES=		compiler:c++2b-lang pkgconfig
+
+OPTIONS_DEFINE=	DOCS
+
+B_CMD=		${LOCALBASE}/bin/b
+B_ARGS=		-V -j ${MAKE_JOBS_NUMBER} -J ${MAKE_JOBS_NUMBER}
+
+do-build:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} configure ${B_ARGS} \
+		config.cxx=${CXX} \
+		config.cxx.coptions="${CXXFLAGS}" \
+		config.cxx.loptions="${LDFLAGS} ${STRIP}" \
+		config.bin.lib=shared \
+		config.bin.rpath=${PREFIX}/lib \
+		config.install.chroot=${STAGEDIR} \
+		config.install.root=${PREFIX}
+
+do-install:
+	@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${B_CMD} install ${B_ARGS}
 
 post-install:
-# Install examples into the right directory.
-	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
-	${MV} ${STAGEDIR}${DOCSDIR}/examples/* ${STAGEDIR}${EXAMPLESDIR}
-	${RMDIR} ${STAGEDIR}${DOCSDIR}/examples
+# Rename the xsd binary to xsdcxx, as lang/mono already installs an executable
+# called `xsd'.
+	@cd ${STAGEDIR}${PREFIX}/bin && ${MV} xsd xsdcxx
+	@cd ${STAGEDIR}${PREFIX}/share/man/man1 && ${MV} xsd.1 xsdcxx.1
 
 .include <bsd.port.mk>
diff --git a/devel/xsd/distinfo b/devel/xsd/distinfo
index 917f7e1570b1..85b30c351202 100644
--- a/devel/xsd/distinfo
+++ b/devel/xsd/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1626852794
-SHA256 (xsd-4.1.0.a11+dep.tar.bz2) = 4fbe2d1e17ad4451bb3a9d9101ac89f7b465205470f1c7ad5e2c1386ac2c87d2
-SIZE (xsd-4.1.0.a11+dep.tar.bz2) = 1778335
+TIMESTAMP = 1702607105
+SHA256 (xsd-4.2.0.tar.gz) = 2bed17c601cfb984f9a7501fd5c672f4f18eac678f5bdef6016971966add9145
+SIZE (xsd-4.2.0.tar.gz) = 1082536
diff --git a/devel/xsd/files/patch-xsd_doc_xsd.1 b/devel/xsd/files/patch-doc_pregenerated_xsd.1
similarity index 84%
rename from devel/xsd/files/patch-xsd_doc_xsd.1
rename to devel/xsd/files/patch-doc_pregenerated_xsd.1
index ee3e585c828a..74960514a2aa 100644
--- a/devel/xsd/files/patch-xsd_doc_xsd.1
+++ b/devel/xsd/files/patch-doc_pregenerated_xsd.1
@@ -1,13 +1,14 @@
 Rename the xsd binary to xsdcxx, as lang/mono already installs an executable
 called `xsd'.
---- xsd/doc/xsd.1.orig	2017-09-24 00:18:08 UTC
-+++ xsd/doc/xsd.1
+
+--- doc/pregenerated/xsd.1.orig	2023-09-28 07:36:28 UTC
++++ doc/pregenerated/xsd.1
 @@ -1,7 +1,7 @@
  .\" Process this file with
  .\" groff -man -Tascii xsd.1
  .\"
--.TH XSD 1 "July 2014" "XSD 4.1.0"
-+.TH XSDCXX 1 "July 2014" "XSDCXX 4.1.0"
+-.TH XSD 1 "January 2023" "XSD 4.2.0"
++.TH XSDCXX 1 "January 2023" "XSDCXX 4.2.0"
  .SH NAME
  xsd \- W3C XML Schema to C++ Compiler
  .\"
@@ -52,7 +53,7 @@ called `xsd'.
  .I command
  .RE
  .PP
-@@ -1461,7 +1461,7 @@ option. With this approach you don't need to worry abo
+@@ -1484,7 +1484,7 @@ If the input file is not a valid W3C XML Schema defini
  .\"
  .SH DIAGNOSTICS
  If the input file is not a valid W3C XML Schema definition,
diff --git a/devel/xsd/files/patch-xsd_doc_xsd.xhtml b/devel/xsd/files/patch-doc_pregenerated_xsd.xhtml
similarity index 83%
rename from devel/xsd/files/patch-xsd_doc_xsd.xhtml
rename to devel/xsd/files/patch-doc_pregenerated_xsd.xhtml
index 321f1a928bcc..d680e9af3af7 100644
--- a/devel/xsd/files/patch-xsd_doc_xsd.xhtml
+++ b/devel/xsd/files/patch-doc_pregenerated_xsd.xhtml
@@ -1,22 +1,24 @@
 Rename the xsd binary to xsdcxx, as lang/mono already installs an executable
*** 674 LINES SKIPPED ***