1 |
commit: 8ac83bdb7f1ff6563756fc11007b39e685f0e6b1 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 30 21:12:49 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 30 21:12:49 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde-sunset.git;a=commit;h=8ac83bdb |
7 |
|
8 |
x11-libs/qt-meta: Add libpng 1.5 patch, as requested by Poly-C. Fixes bug #384953. |
9 |
|
10 |
(Portage version: 2.2.0_alpha60/git/Linux x86_64, signed Manifest commit with key 42B9401D) |
11 |
|
12 |
--- |
13 |
x11-libs/qt-meta/ChangeLog | 6 +- |
14 |
x11-libs/qt-meta/files/qt-3.3.8-libpng14.patch | 42 ----- |
15 |
x11-libs/qt-meta/files/qt-3.3.8-libpng15.patch | 212 ++++++++++++++++++++++++ |
16 |
x11-libs/qt-meta/qt-meta-3.3.8b-r2.ebuild | 4 +- |
17 |
4 files changed, 219 insertions(+), 45 deletions(-) |
18 |
|
19 |
diff --git a/x11-libs/qt-meta/ChangeLog b/x11-libs/qt-meta/ChangeLog |
20 |
index 1f51c66..5aeda1e 100644 |
21 |
--- a/x11-libs/qt-meta/ChangeLog |
22 |
+++ b/x11-libs/qt-meta/ChangeLog |
23 |
@@ -1,7 +1,11 @@ |
24 |
-# ChangeLog for x11-libs/qt |
25 |
+# ChangeLog for x11-libs/qt-meta |
26 |
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 |
27 |
# $Header: /var/cvsroot/gentoo-x86/x11-libs/qt/ChangeLog,v 1.586 2009/08/02 21:54:28 tommy Exp $ |
28 |
|
29 |
+ 30 Sep 2011; Michał Górny <mgorny@g.o> qt-meta-3.3.8b-r2.ebuild, |
30 |
+ -files/qt-3.3.8-libpng14.patch, +files/qt-3.3.8-libpng15.patch: |
31 |
+ Add libpng 1.5 patch, as requested by Poly-C. Fixes bug #384953. |
32 |
+ |
33 |
28 Feb 2011; Hanno Boeck <hanno@g.o> qt-3.3.8b-r1.ebuild, |
34 |
qt-3.3.8b-r2.ebuild: |
35 |
Change dependency from media-libs/jpeg to virtual/jpeg. |
36 |
|
37 |
diff --git a/x11-libs/qt-meta/files/qt-3.3.8-libpng14.patch b/x11-libs/qt-meta/files/qt-3.3.8-libpng14.patch |
38 |
deleted file mode 100644 |
39 |
index 8906e6f..0000000 |
40 |
--- a/x11-libs/qt-meta/files/qt-3.3.8-libpng14.patch |
41 |
+++ /dev/null |
42 |
@@ -1,42 +0,0 @@ |
43 |
---- qt-x11-free-3.3.8b-x/src/kernel/qpngio.cpp 2008-01-15 20:09:13.000000000 +0100 |
44 |
-+++ qt-x11-free-3.3.8b/src/kernel/qpngio.cpp 2010-02-16 00:13:11.000000000 +0100 |
45 |
-@@ -162,7 +162,11 @@ |
46 |
- image.setColor( i, qRgba(c,c,c,0xff) ); |
47 |
- } |
48 |
- if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { |
49 |
-+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) |
50 |
-+ const int g = info_ptr->trans_color.gray; |
51 |
-+#else |
52 |
- const int g = info_ptr->trans_values.gray; |
53 |
-+#endif |
54 |
- if (g < ncols) { |
55 |
- image.setAlphaBuffer(TRUE); |
56 |
- image.setColor(g, image.color(g) & RGB_MASK); |
57 |
-@@ -190,7 +194,11 @@ |
58 |
- info_ptr->palette[i].red, |
59 |
- info_ptr->palette[i].green, |
60 |
- info_ptr->palette[i].blue, |
61 |
-+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) |
62 |
-+ info_ptr->trans_alpha[i] |
63 |
-+#else |
64 |
- info_ptr->trans[i] |
65 |
-+#endif |
66 |
- ) |
67 |
- ); |
68 |
- i++; |
69 |
-@@ -324,9 +332,15 @@ |
70 |
- png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) |
71 |
- if (image.depth()==32 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { |
72 |
- QRgb trans = 0xFF000000 | qRgb( |
73 |
-+#if PNG_LIBPNG_VER_MAJOR>1 || ( PNG_LIBPNG_VER_MAJOR==1 && PNG_LIBPNG_VER_MINOR>=4 ) |
74 |
-+ (info_ptr->trans_color.red << 8 >> bit_depth)&0xff, |
75 |
-+ (info_ptr->trans_color.green << 8 >> bit_depth)&0xff, |
76 |
-+ (info_ptr->trans_color.blue << 8 >> bit_depth)&0xff); |
77 |
-+#else |
78 |
- (info_ptr->trans_values.red << 8 >> bit_depth)&0xff, |
79 |
- (info_ptr->trans_values.green << 8 >> bit_depth)&0xff, |
80 |
- (info_ptr->trans_values.blue << 8 >> bit_depth)&0xff); |
81 |
-+#endif |
82 |
- for (uint y=0; y<height; y++) { |
83 |
- for (uint x=0; x<info_ptr->width; x++) { |
84 |
- if (((uint**)jt)[y][x] == trans) { |
85 |
|
86 |
diff --git a/x11-libs/qt-meta/files/qt-3.3.8-libpng15.patch b/x11-libs/qt-meta/files/qt-3.3.8-libpng15.patch |
87 |
new file mode 100644 |
88 |
index 0000000..e64fea3 |
89 |
--- /dev/null |
90 |
+++ b/x11-libs/qt-meta/files/qt-3.3.8-libpng15.patch |
91 |
@@ -0,0 +1,212 @@ |
92 |
+$NetBSD: patch-as,v 1.5 2011/03/25 15:28:26 wiz Exp $ |
93 |
+ |
94 |
+--- src/kernel/qpngio.cpp.orig 2007-02-02 10:01:15.000000000 -0400 |
95 |
++++ src/kernel/qpngio.cpp |
96 |
+@@ -43,6 +43,7 @@ |
97 |
+ #include "qiodevice.h" |
98 |
+ |
99 |
+ #include <png.h> |
100 |
++#include <zlib.h> |
101 |
+ |
102 |
+ |
103 |
+ #ifdef Q_OS_TEMP |
104 |
+@@ -123,9 +124,24 @@ void setup_qt( QImage& image, png_struct |
105 |
+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, |
106 |
+ 0, 0, 0); |
107 |
+ |
108 |
++ png_colorp info_ptr_palette = NULL; |
109 |
++ int info_ptr_num_palette = 0; |
110 |
++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE)) { |
111 |
++ png_get_PLTE(png_ptr, info_ptr, &info_ptr_palette, &info_ptr_num_palette); |
112 |
++ } |
113 |
++ |
114 |
++ png_bytep info_ptr_trans_alpha = NULL; |
115 |
++ int info_ptr_num_trans = 0; |
116 |
++ png_color_16p info_ptr_trans_color = NULL; |
117 |
++ |
118 |
++ if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { |
119 |
++ png_get_tRNS(png_ptr, info_ptr, &info_ptr_trans_alpha, &info_ptr_num_trans, &info_ptr_trans_color); |
120 |
++ } |
121 |
++ |
122 |
++ |
123 |
+ if ( color_type == PNG_COLOR_TYPE_GRAY ) { |
124 |
+ // Black & White or 8-bit grayscale |
125 |
+- if ( bit_depth == 1 && info_ptr->channels == 1 ) { |
126 |
++ if ( bit_depth == 1 && png_get_channels(png_ptr, info_ptr) == 1 ) { |
127 |
+ png_set_invert_mono( png_ptr ); |
128 |
+ png_read_update_info( png_ptr, info_ptr ); |
129 |
+ if (!image.create( width, height, 1, 2, QImage::BigEndian )) |
130 |
+@@ -159,7 +175,7 @@ void setup_qt( QImage& image, png_struct |
131 |
+ image.setColor( i, qRgba(c,c,c,0xff) ); |
132 |
+ } |
133 |
+ if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { |
134 |
+- const int g = info_ptr->trans_values.gray; |
135 |
++ const int g = info_ptr_trans_color->gray; |
136 |
+ if (g < ncols) { |
137 |
+ image.setAlphaBuffer(TRUE); |
138 |
+ image.setColor(g, image.color(g) & RGB_MASK); |
139 |
+@@ -168,7 +184,7 @@ void setup_qt( QImage& image, png_struct |
140 |
+ } |
141 |
+ } else if ( color_type == PNG_COLOR_TYPE_PALETTE |
142 |
+ && png_get_valid(png_ptr, info_ptr, PNG_INFO_PLTE) |
143 |
+- && info_ptr->num_palette <= 256 ) |
144 |
++ && info_ptr_num_palette <= 256 ) |
145 |
+ { |
146 |
+ // 1-bit and 8-bit color |
147 |
+ if ( bit_depth != 1 ) |
148 |
+@@ -176,28 +192,28 @@ void setup_qt( QImage& image, png_struct |
149 |
+ png_read_update_info( png_ptr, info_ptr ); |
150 |
+ png_get_IHDR(png_ptr, info_ptr, |
151 |
+ &width, &height, &bit_depth, &color_type, 0, 0, 0); |
152 |
+- if (!image.create(width, height, bit_depth, info_ptr->num_palette, |
153 |
++ if (!image.create(width, height, bit_depth, info_ptr_num_palette, |
154 |
+ QImage::BigEndian)) |
155 |
+ return; |
156 |
+ int i = 0; |
157 |
+ if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { |
158 |
+ image.setAlphaBuffer( TRUE ); |
159 |
+- while ( i < info_ptr->num_trans ) { |
160 |
++ while ( i < info_ptr_num_trans ) { |
161 |
+ image.setColor(i, qRgba( |
162 |
+- info_ptr->palette[i].red, |
163 |
+- info_ptr->palette[i].green, |
164 |
+- info_ptr->palette[i].blue, |
165 |
+- info_ptr->trans[i] |
166 |
++ info_ptr_palette[i].red, |
167 |
++ info_ptr_palette[i].green, |
168 |
++ info_ptr_palette[i].blue, |
169 |
++ info_ptr_trans_alpha[i] |
170 |
+ ) |
171 |
+ ); |
172 |
+ i++; |
173 |
+ } |
174 |
+ } |
175 |
+- while ( i < info_ptr->num_palette ) { |
176 |
++ while ( i < info_ptr_num_palette ) { |
177 |
+ image.setColor(i, qRgba( |
178 |
+- info_ptr->palette[i].red, |
179 |
+- info_ptr->palette[i].green, |
180 |
+- info_ptr->palette[i].blue, |
181 |
++ info_ptr_palette[i].red, |
182 |
++ info_ptr_palette[i].green, |
183 |
++ info_ptr_palette[i].blue, |
184 |
+ 0xff |
185 |
+ ) |
186 |
+ ); |
187 |
+@@ -284,7 +300,7 @@ void read_png_image(QImageIO* iio) |
188 |
+ return; |
189 |
+ } |
190 |
+ |
191 |
+- if (setjmp(png_ptr->jmpbuf)) { |
192 |
++ if (setjmp(png_jmpbuf(png_ptr))) { |
193 |
+ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); |
194 |
+ iio->setStatus(-4); |
195 |
+ return; |
196 |
+@@ -469,7 +485,7 @@ bool QPNGImageWriter::writeImage(const Q |
197 |
+ return FALSE; |
198 |
+ } |
199 |
+ |
200 |
+- if (setjmp(png_ptr->jmpbuf)) { |
201 |
++ if (setjmp(png_jmpbuf(png_ptr))) { |
202 |
+ png_destroy_write_struct(&png_ptr, &info_ptr); |
203 |
+ return FALSE; |
204 |
+ } |
205 |
+@@ -491,10 +507,16 @@ bool QPNGImageWriter::writeImage(const Q |
206 |
+ |
207 |
+ png_set_write_fn(png_ptr, (void*)this, qpiw_write_fn, qpiw_flush_fn); |
208 |
+ |
209 |
++#warning XXXtnn not too sure about this |
210 |
++/* |
211 |
++according to png.h, channels is only used on read, not writes, so we |
212 |
++should be able to comment this out. |
213 |
++ |
214 |
+ info_ptr->channels = |
215 |
+ (image.depth() == 32) |
216 |
+ ? (image.hasAlphaBuffer() ? 4 : 3) |
217 |
+ : 1; |
218 |
++*/ |
219 |
+ |
220 |
+ png_set_IHDR(png_ptr, info_ptr, image.width(), image.height(), |
221 |
+ image.depth() == 1 ? 1 : 8 /* per channel */, |
222 |
+@@ -504,11 +526,12 @@ bool QPNGImageWriter::writeImage(const Q |
223 |
+ : PNG_COLOR_TYPE_RGB |
224 |
+ : PNG_COLOR_TYPE_PALETTE, 0, 0, 0); |
225 |
+ |
226 |
++ png_color_8 sig_bit; |
227 |
++ sig_bit.red = 8; |
228 |
++ sig_bit.green = 8; |
229 |
++ sig_bit.blue = 8; |
230 |
++ png_set_sBIT(png_ptr, info_ptr, &sig_bit); |
231 |
+ |
232 |
+- //png_set_sBIT(png_ptr, info_ptr, 8); |
233 |
+- info_ptr->sig_bit.red = 8; |
234 |
+- info_ptr->sig_bit.green = 8; |
235 |
+- info_ptr->sig_bit.blue = 8; |
236 |
+ |
237 |
+ if (image.depth() == 1 && image.bitOrder() == QImage::LittleEndian) |
238 |
+ png_set_packswap(png_ptr); |
239 |
+@@ -522,11 +545,14 @@ bool QPNGImageWriter::writeImage(const Q |
240 |
+ png_set_PLTE(png_ptr, info_ptr, palette, num_palette); |
241 |
+ int* trans = new int[num_palette]; |
242 |
+ int num_trans = 0; |
243 |
++ png_colorp info_ptr_palette = NULL; |
244 |
++ int tmp; |
245 |
++ png_get_PLTE(png_ptr, info_ptr, &info_ptr_palette, &tmp); |
246 |
+ for (int i=0; i<num_palette; i++) { |
247 |
+ QRgb rgb=image.color(i); |
248 |
+- info_ptr->palette[i].red = qRed(rgb); |
249 |
+- info_ptr->palette[i].green = qGreen(rgb); |
250 |
+- info_ptr->palette[i].blue = qBlue(rgb); |
251 |
++ info_ptr_palette[i].red = qRed(rgb); |
252 |
++ info_ptr_palette[i].green = qGreen(rgb); |
253 |
++ info_ptr_palette[i].blue = qBlue(rgb); |
254 |
+ if (image.hasAlphaBuffer()) { |
255 |
+ trans[i] = rgb >> 24; |
256 |
+ if (trans[i] < 255) { |
257 |
+@@ -534,6 +560,7 @@ bool QPNGImageWriter::writeImage(const Q |
258 |
+ } |
259 |
+ } |
260 |
+ } |
261 |
++ png_set_PLTE(png_ptr, info_ptr, info_ptr_palette, num_palette); |
262 |
+ if (num_trans) { |
263 |
+ copy_trans = new png_byte[num_trans]; |
264 |
+ for (int i=0; i<num_trans; i++) |
265 |
+@@ -544,7 +571,10 @@ bool QPNGImageWriter::writeImage(const Q |
266 |
+ } |
267 |
+ |
268 |
+ if ( image.hasAlphaBuffer() ) { |
269 |
+- info_ptr->sig_bit.alpha = 8; |
270 |
++ png_color_8p sig_bit; |
271 |
++ png_get_sBIT(png_ptr, info_ptr, &sig_bit); |
272 |
++ sig_bit->alpha = 8; |
273 |
++ png_set_sBIT(png_ptr, info_ptr, sig_bit); |
274 |
+ } |
275 |
+ |
276 |
+ // Swap ARGB to RGBA (normal PNG format) before saving on |
277 |
+@@ -1030,7 +1060,7 @@ int QPNGFormat::decode(QImage& img, QIma |
278 |
+ return -1; |
279 |
+ } |
280 |
+ |
281 |
+- if (setjmp((png_ptr)->jmpbuf)) { |
282 |
++ if (setjmp(png_jmpbuf(png_ptr))) { |
283 |
+ png_destroy_read_struct(&png_ptr, &info_ptr, 0); |
284 |
+ image = 0; |
285 |
+ return -1; |
286 |
+@@ -1057,7 +1087,7 @@ int QPNGFormat::decode(QImage& img, QIma |
287 |
+ |
288 |
+ if ( !png_ptr ) return 0; |
289 |
+ |
290 |
+- if (setjmp(png_ptr->jmpbuf)) { |
291 |
++ if (setjmp(png_jmpbuf(png_ptr))) { |
292 |
+ png_destroy_read_struct(&png_ptr, &info_ptr, 0); |
293 |
+ image = 0; |
294 |
+ state = MovieStart; |
295 |
+@@ -1117,7 +1147,7 @@ void QPNGFormat::end(png_structp png, pn |
296 |
+ consumer->frameDone(QPoint(offx,offy),r); |
297 |
+ consumer->end(); |
298 |
+ state = FrameStart; |
299 |
+- unused_data = (int)png->buffer_size; // Since libpng doesn't tell us |
300 |
++ unused_data = png_process_data_pause(png, 0); |
301 |
+ } |
302 |
+ |
303 |
+ #ifdef PNG_USER_CHUNKS_SUPPORTED |
304 |
|
305 |
diff --git a/x11-libs/qt-meta/qt-meta-3.3.8b-r2.ebuild b/x11-libs/qt-meta/qt-meta-3.3.8b-r2.ebuild |
306 |
index 233884d..3eabbb0 100644 |
307 |
--- a/x11-libs/qt-meta/qt-meta-3.3.8b-r2.ebuild |
308 |
+++ b/x11-libs/qt-meta/qt-meta-3.3.8b-r2.ebuild |
309 |
@@ -134,8 +134,8 @@ src_unpack() { |
310 |
# Fix CJK script rendering, bug 229567 |
311 |
epatch "${FILESDIR}"/qt-3.3.8b-cjk-fix.patch |
312 |
|
313 |
- # Fix libpng-1.4 issues |
314 |
- epatch "${FILESDIR}"/qt-3.3.8-libpng14.patch |
315 |
+ # Fix libpng-1.5 issues |
316 |
+ epatch "${FILESDIR}"/qt-3.3.8-libpng15.patch |
317 |
|
318 |
if use immqt || use immqt-bc ; then |
319 |
epatch ../${IMMQT_P}.diff |