blob: 848cda5aad05bf2a062c911a6ff66bba62890ef4 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 8b4648d5bc50cb1c14961ed38bf97d5a693f5237 Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Mon, 24 Jun 2019 14:51:52 +0800
4Subject: [PATCH] python-pyobject: fix the wrong install dir for python2
5
6* after upgrade to 3.32.1, pygobject switch to build with meson, and
7 default python option is python3, switch to python2
8
9* default install dir get by python.install_sources and
10python.get_install_dir is get from python's sysconfig info,
11not like python3, for python2, the install dir include the basedir of
12recipe-sysroot-native, add stagedir option for user to config
13correct install dir.
14
15Upstream-Status: Inappropriate [oe-specific]
16
17Signed-off-by: Changqing Li <changqing.li@windriver.com>
18---
19 gi/meson.build | 7 +++----
20 gi/overrides/meson.build | 4 ++--
21 gi/repository/meson.build | 4 ++--
22 meson.build | 4 +++-
23 meson_options.txt | 1 +
24 pygtkcompat/meson.build | 4 ++--
25 6 files changed, 13 insertions(+), 11 deletions(-)
26
27diff --git a/gi/meson.build b/gi/meson.build
28index c1afd68..249c23d 100644
29--- a/gi/meson.build
30+++ b/gi/meson.build
31@@ -60,9 +60,8 @@ python_sources = [
32 'types.py',
33 ]
34
35-python.install_sources(python_sources,
36- pure : false,
37- subdir : 'gi'
38+install_data(python_sources,
39+ install_dir: join_paths(stagedir, 'gi')
40 )
41
42 # https://github.com/mesonbuild/meson/issues/4117
43@@ -76,7 +75,7 @@ giext = python.extension_module('_gi', sources,
44 dependencies : [python_ext_dep, glib_dep, gi_dep, ffi_dep],
45 include_directories: include_directories('..'),
46 install: true,
47- subdir : 'gi',
48+ install_dir: join_paths(stagedir, 'gi'),
49 c_args: pyext_c_args + main_c_args
50 )
51
52diff --git a/gi/overrides/meson.build b/gi/overrides/meson.build
53index 6ff073f..964fef1 100644
54--- a/gi/overrides/meson.build
55+++ b/gi/overrides/meson.build
56@@ -10,6 +10,6 @@ python_sources = [
57 'keysyms.py',
58 '__init__.py']
59
60-python.install_sources(python_sources,
61- subdir : join_paths('gi', 'overrides')
62+install_data(python_sources,
63+ install_dir: join_paths(stagedir, 'gi', 'overrides')
64 )
65diff --git a/gi/repository/meson.build b/gi/repository/meson.build
66index fdc136b..fc88adf 100644
67--- a/gi/repository/meson.build
68+++ b/gi/repository/meson.build
69@@ -1,5 +1,5 @@
70 python_sources = ['__init__.py']
71
72-python.install_sources(python_sources,
73- subdir : join_paths('gi', 'repository')
74+install_data(python_sources,
75+ install_dir: join_paths(stagedir, 'gi', 'repository')
76 )
77diff --git a/meson.build b/meson.build
78index d27a005..ecd55d5 100644
79--- a/meson.build
80+++ b/meson.build
81@@ -165,12 +165,14 @@ else
82 py_version = pygobject_version
83 endif
84
85+stagedir = get_option('stagedir')
86+
87 pkginfo_conf = configuration_data()
88 pkginfo_conf.set('VERSION', py_version)
89 configure_file(input : 'PKG-INFO.in',
90 output : 'PyGObject-@0@.egg-info'.format(py_version),
91 configuration : pkginfo_conf,
92- install_dir : python.get_install_dir(pure : false))
93+ install_dir : stagedir)
94
95 subdir('gi')
96 subdir('pygtkcompat')
97diff --git a/meson_options.txt b/meson_options.txt
98index 5dd4cbc..21def16 100644
99--- a/meson_options.txt
100+++ b/meson_options.txt
101@@ -1,3 +1,4 @@
102 option('python', type : 'string', value : 'python3')
103 option('pycairo', type : 'boolean', value : true, description : 'build with pycairo integration')
104 option('tests', type : 'boolean', value : true, description : 'build unit tests')
105+option('stagedir', type : 'string', value : '')
106diff --git a/pygtkcompat/meson.build b/pygtkcompat/meson.build
107index 9e43c44..ef3322d 100644
108--- a/pygtkcompat/meson.build
109+++ b/pygtkcompat/meson.build
110@@ -3,6 +3,6 @@ python_sources = [
111 'generictreemodel.py',
112 'pygtkcompat.py']
113
114-python.install_sources(python_sources,
115- subdir : 'pygtkcompat'
116+install_data(python_sources,
117+ install_dir: join_paths(stagedir, 'pygtkcompat')
118 )
119--
1202.7.4
121