Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 1 | From 37f24a9bd62f0a8f3e37eaddd33f2f0c9d3aaa0a Mon Sep 17 00:00:00 2001 |
| 2 | From: Chen Qi <Qi.Chen@windriver.com> |
| 3 | Date: Fri, 1 Apr 2022 23:12:17 -0700 |
| 4 | Subject: [PATCH] meson: add pythoninstalldir option |
| 5 | |
| 6 | In case of cross build, using host python to determine the python |
| 7 | site-packages directory for target is not feasible, add a new option |
| 8 | pythoninstalldir to fix the issue. |
| 9 | |
| 10 | Upstream-Status: Submitted [https://github.com/blueman-project/blueman/pull/1699] |
| 11 | |
| 12 | Signed-off-by: Chen Qi <Qi.Chen@windriver.com> |
| 13 | --- |
| 14 | meson.build | 7 ++++++- |
| 15 | meson_options.txt | 1 + |
| 16 | 2 files changed, 7 insertions(+), 1 deletion(-) |
| 17 | |
| 18 | diff --git a/meson.build b/meson.build |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 19 | index e12d0ce6..e84457a5 100644 |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 20 | --- a/meson.build |
| 21 | +++ b/meson.build |
| 22 | @@ -26,7 +26,12 @@ pkgdatadir = join_paths([prefix, get_option('datadir'), package_name]) |
| 23 | bindir = join_paths([prefix, get_option('bindir')]) |
| 24 | libexecdir = join_paths([prefix, get_option('libexecdir')]) |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 25 | schemadir = join_paths(['share', 'glib-2.0', 'schemas']) |
| 26 | -pythondir = pyinstall.get_install_dir() |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 27 | +pythoninstalldir = get_option('pythoninstalldir') |
| 28 | +if pythoninstalldir != '' |
| 29 | + pythondir = join_paths([prefix, pythoninstalldir]) |
| 30 | +else |
| 31 | + pythondir = join_paths([prefix, python.sysconfig_path('purelib')]) |
| 32 | +endif |
| 33 | |
| 34 | if get_option('policykit') |
| 35 | have_polkit = 'True' |
| 36 | diff --git a/meson_options.txt b/meson_options.txt |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 37 | index 177d9ab8..3e397d8e 100644 |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 38 | --- a/meson_options.txt |
| 39 | +++ b/meson_options.txt |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 40 | @@ -2,6 +2,7 @@ option('runtime_deps_check', type: 'boolean', value: true, description: 'Disable |
| 41 | option('dhcp-config-path', type: 'string', value: '/etc/dhcp3/dhcpd.conf', description: 'Set dhcp3 server configuration path') |
| 42 | option('policykit', type: 'boolean', value: true, description: 'Enable policykit support') |
| 43 | option('pulseaudio', type: 'boolean', value: true, description: 'Enable PulseAudio support') |
| 44 | +option('pythoninstalldir', type: 'string', description: 'Path to python site-packages dir relative to ${prefix}') |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 45 | option('systemdsystemunitdir', type: 'string', description: 'Path to systemd system unit dir relative to ${prefix}') |
| 46 | option('systemduserunitdir', type: 'string', description: 'Path to systemd user unit dir relative to ${prefix}') |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 47 | option('sendto-plugins', type: 'array', choices: ['Caja', 'Nemo', 'Nautilus'], value: ['Caja', 'Nemo', 'Nautilus'], description: 'Install sendto plugins for various filemanagers') |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 48 | -- |
Patrick Williams | 2194f50 | 2022-10-16 14:26:09 -0500 | [diff] [blame^] | 49 | 2.34.1 |
Patrick Williams | de0582f | 2022-04-08 10:23:27 -0500 | [diff] [blame] | 50 | |