From 4c0990ed36618adb419e1bd6e4b5659f8ecb81c2 Mon Sep 17 00:00:00 2001
From: Bernhard M. Wiedemann <bwiedemann+opensusegit@suse.de>
Date: Apr 04 2020 10:25:36 +0000
Subject: Update atril to rev 30 via SR 790967


https://build.opensuse.org/request/show/790967
by user XRevan86 + dimstar_suse

---

diff --git a/packages/a/atril/.files b/packages/a/atril/.files
index e09360a..6aabe5b 100644
Binary files a/packages/a/atril/.files and b/packages/a/atril/.files differ
diff --git a/packages/a/atril/.rev b/packages/a/atril/.rev
index c0c8351..a0df0c2 100644
--- a/packages/a/atril/.rev
+++ b/packages/a/atril/.rev
@@ -230,4 +230,12 @@
     <comment>- Update to version 1.24.0.</comment>
     <requestid>780511</requestid>
   </revision>
+  <revision rev="30" vrev="2">
+    <srcmd5>8fb0e24e2f2942d6098b6bebe0e63901</srcmd5>
+    <version>1.24.0</version>
+    <time>1585995792</time>
+    <user>dimstar_suse</user>
+    <comment> </comment>
+    <requestid>790967</requestid>
+  </revision>
 </revisionlist>
diff --git a/packages/a/atril/atril-glib-2.54.patch b/packages/a/atril/atril-glib-2.54.patch
new file mode 100644
index 0000000..d4b5e19
--- /dev/null
+++ b/packages/a/atril/atril-glib-2.54.patch
@@ -0,0 +1,59 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -84,7 +84,7 @@ GLIB_GSETTINGS
+ 
+ dnl Specify required versions of dependencies
+ CAIRO_REQUIRED=1.14.0
+-GLIB_REQUIRED=2.62.0
++GLIB_REQUIRED=2.54.0
+ GTK_REQUIRED=3.22.0
+ WEBKIT_REQUIRED=2.6.0
+ LIBSECRET_REQUIRED=0.5
+--- a/shell/ev-window.c
++++ b/shell/ev-window.c
+@@ -2194,12 +2194,18 @@ set_uri_mtime (GFile        *source,
+ 
+ 	info = g_file_query_info_finish (source, async_result, NULL);
+ 	if (info) {
++#if GLIB_CHECK_VERSION (2, 62, 0)
+ 		GDateTime *mtime;
+ 		mtime = g_file_info_get_modification_date_time (info);
+ 		if (mtime) {
+ 			utime = g_date_time_to_unix (mtime);
+ 			g_date_time_unref (mtime);
+ 		}
++#else
++		GTimeVal mtime;
++		g_file_info_get_modification_time (info, &mtime);
++		utime = mtime.tv_sec;
++#endif
+ 		g_object_unref (info);
+ 	}
+ 	ev_window->priv->uri_mtime = utime;
+@@ -2597,7 +2603,11 @@ query_remote_uri_mtime_cb (GFile
+ 			   EvWindow     *ev_window)
+ {
+ 	GFileInfo *info;
++#if GLIB_CHECK_VERSION (2, 62, 0)
+ 	GDateTime *mtime;
++#else
++	GTimeVal   mtime;
++#endif
+ 	GError    *error = NULL;
+         gint64     utime;
+ 
+@@ -2610,9 +2620,14 @@ query_remote_uri_mtime_cb (GFile
+ 		return;
+ 	}
+ 
++#if GLIB_CHECK_VERSION (2, 62, 0)
+ 	mtime = g_file_info_get_modification_date_time (info);
+ 	utime = g_date_time_to_unix (mtime);
+ 	g_date_time_unref (mtime);
++#else
++	g_file_info_get_modification_time (info, &mtime);
++	utime = mtime.tv_sec;
++#endif
+ 
+ 	if (ev_window->priv->uri_mtime != utime) {
+ 		GFile *target_file;
diff --git a/packages/a/atril/atril-synctex-1.18.patch b/packages/a/atril/atril-synctex-1.18.patch
new file mode 100644
index 0000000..49e691a
--- /dev/null
+++ b/packages/a/atril/atril-synctex-1.18.patch
@@ -0,0 +1,50 @@
+--- 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;
+ 
diff --git a/packages/a/atril/atril.changes b/packages/a/atril/atril.changes
index 55d18e1..8236eae 100644
--- a/packages/a/atril/atril.changes
+++ b/packages/a/atril/atril.changes
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Mon Mar 30 14:26:19 UTC 2020 - Alexei Sorokin <sor.alexei@meowr.ru>
+
+- Add atril-synctex-1.18.patch: Restore SyncTeX 1.18 support.
+- Add atril-glib-2.54.patch: Restore GLib 2.54 support.
+
+-------------------------------------------------------------------
 Wed Feb 26 19:38:40 UTC 2020 - Alexei Sorokin <sor.alexei@meowr.ru>
 
 - Update to version 1.24.0 (changes since 1.23.0):
diff --git a/packages/a/atril/atril.spec b/packages/a/atril/atril.spec
index fdcce62..b15ba11 100644
--- a/packages/a/atril/atril.spec
+++ b/packages/a/atril/atril.spec
@@ -27,6 +27,10 @@ Summary:        MATE Desktop document viewer
 License:        GPL-2.0-only AND LGPL-2.0-only
 URL:            https://mate-desktop.org/
 Source:         https://pub.mate-desktop.org/releases/%{_version}/%{name}-%{version}.tar.xz
+# PATCH-FEATURE-OPENSUSE atril-synctex-1.18.patch -- Restore SyncTeX 1.18 support.
+Patch0:         %{name}-synctex-1.18.patch
+# PATCH-FEATURE-OPENSUSE atril-glib-2.54.patch -- Restore GLib 2.54 support.
+Patch1:         %{name}-glib-2.54.patch
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
 BuildRequires:  mate-common >= %{_version}
@@ -158,7 +162,7 @@ page document formats like PDF and Postscript.
 This package contains the Atril extension for the Caja file manager.
 
 %prep
-%setup -q
+%autosetup -p1
 
 %build
 NOCONFIGURE=1 mate-autogen