summary refs log tree commit diff
path: root/pkgs/development/libraries/libaccounts-glib/py-override.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/libaccounts-glib/py-override.patch')
-rw-r--r--pkgs/development/libraries/libaccounts-glib/py-override.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libaccounts-glib/py-override.patch b/pkgs/development/libraries/libaccounts-glib/py-override.patch
new file mode 100644
index 00000000000..4179f4fa0af
--- /dev/null
+++ b/pkgs/development/libraries/libaccounts-glib/py-override.patch
@@ -0,0 +1,38 @@
+diff --git a/libaccounts-glib/pygobject/meson.build b/libaccounts-glib/pygobject/meson.build
+index fa1f4a0..588c4ce 100644
+--- a/libaccounts-glib/pygobject/meson.build
++++ b/libaccounts-glib/pygobject/meson.build
+@@ -1,11 +1,19 @@
+-python3 = import('python3')
+-python_exec = python3.find_python()
+-python_exec_result = run_command(python_exec, ['-c', 'import gi; from os.path import abspath; print(abspath(gi._overridesdir))'])
++py_override = get_option('py-overrides-dir')
+ 
+-if python_exec_result.returncode() != 0
+-    error('Failed to retreive the python GObject override directory')
++if py_override == ''
++    python3 = import('python3')
++    python_exec = python3.find_python()
++    
++    python_exec_result = run_command(python_exec, ['-c', 'import gi; from os.path import abspath; print(abspath(gi._overridesdir))'])
++
++    if python_exec_result.returncode() != 0
++        error('Failed to retreive the python GObject override directory')
++    endif
++
++    py_override = python_exec_result.stdout().strip()
+ endif
+ 
+-install_data('Accounts.py',
+-    install_dir: join_paths(python_exec_result.stdout().strip())
++install_data(
++    'Accounts.py',
++    install_dir: py_override
+ )
+diff --git a/meson_options.txt  b/meson_options.txt 
+new file mode 100644
+index 0000000..2c33804
+--- /dev/null
++++ b/meson_options.txt 	
+@@ -0,0 +1 @@
++option('py-overrides-dir', type : 'string', value : '', description: 'Path to pygobject overrides directory')