File atril-synctex-1.18.patch of Package atril
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,7 @@ GTK_REQUIRED=3.22.0
WEBKIT_REQUIRED=2.6.0
LIBSECRET_REQUIRED=0.5
LIBXML_REQUIRED=2.5.0
-SYNCTEX_REQUIRED=1.21
+SYNCTEX_REQUIRED=1.18
AC_SUBST([GLIB_REQUIRED])
AC_SUBST([GTK_REQUIRED])
@@ -364,6 +364,11 @@ dnl ================== libsynctex ======
PKG_CHECK_MODULES(SYNCTEX, [synctex >= $SYNCTEX_REQUIRED], has_synctex=yes, has_synctex=no)
+PKG_CHECK_EXISTS(synctex >= 1.21, [have_synctex_1_21=yes], [have_synctex_1_21=no])
+if test "$have_synctex_1_21" = yes; then
+ AC_DEFINE(HAVE_SYNCTEX_1_21, 1, [synctex >= 1.21 present])
+fi
+
dnl not found? use internal code copy.
if test "x$has_synctex" = "xno"; then
AC_MSG_ERROR("SyncTeX support is disabled since library version $SYNCTEX_REQUIRED or newer not found")
--- a/libdocument/ev-document.c
+++ b/libdocument/ev-document.c
@@ -28,6 +28,12 @@
#include "synctex_parser.h"
#include "ev-file-helpers.h"
+#ifndef HAVE_SYNCTEX_1_21
+typedef synctex_node_t synctex_node_p;
+typedef synctex_scanner_t synctex_scanner_p;
+#define synctex_scanner_next_result synctex_next_result
+#endif
+
typedef struct _EvPageSize
{
gdouble width;
@@ -471,7 +477,11 @@ ev_document_synctex_forward_search (EvDo
if (!scanner)
return NULL;
+#ifdef HAVE_SYNCTEX_1_21
if (synctex_display_query (scanner, link->filename, link->line, link->col, 0) > 0) {
+#else
+ if (synctex_display_query (scanner, link->filename, link->line, link->col) > 0) {
+#endif
synctex_node_p node;
gint page;