summaryrefslogtreecommitdiff
path: root/debian/patches/fix-installed-paths.patch
blob: 5acbd5bcd2c4298f2172522e111c3b01b4c0e252 (plain)
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
From: Andrej Shadura <andrewsh@debian.org>
Subject: point gtimelog into the right places

Index: gtimelog/src/gtimelog/main.py
===================================================================
--- gtimelog.orig/src/gtimelog/main.py
+++ gtimelog/src/gtimelog/main.py
@@ -50,22 +50,6 @@ if '--debug' in sys.argv:
 
 HERE = os.path.dirname(__file__)
 
-SCHEMA_DIR = os.path.join(HERE, 'data')
-if SCHEMA_DIR and not os.environ.get('GSETTINGS_SCHEMA_DIR'):
-    # Have to do this before importing 'gi'.
-    os.environ['GSETTINGS_SCHEMA_DIR'] = SCHEMA_DIR
-    if not os.path.exists(os.path.join(SCHEMA_DIR, 'gschemas.compiled')):
-        # This, too, I have to do before importing 'gi'.
-        print("Compiling GSettings schema")
-        glib_compile_schemas = os.path.join(sys.prefix, 'lib', 'site-packages', 'gnome', 'glib-compile-schemas.exe')
-        if not os.path.exists(glib_compile_schemas):
-            glib_compile_schemas = 'glib-compile-schemas'
-        try:
-            subprocess.call([glib_compile_schemas, SCHEMA_DIR])
-        except OSError as e:
-            print("Failed: %s" % e)
-
-
 import gi
 gi.require_version('Gtk', '3.0')
 gi.require_version('Soup', '2.4')
@@ -95,7 +79,7 @@ else:
 
 mark_time("gtimelog imports done")
 
-UI_DIR = HERE
+UI_DIR = '/usr/share/gtimelog'
 
 if (Gtk.MAJOR_VERSION, Gtk.MINOR_VERSION) < (3, 12):
     UI_FILE = os.path.join(UI_DIR, 'gtimelog-gtk3.10.ui')
@@ -108,9 +92,9 @@ ABOUT_DIALOG_UI_FILE = os.path.join(UI_D
 SHORTCUTS_UI_FILE = os.path.join(UI_DIR, 'shortcuts.ui')
 MENUS_UI_FILE = os.path.join(UI_DIR, 'menus.ui')
 CSS_FILE = os.path.join(UI_DIR, 'gtimelog.css')
-LOCALE_DIR = os.path.join(UI_DIR, 'locale')
+LOCALE_DIR = '/usr/share/locale'
 
-CONTRIBUTORS_FILE = os.path.join(UI_DIR, 'CONTRIBUTORS.rst')
+CONTRIBUTORS_FILE = os.path.join('/usr/share/doc/gtimelog', 'CONTRIBUTORS.rst')
 
 
 log = logging.getLogger('gtimelog')