commit:     c9283e917a7d9668efb21be616ed14c23291536f
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 04:07:30 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 04:07:33 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9283e91

app-admin/augeas: fix musl/clang 15 build & runtime

Closes: https://bugs.gentoo.org/894188
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-admin/augeas/augeas-1.14.0-r2.ebuild           | 53 ++++++++++++++++++++++
 .../files/augeas-1.14.0-musl-strerror_r.patch      | 22 +++++++++
 2 files changed, 75 insertions(+)

diff --git a/app-admin/augeas/augeas-1.14.0-r2.ebuild 
b/app-admin/augeas/augeas-1.14.0-r2.ebuild
new file mode 100644
index 000000000000..a8fbc7adbc26
--- /dev/null
+++ b/app-admin/augeas/augeas-1.14.0-r2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="A library for changing configuration files"
+HOMEPAGE="http://augeas.net/";
+SRC_URI="https://github.com/hercules-team/augeas/releases/download/release-${PV}/${P}.tar.gz";
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       dev-libs/libxml2
+       sys-libs/readline:="
+DEPEND="${RDEPEND}"
+BDEPEND="
+       >=app-doc/NaturalDocs-1.40
+       virtual/pkgconfig
+       test? ( dev-lang/ruby )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.14.0-musl-strerror_r.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       # selinux needs to be implemented
+       econf --without-selinux
+}
+
+src_compile() {
+       addpredict /usr/share/NaturalDocs/Config/Languages.txt
+       addpredict /usr/share/NaturalDocs/Config/Topics.txt
+
+       default
+}
+
+src_install() {
+       default
+
+       find "${ED}" -name '*.la' -delete || die
+}

diff --git a/app-admin/augeas/files/augeas-1.14.0-musl-strerror_r.patch 
b/app-admin/augeas/files/augeas-1.14.0-musl-strerror_r.patch
new file mode 100644
index 000000000000..07cda4c4ae02
--- /dev/null
+++ b/app-admin/augeas/files/augeas-1.14.0-musl-strerror_r.patch
@@ -0,0 +1,22 @@
+https://github.com/hercules-team/augeas/pull/791
+
+From 46ecd3542820604603ab4f046f9fb3e6195f60aa Mon Sep 17 00:00:00 2001
+From: Dimitry Andric <[email protected]>
+Date: Thu, 8 Dec 2022 13:08:53 +0100
+Subject: [PATCH] Only use GNU specific strerror_r() API when __GLIBC__ is
+ defined.
+
+--- a/src/internal.c
++++ b/src/internal.c
+@@ -431,8 +431,8 @@ char *cleanpath(char *path) {
+ 
+ const char *xstrerror(int errnum, char *buf, size_t len) {
+ #ifdef HAVE_STRERROR_R
+-# ifdef __USE_GNU
+-    /* Annoying linux specific API contract */
++# if defined(__USE_GNU) && defined(__GLIBC__)
++    /* Annoying GNU specific API contract */
+     return strerror_r(errnum, buf, len);
+ # else
+     strerror_r(errnum, buf, len);
+

Reply via email to