Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.43 KB | None | 0 0
  1. From 5751f5fb6b862ccd129af523d783968fcc77ed26 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <Aduskett@gmail.com>
  3. Date: Mon, 24 Feb 2020 07:22:33 -0800
  4. Subject: [PATCH] GOI: Fix meson building
  5.  
  6. Signed-off-by: Adam Duskett <Aduskett@gmail.com>
  7. ---
  8.  package/gobject-introspection/g-ir-scanner.in |  2 +
  9.  .../gobject-introspection.mk                  |  6 ++-
  10.  ...4-determine-goi-tools-from-pkgconfig.patch | 38 +++++++++++++++++++
  11.  3 files changed, 44 insertions(+), 2 deletions(-)
  12.  create mode 100644 package/meson/0004-determine-goi-tools-from-pkgconfig.patch
  13.  
  14. diff --git a/package/gobject-introspection/g-ir-scanner.in b/package/gobject-introspection/g-ir-scanner.in
  15. index 9f97497b7e..d5847ad063 100644
  16. --- a/package/gobject-introspection/g-ir-scanner.in
  17. +++ b/package/gobject-introspection/g-ir-scanner.in
  18. @@ -1,6 +1,8 @@
  19.  #!/usr/bin/env bash
  20.  
  21.  export GI_SCANNER_DISABLE_CACHE=1
  22. +export CC="$(dirname "${0}")/../../../../bin/@BASENAME_TARGET_CC@"
  23. +
  24.  ${HOST_DIR}/bin/g-ir-scanner \
  25.  --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH \
  26.  --use-binary-wrapper=$(dirname $0)/g-ir-scanner-qemuwrapper \
  27. diff --git a/package/gobject-introspection/gobject-introspection.mk b/package/gobject-introspection/gobject-introspection.mk
  28. index 67e5e37dee..5997262f91 100644
  29. --- a/package/gobject-introspection/gobject-introspection.mk
  30. +++ b/package/gobject-introspection/gobject-introspection.mk
  31. @@ -36,8 +36,8 @@ GOBJECT_INTROSPECTION_NINJA_ENV += \
  32.  # Disable introspection data on the host, as it is not needed and
  33.  # the package will attempt to use the systems libglib2 which will fail
  34.  # if the systems libglib2 version is older than 2.60.
  35. -HOST_GOBJECT_INTROSPECTION_CONF_OPTS = \
  36. -   -Denable-introspection-data=false
  37. +HOST_GOBJECT_INTROSPECTION_NINJA_ENV += \
  38. +   LD_RUN_PATH="$(HOST_DIR)/lib"
  39.  
  40.  # Use the host gi-scanner to prevent the scanner from generating incorrect
  41.  # elf classes.
  42. @@ -101,6 +101,8 @@ define GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
  43.         $(INSTALL) -D -m 755 \
  44.             $(GOBJECT_INTROSPECTION_PKGDIR)/$(w).in $(STAGING_DIR)/usr/bin/$(w)
  45.     )
  46. +   $(SED) "s%@BASENAME_TARGET_CC@%$(notdir $(TARGET_CC))%g" $(STAGING_DIR)/usr/bin/g-ir-scanner
  47. +
  48.     # Gobject-introspection installs Makefile.introspection in
  49.     # $(STAGING_DIR)/usr/share which is needed for autotools-based programs to
  50.     # build .gir and .typelib files. Unfortuantly, gobject-introspection-1.0.pc
  51. diff --git a/package/meson/0004-determine-goi-tools-from-pkgconfig.patch b/package/meson/0004-determine-goi-tools-from-pkgconfig.patch
  52. new file mode 100644
  53. index 0000000000..9b4e85e581
  54. --- /dev/null
  55. +++ b/package/meson/0004-determine-goi-tools-from-pkgconfig.patch
  56. @@ -0,0 +1,38 @@
  57. +From 831fd737c3f2e54f6f77ce4da0c3abd02349e086 Mon Sep 17 00:00:00 2001
  58. +From: Adam Duskett <Aduskett@gmail.com>
  59. +Date: Mon, 24 Feb 2020 06:29:26 -0800
  60. +Subject: [PATCH] gobject-introspection: determine g-ir-scanner and
  61. + g-ir-compiler paths from pkgconfig
  62. +
  63. +Currently, meson hard codes the paths of these binaries which results in
  64. +cross-compiled environments to run the host versions of these tools.
  65. +
  66. +GObject-introspection provides the appropriate paths to these utilities via
  67. +pkg-config.
  68. +---
  69. + mesonbuild/modules/gnome.py | 6 +++---
  70. + 1 file changed, 3 insertions(+), 3 deletions(-)
  71. +
  72. +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
  73. +index 3d5d718136..3cdacfe0b1 100644
  74. +--- a/mesonbuild/modules/gnome.py
  75. ++++ b/mesonbuild/modules/gnome.py
  76. +@@ -736,15 +736,15 @@ def generate_gir(self, state, args, kwargs):
  77. +         if kwargs.get('install_dir'):
  78. +             raise MesonException('install_dir is not supported with generate_gir(), see "install_dir_gir" and "install_dir_typelib"')
  79. +
  80. +-        giscanner = self.interpreter.find_program_impl('g-ir-scanner')
  81. +-        gicompiler = self.interpreter.find_program_impl('g-ir-compiler')
  82. +-
  83. +         girtargets = [self._unwrap_gir_target(arg, state) for arg in args]
  84. +
  85. +         if len(girtargets) > 1 and any([isinstance(el, build.Executable) for el in girtargets]):
  86. +             raise MesonException('generate_gir only accepts a single argument when one of the arguments is an executable')
  87. +
  88. +         self.gir_dep, pkgargs = self._get_gir_dep(state)
  89. ++        giscanner = self.gir_dep.get_pkgconfig_variable('g_ir_scanner', {})
  90. ++        gicompiler = self.gir_dep.get_pkgconfig_variable('g_ir_compiler', {})
  91. ++
  92. +
  93. +         ns = kwargs.pop('namespace')
  94. +         nsversion = kwargs.pop('nsversion')
  95. --
  96. 2.21.1 (Apple Git-122.3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement