blob: a52821915ebb7c1e6d3a96da8a3251bb84df4905 [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
19index bc990cd..a37aacd 100644
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')])
25 schemadir = join_paths([datadir, 'glib-2.0', 'schemas'])
26-pythondir = join_paths([prefix, python.sysconfig_path('purelib')])
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'
36diff --git a/meson_options.txt b/meson_options.txt
37index b3e939f..96acbbc 100644
38--- a/meson_options.txt
39+++ b/meson_options.txt
40@@ -5,5 +5,6 @@ option('pulseaudio', type: 'boolean', value: true, description: 'Enable PulseAud
41 option('appindicator', type: 'boolean', value: true, description: 'Enable Libappindicator support')
42 option('systemdsystemunitdir', type: 'string', description: 'Path to systemd system unit dir relative to ${prefix}')
43 option('systemduserunitdir', type: 'string', description: 'Path to systemd user unit dir relative to ${prefix}')
44+option('pythoninstalldir', type: 'string', description: 'Path to python site-packages dir relative to ${prefix}')
45 option('sendto-plugins', type: 'array', choices: ['Caja', 'Nemo', 'Nautilus'], value: ['Caja', 'Nemo', 'Nautilus'], description: 'Install sendto plugins for various filemanagers')
46 option('thunar-sendto', type: 'boolean', value: true, description: 'Install Thunar sendto plugin')
47--
482.33.0
49