blob: cc448b4ffdbc712b9eb69521ce20f7ae7638a543 [file] [log] [blame]
Patrick Williamsde0582f2022-04-08 10:23:27 -05001From 37f24a9bd62f0a8f3e37eaddd33f2f0c9d3aaa0a Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 1 Apr 2022 23:12:17 -0700
4Subject: [PATCH] meson: add pythoninstalldir option
5
6In case of cross build, using host python to determine the python
7site-packages directory for target is not feasible, add a new option
8pythoninstalldir to fix the issue.
9
10Upstream-Status: Submitted [https://github.com/blueman-project/blueman/pull/1699]
11
12Signed-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
18diff --git a/meson.build b/meson.build
Patrick Williams2194f502022-10-16 14:26:09 -050019index e12d0ce6..e84457a5 100644
Patrick Williamsde0582f2022-04-08 10:23:27 -050020--- 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 Williams2194f502022-10-16 14:26:09 -050025 schemadir = join_paths(['share', 'glib-2.0', 'schemas'])
26-pythondir = pyinstall.get_install_dir()
Patrick Williamsde0582f2022-04-08 10:23:27 -050027+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'
36diff --git a/meson_options.txt b/meson_options.txt
Patrick Williams2194f502022-10-16 14:26:09 -050037index 177d9ab8..3e397d8e 100644
Patrick Williamsde0582f2022-04-08 10:23:27 -050038--- a/meson_options.txt
39+++ b/meson_options.txt
Patrick Williams2194f502022-10-16 14:26:09 -050040@@ -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 Williamsde0582f2022-04-08 10:23:27 -050045 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 Williamsde0582f2022-04-08 10:23:27 -050047 option('sendto-plugins', type: 'array', choices: ['Caja', 'Nemo', 'Nautilus'], value: ['Caja', 'Nemo', 'Nautilus'], description: 'Install sendto plugins for various filemanagers')
Patrick Williamsde0582f2022-04-08 10:23:27 -050048--
Patrick Williams2194f502022-10-16 14:26:09 -0500492.34.1
Patrick Williamsde0582f2022-04-08 10:23:27 -050050