0001-python-pyobject-fix-install-dir.patch 3.7 KB

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