Gentoo Archives: gentoo-commits

From: David Heidelberger <d.okias@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/x11:master commit in: x11-libs/cairo/, x11-libs/cairo/files/
Date: Fri, 24 May 2013 19:54:25
Message-Id: 1369425206.aca14123d5fa6fa0379ea285df1f497e8cdf7451.okias@gentoo
1 commit: aca14123d5fa6fa0379ea285df1f497e8cdf7451
2 Author: David Heidelberger <david.heidelberger <AT> ixit <DOT> cz>
3 AuthorDate: Fri May 24 19:53:26 2013 +0000
4 Commit: David Heidelberger <d.okias <AT> gmail <DOT> com>
5 CommitDate: Fri May 24 19:53:26 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/x11.git;a=commit;h=aca14123
7
8 x11-libs/cairo: cairo-1.12.14-r3 - added gles2 support
9
10 Package-Manager: portage-2.2.0_alpha177
11
12 ---
13 x11-libs/cairo/cairo-1.12.14-r3.ebuild | 149 ++++++++++++++++++++
14 .../cairo/files/cairo-1.10.0-buggy_gradients.patch | 17 +++
15 .../cairo/files/cairo-1.10.2-export-symbols.patch | 38 +++++
16 x11-libs/cairo/files/cairo-1.10.2-interix.patch | 36 +++++
17 x11-libs/cairo/files/cairo-1.10.2-qt-surface.patch | 55 +++++++
18 x11-libs/cairo/files/cairo-1.10.2-ubuntu.patch | 53 +++++++
19 .../files/cairo-1.12.10-xlib-corruption.patch | 90 ++++++++++++
20 .../files/cairo-1.12.10-xshm-corruption.patch | 28 ++++
21 .../files/cairo-1.12.12-disable-test-suite.patch | 12 ++
22 x11-libs/cairo/files/cairo-1.12.14-libpng16.patch | 40 ++++++
23 x11-libs/cairo/files/cairo-1.8.8-interix.patch | 16 ++
24 .../cairo/files/cairo-respect-fontconfig.patch | 13 ++
25 x11-libs/cairo/metadata.xml | 19 +++
26 13 files changed, 566 insertions(+), 0 deletions(-)
27
28 diff --git a/x11-libs/cairo/cairo-1.12.14-r3.ebuild b/x11-libs/cairo/cairo-1.12.14-r3.ebuild
29 new file mode 100644
30 index 0000000..1cd714a
31 --- /dev/null
32 +++ b/x11-libs/cairo/cairo-1.12.14-r3.ebuild
33 @@ -0,0 +1,149 @@
34 +# Copyright 1999-2013 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +# $Header: /var/cvsroot/gentoo-x86/x11-libs/cairo/cairo-1.12.14-r2.ebuild,v 1.1 2013/04/27 10:25:10 ssuominen Exp $
37 +
38 +EAPI=5
39 +
40 +inherit eutils flag-o-matic autotools
41 +
42 +if [[ ${PV} == *9999* ]]; then
43 + inherit git-2
44 + EGIT_REPO_URI="git://anongit.freedesktop.org/git/cairo"
45 + SRC_URI=""
46 + KEYWORDS=""
47 +else
48 + SRC_URI="http://cairographics.org/releases/${P}.tar.xz"
49 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
50 +fi
51 +
52 +DESCRIPTION="A vector graphics library with cross-device output support"
53 +HOMEPAGE="http://cairographics.org/"
54 +LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
55 +SLOT="0"
56 +IUSE="X aqua debug directfb doc drm gallium gles2 +glib legacy-drivers opengl openvg qt4 static-libs +svg xcb"
57 +
58 +# Test causes a circular depend on gtk+... since gtk+ needs cairo but test needs gtk+ so we need to block it
59 +RESTRICT="test"
60 +
61 +RDEPEND="media-libs/fontconfig
62 + media-libs/freetype:2
63 + media-libs/libpng:0=
64 + sys-libs/zlib
65 + >=x11-libs/pixman-0.28.0
66 + directfb? ( dev-libs/DirectFB )
67 + gles2? ( media-libs/mesa[gles2] )
68 + glib? ( >=dev-libs/glib-2.28.6:2 )
69 + opengl? ( || ( media-libs/mesa[egl] media-libs/opengl-apple ) )
70 + openvg? ( media-libs/mesa[openvg] )
71 + qt4? ( >=dev-qt/qtgui-4.8:4 )
72 + X? (
73 + >=x11-libs/libXrender-0.6
74 + x11-libs/libXext
75 + x11-libs/libX11
76 + drm? (
77 + >=virtual/udev-136
78 + gallium? ( media-libs/mesa[gallium] )
79 + )
80 + )
81 + xcb? (
82 + x11-libs/libxcb
83 + x11-libs/xcb-util
84 + )"
85 +DEPEND="${RDEPEND}
86 + virtual/pkgconfig
87 + >=sys-devel/libtool-2
88 + doc? (
89 + >=dev-util/gtk-doc-1.6
90 + ~app-text/docbook-xml-dtd-4.2
91 + )
92 + X? (
93 + x11-proto/renderproto
94 + drm? (
95 + x11-proto/xproto
96 + >=x11-proto/xextproto-7.1
97 + )
98 + )"
99 +
100 +# drm module requires X
101 +# for gallium we need to enable drm
102 +REQUIRED_USE="
103 + gles2? ( !opengl )
104 + drm? ( X )
105 + gallium? ( drm )
106 +"
107 +
108 +src_prepare() {
109 + epatch "${FILESDIR}"/${PN}-1.8.8-interix.patch
110 + use legacy-drivers && epatch "${FILESDIR}"/${PN}-1.10.0-buggy_gradients.patch
111 + epatch "${FILESDIR}"/${PN}-respect-fontconfig.patch
112 + epatch "${FILESDIR}"/${PN}-1.12.12-disable-test-suite.patch
113 + epatch "${FILESDIR}"/${PN}-1.12.14-libpng16.patch
114 + epatch_user
115 +
116 + # Slightly messed build system YAY
117 + if [[ ${PV} == *9999* ]]; then
118 + touch boilerplate/Makefile.am.features
119 + touch src/Makefile.am.features
120 + touch ChangeLog
121 + fi
122 +
123 + # We need to run elibtoolize to ensure correct so versioning on FreeBSD
124 + # upgraded to an eautoreconf for the above interix patch.
125 + eautoreconf
126 +}
127 +
128 +src_configure() {
129 + local myopts
130 +
131 + # SuperH doesn't have native atomics yet
132 + use sh && myopts+=" --disable-atomic"
133 +
134 + [[ ${CHOST} == *-interix* ]] && append-flags -D_REENTRANT
135 + # http://bugs.freedesktop.org/show_bug.cgi?id=15463
136 + [[ ${CHOST} == *-solaris* ]] && append-flags -D_POSIX_PTHREAD_SEMANTICS
137 +
138 + #gets rid of fbmmx.c inlining warnings
139 + append-flags -finline-limit=1200
140 +
141 + use X && myopts+=" --enable-tee=yes"
142 +
143 + use elibc_FreeBSD && myopts+=" --disable-symbol-lookup"
144 +
145 + # --disable-valgrind:
146 + # valgrind code is busted as per upstream
147 + econf \
148 + --disable-dependency-tracking \
149 + $(use_with X x) \
150 + $(use_enable X xlib) \
151 + $(use_enable X xlib-xrender) \
152 + $(use_enable aqua quartz) \
153 + $(use_enable aqua quartz-image) \
154 + $(use_enable debug test-surfaces) \
155 + $(use_enable directfb) \
156 + $(use_enable gles2 glesv2) \
157 + $(use_enable glib gobject) \
158 + $(use_enable doc gtk-doc) \
159 + $(use_enable openvg vg) \
160 + $(use_enable opengl gl) \
161 + $(use_enable qt4 qt) \
162 + $(use_enable static-libs static) \
163 + $(use_enable svg) \
164 + $(use_enable xcb) \
165 + $(use_enable xcb xcb-shm) \
166 +# $(use_enable xcb xlib-xcb) \
167 + $(use_enable drm) \
168 + $(use_enable gallium) \
169 + --enable-ft \
170 + --enable-pdf \
171 + --enable-png \
172 + --enable-ps \
173 + --disable-valgrind \
174 + ${myopts}
175 +}
176 +
177 +src_install() {
178 + # parallel make install fails
179 + emake -j1 DESTDIR="${D}" install
180 + find "${ED}" -name '*.la' -exec rm -f {} +
181 + dodoc AUTHORS ChangeLog NEWS README
182 +}
183
184 diff --git a/x11-libs/cairo/files/cairo-1.10.0-buggy_gradients.patch b/x11-libs/cairo/files/cairo-1.10.0-buggy_gradients.patch
185 new file mode 100644
186 index 0000000..a58c2f8
187 --- /dev/null
188 +++ b/x11-libs/cairo/files/cairo-1.10.0-buggy_gradients.patch
189 @@ -0,0 +1,17 @@
190 +http://repos.archlinux.org/wsvn/packages/cairo/trunk/cairo-1.10.0-buggy_gradients.patch
191 +http://bugs.gentoo.org/336696
192 +
193 +--- src/cairo-xlib-display.c
194 ++++ src/cairo-xlib-display.c
195 +@@ -353,11 +353,7 @@
196 + /* Prior to Render 0.10, there is no protocol support for gradients and
197 + * we call function stubs instead, which would silently consume the drawing.
198 + */
199 +-#if RENDER_MAJOR == 0 && RENDER_MINOR < 10
200 + display->buggy_gradients = TRUE;
201 +-#else
202 +- display->buggy_gradients = FALSE;
203 +-#endif
204 + display->buggy_pad_reflect = FALSE;
205 + display->buggy_repeat = FALSE;
206 +
207
208 diff --git a/x11-libs/cairo/files/cairo-1.10.2-export-symbols.patch b/x11-libs/cairo/files/cairo-1.10.2-export-symbols.patch
209 new file mode 100644
210 index 0000000..5f1c2d4
211 --- /dev/null
212 +++ b/x11-libs/cairo/files/cairo-1.10.2-export-symbols.patch
213 @@ -0,0 +1,38 @@
214 +Index: cairo/src/Makefile.am
215 +===================================================================
216 +--- cairo.orig/src/Makefile.am 2011-02-08 10:11:46.879538772 +0100
217 ++++ cairo/src/Makefile.am 2011-02-08 10:12:36.381915666 +0100
218 +@@ -46,7 +46,7 @@
219 + $(enabled_cairo_private) \
220 + $(enabled_cairo_sources) \
221 + $(NULL)
222 +-libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
223 ++libcairo_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -export-symbols-regex \^cairo_.*
224 + libcairo_la_LIBADD = $(CAIRO_LIBS) \
225 + $(cairo_cxx_lib)
226 + libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(cairo_cxx_lib)
227 +diff --git a/util/cairo-gobject/Makefile.am b/util/cairo-gobject/Makefile.am
228 +index 22c1a27..5a15950 100644
229 +--- a/util/cairo-gobject/Makefile.am
230 ++++ b/util/cairo-gobject/Makefile.am
231 +@@ -10,6 +10,6 @@ libcairo_gobject_la_SOURCES = \
232 + $(NULL)
233 +
234 + libcairo_gobject_la_CFLAGS = $(CAIRO_CFLAGS) $(GOBJECT_CFLAGS)
235 +-libcairo_gobject_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
236 ++libcairo_gobject_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -export-symbols-regex \^cairo_.*
237 + libcairo_gobject_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LIBS) $(GOBJECT_LIBS)
238 +
239 +diff --git a/util/cairo-script/Makefile.am b/util/cairo-script/Makefile.am
240 +index d7e4427..8d4181b 100644
241 +--- a/util/cairo-script/Makefile.am
242 ++++ b/util/cairo-script/Makefile.am
243 +@@ -18,7 +18,7 @@ libcairo_script_interpreter_la_SOURCES = \
244 + cairo-script-stack.c \
245 + $(NULL)
246 + libcairo_script_interpreter_la_CFLAGS = $(CAIRO_CFLAGS)
247 +-libcairo_script_interpreter_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols)
248 ++libcairo_script_interpreter_la_LDFLAGS = -version-info $(CAIRO_LIBTOOL_VERSION_INFO) -no-undefined $(export_symbols) -export-symbols-regex \^cairo_.*
249 + libcairo_script_interpreter_la_LIBADD = $(top_builddir)/src/libcairo.la $(CAIRO_LIBS) -lz
250 +
251 + csi_replay_SOURCES = csi-replay.c
252
253 diff --git a/x11-libs/cairo/files/cairo-1.10.2-interix.patch b/x11-libs/cairo/files/cairo-1.10.2-interix.patch
254 new file mode 100644
255 index 0000000..3333e3e
256 --- /dev/null
257 +++ b/x11-libs/cairo/files/cairo-1.10.2-interix.patch
258 @@ -0,0 +1,36 @@
259 +commit 95f6f7a174ca096a3d3dbe84ff220d166d1e2baa
260 +Author: Uli Schlachter <psychon@×××.in>
261 +Date: Fri Oct 22 11:54:57 2010 +0200
262 +
263 + Make both versions of _cairo_lround consistent again
264 +
265 + Commit c0008242b0f made cairo use libm's lround instead of its own _cairo_lround
266 + by default. However, since commit ce58f874 from 2006, _cairo_lround does
267 + arithmetic rounding instead of away-from-zero rounding (before said commit, it
268 + was using baker's rounding).
269 +
270 + So to make the rounding of _cairo_lround be independent from
271 + DISABLE_SOME_FLOATING_POINT, we have to use another function. Turns out that
272 + _cairo_round already does the same thing that _cairo_lround does. Their only
273 + difference is the return type.
274 +
275 + Signed-off-by: Uli Schlachter <psychon@×××.in>
276 + Signed-off-by: Chris Wilson <chris@×××××××××××××××.uk>
277 +
278 +diff --git a/src/cairoint.h b/src/cairoint.h
279 +index 53c87e5..539d92e 100644
280 +--- a/src/cairoint.h
281 ++++ b/src/cairoint.h
282 +@@ -968,7 +968,11 @@ _cairo_round (double r)
283 + cairo_private int
284 + _cairo_lround (double d) cairo_const;
285 + #else
286 +-#define _cairo_lround lround
287 ++static inline int cairo_const
288 ++_cairo_lround (double r)
289 ++{
290 ++ return _cairo_round (r);
291 ++}
292 + #endif
293 +
294 + cairo_private uint16_t
295
296 diff --git a/x11-libs/cairo/files/cairo-1.10.2-qt-surface.patch b/x11-libs/cairo/files/cairo-1.10.2-qt-surface.patch
297 new file mode 100644
298 index 0000000..cf0b57a
299 --- /dev/null
300 +++ b/x11-libs/cairo/files/cairo-1.10.2-qt-surface.patch
301 @@ -0,0 +1,55 @@
302 +diff -ruN cairo-1.10.2-0-vanilla/src/cairo-qt-surface.cpp cairo-1.10.2/src/cairo-qt-surface.cpp
303 +--- cairo-1.10.2-0-vanilla/src/cairo-qt-surface.cpp 2010-12-25 15:21:34.000000000 +0100
304 ++++ cairo-1.10.2/src/cairo-qt-surface.cpp 2011-12-20 22:59:30.000000000 +0100
305 +@@ -61,7 +61,9 @@
306 + #include <QtGui/QX11Info>
307 + #include <QtCore/QVarLengthArray>
308 +
309 +-#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
310 ++#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0))
311 ++#include <QtGui/QGlyphRun>
312 ++#elif (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
313 + extern void qt_draw_glyphs(QPainter *, const quint32 *glyphs, const QPointF *positions, int count);
314 + #endif
315 +
316 +@@ -1370,7 +1372,39 @@
317 + cairo_clip_t *clip,
318 + int *remaining_glyphs)
319 + {
320 +-#if (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
321 ++#if (QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)) && !defined(QT_NO_RAWFONT)
322 ++ cairo_qt_surface_t *qs = (cairo_qt_surface_t *) abstract_surface;
323 ++
324 ++ // pick out the colour to use from the cairo source
325 ++ cairo_solid_pattern_t *solid = (cairo_solid_pattern_t*) source;
326 ++ // documentation says you have to freeze the cache, but I don't believe it
327 ++ _cairo_scaled_font_freeze_cache(scaled_font);
328 ++
329 ++ QColor tempColour(solid->color.red * 255, solid->color.green * 255, solid->color.blue * 255);
330 ++ QVector<QPointF> positions(num_glyphs);
331 ++ QVector<unsigned int> glyphss(num_glyphs);
332 ++ FT_Face face = cairo_ft_scaled_font_lock_face (scaled_font);
333 ++ const FT_Size_Metrics& ftMetrics = face->size->metrics;
334 ++ QFont font(face->family_name);
335 ++ font.setStyleStrategy(QFont::NoFontMerging);
336 ++ font.setBold(face->style_flags & FT_STYLE_FLAG_BOLD);
337 ++ font.setItalic(face->style_flags & FT_STYLE_FLAG_ITALIC);
338 ++ font.setKerning(face->face_flags & FT_FACE_FLAG_KERNING);
339 ++ font.setPixelSize(ftMetrics.y_ppem);
340 ++ cairo_ft_scaled_font_unlock_face(scaled_font);
341 ++ qs->p->setFont(font);
342 ++ qs->p->setPen(tempColour);
343 ++ for (int currentGlyph = 0; currentGlyph < num_glyphs; currentGlyph++) {
344 ++ positions.append(QPointF(glyphs[currentGlyph].x, glyphs[currentGlyph].y));
345 ++ glyphss.append(glyphs[currentGlyph].index);
346 ++ }
347 ++ QGlyphRun qglyphs;
348 ++ qglyphs.setGlyphIndexes(glyphss);
349 ++ qglyphs.setPositions(positions);
350 ++ qs->p->drawGlyphRun(QPointF(), qglyphs);
351 ++ _cairo_scaled_font_thaw_cache(scaled_font);
352 ++ return CAIRO_INT_STATUS_SUCCESS;
353 ++#elif (QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)) || defined(QT_GLYPHS_API_BACKPORT)
354 + cairo_qt_surface_t *qs = (cairo_qt_surface_t *) abstract_surface;
355 +
356 + // pick out the colour to use from the cairo source
357
358 diff --git a/x11-libs/cairo/files/cairo-1.10.2-ubuntu.patch b/x11-libs/cairo/files/cairo-1.10.2-ubuntu.patch
359 new file mode 100644
360 index 0000000..751bbd4
361 --- /dev/null
362 +++ b/x11-libs/cairo/files/cairo-1.10.2-ubuntu.patch
363 @@ -0,0 +1,53 @@
364 +--- cairo.orig/build/configure.ac.features 2010-12-28 14:41:21.487225155 +0100
365 ++++ cairo/build/configure.ac.features 2010-12-28 14:42:06.166239606 +0100
366 +@@ -407,6 +407,7 @@
367 + echo "The following features and utilities:"
368 + echo " cairo-trace: $use_trace"
369 + echo " cairo-script-interpreter: $use_interpreter"
370 ++ echo " cairo-perf-utils: $use_perf_utils"
371 + echo ""
372 + echo "And the following internal features:"
373 + echo " pthread: $use_pthread"
374 +--- cairo.orig/configure.ac 2010-12-28 14:43:02.291226995 +0100
375 ++++ cairo/configure.ac 2010-12-28 14:43:18.191141863 +0100
376 +@@ -10,6 +10,7 @@
377 + AC_CONFIG_SRCDIR(src/cairo.h)
378 + AC_CONFIG_HEADERS(config.h)
379 + AM_INIT_AUTOMAKE([1.9.6 gnu -Wall no-define])
380 ++AM_MAINTAINER_MODE
381 + m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
382 + AC_LIBTOOL_WIN32_DLL dnl Must be called before AC_PROG_LIBTOOL
383 + AC_PROG_LIBTOOL dnl ([1.4]) Don't remove!
384 +@@ -796,6 +796,11 @@
385 + PKG_CHECK_MODULES(gtk, "gtk+-2.0",have_gtk=yes, have_gtk=no)
386 + AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
387 +
388 ++dnl ===========================================================================
389 ++
390 ++CAIRO_ENABLE(perf_utils, cairo-perf-utils, no, [use_perf_utils=yes])
391 ++
392 ++
393 + AC_CONFIG_FILES([
394 + Makefile
395 + boilerplate/Makefile
396 +--- cairo.orig/perf/Makefile.am 2010-06-18 13:47:11.000000000 +0200
397 ++++ cairo/perf/Makefile.am 2010-12-28 14:42:06.162226875 +0100
398 +@@ -10,6 +10,18 @@
399 +
400 + AM_LDFLAGS = $(CAIRO_LDFLAGS)
401 +
402 ++if CAIRO_HAS_PERF_UTILS
403 ++bin_PROGRAMS = cairo-perf-micro \
404 ++ cairo-perf-trace \
405 ++ cairo-perf-diff-files \
406 ++ cairo-perf-print \
407 ++ cairo-perf-chart \
408 ++ cairo-perf-compare-backends
409 ++if HAVE_GTK
410 ++bin_PROGRAMS += cairo-perf-graph-files
411 ++endif
412 ++endif
413 ++
414 + EXTRA_PROGRAMS += cairo-perf-micro \
415 + cairo-perf-trace \
416 + cairo-perf-diff-files \
417
418 diff --git a/x11-libs/cairo/files/cairo-1.12.10-xlib-corruption.patch b/x11-libs/cairo/files/cairo-1.12.10-xlib-corruption.patch
419 new file mode 100644
420 index 0000000..84bab57
421 --- /dev/null
422 +++ b/x11-libs/cairo/files/cairo-1.12.10-xlib-corruption.patch
423 @@ -0,0 +1,90 @@
424 +From fa4f48cccb6c7f4e1afb2ff4b98b906b7d8d4afc Mon Sep 17 00:00:00 2001
425 +From: Chris Wilson <chris@×××××××××××××××.uk>
426 +Date: Wed, 23 Jan 2013 15:04:26 +0000
427 +Subject: xlib: Do not upload the whole image just because we want an entire row
428 +
429 +Fixes regression exposed by
430 +
431 +commit a73e7ff0186176bc82cd3ae1432c054c1fd3aebd
432 +Author: Chris Wilson <chris@×××××××××××××××.uk>
433 +Date: Sun Jan 6 11:29:27 2013 +0000
434 +
435 + xlib: Simplify source creation by use of map-to-image
436 +
437 +but ultimately from
438 +
439 +commit 74941f822015cc50cd8477d0cf97f1a70dbff60b
440 +Author: Chris Wilson <chris@×××××××××××××××.uk>
441 +Date: Wed Jan 2 22:27:55 2013 +0000
442 +
443 + xlib: Use SHM transport for ordinary image uploads
444 +
445 +Reported-by: Gökçen Eraslan <gokcen.eraslan@×××××.com>
446 +Reported-by: Guillaume Ayoub <guillaume.ayoub@×××××.fr>
447 +Reported-by: Emmanuel Benisty <benisty.e@×××××.com>
448 +Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59635
449 +Signed-off-by: Chris Wilson <chris@×××××××××××××××.uk>
450 +---
451 +diff --git a/src/cairo-xlib-source.c b/src/cairo-xlib-source.c
452 +index 24290f7..ca55278 100644
453 +--- a/src/cairo-xlib-source.c
454 ++++ b/src/cairo-xlib-source.c
455 +@@ -1035,7 +1035,13 @@ surface_source (cairo_xlib_surface_t *dst,
456 +
457 + status = _cairo_surface_unmap_image (&xsrc->base, image);
458 + if (unlikely (status)) {
459 +- cairo_surface_destroy (src);
460 ++ cairo_surface_destroy (&xsrc->base);
461 ++ return _cairo_surface_create_in_error (status);
462 ++ }
463 ++
464 ++ status = _cairo_xlib_surface_put_shm (xsrc);
465 ++ if (unlikely (status)) {
466 ++ cairo_surface_destroy (&xsrc->base);
467 + return _cairo_surface_create_in_error (status);
468 + }
469 + }
470 +diff --git a/src/cairo-xlib-surface.c b/src/cairo-xlib-surface.c
471 +index dbc677e..ee69b66 100644
472 +--- a/src/cairo-xlib-surface.c
473 ++++ b/src/cairo-xlib-surface.c
474 +@@ -1139,26 +1139,24 @@ _cairo_xlib_surface_draw_image (cairo_xlib_surface_t *surface,
475 + max_request_size = XMaxRequestSize (display->display);
476 + if (max_request_size > 8192)
477 + max_request_size = 8192;
478 +- if (image->stride * image->height > max_request_size) {
479 ++ if (width * height * 4 > max_request_size) {
480 + shm_image = _cairo_xlib_surface_create_shm__image (surface,
481 + image->pixman_format,
482 +- image->width,
483 +- image->height);
484 ++ width, height);
485 + if (shm_image && shm_image->status == CAIRO_STATUS_SUCCESS) {
486 + cairo_image_surface_t *clone = (cairo_image_surface_t *) shm_image;
487 +- if (clone->stride == image->stride) {
488 +- memcpy (clone->data, image->data, clone->stride * clone->height);
489 +- } else {
490 +- pixman_image_composite32 (PIXMAN_OP_SRC,
491 +- image->pixman_image, NULL, clone->pixman_image,
492 +- 0, 0,
493 +- 0, 0,
494 +- 0, 0,
495 +- image->width, image->height);
496 +- }
497 ++ pixman_image_composite32 (PIXMAN_OP_SRC,
498 ++ image->pixman_image, NULL, clone->pixman_image,
499 ++ src_x, src_y,
500 ++ 0, 0,
501 ++ 0, 0,
502 ++ width, height);
503 + ximage.obdata = _cairo_xlib_shm_surface_get_obdata (shm_image);
504 + ximage.data = (char *)clone->data;
505 + ximage.bytes_per_line = clone->stride;
506 ++ ximage.width = width;
507 ++ ximage.height = height;
508 ++ src_x = src_y = 0;
509 + }
510 + }
511 + } else
512 +--
513 +cgit v0.9.0.2-2-gbebe
514
515 diff --git a/x11-libs/cairo/files/cairo-1.12.10-xshm-corruption.patch b/x11-libs/cairo/files/cairo-1.12.10-xshm-corruption.patch
516 new file mode 100644
517 index 0000000..92bf134
518 --- /dev/null
519 +++ b/x11-libs/cairo/files/cairo-1.12.10-xshm-corruption.patch
520 @@ -0,0 +1,28 @@
521 +From c006b886d28a772d7a62cec52ab7e0c8196c36f6 Mon Sep 17 00:00:00 2001
522 +From: Chris Wilson <chris@×××××××××××××××.uk>
523 +Date: Tue, 29 Jan 2013 03:01:31 +0000
524 +Subject: xlib/shm: Force synchronisation for scratch SHM image buffers
525 +
526 +The scratch image buffers are used for uploads to the xserver and so we
527 +must be careful not to overwrite active SHM segments. Unfortunately we
528 +told the core SHM allocator that we would sync before using the images,
529 +which was a lie.
530 +
531 +Reported-by: Michael Natterer <mitch@××××.org>
532 +Signed-off-by: Chris Wilson <chris@×××××××××××××××.uk>
533 +---
534 +diff --git a/src/cairo-xlib-surface-shm.c b/src/cairo-xlib-surface-shm.c
535 +index 43cecdf..32c7033 100644
536 +--- a/src/cairo-xlib-surface-shm.c
537 ++++ b/src/cairo-xlib-surface-shm.c
538 +@@ -1155,7 +1155,7 @@ _cairo_xlib_surface_create_shm__image (cairo_xlib_surface_t *surface,
539 + return NULL;
540 +
541 + return &_cairo_xlib_shm_surface_create (surface, format, width, height,
542 +- TRUE, 0)->image.base;
543 ++ FALSE, 0)->image.base;
544 + }
545 +
546 + cairo_surface_t *
547 +--
548 +cgit v0.9.0.2-2-gbebe
549
550 diff --git a/x11-libs/cairo/files/cairo-1.12.12-disable-test-suite.patch b/x11-libs/cairo/files/cairo-1.12.12-disable-test-suite.patch
551 new file mode 100644
552 index 0000000..37033d7
553 --- /dev/null
554 +++ b/x11-libs/cairo/files/cairo-1.12.12-disable-test-suite.patch
555 @@ -0,0 +1,12 @@
556 +diff -ruN cairo-1.12.10.orig/test/Makefile.am cairo-1.12.10/test/Makefile.am
557 +--- cairo-1.12.10.orig/test/Makefile.am 2013-01-27 14:56:03.345178612 -0800
558 ++++ cairo-1.12.10/test/Makefile.am 2013-01-27 14:56:15.371177856 -0800
559 +@@ -71,8 +71,6 @@
560 + endif
561 + test_sources += $(test)
562 +
563 +-noinst_PROGRAMS = cairo-test-suite$(EXEEXT) # always build
564 +-
565 + TESTS += cairo-test-suite$(EXEEXT)
566 +
567 + cairo-test-constructors.c: Makefile $(test_sources) make-cairo-test-constructors.sh
568
569 diff --git a/x11-libs/cairo/files/cairo-1.12.14-libpng16.patch b/x11-libs/cairo/files/cairo-1.12.14-libpng16.patch
570 new file mode 100644
571 index 0000000..c163178
572 --- /dev/null
573 +++ b/x11-libs/cairo/files/cairo-1.12.14-libpng16.patch
574 @@ -0,0 +1,40 @@
575 +From 2dd2c826a5b367d32cf2d48ed69754795990c5db Mon Sep 17 00:00:00 2001
576 +From: Chris Wilson <chris@×××××××××××××××.uk>
577 +Date: Tue, 16 Apr 2013 09:58:56 +0000
578 +Subject: png: Avoid marking the surface as in error after a png warning
579 +
580 +It turns out that libpng will continue to load an image after throwing a
581 +warning, and that libpng16 now throws warnings for images that libpng15
582 +and earlier loaded without error. As we were happily loading those
583 +images into cairo surfaces before, we are therefore being overzealous
584 +in throwing an error now - so just squelch the warning.
585 +
586 +Signed-off-by: Chris Wilson <chris@×××××××××××××××.uk>
587 +---
588 +diff --git a/src/cairo-png.c b/src/cairo-png.c
589 +index e74a4a8..068617d 100644
590 +--- a/src/cairo-png.c
591 ++++ b/src/cairo-png.c
592 +@@ -149,13 +149,13 @@ static void
593 + png_simple_warning_callback (png_structp png,
594 + png_const_charp error_msg)
595 + {
596 +- cairo_status_t *error = png_get_error_ptr (png);
597 +-
598 +- /* default to the most likely error */
599 +- if (*error == CAIRO_STATUS_SUCCESS)
600 +- *error = _cairo_error (CAIRO_STATUS_NO_MEMORY);
601 +-
602 +- /* png does not expect to abort and will try to tidy up after a warning */
603 ++ /* png does not expect to abort and will try to tidy up and continue
604 ++ * loading the image after a warning. So we also want to return the
605 ++ * (incorrect?) surface.
606 ++ *
607 ++ * We use our own warning callback to squelch any attempts by libpng
608 ++ * to write to stderr as we may not be in control of that output.
609 ++ */
610 + }
611 +
612 +
613 +--
614 +cgit v0.9.0.2-2-gbebe
615
616 diff --git a/x11-libs/cairo/files/cairo-1.8.8-interix.patch b/x11-libs/cairo/files/cairo-1.8.8-interix.patch
617 new file mode 100644
618 index 0000000..dc20714
619 --- /dev/null
620 +++ b/x11-libs/cairo/files/cairo-1.8.8-interix.patch
621 @@ -0,0 +1,16 @@
622 +diff -ru cairo-1.8.8.orig/build/configure.ac.tools cairo-1.8.8/build/configure.ac.tools
623 +--- cairo-1.8.8.orig/build/configure.ac.tools 2009-09-30 13:36:42 +0200
624 ++++ cairo-1.8.8/build/configure.ac.tools 2009-09-30 13:50:50 +0200
625 +@@ -21,5 +21,12 @@
626 + *) PKGCONFIG_REQUIRES="Requires.private"; ;;
627 + esac
628 +
629 ++dnl hmm... on interix, things go really bad with Requires.private, since libpng12
630 ++dnl is missing on the final link commands, so gtk+'s configure checks for cairo
631 ++dnl fail miserably with unresolved symbols to it.
632 ++case "$host_os" in
633 ++interix*) PKGCONFIG_REQUIRES="Requires" ;;
634 ++esac
635 ++
636 + AC_SUBST(PKGCONFIG_REQUIRES)
637 +
638
639 diff --git a/x11-libs/cairo/files/cairo-respect-fontconfig.patch b/x11-libs/cairo/files/cairo-respect-fontconfig.patch
640 new file mode 100644
641 index 0000000..b0a1b29
642 --- /dev/null
643 +++ b/x11-libs/cairo/files/cairo-respect-fontconfig.patch
644 @@ -0,0 +1,13 @@
645 +--- cairo-1.7.6-orig/src/cairo-ft-font.c 2008-09-29 21:43:13.000000000 +0100
646 ++++ cairo-1.7.6/src/cairo-ft-font.c 2008-09-29 21:52:19.000000000 +0100
647 +@@ -1705,7 +1705,9 @@
648 + options->base.subpixel_order = other->base.subpixel_order;
649 + }
650 +
651 +- if (options->base.hint_style == CAIRO_HINT_STYLE_DEFAULT)
652 ++ options->base.hint_style = CAIRO_HINT_STYLE_DEFAULT;
653 ++
654 ++ if (other->base.hint_style != CAIRO_HINT_STYLE_DEFAULT)
655 + options->base.hint_style = other->base.hint_style;
656 +
657 + if (other->base.hint_style == CAIRO_HINT_STYLE_NONE)
658
659 diff --git a/x11-libs/cairo/metadata.xml b/x11-libs/cairo/metadata.xml
660 new file mode 100644
661 index 0000000..f27a5c0
662 --- /dev/null
663 +++ b/x11-libs/cairo/metadata.xml
664 @@ -0,0 +1,19 @@
665 +<?xml version="1.0" encoding="UTF-8"?>
666 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
667 +<pkgmetadata>
668 + <herd>x11</herd>
669 + <maintainer>
670 + <email>yngwin@g.o</email>
671 + <name>Ben de Groot</name>
672 + </maintainer>
673 + <use>
674 + <flag name='opengl' restrict="&gt;=x11-libs/cairo-1.10.0">
675 + Use Mesa backend for acceleration</flag>
676 + <flag name='drm'>Use Linux DRM for backend acceleration</flag>
677 + <flag name='gallium'>Use Mesa's Gallium backend for acceleration</flag>
678 + <flag name='gles2'>Use more recent OpenGL ES2 backend for acceleration.</flag>
679 + <flag name='glib'>Compile with GLib Object System support</flag>
680 + <flag name='legacy-drivers'>Include the buggy gradients patch (for legacy drivers, such as nvidia-drivers older than 304.30)</flag>
681 + <flag name='openvg'>Use OpenVG for backend acceleration</flag>
682 + </use>
683 +</pkgmetadata>