summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/glib-respect-datadir.patch
blob: 309ce9fc0b096254dbdc51d1bec2787a03d1db4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
On Guix, Python modules are in a different output from the executables,
so searching "../share/glib-2.0" will not work.

This patch restores behaviour prior to this commit:
<https://git.gnome.org/browse/glib/commit/?id=fe2a9887a8ccb14f2386e01b14834e97a33bc2d7>

--- a/gio/gdbus-2.0/codegen/gdbus-codegen.in
+++ b/gio/gdbus-2.0/codegen/gdbus-codegen.in
@@ -25,9 +25,12 @@
 
 srcdir = os.getenv('UNINSTALLED_GLIB_SRCDIR', None)
 filedir = os.path.dirname(__file__)
+datadir = os.path.join('@datadir@', 'glib-2.0')
 
 if srcdir is not None:
     path = os.path.join(srcdir, 'gio', 'gdbus-2.0')
+elif os.path.exists(os.path.join(datadir, 'codegen')):
+    path = datadir
 elif os.path.basename(filedir) == 'bin':
     # Make the prefix containing gdbus-codegen 'relocatable' at runtime by
     # adding /some/prefix/bin/../share/glib-2.0 to the python path