1diff --git a/libaccounts-glib/pygobject/meson.build b/libaccounts-glib/pygobject/meson.build
2index fa1f4a0..588c4ce 100644
3--- a/libaccounts-glib/pygobject/meson.build
4+++ b/libaccounts-glib/pygobject/meson.build
5@@ -1,11 +1,19 @@
6-python3 = import('python3')
7-python_exec = python3.find_python()
8-python_exec_result = run_command(python_exec, ['-c', 'import gi; from os.path import abspath; print(abspath(gi._overridesdir))'])
9+py_override = get_option('py-overrides-dir')
10
11-if python_exec_result.returncode() != 0
12- error('Failed to retreive the python GObject override directory')
13+if py_override == ''
14+ python3 = import('python3')
15+ python_exec = python3.find_python()
16+
17+ python_exec_result = run_command(python_exec, ['-c', 'import gi; from os.path import abspath; print(abspath(gi._overridesdir))'])
18+
19+ if python_exec_result.returncode() != 0
20+ error('Failed to retreive the python GObject override directory')
21+ endif
22+
23+ py_override = python_exec_result.stdout().strip()
24 endif
25
26-install_data('Accounts.py',
27- install_dir: join_paths(python_exec_result.stdout().strip())
28+install_data(
29+ 'Accounts.py',
30+ install_dir: py_override
31 )
32diff --git a/meson_options.txt b/meson_options.txt
33new file mode 100644
34index 0000000..2c33804
35--- /dev/null
36+++ b/meson_options.txt
37@@ -0,0 +1 @@
38+option('py-overrides-dir', type : 'string', value : '', description: 'Path to pygobject overrides directory')