Gentoo Archives: gentoo-commits

From: Matthew Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/leatherman/, dev-libs/leatherman/files/
Date: Fri, 31 Dec 2021 20:08:55
Message-Id: 1640981327.3b8e554a80837cc26ddb9f6915d03664f569911f.prometheanfire@gentoo
1 commit: 3b8e554a80837cc26ddb9f6915d03664f569911f
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 31 20:08:33 2021 +0000
4 Commit: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 31 20:08:47 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b8e554a
7
8 dev-libs/leatherman: fix builds with >=glibc-2.33
9
10 fixes upstream bug LTH-172
11 Closes: https://bugs.gentoo.org/830346
12 Package-Manager: Portage-3.0.28, Repoman-3.0.3
13 Signed-off-by: Matthew Thode <prometheanfire <AT> gentoo.org>
14
15 .../files/leatherman-1.12.6-SIGSTKSZ.patch | 45 ++++++++++++++++
16 dev-libs/leatherman/leatherman-1.12.6-r2.ebuild | 62 ++++++++++++++++++++++
17 2 files changed, 107 insertions(+)
18
19 diff --git a/dev-libs/leatherman/files/leatherman-1.12.6-SIGSTKSZ.patch b/dev-libs/leatherman/files/leatherman-1.12.6-SIGSTKSZ.patch
20 new file mode 100644
21 index 000000000000..e6c7349e814b
22 --- /dev/null
23 +++ b/dev-libs/leatherman/files/leatherman-1.12.6-SIGSTKSZ.patch
24 @@ -0,0 +1,45 @@
25 +diff -Naur a/src/Catch-1.10.0/single_include/catch.hpp b/src/Catch-1.10.0/single_include/catch.hpp
26 +--- a/src/Catch-1.10.0/single_include/catch.hpp 2021-07-05 07:30:43.000000000 -0500
27 ++++ b/src/Catch-1.10.0/single_include/catch.hpp 2021-12-17 01:34:41.000000000 -0600
28 +@@ -6447,6 +6447,14 @@
29 +
30 + # else // CATCH_CONFIG_POSIX_SIGNALS is defined
31 +
32 ++# if defined(_SC_SIGSTKSZ_SOURCE) || defined(_GNU_SOURCE)
33 ++// on glibc > 2.33 this is no longer constant, see
34 ++// https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD
35 ++static constexpr std::size_t sigStackSize = 32768;
36 ++# else
37 ++static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
38 ++# endif
39 ++
40 + #include <signal.h>
41 +
42 + namespace Catch {
43 +@@ -6470,7 +6478,7 @@
44 + static bool isSet;
45 + static struct sigaction oldSigActions [sizeof(signalDefs)/sizeof(SignalDefs)];
46 + static stack_t oldSigStack;
47 +- static char altStackMem[SIGSTKSZ];
48 ++ static char altStackMem[sigStackSize];
49 +
50 + static void handleSignal( int sig ) {
51 + std::string name = "<unknown signal>";
52 +@@ -6490,7 +6498,7 @@
53 + isSet = true;
54 + stack_t sigStack;
55 + sigStack.ss_sp = altStackMem;
56 +- sigStack.ss_size = SIGSTKSZ;
57 ++ sigStack.ss_size = sigStackSize;
58 + sigStack.ss_flags = 0;
59 + sigaltstack(&sigStack, &oldSigStack);
60 + struct sigaction sa = { 0 };
61 +@@ -6521,7 +6529,7 @@
62 + bool FatalConditionHandler::isSet = false;
63 + struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {};
64 + stack_t FatalConditionHandler::oldSigStack = {};
65 +- char FatalConditionHandler::altStackMem[SIGSTKSZ] = {};
66 ++ char FatalConditionHandler::altStackMem[sigStackSize] = {};
67 +
68 + } // namespace Catch
69 +
70
71 diff --git a/dev-libs/leatherman/leatherman-1.12.6-r2.ebuild b/dev-libs/leatherman/leatherman-1.12.6-r2.ebuild
72 new file mode 100644
73 index 000000000000..3a12d519ae1c
74 --- /dev/null
75 +++ b/dev-libs/leatherman/leatherman-1.12.6-r2.ebuild
76 @@ -0,0 +1,62 @@
77 +# Copyright 1999-2021 Gentoo Authors
78 +# Distributed under the terms of the GNU General Public License v2
79 +
80 +EAPI=7
81 +
82 +inherit cmake
83 +
84 +DESCRIPTION="A C++ toolkit"
85 +HOMEPAGE="https://github.com/puppetlabs/leatherman"
86 +SRC_URI="https://github.com/puppetlabs/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
87 +
88 +LICENSE="Apache-2.0"
89 +SLOT="0/${PV}"
90 +KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
91 +IUSE="debug static-libs test"
92 +#RESTRICT="!test? ( test )"
93 +RESTRICT="test" # restricted til we don't need the shared_nowide patch
94 +
95 +RDEPEND=">=dev-libs/boost-1.73:=[nls]
96 + net-misc/curl"
97 +DEPEND="${RDEPEND}"
98 +
99 +PATCHES=(
100 + "${FILESDIR}"/portage-sandbox-test-fix.patch
101 + "${FILESDIR}"/1.12.2-shared_nowide.patch
102 +)
103 +
104 +src_prepare() {
105 + sed -i 's/\-Werror\ //g' "cmake/cflags.cmake" || die
106 + # vendored boost lib conflicts with boost 1.73 and above
107 + cmake_src_prepare
108 +}
109 +
110 +src_configure() {
111 + local mycmakeargs=(
112 + -DCMAKE_VERBOSE_MAKEFILE=ON
113 + -DCMAKE_BUILD_TYPE=None
114 + -DLEATHERMAN_ENABLE_TESTING=$(usex test)
115 + # We depend on Boost with nls, so this is always true
116 + -DLEATHERMAN_USE_ICU=ON
117 +
118 + -DLEATHERMAN_SHARED=$(usex !static-libs)
119 + )
120 +
121 + if use debug; then
122 + mycmakeargs+=(
123 + -DCMAKE_BUILD_TYPE=Debug
124 + )
125 + fi
126 +
127 + cmake_src_configure
128 + cd "${BUILD_DIR}"
129 + eapply "${FILESDIR}"/${P}-SIGSTKSZ.patch
130 +}
131 +
132 +src_test() {
133 + "${WORKDIR}/${P}"_build/bin/leatherman_test || die
134 +}
135 +
136 +src_install() {
137 + cmake_src_install
138 +}