commit:     aef0ef66bf7cce12aeea00a3efd0e745def7e095
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 23 18:33:14 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 23 18:33:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aef0ef66

dev-libs/log4cpp: add 1.1.4

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 dev-libs/log4cpp/Manifest                          |  1 +
 ...4cpp-1.1.4-fix-implicit-func-in-configure.patch | 20 ++++++++
 dev-libs/log4cpp/files/log4cpp-1.1.4-gcc43.patch   | 11 ++++
 dev-libs/log4cpp/log4cpp-1.1.4.ebuild              | 59 ++++++++++++++++++++++
 4 files changed, 91 insertions(+)

diff --git a/dev-libs/log4cpp/Manifest b/dev-libs/log4cpp/Manifest
index b9af8f327ffe..58f428e911e6 100644
--- a/dev-libs/log4cpp/Manifest
+++ b/dev-libs/log4cpp/Manifest
@@ -1 +1,2 @@
 DIST log4cpp-1.1.3.tar.gz 595639 BLAKE2B 
fc7d643aa70d739e38ec5aba127b4e760a47a064f4032690586c4698ec83a2b7f219d8476650d3bfc5e25563de0852869429ec45171233c6bd5c08b69476b169
 SHA512 
88e5e10bce8d7d6421c3dcf14aa25385159c4ae52becdc1f3666ab86e1ad3f633786d82afe398c517d4faaa57b3e7b7c0b524361d81c6b9040dbded5cecc19de
+DIST log4cpp-1.1.4.tar.gz 637440 BLAKE2B 
fe7d3cf5ea8ff8f9bdd86691195c02473bd21a90ebfe2d9cd7a32c2fa30e17b5a104c6181601cf2dce19b703496bb6038e7b0a782a24dfd55415ecd462e49841
 SHA512 
0cdbd46ccd048d70bea3c35d22080dc5dd21fc3b9c415fe464847e60775954f57e9c8344506f0f94f16e90e8bdaa9cc6d84d3aa65191501e52ee8dfc639f0398

diff --git 
a/dev-libs/log4cpp/files/log4cpp-1.1.4-fix-implicit-func-in-configure.patch 
b/dev-libs/log4cpp/files/log4cpp-1.1.4-fix-implicit-func-in-configure.patch
new file mode 100644
index 000000000000..78a5dd4c8e54
--- /dev/null
+++ b/dev-libs/log4cpp/files/log4cpp-1.1.4-fix-implicit-func-in-configure.patch
@@ -0,0 +1,20 @@
+clang16 throws an error because of the implicit function declaration of exit().
+This leads to the wrong assumption that snprintf is not present on the system.
+
+Bug: https://bugs.gentoo.org/906535
+Upstream PR: https://sourceforge.net/p/log4cpp/codegit/merge-requests/10/
+
+#  Pascal Jäger <[email protected]> (2023-09-22)
+
+--- a/m4/AC_FUNC_SNPRINTF.m4
++++ b/m4/AC_FUNC_SNPRINTF.m4
+@@ -12,7 +12,8 @@ dnl @author Caolan McNamara <[email protected]>
+ dnl
+ AC_DEFUN([AC_FUNC_SNPRINTF],
+ [AC_CACHE_CHECK(for working snprintf, ac_cv_func_snprintf,
+-[AC_TRY_RUN([#include <stdio.h>
++[AC_TRY_RUN([#include <stdlib.h>
++#include <stdio.h>
+ int main () { int l = snprintf(NULL,0,"%d",100); return !((3 <= l) || (-1 == 
l)); }
+ ], ac_cv_func_snprintf=yes, ac_cv_func_snprintf=no,
+ ac_cv_func_snprintf=no)])

diff --git a/dev-libs/log4cpp/files/log4cpp-1.1.4-gcc43.patch 
b/dev-libs/log4cpp/files/log4cpp-1.1.4-gcc43.patch
new file mode 100644
index 000000000000..9a1fd466c274
--- /dev/null
+++ b/dev-libs/log4cpp/files/log4cpp-1.1.4-gcc43.patch
@@ -0,0 +1,11 @@
+--- a/src/PatternLayout.cpp
++++ b/src/PatternLayout.cpp
+@@ -373,7 +373,7 @@
+                         literal = "";
+                     }
+                     if ((minWidth != 0) || (maxWidth != 0)) {
+-                        component = new FormatModifierComponent(component, 
std::abs(minWidth), maxWidth, minWidth < 0);
++                        component = new FormatModifierComponent(component, 
std::abs((float)minWidth), maxWidth, minWidth < 0);
+                         minWidth = maxWidth = 0;
+                     }
+                     _components.push_back(component);

diff --git a/dev-libs/log4cpp/log4cpp-1.1.4.ebuild 
b/dev-libs/log4cpp/log4cpp-1.1.4.ebuild
new file mode 100644
index 000000000000..3b679658a0e5
--- /dev/null
+++ b/dev-libs/log4cpp/log4cpp-1.1.4.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools flag-o-matic
+
+DESCRIPTION="C++ classes for flexible logging to files, syslog and other 
destinations"
+HOMEPAGE="https://log4cpp.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+S="${WORKDIR}/${PN}"
+
+LICENSE="LGPL-2.1"
+SLOT="0/5"
+KEYWORDS="~amd64 ~arm ~ppc ~riscv ~s390 ~x86"
+IUSE="doc test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="doc? ( app-text/doxygen )"
+
+PATCHES=(
+       "${FILESDIR}"/1.0-doc_install_path.patch
+       "${FILESDIR}"/1.0-asneeded.patch
+       "${FILESDIR}"/${PN}-1.1-cmath-fix.patch
+       "${FILESDIR}"/${PN}-1.1-automake-1.13.patch
+       "${FILESDIR}"/${PN}-1.1.3-fix-version.patch
+       "${FILESDIR}"/${PN}-1.1.4-fix-implicit-func-in-configure.patch
+       "${FILESDIR}"/${PN}-1.1.4-gcc43.patch
+)
+
+src_prepare() {
+       default
+
+       mv configure.{in,ac} || die
+
+       # Build tests conditionally
+       if ! use test; then
+               sed -i -e '/^SUBDIRS/s/ tests//' Makefile.am || die
+       fi
+
+       eautoreconf
+}
+
+src_configure() {
+       append-cxxflags -Wno-register # https://bugs.gentoo.org/895054
+       # Bashisms call configure tests to malfunction / config.h to be 
misgenerated
+       # which then causes a build failure later on in the package (w/ GCC 12,
+       # anyway).
+       CONFIG_SHELL="${BROOT}"/bin/bash econf \
+               --without-idsa \
+               $(use_enable doc doxygen)
+}
+
+src_install() {
+       default
+
+       # Package installs .pc files
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to