1 |
commit: 1d22283e63b0b3352a6fc636060911f3a4e4aeac |
2 |
Author: Adam Feldman <NP-Hardass <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Sep 5 15:42:27 2020 +0000 |
4 |
Commit: Adam Feldman <np-hardass <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 25 20:32:18 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d22283e |
7 |
|
8 |
app-text/atril: Bump to 1.24.0-r2, synctex optional, add broken tests |
9 |
|
10 |
Package-Manager: Portage-2.3.103, Repoman-2.3.23 |
11 |
Signed-off-by: Adam Feldman <NP-Hardass <AT> gentoo.org> |
12 |
|
13 |
app-text/atril/atril-1.24.0-r2.ebuild | 119 +++++ |
14 |
.../files/atril-1.24.0-make-synctex-optional.patch | 526 +++++++++++++++++++++ |
15 |
app-text/atril/metadata.xml | 2 + |
16 |
3 files changed, 647 insertions(+) |
17 |
|
18 |
diff --git a/app-text/atril/atril-1.24.0-r2.ebuild b/app-text/atril/atril-1.24.0-r2.ebuild |
19 |
new file mode 100644 |
20 |
index 00000000000..6947e34b8f3 |
21 |
--- /dev/null |
22 |
+++ b/app-text/atril/atril-1.24.0-r2.ebuild |
23 |
@@ -0,0 +1,119 @@ |
24 |
+# Copyright 1999-2020 Gentoo Authors |
25 |
+# Distributed under the terms of the GNU General Public License v2 |
26 |
+ |
27 |
+EAPI=6 |
28 |
+ |
29 |
+MATE_LA_PUNT="yes" |
30 |
+ |
31 |
+PYTHON_COMPAT=( python3_{6,7} ) |
32 |
+ |
33 |
+inherit mate python-any-r1 virtualx |
34 |
+ |
35 |
+if [[ ${PV} != 9999 ]]; then |
36 |
+ KEYWORDS="~amd64 ~arm ~arm64 ~x86" |
37 |
+fi |
38 |
+ |
39 |
+DESCRIPTION="Atril document viewer for MATE" |
40 |
+LICENSE="FDL-1.1+ GPL-2+ GPL-3+ LGPL-2+ LGPL-2.1+" |
41 |
+SLOT="0" |
42 |
+ |
43 |
+IUSE="caja dbus debug djvu dvi epub +introspection gnome-keyring +postscript synctex t1lib test tiff xps" |
44 |
+ |
45 |
+REQUIRED_USE="t1lib? ( dvi )" |
46 |
+ |
47 |
+COMMON_DEPEND=" |
48 |
+ >=app-text/poppler-0.22[cairo] |
49 |
+ dev-libs/atk |
50 |
+ >=dev-libs/glib-2.62:2 |
51 |
+ >=dev-libs/libxml2-2.5:2 |
52 |
+ sys-libs/zlib |
53 |
+ x11-libs/gdk-pixbuf:2 |
54 |
+ >=x11-libs/gtk+-3.22:3[introspection?] |
55 |
+ x11-libs/libICE |
56 |
+ >=x11-libs/libSM-1:0 |
57 |
+ x11-libs/libX11 |
58 |
+ >=x11-libs/cairo-1.14 |
59 |
+ x11-libs/pango |
60 |
+ caja? ( >=mate-base/caja-1.17.1[introspection?] ) |
61 |
+ djvu? ( >=app-text/djvu-3.5.17:0 ) |
62 |
+ dvi? ( |
63 |
+ virtual/tex-base |
64 |
+ t1lib? ( >=media-libs/t1lib-5:5 ) |
65 |
+ ) |
66 |
+ epub? ( |
67 |
+ dev-libs/mathjax |
68 |
+ >=net-libs/webkit-gtk-2.6.0:4 |
69 |
+ ) |
70 |
+ gnome-keyring? ( >=app-crypt/libsecret-0.5 ) |
71 |
+ introspection? ( >=dev-libs/gobject-introspection-0.6:= ) |
72 |
+ postscript? ( >=app-text/libspectre-0.2 ) |
73 |
+ synctex? ( virtual/tex-base ) |
74 |
+ tiff? ( >=media-libs/tiff-3.6:0 ) |
75 |
+ xps? ( >=app-text/libgxps-0.2.1 ) |
76 |
+" |
77 |
+ |
78 |
+RDEPEND="${COMMON_DEPEND} |
79 |
+ virtual/libintl |
80 |
+ !!app-text/mate-document-viewer |
81 |
+" |
82 |
+ |
83 |
+DEPEND="${COMMON_DEPEND} |
84 |
+ app-text/docbook-xml-dtd:4.1.2 |
85 |
+ app-text/rarian |
86 |
+ app-text/yelp-tools |
87 |
+ >=app-text/scrollkeeper-dtd-1:1.0 |
88 |
+ dev-util/gdbus-codegen |
89 |
+ dev-util/glib-utils |
90 |
+ dev-util/gtk-doc |
91 |
+ dev-util/gtk-doc-am |
92 |
+ >=sys-devel/gettext-0.19.8 |
93 |
+ virtual/pkgconfig |
94 |
+ test? ( $(python_gen_any_dep 'dev-util/dogtail[${PYTHON_USEDEP}]') ) |
95 |
+" |
96 |
+ |
97 |
+#RESTRICT="!test? ( test )" |
98 |
+# Tests use dogtail and require using accessibility services. |
99 |
+# Until we figure out how to run successfully, don't run tests |
100 |
+RESTRICT="test" |
101 |
+ |
102 |
+PATCHES=( "${FILESDIR}/${PN}-1.24.0-make-synctex-optional.patch" ) |
103 |
+ |
104 |
+python_check_deps() { |
105 |
+ use test && has_version "dev-util/dogtail[${PYTHON_USEDEP}]" |
106 |
+} |
107 |
+ |
108 |
+pkg_setup() { |
109 |
+ use test && python-any-r1_pkg_setup |
110 |
+} |
111 |
+ |
112 |
+src_configure() { |
113 |
+ # Passing --disable-help would drop offline help, that would be inconsistent |
114 |
+ # with helps of the most of GNOME apps that doesn't require network for that. |
115 |
+ mate_src_configure \ |
116 |
+ --enable-comics \ |
117 |
+ --enable-pdf \ |
118 |
+ --enable-pixbuf \ |
119 |
+ --enable-previewer \ |
120 |
+ --enable-thumbnailer \ |
121 |
+ $(use_with gnome-keyring keyring) \ |
122 |
+ $(use_enable caja) \ |
123 |
+ $(use_enable dbus) \ |
124 |
+ $(use_enable debug) \ |
125 |
+ $(use_enable djvu) \ |
126 |
+ $(use_enable dvi) \ |
127 |
+ $(use_enable epub) \ |
128 |
+ $(use_enable introspection) \ |
129 |
+ $(use_enable postscript ps) \ |
130 |
+ $(use_enable synctex) \ |
131 |
+ $(use_enable t1lib) \ |
132 |
+ $(use_enable test tests) \ |
133 |
+ $(use_enable tiff) \ |
134 |
+ $(use_enable xps) |
135 |
+} |
136 |
+ |
137 |
+src_test() { |
138 |
+ export GSETTINGS_BACKEND=keyfile |
139 |
+ gsettings set org.gnome.desktop.interface toolkit-accessibility true || die |
140 |
+ gsettings set org.mate.interface accessibility true || die |
141 |
+ virtx emake check |
142 |
+} |
143 |
|
144 |
diff --git a/app-text/atril/files/atril-1.24.0-make-synctex-optional.patch b/app-text/atril/files/atril-1.24.0-make-synctex-optional.patch |
145 |
new file mode 100644 |
146 |
index 00000000000..7b2d3a9c372 |
147 |
--- /dev/null |
148 |
+++ b/app-text/atril/files/atril-1.24.0-make-synctex-optional.patch |
149 |
@@ -0,0 +1,526 @@ |
150 |
+From ed650322792514d69ae54eef4cb105cac1dcb4b8 Mon Sep 17 00:00:00 2001 |
151 |
+From: Oz Tiram <oz.tiram@×××××.com> |
152 |
+Date: Fri, 7 Feb 2020 21:57:10 +0100 |
153 |
+Subject: [PATCH 1/5] Make synctex optional |
154 |
+ |
155 |
+Not everyone who reads PDF's is necessarily a LaTeX user. |
156 |
+These changes allow users to install atril without the huge bagage |
157 |
+of tex-live on systems where synctex isn't provided as a stand alone |
158 |
+library. |
159 |
+--- |
160 |
+ configure.ac | 25 +++++++++++++++++-------- |
161 |
+ libdocument/ev-document.c | 16 ++++++++++++---- |
162 |
+ libview/ev-view.c | 9 ++++++++- |
163 |
+ shell/ev-window.c | 5 +++++ |
164 |
+ 4 files changed, 42 insertions(+), 13 deletions(-) |
165 |
+ |
166 |
+diff --git a/configure.ac b/configure.ac |
167 |
+index 6fee0ff6e..e7a63feed 100644 |
168 |
+--- a/configure.ac |
169 |
++++ b/configure.ac |
170 |
+@@ -361,15 +361,25 @@ AC_SUBST([GIRTYPELIBDIR]) |
171 |
+ AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"]) |
172 |
+ |
173 |
+ dnl ================== libsynctex =========================================== |
174 |
++AC_ARG_ENABLE([synctex], |
175 |
++ [AS_HELP_STRING([--disable-synctex], [Disable support for synctex])], |
176 |
++ [], |
177 |
++ [enable_synctex=yes]) |
178 |
+ |
179 |
+-PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no) |
180 |
+ |
181 |
+-dnl not found? use internal code copy. |
182 |
+-if test "x$has_synctex" = "xno"; then |
183 |
+- AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found") |
184 |
++if test "$enable_synctex" = "yes"; then |
185 |
++ AC_DEFINE([ENABLE_SYNCTEX],[1],[Define if synctex support is enabled]) |
186 |
++ PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no) |
187 |
++ dnl not found? use internal code copy. |
188 |
++ if test "x$has_synctex" = "xno"; then |
189 |
++ AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found") |
190 |
++ fi |
191 |
++ AC_SUBST(SYNCTEX_LIBS) |
192 |
++ AC_SUBST(SYNCTEX_CFLAGS) |
193 |
+ fi |
194 |
+-AC_SUBST(SYNCTEX_LIBS) |
195 |
+-AC_SUBST(SYNCTEX_CFLAGS) |
196 |
++ |
197 |
++AM_CONDITIONAL([ENABLE_SYNCTEX], [test "$enable_synctex" = "yes"]) |
198 |
++ |
199 |
+ |
200 |
+ dnl ================== portability checks =========================================== |
201 |
+ |
202 |
+@@ -776,6 +786,7 @@ Configure summary: |
203 |
+ Tests...............: $enable_tests |
204 |
+ |
205 |
+ PDF Backend.........: $enable_pdf |
206 |
++ Synctex enabled.....: $enable_synctex |
207 |
+ PostScript Backend..: $enable_ps |
208 |
+ TIFF Backend........: $enable_tiff |
209 |
+ DJVU Backend........: $enable_djvu |
210 |
+@@ -784,6 +795,4 @@ Configure summary: |
211 |
+ Comics Backend......: $enable_comics |
212 |
+ XPS Backend.........: $enable_xps |
213 |
+ ePub Backend........: $have_webkit |
214 |
+- |
215 |
+- SyncTeX.............: $has_synctex |
216 |
+ " |
217 |
+diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c |
218 |
+index b713a6717..be082aebb 100644 |
219 |
+--- a/libdocument/ev-document.c |
220 |
++++ b/libdocument/ev-document.c |
221 |
+@@ -25,7 +25,9 @@ |
222 |
+ #include <string.h> |
223 |
+ |
224 |
+ #include "ev-document.h" |
225 |
++#ifdef ENABLE_SYNCTEX |
226 |
+ #include "synctex_parser.h" |
227 |
++#endif |
228 |
+ #include "ev-file-helpers.h" |
229 |
+ |
230 |
+ typedef struct _EvPageSize |
231 |
+@@ -53,8 +55,9 @@ struct _EvDocumentPrivate |
232 |
+ gchar **page_labels; |
233 |
+ EvPageSize *page_sizes; |
234 |
+ EvDocumentInfo *info; |
235 |
+- |
236 |
++#ifdef ENABLE_SYNCTEX |
237 |
+ synctex_scanner_p synctex_scanner; |
238 |
++#endif |
239 |
+ }; |
240 |
+ |
241 |
+ static gint _ev_document_get_n_pages (EvDocument *document); |
242 |
+@@ -124,12 +127,12 @@ ev_document_finalize (GObject *object) |
243 |
+ ev_document_info_free (document->priv->info); |
244 |
+ document->priv->info = NULL; |
245 |
+ } |
246 |
+- |
247 |
++#ifdef ENABLE_SYNCTEX |
248 |
+ if (document->priv->synctex_scanner) { |
249 |
+ synctex_scanner_free (document->priv->synctex_scanner); |
250 |
+ document->priv->synctex_scanner = NULL; |
251 |
+ } |
252 |
+- |
253 |
++#endif |
254 |
+ G_OBJECT_CLASS (ev_document_parent_class)->finalize (object); |
255 |
+ } |
256 |
+ |
257 |
+@@ -137,8 +140,9 @@ static void |
258 |
+ ev_document_init (EvDocument *document) |
259 |
+ { |
260 |
+ document->priv = ev_document_get_instance_private (document); |
261 |
++#ifdef ENABLE_SYNCTEX |
262 |
+ document->synctex_version = SYNCTEX_VERSION_STRING; |
263 |
+- |
264 |
++#endif |
265 |
+ /* Assume all pages are the same size until proven otherwise */ |
266 |
+ document->priv->uniform = TRUE; |
267 |
+ /* Assume that the document is not a web document*/ |
268 |
+@@ -336,6 +340,7 @@ ev_document_load (EvDocument *document, |
269 |
+ } |
270 |
+ |
271 |
+ priv->info = _ev_document_get_info (document); |
272 |
++#ifdef ENABLE_SYNCTEX |
273 |
+ if (_ev_document_support_synctex (document)) { |
274 |
+ gchar *filename; |
275 |
+ |
276 |
+@@ -346,6 +351,7 @@ ev_document_load (EvDocument *document, |
277 |
+ g_free (filename); |
278 |
+ } |
279 |
+ } |
280 |
++#endif |
281 |
+ } |
282 |
+ |
283 |
+ return retval; |
284 |
+@@ -388,6 +394,7 @@ _ev_document_support_synctex (EvDocument *document) |
285 |
+ return klass->support_synctex ? klass->support_synctex (document) : FALSE; |
286 |
+ } |
287 |
+ |
288 |
++#ifdef ENABLE_SYNCTEX |
289 |
+ gboolean |
290 |
+ ev_document_has_synctex (EvDocument *document) |
291 |
+ { |
292 |
+@@ -492,6 +499,7 @@ ev_document_synctex_forward_search (EvDocument *document, |
293 |
+ |
294 |
+ return result; |
295 |
+ } |
296 |
++#endif /* ENABLE_SYNCTEX */ |
297 |
+ |
298 |
+ static gint |
299 |
+ _ev_document_get_n_pages (EvDocument *document) |
300 |
+diff --git a/libview/ev-view.c b/libview/ev-view.c |
301 |
+index a195ba21f..e98582d34 100644 |
302 |
+--- a/libview/ev-view.c |
303 |
++++ b/libview/ev-view.c |
304 |
+@@ -3210,6 +3210,7 @@ ev_view_remove_annotation (EvView *view, |
305 |
+ g_object_unref (annot); |
306 |
+ } |
307 |
+ |
308 |
++#ifdef ENABLE_SYNCTEX |
309 |
+ static gboolean |
310 |
+ ev_view_synctex_backward_search (EvView *view, |
311 |
+ gdouble x, |
312 |
+@@ -3235,6 +3236,7 @@ ev_view_synctex_backward_search (EvView *view, |
313 |
+ |
314 |
+ return FALSE; |
315 |
+ } |
316 |
++#endif |
317 |
+ |
318 |
+ /* Caret navigation */ |
319 |
+ #define CURSOR_ON_MULTIPLIER 2 |
320 |
+@@ -4078,8 +4080,10 @@ ev_view_draw (GtkWidget *widget, |
321 |
+ show_annotation_windows (view, i); |
322 |
+ if (page_ready && view->focused_element) |
323 |
+ draw_focus (view, cr, i, &clip_rect); |
324 |
++#ifdef ENABLE_SYNCTEX |
325 |
+ if (page_ready && view->synctex_result) |
326 |
+ highlight_forward_search_results (view, cr, i); |
327 |
++#endif |
328 |
+ } |
329 |
+ |
330 |
+ if (GTK_WIDGET_CLASS (ev_view_parent_class)->draw) |
331 |
+@@ -4472,9 +4476,10 @@ ev_view_button_press_event (GtkWidget *widget, |
332 |
+ EvFormField *field; |
333 |
+ EvMapping *link; |
334 |
+ gint page; |
335 |
+- |
336 |
++#ifdef ENABLE_SYNCTEX |
337 |
+ if (event->state & GDK_CONTROL_MASK) |
338 |
+ return ev_view_synctex_backward_search (view, event->x , event->y); |
339 |
++#endif |
340 |
+ |
341 |
+ if (EV_IS_SELECTION (view->document) && view->selection_info.selections) { |
342 |
+ if (event->type == GDK_3BUTTON_PRESS) { |
343 |
+@@ -7522,6 +7527,7 @@ ev_view_find_cancel (EvView *view) |
344 |
+ view->find_pages = NULL; |
345 |
+ } |
346 |
+ |
347 |
++#ifdef ENABLE_SYNCTEX |
348 |
+ /*** Synctex ***/ |
349 |
+ void |
350 |
+ ev_view_highlight_forward_search (EvView *view, |
351 |
+@@ -7549,6 +7555,7 @@ ev_view_highlight_forward_search (EvView *view, |
352 |
+ ensure_rectangle_is_visible (view, &view_rect); |
353 |
+ gtk_widget_queue_draw (GTK_WIDGET (view)); |
354 |
+ } |
355 |
++#endif /* ENABLE_SYNCTEX */ |
356 |
+ |
357 |
+ /*** Selections ***/ |
358 |
+ static gboolean |
359 |
+diff --git a/shell/ev-window.c b/shell/ev-window.c |
360 |
+index e2dfbf727..bffc9a7f9 100644 |
361 |
+--- a/shell/ev-window.c |
362 |
++++ b/shell/ev-window.c |
363 |
+@@ -7736,6 +7736,8 @@ ev_window_emit_doc_loaded (EvWindow *window) |
364 |
+ ev_atril_window_emit_document_loaded (window->priv->skeleton, window->priv->uri); |
365 |
+ } |
366 |
+ |
367 |
++ |
368 |
++#ifdef ENABLE_SYNCTEX |
369 |
+ static gboolean |
370 |
+ handle_sync_view_cb (EvAtrilWindow *object, |
371 |
+ GDBusMethodInvocation *invocation, |
372 |
+@@ -7756,6 +7758,7 @@ handle_sync_view_cb (EvAtrilWindow *object, |
373 |
+ |
374 |
+ return TRUE; |
375 |
+ } |
376 |
++#endif |
377 |
+ #endif /* ENABLE_DBUS */ |
378 |
+ |
379 |
+ static gboolean |
380 |
+@@ -7816,9 +7819,11 @@ ev_window_init (EvWindow *ev_window) |
381 |
+ ev_window->priv->dbus_object_path, |
382 |
+ &error)) { |
383 |
+ ev_window->priv->skeleton = skeleton; |
384 |
++#ifdef ENABLE_SYNCTEX |
385 |
+ g_signal_connect (skeleton, "handle-sync-view", |
386 |
+ G_CALLBACK (handle_sync_view_cb), |
387 |
+ ev_window); |
388 |
++#endif |
389 |
+ } else { |
390 |
+ g_printerr ("Failed to register bus object %s: %s\n", |
391 |
+ ev_window->priv->dbus_object_path, error->message); |
392 |
+ |
393 |
+From c141d2c6ae0b4ce5824817f9aa2f98d5edbf7756 Mon Sep 17 00:00:00 2001 |
394 |
+From: Oz N Tiram <oz.tiram@×××××.com> |
395 |
+Date: Thu, 11 Jun 2020 09:15:28 +0200 |
396 |
+Subject: [PATCH 2/5] Fix -Wunused-function warnings caused by |
397 |
+ --enable-synctex=no |
398 |
+ |
399 |
+--- |
400 |
+ libdocument/ev-document.c | 5 ++++- |
401 |
+ libview/ev-view-private.h | 3 ++- |
402 |
+ libview/ev-view.c | 10 ++++++++++ |
403 |
+ 3 files changed, 16 insertions(+), 2 deletions(-) |
404 |
+ |
405 |
+diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c |
406 |
+index be082aebb..f7c878956 100644 |
407 |
+--- a/libdocument/ev-document.c |
408 |
++++ b/libdocument/ev-document.c |
409 |
+@@ -68,7 +68,9 @@ static void _ev_document_get_page_size (EvDocument *document, |
410 |
+ static gchar *_ev_document_get_page_label (EvDocument *document, |
411 |
+ EvPage *page); |
412 |
+ static EvDocumentInfo *_ev_document_get_info (EvDocument *document); |
413 |
++#ifdef ENABLE_SYNCTEX |
414 |
+ static gboolean _ev_document_support_synctex (EvDocument *document); |
415 |
++#endif |
416 |
+ |
417 |
+ static GMutex ev_doc_mutex; |
418 |
+ static GMutex ev_fc_mutex; |
419 |
+@@ -386,6 +388,8 @@ ev_document_get_page (EvDocument *document, |
420 |
+ return klass->get_page (document, index); |
421 |
+ } |
422 |
+ |
423 |
++ |
424 |
++#ifdef ENABLE_SYNCTEX |
425 |
+ static gboolean |
426 |
+ _ev_document_support_synctex (EvDocument *document) |
427 |
+ { |
428 |
+@@ -394,7 +398,6 @@ _ev_document_support_synctex (EvDocument *document) |
429 |
+ return klass->support_synctex ? klass->support_synctex (document) : FALSE; |
430 |
+ } |
431 |
+ |
432 |
+-#ifdef ENABLE_SYNCTEX |
433 |
+ gboolean |
434 |
+ ev_document_has_synctex (EvDocument *document) |
435 |
+ { |
436 |
+diff --git a/libview/ev-view-private.h b/libview/ev-view-private.h |
437 |
+index f10593953..4f6179e4a 100644 |
438 |
+--- a/libview/ev-view-private.h |
439 |
++++ b/libview/ev-view-private.h |
440 |
+@@ -125,8 +125,9 @@ struct _EvView { |
441 |
+ GList **find_pages; |
442 |
+ gint find_result; |
443 |
+ gboolean jump_to_find_result; |
444 |
++#ifdef ENABLE_SYNCTEX |
445 |
+ gboolean highlight_find_results; |
446 |
+- |
447 |
++#endif |
448 |
+ EvDocumentModel *model; |
449 |
+ EvPixbufCache *pixbuf_cache; |
450 |
+ gsize pixbuf_cache_size; |
451 |
+diff --git a/libview/ev-view.c b/libview/ev-view.c |
452 |
+index e98582d34..7c9281cef 100644 |
453 |
+--- a/libview/ev-view.c |
454 |
++++ b/libview/ev-view.c |
455 |
+@@ -177,12 +177,14 @@ static void ev_view_remove_all (EvView |
456 |
+ static AtkObject *ev_view_get_accessible (GtkWidget *widget); |
457 |
+ |
458 |
+ /*** Drawing ***/ |
459 |
++#if ENABLE_SYNCTEX |
460 |
+ static void highlight_find_results (EvView *view, |
461 |
+ cairo_t *cr, |
462 |
+ int page); |
463 |
+ static void highlight_forward_search_results (EvView *view, |
464 |
+ cairo_t *cr, |
465 |
+ int page); |
466 |
++#endif |
467 |
+ static void draw_one_page (EvView *view, |
468 |
+ gint page, |
469 |
+ cairo_t *cr, |
470 |
+@@ -4074,8 +4076,10 @@ ev_view_draw (GtkWidget *widget, |
471 |
+ |
472 |
+ if (page_ready && should_draw_caret_cursor (view, i)) |
473 |
+ draw_caret_cursor (view, cr); |
474 |
++#ifdef ENABLE_SYNCTEX |
475 |
+ if (page_ready && view->find_pages && view->highlight_find_results) |
476 |
+ highlight_find_results (view, cr, i); |
477 |
++#endif |
478 |
+ if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document)) |
479 |
+ show_annotation_windows (view, i); |
480 |
+ if (page_ready && view->focused_element) |
481 |
+@@ -5654,6 +5658,7 @@ draw_rubberband (EvView *view, |
482 |
+ } |
483 |
+ |
484 |
+ |
485 |
++#ifdef ENABLE_SYNCTEX |
486 |
+ static void |
487 |
+ highlight_find_results (EvView *view, cairo_t *cr, int page) |
488 |
+ { |
489 |
+@@ -5698,6 +5703,7 @@ highlight_forward_search_results (EvView *view, cairo_t *cr, int page) |
490 |
+ cairo_stroke (cr); |
491 |
+ cairo_restore (cr); |
492 |
+ } |
493 |
++#endif |
494 |
+ |
495 |
+ static void |
496 |
+ draw_surface (cairo_t *cr, |
497 |
+@@ -6497,7 +6503,9 @@ ev_view_init (EvView *view) |
498 |
+ view->page_layout = EV_PAGE_LAYOUT_SINGLE; |
499 |
+ view->pending_scroll = SCROLL_TO_KEEP_POSITION; |
500 |
+ view->jump_to_find_result = TRUE; |
501 |
++#ifdef ENABLE_SYNCTEX |
502 |
+ view->highlight_find_results = FALSE; |
503 |
++#endif |
504 |
+ view->caret_enabled = FALSE; |
505 |
+ view->cursor_page = 0; |
506 |
+ view->zoom_center_x = -1; |
507 |
+@@ -7517,7 +7525,9 @@ ev_view_find_search_changed (EvView *view) |
508 |
+ void |
509 |
+ ev_view_find_set_highlight_search (EvView *view, gboolean value) |
510 |
+ { |
511 |
++#ifdef ENABLE_SYNCTEX |
512 |
+ view->highlight_find_results = value; |
513 |
++#endif |
514 |
+ gtk_widget_queue_draw (GTK_WIDGET (view)); |
515 |
+ } |
516 |
+ |
517 |
+ |
518 |
+From f0054e7011c5cf6ac814ce1c6b42ce1713b25dba Mon Sep 17 00:00:00 2001 |
519 |
+From: Oz N Tiram <oz.tiram@×××××.com> |
520 |
+Date: Thu, 11 Jun 2020 10:21:00 +0200 |
521 |
+Subject: [PATCH 3/5] Improved detection of --enable/disable synctex option |
522 |
+ |
523 |
+--- |
524 |
+ configure.ac | 9 ++++++--- |
525 |
+ 1 file changed, 6 insertions(+), 3 deletions(-) |
526 |
+ |
527 |
+diff --git a/configure.ac b/configure.ac |
528 |
+index e7a63feed..ee33f27d9 100644 |
529 |
+--- a/configure.ac |
530 |
++++ b/configure.ac |
531 |
+@@ -362,9 +362,12 @@ AM_CONDITIONAL([ENABLE_INTROSPECTION],[test "$enable_introspection" = "yes"]) |
532 |
+ |
533 |
+ dnl ================== libsynctex =========================================== |
534 |
+ AC_ARG_ENABLE([synctex], |
535 |
+- [AS_HELP_STRING([--disable-synctex], [Disable support for synctex])], |
536 |
+- [], |
537 |
+- [enable_synctex=yes]) |
538 |
++ [--enable-synctex enable support for synctex)], |
539 |
++ [case "${enableval}" in |
540 |
++ yes) synctex=true ;; |
541 |
++ no) synctex=false;; |
542 |
++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-synctex]) ;; |
543 |
++ esac],[enable_synctex=yes]) |
544 |
+ |
545 |
+ |
546 |
+ if test "$enable_synctex" = "yes"; then |
547 |
+ |
548 |
+From 37d80d4c862cbd03525fe4393f09b92d1dff8f56 Mon Sep 17 00:00:00 2001 |
549 |
+From: Oz N Tiram <oz.tiram@×××××.com> |
550 |
+Date: Thu, 11 Jun 2020 10:23:15 +0200 |
551 |
+Subject: [PATCH 4/5] Use ENABLE_SYNCTEX in libdocument/Makefile.am |
552 |
+ |
553 |
+--- |
554 |
+ libdocument/Makefile.am | 9 +++++++-- |
555 |
+ 1 file changed, 7 insertions(+), 2 deletions(-) |
556 |
+ |
557 |
+diff --git a/libdocument/Makefile.am b/libdocument/Makefile.am |
558 |
+index f527f0a4a..d1db419c0 100644 |
559 |
+--- a/libdocument/Makefile.am |
560 |
++++ b/libdocument/Makefile.am |
561 |
+@@ -102,11 +102,14 @@ libatrildocument_la_CPPFLAGS = \ |
562 |
+ |
563 |
+ libatrildocument_la_CFLAGS = \ |
564 |
+ $(LIBDOCUMENT_CFLAGS) \ |
565 |
+- $(SYNCTEX_CFLAGS) \ |
566 |
+ $(WARN_CFLAGS) \ |
567 |
+ $(DISABLE_DEPRECATED) \ |
568 |
+ $(AM_CFLAGS) |
569 |
+ |
570 |
++if ENABLE_SYNCTEX |
571 |
++libatrildocument_la_CFLAGS += $(SYNCTEX_CFLAGS) |
572 |
++endif |
573 |
++ |
574 |
+ libatrildocument_la_LDFLAGS = \ |
575 |
+ -version-info $(EV_DOCUMENT_LT_VERSION_INFO) \ |
576 |
+ -no-undefined \ |
577 |
+@@ -116,9 +119,11 @@ libatrildocument_la_LDFLAGS = \ |
578 |
+ libatrildocument_la_LIBADD = \ |
579 |
+ $(LIBDOCUMENT_LIBS) \ |
580 |
+ $(GMODULE_LIBS) \ |
581 |
+- $(SYNCTEX_LIBS) \ |
582 |
+ $(ZLIB_LIBS) |
583 |
+ |
584 |
++if ENABLE_SYNCTEX |
585 |
++libatrildocument_la_LIBADD += $(SYNCTEX_LIBS) |
586 |
++endif |
587 |
+ |
588 |
+ BUILT_SOURCES = \ |
589 |
+ ev-document-type-builtins.c \ |
590 |
+ |
591 |
+From 87c8ee575d3ec50a278c5e428d066341ffd3295d Mon Sep 17 00:00:00 2001 |
592 |
+From: Oz N Tiram <oz.tiram@×××××.com> |
593 |
+Date: Sun, 14 Jun 2020 17:09:56 +0200 |
594 |
+Subject: [PATCH 5/5] Re-enable highlight_find_results |
595 |
+ |
596 |
+--- |
597 |
+ libview/ev-view-private.h | 2 -- |
598 |
+ libview/ev-view.c | 9 +++------ |
599 |
+ 2 files changed, 3 insertions(+), 8 deletions(-) |
600 |
+ |
601 |
+diff --git a/libview/ev-view-private.h b/libview/ev-view-private.h |
602 |
+index 4f6179e4a..e95157234 100644 |
603 |
+--- a/libview/ev-view-private.h |
604 |
++++ b/libview/ev-view-private.h |
605 |
+@@ -125,9 +125,7 @@ struct _EvView { |
606 |
+ GList **find_pages; |
607 |
+ gint find_result; |
608 |
+ gboolean jump_to_find_result; |
609 |
+-#ifdef ENABLE_SYNCTEX |
610 |
+ gboolean highlight_find_results; |
611 |
+-#endif |
612 |
+ EvDocumentModel *model; |
613 |
+ EvPixbufCache *pixbuf_cache; |
614 |
+ gsize pixbuf_cache_size; |
615 |
+diff --git a/libview/ev-view.c b/libview/ev-view.c |
616 |
+index 7c9281cef..29b06fbef 100644 |
617 |
+--- a/libview/ev-view.c |
618 |
++++ b/libview/ev-view.c |
619 |
+@@ -177,10 +177,10 @@ static void ev_view_remove_all (EvView |
620 |
+ static AtkObject *ev_view_get_accessible (GtkWidget *widget); |
621 |
+ |
622 |
+ /*** Drawing ***/ |
623 |
+-#if ENABLE_SYNCTEX |
624 |
+ static void highlight_find_results (EvView *view, |
625 |
+ cairo_t *cr, |
626 |
+ int page); |
627 |
++#if ENABLE_SYNCTEX |
628 |
+ static void highlight_forward_search_results (EvView *view, |
629 |
+ cairo_t *cr, |
630 |
+ int page); |
631 |
+@@ -4076,10 +4076,8 @@ ev_view_draw (GtkWidget *widget, |
632 |
+ |
633 |
+ if (page_ready && should_draw_caret_cursor (view, i)) |
634 |
+ draw_caret_cursor (view, cr); |
635 |
+-#ifdef ENABLE_SYNCTEX |
636 |
+ if (page_ready && view->find_pages && view->highlight_find_results) |
637 |
+ highlight_find_results (view, cr, i); |
638 |
+-#endif |
639 |
+ if (page_ready && EV_IS_DOCUMENT_ANNOTATIONS (view->document)) |
640 |
+ show_annotation_windows (view, i); |
641 |
+ if (page_ready && view->focused_element) |
642 |
+@@ -5627,6 +5625,7 @@ ev_view_style_updated (GtkWidget *widget) |
643 |
+ |
644 |
+ /*** Drawing ***/ |
645 |
+ |
646 |
++ |
647 |
+ static void |
648 |
+ draw_rubberband (EvView *view, |
649 |
+ cairo_t *cr, |
650 |
+@@ -5658,7 +5657,6 @@ draw_rubberband (EvView *view, |
651 |
+ } |
652 |
+ |
653 |
+ |
654 |
+-#ifdef ENABLE_SYNCTEX |
655 |
+ static void |
656 |
+ highlight_find_results (EvView *view, cairo_t *cr, int page) |
657 |
+ { |
658 |
+@@ -5683,6 +5681,7 @@ highlight_find_results (EvView *view, cairo_t *cr, int page) |
659 |
+ } |
660 |
+ } |
661 |
+ |
662 |
++#ifdef ENABLE_SYNCTEX |
663 |
+ static void |
664 |
+ highlight_forward_search_results (EvView *view, cairo_t *cr, int page) |
665 |
+ { |
666 |
+@@ -7525,9 +7524,7 @@ ev_view_find_search_changed (EvView *view) |
667 |
+ void |
668 |
+ ev_view_find_set_highlight_search (EvView *view, gboolean value) |
669 |
+ { |
670 |
+-#ifdef ENABLE_SYNCTEX |
671 |
+ view->highlight_find_results = value; |
672 |
+-#endif |
673 |
+ gtk_widget_queue_draw (GTK_WIDGET (view)); |
674 |
+ } |
675 |
+ |
676 |
|
677 |
diff --git a/app-text/atril/metadata.xml b/app-text/atril/metadata.xml |
678 |
index 0b999715ba8..57f8c6d47b4 100644 |
679 |
--- a/app-text/atril/metadata.xml |
680 |
+++ b/app-text/atril/metadata.xml |
681 |
@@ -11,6 +11,8 @@ |
682 |
<flag name="dvi">Enable build-in DVI viewer</flag> |
683 |
<flag name="epub">Enable build-in DVI viewer using |
684 |
<pkg>net-libs/webkit-gtk</pkg></flag> |
685 |
+ <flag name="synctex">Enable search highlighting through synctex |
686 |
+ (<pkg>virtual/tex-base</pkg>)</flag> |
687 |
<flag name="t1lib">Enable the Type-1 fonts for the build-in DVI viewer |
688 |
(<pkg>media-libs/t1lib</pkg>)</flag> |
689 |
<flag name="xps">Enable XPS viewer using |