blob: 50cb6ac2edd8edf08e4e75d52a497b8249b88032 [file] [log] [blame]
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -07001--- a/__init__.py 1969-12-31 16:00:00.000000000 -0800
2+++ b/__init__.py 2018-10-17 21:45:04.908201161 -0700
Philipp Schraderbde36ad2022-02-26 16:18:41 -08003@@ -29,6 +29,22 @@ import os
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -07004 import importlib
5 import types
6
7+_base = os.path.dirname(os.path.dirname(__file__))
8+os.environ['GI_TYPELIB_PATH'] = os.path.join(_base, 'usr', 'lib',
9+ 'x86_64-linux-gnu',
10+ 'girepository-1.0')
11+
James Kuszmaul58683ed2020-01-25 20:33:11 -080012+# Tell fontconfig where to find the sandboxed font files.
13+os.environ["FONTCONFIG_PATH"] = os.path.join(_base, "etc/fonts/")
14+os.environ["FONTCONFIG_FILE"] = os.path.join(_base, "etc/fonts/fonts.conf")
Philipp Schraderbde36ad2022-02-26 16:18:41 -080015+# The sysroot here needs to be "/". If it were _base, then the font caches
16+# would contain _base-relative paths in them. Unfortunately pango interprets
17+# those as absolute paths and ends up failing to find all fonts.
18+os.environ["FONTCONFIG_SYSROOT"] = "/"
Austin Schuh903b99a2021-02-06 13:41:34 -080019+os.environ["GDK_PIXBUF_MODULEDIR"] = os.path.join(_base, "rpathed", "usr", "lib", "x86_64-linux-gnu", "gdk-pixbuf-2.0", "2.10.0", "loaders")
20+os.environ["GDK_PIXBUF_MODULE_FILE"] = os.path.join(os.environ["GDK_PIXBUF_MODULEDIR"], "loaders.cache")
21+os.system(os.path.join(_base, "usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders") + " --update-cache")
James Kuszmaul58683ed2020-01-25 20:33:11 -080022+
Brian Silvermanb0ebf1d2018-10-17 23:36:40 -070023 _static_binding_error = ('When using gi.repository you must not import static '
24 'modules like "gobject". Please change all occurrences '
25 'of "import gobject" to "from gi.repository import GObject". '