1 |
commit: 449a25488af2de2cda045d3073bb64d0deec5f05 |
2 |
Author: Peter Levine <plevine457 <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue May 16 04:17:10 2017 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 25 20:54:49 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=449a2548 |
7 |
|
8 |
dev-util/open-vcdiff: fix building with GCC-6. |
9 |
|
10 |
Gentoo-Bug: https://bugs.gentoo.org/594334 |
11 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
12 |
Closes: https://github.com/gentoo/gentoo/pull/4639 |
13 |
|
14 |
.../open-vcdiff/files/open-vcdiff-0.8.4-gcc6.patch | 223 +++++++++++++++++++++ |
15 |
...ff-0.8.4.ebuild => open-vcdiff-0.8.4-r1.ebuild} | 12 +- |
16 |
dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild | 6 +- |
17 |
3 files changed, 234 insertions(+), 7 deletions(-) |
18 |
|
19 |
diff --git a/dev-util/open-vcdiff/files/open-vcdiff-0.8.4-gcc6.patch b/dev-util/open-vcdiff/files/open-vcdiff-0.8.4-gcc6.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..fdba3faa78b |
22 |
--- /dev/null |
23 |
+++ b/dev-util/open-vcdiff/files/open-vcdiff-0.8.4-gcc6.patch |
24 |
@@ -0,0 +1,223 @@ |
25 |
+--- a/src/vcdecoder_test.cc |
26 |
++++ b/src/vcdecoder_test.cc |
27 |
+@@ -23,7 +23,7 @@ |
28 |
+ |
29 |
+ namespace open_vcdiff { |
30 |
+ |
31 |
+-const char VCDiffDecoderTest::kStandardFileHeader[] = { |
32 |
++const uint8_t VCDiffDecoderTest::kStandardFileHeader[] = { |
33 |
+ 0xD6, // 'V' | 0x80 |
34 |
+ 0xC3, // 'C' | 0x80 |
35 |
+ 0xC4, // 'D' | 0x80 |
36 |
+@@ -31,7 +31,7 @@ |
37 |
+ 0x00 // Hdr_Indicator: no custom code table, no compression |
38 |
+ }; |
39 |
+ |
40 |
+-const char VCDiffDecoderTest::kInterleavedFileHeader[] = { |
41 |
++const uint8_t VCDiffDecoderTest::kInterleavedFileHeader[] = { |
42 |
+ 0xD6, // 'V' | 0x80 |
43 |
+ 0xC3, // 'C' | 0x80 |
44 |
+ 0xC4, // 'D' | 0x80 |
45 |
+@@ -61,21 +61,22 @@ |
46 |
+ } |
47 |
+ |
48 |
+ void VCDiffDecoderTest::UseStandardFileHeader() { |
49 |
+- delta_file_header_.assign(kStandardFileHeader, |
50 |
++ delta_file_header_.assign(reinterpret_cast<const char *>(kStandardFileHeader), |
51 |
+ sizeof(kStandardFileHeader)); |
52 |
+ } |
53 |
+ |
54 |
+ void VCDiffDecoderTest::UseInterleavedFileHeader() { |
55 |
+- delta_file_header_.assign(kInterleavedFileHeader, |
56 |
+- sizeof(kInterleavedFileHeader)); |
57 |
++ delta_file_header_.assign( |
58 |
++ reinterpret_cast<const char *>(kInterleavedFileHeader), |
59 |
++ sizeof(kInterleavedFileHeader)); |
60 |
+ } |
61 |
+ |
62 |
+ void VCDiffDecoderTest::InitializeDeltaFile() { |
63 |
+ delta_file_ = delta_file_header_ + delta_window_header_ + delta_window_body_; |
64 |
+ } |
65 |
+ |
66 |
+-char VCDiffDecoderTest::GetByteFromStringLength(const char* s, |
67 |
+- int which_byte) { |
68 |
++uint8_t VCDiffDecoderTest::GetByteFromStringLength(const char* s, |
69 |
++ int which_byte) { |
70 |
+ char varint_buf[VarintBE<int32_t>::kMaxBytes]; |
71 |
+ VarintBE<int32_t>::Encode(static_cast<int32_t>(strlen(s)), varint_buf); |
72 |
+ return varint_buf[which_byte]; |
73 |
+@@ -101,10 +102,10 @@ |
74 |
+ // (0x7FFFFFFF) at the given offset in the delta window. |
75 |
+ void VCDiffDecoderTest::WriteMaxVarintAtOffset(int offset, |
76 |
+ int bytes_to_replace) { |
77 |
+- static const char kMaxVarint[] = { 0x87, 0xFF, 0xFF, 0xFF, 0x7F }; |
78 |
++ static const uint8_t kMaxVarint[] = { 0x87, 0xFF, 0xFF, 0xFF, 0x7F }; |
79 |
+ delta_file_.replace(delta_file_header_.size() + offset, |
80 |
+ bytes_to_replace, |
81 |
+- kMaxVarint, |
82 |
++ reinterpret_cast<const char*>(kMaxVarint), |
83 |
+ sizeof(kMaxVarint)); |
84 |
+ } |
85 |
+ |
86 |
+@@ -112,10 +113,10 @@ |
87 |
+ // in the delta window. |
88 |
+ void VCDiffDecoderTest::WriteNegativeVarintAtOffset(int offset, |
89 |
+ int bytes_to_replace) { |
90 |
+- static const char kNegativeVarint[] = { 0x88, 0x80, 0x80, 0x80, 0x00 }; |
91 |
++ static const uint8_t kNegativeVarint[] = { 0x88, 0x80, 0x80, 0x80, 0x00 }; |
92 |
+ delta_file_.replace(delta_file_header_.size() + offset, |
93 |
+ bytes_to_replace, |
94 |
+- kNegativeVarint, |
95 |
++ reinterpret_cast<const char*>(kNegativeVarint), |
96 |
+ sizeof(kNegativeVarint)); |
97 |
+ } |
98 |
+ |
99 |
+@@ -123,18 +124,18 @@ |
100 |
+ // at the given offset in the delta window. |
101 |
+ void VCDiffDecoderTest::WriteInvalidVarintAtOffset(int offset, |
102 |
+ int bytes_to_replace) { |
103 |
+- static const char kInvalidVarint[] = { 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F }; |
104 |
++ static const uint8_t kInvalidVarint[] = { 0x87, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F }; |
105 |
+ delta_file_.replace(delta_file_header_.size() + offset, |
106 |
+ bytes_to_replace, |
107 |
+- kInvalidVarint, |
108 |
++ reinterpret_cast<const char*>(kInvalidVarint), |
109 |
+ sizeof(kInvalidVarint)); |
110 |
+ } |
111 |
+ |
112 |
+ bool VCDiffDecoderTest::FuzzOneByteInDeltaFile() { |
113 |
+ static const struct Fuzzer { |
114 |
+- char _and; |
115 |
+- char _or; |
116 |
+- char _xor; |
117 |
++ uint8_t _and; |
118 |
++ uint8_t _or; |
119 |
++ uint8_t _xor; |
120 |
+ } fuzzers[] = { |
121 |
+ { 0xff, 0x80, 0x00 }, |
122 |
+ { 0xff, 0xff, 0x00 }, |
123 |
+@@ -162,7 +163,7 @@ |
124 |
+ return false; |
125 |
+ } |
126 |
+ |
127 |
+-const char VCDiffStandardDecoderTest::kWindowHeader[] = { |
128 |
++const uint8_t VCDiffStandardDecoderTest::kWindowHeader[] = { |
129 |
+ VCD_SOURCE, // Win_Indicator: take source from dictionary |
130 |
+ FirstByteOfStringLength(kDictionary), // Source segment size |
131 |
+ SecondByteOfStringLength(kDictionary), |
132 |
+@@ -176,7 +177,7 @@ |
133 |
+ 0x03 // length of addresses for COPYs |
134 |
+ }; |
135 |
+ |
136 |
+-const char VCDiffStandardDecoderTest::kWindowBody[] = { |
137 |
++const uint8_t VCDiffStandardDecoderTest::kWindowBody[] = { |
138 |
+ // Data for ADDs: 1st section (length 61) |
139 |
+ ' ', 'I', ' ', 'h', 'a', 'v', 'e', ' ', 's', 'a', 'i', 'd', ' ', |
140 |
+ 'i', 't', ' ', 't', 'w', 'i', 'c', 'e', ':', '\n', |
141 |
+@@ -216,11 +217,13 @@ |
142 |
+ |
143 |
+ VCDiffStandardDecoderTest::VCDiffStandardDecoderTest() { |
144 |
+ UseStandardFileHeader(); |
145 |
+- delta_window_header_.assign(kWindowHeader, sizeof(kWindowHeader)); |
146 |
+- delta_window_body_.assign(kWindowBody, sizeof(kWindowBody)); |
147 |
++ delta_window_header_.assign(reinterpret_cast<const char *>(kWindowHeader), |
148 |
++ sizeof(kWindowHeader)); |
149 |
++ delta_window_body_.assign(reinterpret_cast<const char *>(kWindowBody), |
150 |
++ sizeof(kWindowBody)); |
151 |
+ } |
152 |
+ |
153 |
+-const char VCDiffInterleavedDecoderTest::kWindowHeader[] = { |
154 |
++const uint8_t VCDiffInterleavedDecoderTest::kWindowHeader[] = { |
155 |
+ VCD_SOURCE, // Win_Indicator: take source from dictionary |
156 |
+ FirstByteOfStringLength(kDictionary), // Source segment size |
157 |
+ SecondByteOfStringLength(kDictionary), |
158 |
+@@ -234,7 +237,7 @@ |
159 |
+ 0x00 // length of addresses for COPYs (unused) |
160 |
+ }; |
161 |
+ |
162 |
+-const char VCDiffInterleavedDecoderTest::kWindowBody[] = { |
163 |
++const uint8_t VCDiffInterleavedDecoderTest::kWindowBody[] = { |
164 |
+ 0x13, // VCD_COPY mode VCD_SELF, size 0 |
165 |
+ 0x1C, // Size of COPY (28) |
166 |
+ 0x00, // Address of COPY: Start of dictionary |
167 |
+@@ -272,8 +275,10 @@ |
168 |
+ |
169 |
+ VCDiffInterleavedDecoderTest::VCDiffInterleavedDecoderTest() { |
170 |
+ UseInterleavedFileHeader(); |
171 |
+- delta_window_header_.assign(kWindowHeader, sizeof(kWindowHeader)); |
172 |
+- delta_window_body_.assign(kWindowBody, sizeof(kWindowBody)); |
173 |
++ delta_window_header_.assign(reinterpret_cast<const char *>(kWindowHeader), |
174 |
++ sizeof(kWindowHeader)); |
175 |
++ delta_window_body_.assign(reinterpret_cast<const char *>(kWindowBody), |
176 |
++ sizeof(kWindowBody)); |
177 |
+ } |
178 |
+ |
179 |
+ } // namespace open_vcdiff |
180 |
+--- a/src/vcdecoder_test.h |
181 |
++++ b/src/vcdecoder_test.h |
182 |
+@@ -16,6 +16,7 @@ |
183 |
+ #define OPEN_VCDIFF_VCDECODER_TEST_H_ |
184 |
+ |
185 |
+ #include "google/vcdecoder.h" |
186 |
++#include <stdint.h> // utf8_t |
187 |
+ #include <string> |
188 |
+ #include "checksum.h" |
189 |
+ #include "testing.h" |
190 |
+@@ -80,7 +81,7 @@ |
191 |
+ // Assuming the length of the given string can be expressed as a VarintBE |
192 |
+ // of length N, this function returns the byte at position which_byte, where |
193 |
+ // 0 <= which_byte < N. |
194 |
+- static char GetByteFromStringLength(const char* s, int which_byte); |
195 |
++ static uint8_t GetByteFromStringLength(const char* s, int which_byte); |
196 |
+ |
197 |
+ // Assuming the length of the given string can be expressed as a one-byte |
198 |
+ // VarintBE, this function returns that byte value. |
199 |
+@@ -90,13 +91,13 @@ |
200 |
+ |
201 |
+ // Assuming the length of the given string can be expressed as a two-byte |
202 |
+ // VarintBE, this function returns the first byte of its representation. |
203 |
+- static char FirstByteOfStringLength(const char* s) { |
204 |
++ static uint8_t FirstByteOfStringLength(const char* s) { |
205 |
+ return GetByteFromStringLength(s, 0); |
206 |
+ } |
207 |
+ |
208 |
+ // Assuming the length of the given string can be expressed as a two-byte |
209 |
+ // VarintBE, this function returns the second byte of its representation. |
210 |
+- static char SecondByteOfStringLength(const char* s) { |
211 |
++ static uint8_t SecondByteOfStringLength(const char* s) { |
212 |
+ return GetByteFromStringLength(s, 1); |
213 |
+ } |
214 |
+ |
215 |
+@@ -124,8 +125,8 @@ |
216 |
+ private: |
217 |
+ // These values should only be accessed via UseStandardFileHeader() and |
218 |
+ // UseInterleavedFileHeader(). |
219 |
+- static const char kStandardFileHeader[]; |
220 |
+- static const char kInterleavedFileHeader[]; |
221 |
++ static const uint8_t kStandardFileHeader[]; |
222 |
++ static const uint8_t kInterleavedFileHeader[]; |
223 |
+ |
224 |
+ // These two counters are used by FuzzOneByteInDeltaFile() to iterate through |
225 |
+ // different ways to corrupt the delta file. |
226 |
+@@ -141,8 +142,8 @@ |
227 |
+ virtual ~VCDiffStandardDecoderTest() {} |
228 |
+ |
229 |
+ private: |
230 |
+- static const char kWindowHeader[]; |
231 |
+- static const char kWindowBody[]; |
232 |
++ static const uint8_t kWindowHeader[]; |
233 |
++ static const uint8_t kWindowBody[]; |
234 |
+ }; |
235 |
+ |
236 |
+ class VCDiffInterleavedDecoderTest : public VCDiffDecoderTest { |
237 |
+@@ -151,8 +152,8 @@ |
238 |
+ virtual ~VCDiffInterleavedDecoderTest() {} |
239 |
+ |
240 |
+ private: |
241 |
+- static const char kWindowHeader[]; |
242 |
+- static const char kWindowBody[]; |
243 |
++ static const uint8_t kWindowHeader[]; |
244 |
++ static const uint8_t kWindowBody[]; |
245 |
+ }; |
246 |
+ |
247 |
+ } // namespace open_vcdiff |
248 |
|
249 |
diff --git a/dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild b/dev-util/open-vcdiff/open-vcdiff-0.8.4-r1.ebuild |
250 |
similarity index 72% |
251 |
copy from dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild |
252 |
copy to dev-util/open-vcdiff/open-vcdiff-0.8.4-r1.ebuild |
253 |
index d4cb3e85905..18324677305 100644 |
254 |
--- a/dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild |
255 |
+++ b/dev-util/open-vcdiff/open-vcdiff-0.8.4-r1.ebuild |
256 |
@@ -1,9 +1,7 @@ |
257 |
-# Copyright 1999-2014 Gentoo Foundation |
258 |
+# Copyright 1999-2017 Gentoo Foundation |
259 |
# Distributed under the terms of the GNU General Public License v2 |
260 |
|
261 |
-EAPI=5 |
262 |
- |
263 |
-inherit eutils |
264 |
+EAPI=6 |
265 |
|
266 |
DESCRIPTION="An encoder/decoder for the VCDIFF (RFC3284) format" |
267 |
HOMEPAGE="https://github.com/google/open-vcdiff" |
268 |
@@ -14,11 +12,13 @@ SLOT="0/0" |
269 |
KEYWORDS="~amd64 ~x86" |
270 |
IUSE="" |
271 |
|
272 |
+PATCHES=( "${FILESDIR}"/${P}-gcc6.patch ) |
273 |
+ |
274 |
src_configure() { |
275 |
econf --disable-static |
276 |
} |
277 |
|
278 |
src_install() { |
279 |
- emake DESTDIR="${D}" install |
280 |
- prune_libtool_files |
281 |
+ default |
282 |
+ find "${D}" -name '*.la' -delete || die |
283 |
} |
284 |
|
285 |
diff --git a/dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild b/dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild |
286 |
index d4cb3e85905..2cf96cbd62d 100644 |
287 |
--- a/dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild |
288 |
+++ b/dev-util/open-vcdiff/open-vcdiff-0.8.4.ebuild |
289 |
@@ -1,4 +1,4 @@ |
290 |
-# Copyright 1999-2014 Gentoo Foundation |
291 |
+# Copyright 1999-2017 Gentoo Foundation |
292 |
# Distributed under the terms of the GNU General Public License v2 |
293 |
|
294 |
EAPI=5 |
295 |
@@ -14,6 +14,10 @@ SLOT="0/0" |
296 |
KEYWORDS="~amd64 ~x86" |
297 |
IUSE="" |
298 |
|
299 |
+src_prepare() { |
300 |
+ epatch "${FILESDIR}"/${P}-gcc6.patch |
301 |
+} |
302 |
+ |
303 |
src_configure() { |
304 |
econf --disable-static |
305 |
} |