1 |
commit: c28560d3da197cb22026c308aab16a56b87ed4f1 |
2 |
Author: Kacper Kowalik <xarthisius <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 8 02:10:50 2016 +0000 |
4 |
Commit: Kacper Kowalik <xarthisius <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Mar 8 02:11:57 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c28560d3 |
7 |
|
8 |
x11-wm/i3: fix build without cairo/pango, correct dep on cairo version |
9 |
|
10 |
Fixes bug #576664 |
11 |
|
12 |
Reported-by: Coacher <itumaykin+gentoo <AT> gmail.com> |
13 |
|
14 |
Package-Manager: portage-2.2.27 |
15 |
|
16 |
x11-wm/i3/files/i3-4.12-pango.patch | 181 ++++++++++++++++++++++++++++++++++++ |
17 |
x11-wm/i3/i3-4.12.ebuild | 19 +++- |
18 |
2 files changed, 197 insertions(+), 3 deletions(-) |
19 |
|
20 |
diff --git a/x11-wm/i3/files/i3-4.12-pango.patch b/x11-wm/i3/files/i3-4.12-pango.patch |
21 |
new file mode 100644 |
22 |
index 0000000..6442796 |
23 |
--- /dev/null |
24 |
+++ b/x11-wm/i3/files/i3-4.12-pango.patch |
25 |
@@ -0,0 +1,181 @@ |
26 |
+Fixes builds with without pango/cairo |
27 |
+ |
28 |
+https://github.com/i3/i3/pull/2243 |
29 |
+https://bugs.gentoo.org/show_bug.cgi?id=576664 |
30 |
+ |
31 |
+--- a/include/libi3.h |
32 |
++++ b/include/libi3.h |
33 |
+@@ -20,7 +20,7 @@ |
34 |
+ #if PANGO_SUPPORT |
35 |
+ #include <pango/pango.h> |
36 |
+ #endif |
37 |
+-#ifdef CAIRO_SUPPORT |
38 |
++#if CAIRO_SUPPORT |
39 |
+ #include <cairo/cairo-xcb.h> |
40 |
+ #endif |
41 |
+ |
42 |
+@@ -518,7 +518,7 @@ typedef struct placeholder_t { |
43 |
+ */ |
44 |
+ char *format_placeholders(char *format, placeholder_t *placeholders, int num); |
45 |
+ |
46 |
+-#ifdef CAIRO_SUPPORT |
47 |
++#if CAIRO_SUPPORT |
48 |
+ /* We need to flush cairo surfaces twice to avoid an assertion bug. See #1989 |
49 |
+ * and https://bugs.freedesktop.org/show_bug.cgi?id=92455. */ |
50 |
+ #define CAIRO_SURFACE_FLUSH(surface) \ |
51 |
+@@ -542,7 +542,7 @@ typedef struct surface_t { |
52 |
+ int width; |
53 |
+ int height; |
54 |
+ |
55 |
+-#ifdef CAIRO_SUPPORT |
56 |
++#if CAIRO_SUPPORT |
57 |
+ /* A cairo surface representing the drawable. */ |
58 |
+ cairo_surface_t *surface; |
59 |
+ |
60 |
+--- a/libi3/draw_util.c |
61 |
++++ b/libi3/draw_util.c |
62 |
+@@ -11,7 +11,7 @@ |
63 |
+ #include <string.h> |
64 |
+ #include <xcb/xcb.h> |
65 |
+ #include <xcb/xcb_aux.h> |
66 |
+-#ifdef CAIRO_SUPPORT |
67 |
++#if CAIRO_SUPPORT |
68 |
+ #include <cairo/cairo-xcb.h> |
69 |
+ #endif |
70 |
+ |
71 |
+@@ -50,7 +50,7 @@ void draw_util_surface_init(xcb_connection_t *conn, surface_t *surface, xcb_draw |
72 |
+ ELOG("Could not create graphical context. Error code: %d. Please report this bug.\n", error->error_code); |
73 |
+ } |
74 |
+ |
75 |
+-#ifdef CAIRO_SUPPORT |
76 |
++#if CAIRO_SUPPORT |
77 |
+ surface->surface = cairo_xcb_surface_create(conn, surface->id, surface->visual_type, width, height); |
78 |
+ surface->cr = cairo_create(surface->surface); |
79 |
+ #endif |
80 |
+@@ -62,7 +62,7 @@ void draw_util_surface_init(xcb_connection_t *conn, surface_t *surface, xcb_draw |
81 |
+ */ |
82 |
+ void draw_util_surface_free(xcb_connection_t *conn, surface_t *surface) { |
83 |
+ xcb_free_gc(conn, surface->gc); |
84 |
+-#ifdef CAIRO_SUPPORT |
85 |
++#if CAIRO_SUPPORT |
86 |
+ cairo_surface_destroy(surface->surface); |
87 |
+ cairo_destroy(surface->cr); |
88 |
+ |
89 |
+@@ -81,7 +81,7 @@ void draw_util_surface_free(xcb_connection_t *conn, surface_t *surface) { |
90 |
+ void draw_util_surface_set_size(surface_t *surface, int width, int height) { |
91 |
+ surface->width = width; |
92 |
+ surface->height = height; |
93 |
+-#ifdef CAIRO_SUPPORT |
94 |
++#if CAIRO_SUPPORT |
95 |
+ cairo_xcb_surface_set_size(surface->surface, width, height); |
96 |
+ #endif |
97 |
+ } |
98 |
+@@ -121,7 +121,7 @@ color_t draw_util_hex_to_color(const char *color) { |
99 |
+ static void draw_util_set_source_color(xcb_connection_t *conn, surface_t *surface, color_t color) { |
100 |
+ RETURN_UNLESS_SURFACE_INITIALIZED(surface); |
101 |
+ |
102 |
+-#ifdef CAIRO_SUPPORT |
103 |
++#if CAIRO_SUPPORT |
104 |
+ cairo_set_source_rgba(surface->cr, color.red, color.green, color.blue, color.alpha); |
105 |
+ #else |
106 |
+ uint32_t colorpixel = color.colorpixel; |
107 |
+@@ -139,7 +139,7 @@ static void draw_util_set_source_color(xcb_connection_t *conn, surface_t *surfac |
108 |
+ void draw_util_text(i3String *text, surface_t *surface, color_t fg_color, color_t bg_color, int x, int y, int max_width) { |
109 |
+ RETURN_UNLESS_SURFACE_INITIALIZED(surface); |
110 |
+ |
111 |
+-#ifdef CAIRO_SUPPORT |
112 |
++#if CAIRO_SUPPORT |
113 |
+ /* Flush any changes before we draw the text as this might use XCB directly. */ |
114 |
+ CAIRO_SURFACE_FLUSH(surface->surface); |
115 |
+ #endif |
116 |
+@@ -147,7 +147,7 @@ void draw_util_text(i3String *text, surface_t *surface, color_t fg_color, color_ |
117 |
+ set_font_colors(surface->gc, fg_color, bg_color); |
118 |
+ draw_text(text, surface->id, surface->gc, surface->visual_type, x, y, max_width); |
119 |
+ |
120 |
+-#ifdef CAIRO_SUPPORT |
121 |
++#if CAIRO_SUPPORT |
122 |
+ /* Notify cairo that we (possibly) used another way to draw on the surface. */ |
123 |
+ cairo_surface_mark_dirty(surface->surface); |
124 |
+ #endif |
125 |
+@@ -162,7 +162,7 @@ void draw_util_text(i3String *text, surface_t *surface, color_t fg_color, color_ |
126 |
+ void draw_util_rectangle(xcb_connection_t *conn, surface_t *surface, color_t color, double x, double y, double w, double h) { |
127 |
+ RETURN_UNLESS_SURFACE_INITIALIZED(surface); |
128 |
+ |
129 |
+-#ifdef CAIRO_SUPPORT |
130 |
++#if CAIRO_SUPPORT |
131 |
+ cairo_save(surface->cr); |
132 |
+ |
133 |
+ /* Using the SOURCE operator will copy both color and alpha information directly |
134 |
+@@ -194,7 +194,7 @@ void draw_util_rectangle(xcb_connection_t *conn, surface_t *surface, color_t col |
135 |
+ void draw_util_clear_surface(xcb_connection_t *conn, surface_t *surface, color_t color) { |
136 |
+ RETURN_UNLESS_SURFACE_INITIALIZED(surface); |
137 |
+ |
138 |
+-#ifdef CAIRO_SUPPORT |
139 |
++#if CAIRO_SUPPORT |
140 |
+ cairo_save(surface->cr); |
141 |
+ |
142 |
+ /* Using the SOURCE operator will copy both color and alpha information directly |
143 |
+@@ -227,7 +227,7 @@ void draw_util_copy_surface(xcb_connection_t *conn, surface_t *src, surface_t *d |
144 |
+ RETURN_UNLESS_SURFACE_INITIALIZED(src); |
145 |
+ RETURN_UNLESS_SURFACE_INITIALIZED(dest); |
146 |
+ |
147 |
+-#ifdef CAIRO_SUPPORT |
148 |
++#if CAIRO_SUPPORT |
149 |
+ cairo_save(dest->cr); |
150 |
+ |
151 |
+ /* Using the SOURCE operator will copy both color and alpha information directly |
152 |
+--- a/libi3/font.c |
153 |
++++ b/libi3/font.c |
154 |
+@@ -397,9 +397,11 @@ static void draw_text_xcb(const xcb_char2b_t *text, size_t text_len, xcb_drawabl |
155 |
+ void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc, |
156 |
+ xcb_visualtype_t *visual, int x, int y, int max_width) { |
157 |
+ assert(savedFont != NULL); |
158 |
++#if PANGO_SUPPORT |
159 |
+ if (visual == NULL) { |
160 |
+ visual = root_visual_type; |
161 |
+ } |
162 |
++#endif |
163 |
+ |
164 |
+ switch (savedFont->type) { |
165 |
+ case FONT_TYPE_NONE: |
166 |
+--- a/src/floating.c |
167 |
++++ b/src/floating.c |
168 |
+@@ -11,6 +11,10 @@ |
169 |
+ */ |
170 |
+ #include "all.h" |
171 |
+ |
172 |
++#ifndef MAX |
173 |
++#define MAX(x, y) ((x) > (y) ? (x) : (y)) |
174 |
++#endif |
175 |
++ |
176 |
+ /* |
177 |
+ * Calculates sum of heights and sum of widths of all currently active outputs |
178 |
+ * |
179 |
+--- a/src/util.c |
180 |
++++ b/src/util.c |
181 |
+@@ -341,10 +341,12 @@ char *pango_escape_markup(char *input) { |
182 |
+ if (!font_is_pango()) |
183 |
+ return input; |
184 |
+ |
185 |
++#if PANGO_SUPPORT |
186 |
+ char *escaped = g_markup_escape_text(input, -1); |
187 |
+ FREE(input); |
188 |
+ |
189 |
+ return escaped; |
190 |
++#endif |
191 |
+ } |
192 |
+ |
193 |
+ /* |
194 |
+--- a/src/x.c |
195 |
++++ b/src/x.c |
196 |
+@@ -12,6 +12,10 @@ |
197 |
+ */ |
198 |
+ #include "all.h" |
199 |
+ |
200 |
++#ifndef MAX |
201 |
++#define MAX(x, y) ((x) > (y) ? (x) : (y)) |
202 |
++#endif |
203 |
++ |
204 |
+ xcb_window_t ewmh_window; |
205 |
+ |
206 |
+ /* Stores the X11 window ID of the currently focused window */ |
207 |
|
208 |
diff --git a/x11-wm/i3/i3-4.12.ebuild b/x11-wm/i3/i3-4.12.ebuild |
209 |
index eabd399..361c0a9 100644 |
210 |
--- a/x11-wm/i3/i3-4.12.ebuild |
211 |
+++ b/x11-wm/i3/i3-4.12.ebuild |
212 |
@@ -13,7 +13,8 @@ SRC_URI="http://i3wm.org/downloads/${P}.tar.bz2" |
213 |
LICENSE="BSD" |
214 |
SLOT="0" |
215 |
KEYWORDS="~amd64 ~arm ~x86" |
216 |
-IUSE="+pango" |
217 |
+IUSE="+cairo +pango" |
218 |
+REQUIRED_USE="pango? ( cairo )" |
219 |
|
220 |
CDEPEND="dev-libs/libev |
221 |
dev-libs/libpcre |
222 |
@@ -25,9 +26,11 @@ CDEPEND="dev-libs/libev |
223 |
x11-libs/xcb-util-cursor |
224 |
x11-libs/xcb-util-keysyms |
225 |
x11-libs/xcb-util-wm |
226 |
+ cairo? ( |
227 |
+ >=x11-libs/cairo-1.14.4[X,xcb] |
228 |
+ ) |
229 |
pango? ( |
230 |
>=x11-libs/pango-1.30.0[X] |
231 |
- >=x11-libs/cairo-1.12.2[X,xcb] |
232 |
)" |
233 |
DEPEND="${CDEPEND} |
234 |
virtual/pkgconfig" |
235 |
@@ -39,8 +42,18 @@ RDEPEND="${CDEPEND} |
236 |
DOCS=( RELEASE-NOTES-${PV} ) |
237 |
|
238 |
src_prepare() { |
239 |
+ epatch "${FILESDIR}"/${P}-pango.patch |
240 |
+ |
241 |
if ! use pango; then |
242 |
- sed -i common.mk -e '/PANGO/d' || die |
243 |
+ sed -e '/^PANGO_.*pangocairo/d' \ |
244 |
+ -e '/PANGO_SUPPORT/ s/1/0/g' \ |
245 |
+ -i common.mk || die |
246 |
+ fi |
247 |
+ |
248 |
+ if ! use cairo; then |
249 |
+ sed -e '/^PANGO_.*cairo/d' \ |
250 |
+ -e '/CAIRO_SUPPORT/ s/1/0/g' \ |
251 |
+ -i common.mk || die |
252 |
fi |
253 |
|
254 |
cat <<- EOF > "${T}"/i3wm |