Gentoo Archives: gentoo-commits

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