Update to 3.31.4

This commit is contained in:
Kalev Lember 2019-01-08 20:24:58 +01:00
parent 3cfa5f80cc
commit 6745b49ba5
4 changed files with 12 additions and 86 deletions

1
.gitignore vendored
View File

@ -77,3 +77,4 @@ evince-3.0.0.tar.bz2
/evince-3.30.0.tar.xz
/evince-3.30.1.tar.xz
/evince-3.30.2.tar.xz
/evince-3.31.4.tar.xz

View File

@ -1,76 +0,0 @@
--- evince-3.21.92/browser-plugin/EvBrowserPluginMain.cpp
+++ evince-3.21.92/browser-plugin/EvBrowserPluginMain.cpp
@@ -38,11 +38,40 @@ static EvBrowserPlugin *pluginForInstanc
return static_cast<EvBrowserPlugin *>(instance->pdata);
}
+static gboolean gtkToolkitIsCompatible(NPP instance)
+{
+ NPNToolkitType toolkit_type = NPNVGtk12;
+ NPError error;
+
+ error = browser->getvalue(instance, NPNVToolkit, &toolkit_type);
+
+ if (error == NPERR_NO_ERROR &&
+ (toolkit_type == NPNVGtk12 ||
+ toolkit_type == NPNVGtk2))
+ return FALSE;
+ else
+ return TRUE;
+}
+
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char *argn[], char *argv[], NPSavedData *savedData)
{
if (!instance)
return NPERR_INVALID_INSTANCE_ERROR;
+ if (!gtkToolkitIsCompatible(instance))
+ return NPERR_GENERIC_ERROR;
+
+ GBytes *resourceData = g_resources_lookup_data("/org/gnome/evince/browser/ui/evince-browser.css", G_RESOURCE_LOOKUP_FLAGS_NONE, nullptr);
+ if (resourceData) {
+ GtkCssProvider *cssProvider = gtk_css_provider_new();
+
+ gtk_css_provider_load_from_data(cssProvider, static_cast<const gchar *>(g_bytes_get_data(resourceData, nullptr)), g_bytes_get_size(resourceData), nullptr);
+ g_bytes_unref(resourceData);
+
+ gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), GTK_STYLE_PROVIDER(cssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref(cssProvider);
+ }
+
return EvBrowserPlugin::create(instance)->initialize(pluginType, mode, argc, argn, argv, savedData);
}
@@ -197,6 +226,11 @@ NPError NP_Initialize(NPNetscapeFuncs *b
if ((browserFuncs->version >> 8) > NP_VERSION_MAJOR)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
+ browser = browserFuncs;
+
+ if (!gtkToolkitIsCompatible(NULL))
+ return NPERR_GENERIC_ERROR;
+
if (!ev_init())
return NPERR_GENERIC_ERROR;
@@ -207,20 +241,8 @@ NPError NP_Initialize(NPNetscapeFuncs *b
return NPERR_GENERIC_ERROR;
#endif
- browser = browserFuncs;
initializePluginFuncs(pluginFuncs);
- GBytes *resourceData = g_resources_lookup_data("/org/gnome/evince/browser/ui/evince-browser.css", G_RESOURCE_LOOKUP_FLAGS_NONE, nullptr);
- if (resourceData) {
- GtkCssProvider *cssProvider = gtk_css_provider_new();
-
- gtk_css_provider_load_from_data(cssProvider, static_cast<const gchar *>(g_bytes_get_data(resourceData, nullptr)), g_bytes_get_size(resourceData), nullptr);
- g_bytes_unref(resourceData);
-
- gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), GTK_STYLE_PROVIDER(cssProvider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
- g_object_unref(cssProvider);
- }
-
return NPERR_NO_ERROR;
}

View File

@ -1,23 +1,23 @@
%global poppler_version 0.24.0
%global poppler_version 0.33.0
%global glib2_version 2.36.0
%global gtk3_version 3.16.0
%global gtk3_version 3.22.0
%global gxps_version 0.2.1
Name: evince
Version: 3.30.2
Release: 2%{?dist}
Version: 3.31.4
Release: 1%{?dist}
Summary: Document viewer
License: GPLv2+ and GPLv3+ and LGPLv2+ and MIT and Afmparse
URL: https://wiki.gnome.org/Apps/Evince
Source0: https://download.gnome.org/sources/%{name}/3.28/%{name}-%{version}.tar.xz
Source0: https://download.gnome.org/sources/%{name}/3.31/%{name}-%{version}.tar.xz
Patch0: evince-3.21.4-NPNVToolKit.patch
# https://bugzilla.gnome.org/show_bug.cgi?id=766749
Patch3: 0001-Resolves-deb-762530-rhbz-1061177-add-man-pages.patch
BuildRequires: gcc-c++
BuildRequires: gcc
BuildRequires: gettext-devel
BuildRequires: pkgconfig(adwaita-icon-theme)
BuildRequires: pkgconfig(gio-unix-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(gnome-desktop-3.0)
@ -30,13 +30,11 @@ BuildRequires: pkgconfig(poppler-glib) >= %{poppler_version}
BuildRequires: pkgconfig(libarchive)
BuildRequires: pkgconfig(gspell-1)
BuildRequires: libtiff-devel
BuildRequires: gettext
BuildRequires: libtool
BuildRequires: gtk-doc
BuildRequires: yelp-tools
BuildRequires: intltool
BuildRequires: /usr/bin/desktop-file-validate
BuildRequires: libappstream-glib
BuildRequires: libappstream-glib-devel
BuildRequires: gnome-common
# for the nautilus properties page
BuildRequires: pkgconfig(libnautilus-extension)
@ -244,6 +242,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.Evince-p
%{_libdir}/nautilus/extensions-3.0/libevince-properties-page.so
%changelog
* Tue Jan 08 2019 Kalev Lember <klember@redhat.com> - 3.31.4-1
- Update to 3.31.4
* Sat Nov 10 2018 Kalev Lember <klember@redhat.com> - 3.30.2-2
- Obsolete evince-browser-plugin (#1644960)

View File

@ -1 +1 @@
SHA512 (evince-3.30.2.tar.xz) = dfffcf15547d0720bd2379054d7b9bee02f8bea7113562162cbab62d77cf84c04f70dcc87a3e6b1ba62db38783df8f481d801854d8f0767f60e9cfabd9efc646
SHA512 (evince-3.31.4.tar.xz) = bed3950fb5ec58855a915c9e06b158924fd07b41c022e281cbada30174d8918c69a29f3408d27db2f1df70e2ba6bc2c35a6f0d5075627397682b9602a6f94a0f