Gentoo Archives: gentoo-commits

From: Matt Turner <mattst88@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-cpp/glog/, dev-cpp/glog/files/
Date: Thu, 18 Aug 2022 03:16:39
Message-Id: 1660792588.475dab847fb2e961d0ef35173cd1295d17bf966b.mattst88@gentoo
1 commit: 475dab847fb2e961d0ef35173cd1295d17bf966b
2 Author: Matt Turner <mattst88 <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 18 03:15:38 2022 +0000
4 Commit: Matt Turner <mattst88 <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 18 03:16:28 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=475dab84
7
8 Revert "dev-cpp/glog: Drop old versions"
9
10 Still needed by sci-libs/caffe2.
11
12 This reverts commit 3817d0904d1cd868a656cf05c50f431bd6a6ccb7.
13
14 Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>
15
16 dev-cpp/glog/Manifest | 1 +
17 dev-cpp/glog/files/glog-0.4.0-errnos.patch | 99 ++++++++++++++++++++++
18 .../glog/files/glog-0.4.0-fix-test-on-ports.patch | 19 +++++
19 dev-cpp/glog/files/glog-0.4.0-fix-x32-build.patch | 35 ++++++++
20 dev-cpp/glog/glog-0.4.0.ebuild | 46 ++++++++++
21 5 files changed, 200 insertions(+)
22
23 diff --git a/dev-cpp/glog/Manifest b/dev-cpp/glog/Manifest
24 index 27d44dcf6c41..30b5047877a8 100644
25 --- a/dev-cpp/glog/Manifest
26 +++ b/dev-cpp/glog/Manifest
27 @@ -1,2 +1,3 @@
28 +DIST glog-0.4.0.tar.gz 200955 BLAKE2B 083da6117af3e85697724942bfcb5a7831d447666945b06b149d8d324231b10923887bd8c507e8027136d12bffd30a657cb225df8c449f234381e3876f132953 SHA512 b585f1819ade2075f6b61dc5aaca5c3f9d25601dba2bd08b6c49b96ac5f79db23c6b7f2042df003f7130497dd7241fcaa8b107d1f97385cb66ce52d3c554b176
29 DIST glog-0.5.0.tar.gz 183346 BLAKE2B 9109a9a4bd3c74ba5d4c1d9ed44ffe0e16d5d3b9b12bf9dd5d31c6e728292ea50f39b4e1b96d55fbb35653a448af4dc8a978e266a2b0f34261c5108099e90845 SHA512 445e4338f3d81cd0b065f2da9c6ce343c243263ca144cea424ef97531a4e9e09c06ffd6942ac01c5213a8003c75cfbbede3c4028d12f0134f23ff29314769c1a
30 DIST glog-0.6.0.tar.gz 193267 BLAKE2B b42112cdfd54280ce7a9592c3af6b6e10dcb854fe9dbe0db7445c60801d1c12a240c4b3709b45e41aedeb8876d2e08fc3368296e088be6a66126858888cc274e SHA512 fd2c42583d0dd72c790a8cf888f328a64447c5fb9d99b2e2a3833d70c102cb0eb9ae874632c2732424cc86216c8a076a3e24b23a793eaddb5da8a1dc52ba9226
31
32 diff --git a/dev-cpp/glog/files/glog-0.4.0-errnos.patch b/dev-cpp/glog/files/glog-0.4.0-errnos.patch
33 new file mode 100644
34 index 000000000000..c55716db1ba2
35 --- /dev/null
36 +++ b/dev-cpp/glog/files/glog-0.4.0-errnos.patch
37 @@ -0,0 +1,99 @@
38 +Index: b/src/googletest.h
39 +===================================================================
40 +--- a/src/googletest.h
41 ++++ b/src/googletest.h
42 +@@ -437,6 +437,18 @@ static inline void StringReplace(string*
43 + }
44 + }
45 +
46 ++static inline void IntReplace(string* str,
47 ++ const string& oldsub,
48 ++ int newsub) {
49 ++ size_t pos = str->find(oldsub);
50 ++ if (pos != string::npos) {
51 ++ std::ostringstream ss;
52 ++ ss << newsub;
53 ++ const std::string x = ss.str();
54 ++ str->replace(pos, oldsub.size(), x.c_str());
55 ++ }
56 ++}
57 ++
58 + static inline string Munge(const string& filename) {
59 + FILE* fp = fopen(filename.c_str(), "rb");
60 + CHECK(fp != NULL) << filename << ": couldn't open";
61 +@@ -452,9 +464,13 @@ static inline string Munge(const string&
62 +
63 + StringReplace(&line, "__SUCCESS__", StrError(0));
64 + StringReplace(&line, "__ENOENT__", StrError(ENOENT));
65 ++ IntReplace(&line, "__ENOENT_NUM__", ENOENT);
66 + StringReplace(&line, "__EINTR__", StrError(EINTR));
67 ++ IntReplace(&line, "__EINTR_NUM__", EINTR);
68 + StringReplace(&line, "__ENXIO__", StrError(ENXIO));
69 ++ IntReplace(&line, "__ENXIO_NUM__", ENXIO);
70 + StringReplace(&line, "__ENOEXEC__", StrError(ENOEXEC));
71 ++ IntReplace(&line, "__ENOEXEC_NUM__", ENOEXEC);
72 + result += line + "\n";
73 + }
74 + fclose(fp);
75 +Index: b/src/logging_unittest.cc
76 +===================================================================
77 +--- a/src/logging_unittest.cc
78 ++++ b/src/logging_unittest.cc
79 +@@ -238,6 +238,17 @@ int main(int argc, char **argv) {
80 + return 0;
81 + }
82 +
83 ++static int errnoForIteration(int i) {
84 ++ switch (i) {
85 ++ case 0: return 0;
86 ++ case 2: return ENOENT;
87 ++ case 4: return EINTR;
88 ++ case 6: return ENXIO;
89 ++ case 8: return ENOEXEC;
90 ++ }
91 ++ return -1;
92 ++}
93 ++
94 + void TestLogging(bool check_counts) {
95 + int64 base_num_infos = LogMessage::num_messages(GLOG_INFO);
96 + int64 base_num_warning = LogMessage::num_messages(GLOG_WARNING);
97 +@@ -246,7 +257,7 @@ void TestLogging(bool check_counts) {
98 + LOG(INFO) << string("foo ") << "bar " << 10 << ' ' << 3.4;
99 + for ( int i = 0; i < 10; ++i ) {
100 + int old_errno = errno;
101 +- errno = i;
102 ++ errno = errnoForIteration(i);
103 + PLOG_EVERY_N(ERROR, 2) << "Plog every 2, iteration " << COUNTER;
104 + errno = old_errno;
105 +
106 +Index: b/src/logging_unittest.err
107 +===================================================================
108 +--- a/src/logging_unittest.err
109 ++++ b/src/logging_unittest.err
110 +@@ -51,21 +51,21 @@ WDATE TIME__ THREADID logging_unittest.c
111 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 1
112 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log if less than 3 every 2, iteration 1
113 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 2
114 +-EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 3: __ENOENT__ [2]
115 ++EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 3: __ENOENT__ [__ENOENT_NUM__]
116 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 3
117 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log if less than 3 every 2, iteration 3
118 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log every 3, iteration 4
119 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 4
120 +-EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 5: __EINTR__ [4]
121 ++EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 5: __EINTR__ [__EINTR_NUM__]
122 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log every 4, iteration 5
123 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 5
124 + WDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 5, iteration 6
125 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 6
126 +-EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 7: __ENXIO__ [6]
127 ++EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 7: __ENXIO__ [__ENXIO_NUM__]
128 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log every 3, iteration 7
129 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 7
130 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 8
131 +-EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 9: __ENOEXEC__ [8]
132 ++EDATE TIME__ THREADID logging_unittest.cc:LINE] Plog every 2, iteration 9: __ENOEXEC__ [__ENOEXEC_NUM__]
133 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log every 4, iteration 9
134 + IDATE TIME__ THREADID logging_unittest.cc:LINE] Log if every 1, iteration 9
135 + EDATE TIME__ THREADID logging_unittest.cc:LINE] Log every 3, iteration 10
136 +
137
138 diff --git a/dev-cpp/glog/files/glog-0.4.0-fix-test-on-ports.patch b/dev-cpp/glog/files/glog-0.4.0-fix-test-on-ports.patch
139 new file mode 100644
140 index 000000000000..392ae8ca7819
141 --- /dev/null
142 +++ b/dev-cpp/glog/files/glog-0.4.0-fix-test-on-ports.patch
143 @@ -0,0 +1,19 @@
144 +Index: google-glog-0.3.2/src/signalhandler_unittest.sh
145 +===================================================================
146 +--- google-glog-0.3.2.orig/src/signalhandler_unittest.sh 2013-03-13 13:49:37.820188111 -0400
147 ++++ google-glog-0.3.2/src/signalhandler_unittest.sh 2013-03-13 14:07:11.980204520 -0400
148 +@@ -65,10 +65,10 @@
149 + exit 0
150 + fi
151 +
152 +-# The PC cannot be obtained in signal handlers on PowerPC correctly.
153 +-# We just skip the test for PowerPC.
154 +-if [ x`uname -p` = x"powerpc" ]; then
155 +- echo "PASS (We don't test the signal handler on PowerPC.)"
156 ++# This test only works correctly on i386 and amd64.
157 ++# We just skip the test when not on those platforms.
158 ++if [ x`uname -m` != x"x86_64" -a x`uname -m` != x"i686" ]; then
159 ++ echo "PASS (We only test the signal handler on i386 or amd64.)"
160 + exit 0
161 + fi
162 +
163
164 diff --git a/dev-cpp/glog/files/glog-0.4.0-fix-x32-build.patch b/dev-cpp/glog/files/glog-0.4.0-fix-x32-build.patch
165 new file mode 100644
166 index 000000000000..e53318ac66ff
167 --- /dev/null
168 +++ b/dev-cpp/glog/files/glog-0.4.0-fix-x32-build.patch
169 @@ -0,0 +1,35 @@
170 +Description: fix FTBFS on x32
171 +Author: Guillaume Morin <guillaume@×××××××.org>
172 +Forwarded: no
173 +Last-Update: 2019-08-05
174 +
175 +---
176 +
177 +--- google-glog-0.3.4.orig/src/symbolize_unittest.cc
178 ++++ google-glog-0.3.4/src/symbolize_unittest.cc
179 +@@ -313,8 +313,12 @@ extern "C" {
180 + inline void* always_inline inline_func() {
181 + void *pc = NULL;
182 + #ifdef TEST_X86_32_AND_64
183 ++#if __x86_64__ || (__x86_64__ && __ILP32__)
184 ++ __asm__ __volatile__("call 1f; 1: popq %q0" : "=r"(pc));
185 ++#else
186 + __asm__ __volatile__("call 1f; 1: pop %0" : "=r"(pc));
187 + #endif
188 ++#endif
189 + return pc;
190 + }
191 +
192 +@@ -322,8 +326,12 @@ void* ATTRIBUTE_NOINLINE non_inline_func
193 + void* ATTRIBUTE_NOINLINE non_inline_func() {
194 + void *pc = NULL;
195 + #ifdef TEST_X86_32_AND_64
196 ++#if __x86_64__ || (__x86_64__ && __ILP32__)
197 ++ __asm__ __volatile__("call 1f; 1: popq %q0" : "=r"(pc));
198 ++#else
199 + __asm__ __volatile__("call 1f; 1: pop %0" : "=r"(pc));
200 + #endif
201 ++#endif
202 + return pc;
203 + }
204 +
205
206 diff --git a/dev-cpp/glog/glog-0.4.0.ebuild b/dev-cpp/glog/glog-0.4.0.ebuild
207 new file mode 100644
208 index 000000000000..9b10f2e2fc95
209 --- /dev/null
210 +++ b/dev-cpp/glog/glog-0.4.0.ebuild
211 @@ -0,0 +1,46 @@
212 +# Copyright 2011-2022 Gentoo Authors
213 +# Distributed under the terms of the GNU General Public License v2
214 +
215 +EAPI="7"
216 +
217 +inherit autotools multilib-minimal
218 +
219 +DESCRIPTION="Google's C++ logging library"
220 +HOMEPAGE="https://github.com/google/glog"
221 +SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
222 +
223 +LICENSE="BSD"
224 +SLOT="0"
225 +# -sparc as libunwind is not ported on sparc
226 +KEYWORDS="amd64 arm arm64 ~hppa ~ia64 ~mips ppc ppc64 -sparc x86 ~amd64-linux ~x86-linux"
227 +IUSE="gflags static-libs test"
228 +RESTRICT="test"
229 +
230 +RDEPEND="sys-libs/libunwind[${MULTILIB_USEDEP}]
231 + gflags? ( dev-cpp/gflags[${MULTILIB_USEDEP}] )"
232 +DEPEND="${RDEPEND}
233 + test? ( >=dev-cpp/gtest-1.8.0[${MULTILIB_USEDEP}] )"
234 +
235 +PATCHES=(
236 + "${FILESDIR}"/${PN}-0.4.0-fix-x32-build.patch
237 + "${FILESDIR}"/${PN}-0.4.0-errnos.patch
238 + "${FILESDIR}"/${PN}-0.4.0-fix-test-on-ports.patch
239 +)
240 +
241 +src_prepare() {
242 + default
243 + eautoreconf
244 +}
245 +
246 +multilib_src_configure() {
247 + ECONF_SOURCE="${S}" econf \
248 + $(use_enable static-libs static) \
249 + ac_cv_lib_gflags_main="$(usex gflags)"
250 +}
251 +
252 +multilib_src_install_all() {
253 + einstalldocs
254 +
255 + # package provides .pc files
256 + find "${D}" -name '*.la' -delete || die
257 +}