public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/xmlstarlet/files/, app-text/xmlstarlet/
@ 2024-03-27 22:51 Sebastian Pipping
  0 siblings, 0 replies; only message in thread
From: Sebastian Pipping @ 2024-03-27 22:51 UTC (permalink / raw
  To: gentoo-commits

commit:     56085500739ab65b687013d8bd8e7725a8edd413
Author:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 27 22:45:51 2024 +0000
Commit:     Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Wed Mar 27 22:45:51 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56085500

app-text/xmlstarlet: Fix compilation for Clang >=17

Closes: https://bugs.gentoo.org/927838
Signed-off-by: Sebastian Pipping <sping <AT> gentoo.org>

 .../files/xmlstarlet-1.6.1-clang17.patch           | 59 +++++++++++++++++++++
 app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild     | 60 ++++++++++++++++++++++
 2 files changed, 119 insertions(+)

diff --git a/app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch b/app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch
new file mode 100644
index 000000000000..9269349726d5
--- /dev/null
+++ b/app-text/xmlstarlet/files/xmlstarlet-1.6.1-clang17.patch
@@ -0,0 +1,59 @@
+From e1da090da24f5620784daf853eb1353aa164583f Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Wed, 27 Mar 2024 23:25:39 +0100
+Subject: [PATCH] Address -Wincompatible-function-pointer-types for Clang 17
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Also showed with -Werror=incompatible-pointer-types with GCC.
+
+Bug: https://bugs.gentoo.org/927838
+
+Symptom with GCC was:
+> src/xml.c: In function ‘main’:
+> src/xml.c:300:43: error: passing argument 2 of ‘xmlSetStructuredErrorFunc’ from incompatible pointer type [-Werror=incompatible-pointer-types]
+>   300 |     xmlSetStructuredErrorFunc(&errorInfo, reportError);
+>       |                                           ^~~~~~~~~~~
+>       |                                           |
+>       |                                           void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
+> In file included from /usr/include/libxml2/libxml/valid.h:15,
+>                  from /usr/include/libxml2/libxml/parser.h:19,
+>                  from /usr/include/libxml2/libxml/tree.h:17,
+>                  from /usr/include/libxslt/xslt.h:13,
+>                  from src/xml.c:37:
+> /usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void *, const struct _xmlError *)’} but argument is of type ‘void (*)(void *, xmlError *)’ {aka ‘void (*)(void *, struct _xmlError *)’}
+---
+ src/xml.c     | 2 +-
+ src/xmlstar.h | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/xml.c b/src/xml.c
+index cf47cc2..e6f19c1 100644
+--- a/src/xml.c
++++ b/src/xml.c
+@@ -104,7 +104,7 @@ void reportGenericError(void* ctx, const char * msg, ...) {
+ /* by default all errors are reported */
+ static ErrorInfo errorInfo = { NULL, NULL, VERBOSE, CONTINUE };
+ 
+-void reportError(void *ptr, xmlErrorPtr error)
++void reportError(void *ptr, const xmlError *error)
+ {
+     ErrorInfo *errorInfo = (ErrorInfo*) ptr;
+     assert(errorInfo);
+diff --git a/src/xmlstar.h b/src/xmlstar.h
+index 3e1eed3..e8d7177 100644
+--- a/src/xmlstar.h
++++ b/src/xmlstar.h
+@@ -32,7 +32,7 @@ typedef struct _errorInfo {
+     ErrorStop stop;
+ } ErrorInfo;
+ 
+-void reportError(void *ptr, xmlErrorPtr error);
++void reportError(void *ptr, const xmlError *error);
+ void suppressErrors(void);
+ 
+ typedef struct _gOptions {
+-- 
+2.44.0
+

diff --git a/app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild b/app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild
new file mode 100644
index 000000000000..8d84085ae390
--- /dev/null
+++ b/app-text/xmlstarlet/xmlstarlet-1.6.1-r2.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="A set of tools to transform, query, validate, and edit XML documents"
+HOMEPAGE="https://xmlstar.sourceforge.net/"
+SRC_URI="mirror://sourceforge/xmlstar/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+
+RDEPEND="
+	dev-libs/libxml2
+	dev-libs/libxslt
+	dev-libs/libgcrypt:0=
+	virtual/libiconv"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-1.6.1-clang16.patch
+	"${FILESDIR}"/${PN}-1.6.1-clang17.patch
+)
+
+src_prepare() {
+	default
+
+	# We need to patch use of /usr/lib because it is a problem with
+	# linker lld with profile 17.1 on amd64 (see https://bugs.gentoo.org/729600).
+	# The grep sandwich acts as a regression test so that a future
+	# version bump cannot break patching without noticing.
+	if [[ $(get_libdir) != lib ]]; then
+	    grep -wq _PREFIX/lib m4/xstar-check-libs.m4 || die
+	    sed "s,_PREFIX/lib,_PREFIX/$(get_libdir)," -i m4/xstar-check-libs.m4 || die
+	    grep -w _PREFIX/lib m4/xstar-check-libs.m4 && die
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	append-cppflags $($(tc-getPKG_CONFIG) --cflags libxml-2.0)
+
+	# NOTE: Fully built documentation is already shipped with the tarball:
+	# - doc/xmlstarlet-ug.{pdf,ps,html}
+	# - doc/xmlstarlet.txt
+	# - doc/xmlstarlet.1
+	econf \
+		--disable-build-docs \
+		--disable-static-libs
+}
+
+src_install() {
+	default
+	dosym xml /usr/bin/xmlstarlet
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-03-27 22:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 22:51 [gentoo-commits] repo/gentoo:master commit in: app-text/xmlstarlet/files/, app-text/xmlstarlet/ Sebastian Pipping

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox