Package: gramps / 4.2.5~dfsg-1

gi-import-version.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Description: PyGIWarning for OsmGpsMap and GExiv2
 This patch fixes several gi.repository warnings found in the buildlog
 (when running the test suite), and when running gramps -v or gramps -l
 from the command line.
 .
 The patch builds upon a patch submitted by Vincent Smeets.
 .
 gi.require_version() is now required before import to ensure that the
 right version of the library gets loaded.
 .
 A pull request has been submitted against the master branch as it will
 be a long time before the warnings turn into errors. Therefore,
 it will be after Gramps 5.0 is released that the patch can be dropped.
Forwarded: https://github.com/gramps-project/gramps/pull/133
Author: Ross Gammon <rossgammon@mail.dk>
Last-Update: 2017-01-09

--- gramps.orig/gramps/gui/editors/editaddress.py
+++ gramps/gramps/gui/editors/editaddress.py
@@ -37,6 +37,8 @@
 # GTK/Gnome modules
 #
 #-------------------------------------------------------------------------
+import gi
+gi.require_version('Gtk', '3.0')
 from gi.repository import Gtk
 
 #-------------------------------------------------------------------------
--- gramps.orig/gramps/gui/utils.py
+++ gramps/gramps/gui/utils.py
@@ -42,6 +42,8 @@
 # GNOME/GTK
 #
 #-------------------------------------------------------------------------
+import gi
+gi.require_version('PangoCairo', '1.0')
 from gi.repository import PangoCairo
 from gi.repository import GLib
 
--- gramps.orig/gramps/gen/constfunc.py
+++ gramps/gramps/gen/constfunc.py
@@ -113,6 +113,8 @@
     # in argv, and we might have unicode.
     temp, sys.argv = sys.argv, sys.argv[:1]
     try:
+        import gi
+        gi.require_version('Gtk', '3.0')
         from gi.repository import Gtk
         from gi.repository import Gdk
     except:
--- gramps.orig/gramps/grampsapp.py
+++ gramps/gramps/grampsapp.py
@@ -200,6 +200,8 @@
     """
     py_str = '%d.%d.%d' % sys.version_info[:3]
     try:
+        import gi
+        gi.require_version('Gtk', '3.0')
         from gi.repository import Gtk
         try:
             gtkver_str = '%d.%d.%d' % (Gtk.get_major_version(),