summaryrefslogtreecommitdiffstats
path: root/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch')
-rw-r--r--meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch
new file mode 100644
index 0000000000..b0d098c9fc
--- /dev/null
+++ b/meta/recipes-gnome/gobject-introspection/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch
@@ -0,0 +1,51 @@
1From 704b888d0abfb01067352c40156f49f655691c7c Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 19 Oct 2015 18:26:40 +0300
4Subject: [PATCH 3/5] giscanner: add --use-binary-wrapper option
5
6With this option, giscanner will use a wrapper executable to run
7binaries it's producing, instead of running them directly. This
8is useful when binaries are cross-compiled and cannot be run directly,
9but they can be run using for example QEMU emulation.
10
11Upstream-Status: Pending [review on oe-core list]
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13---
14 giscanner/scannermain.py | 14 ++++++++++++++
15 1 file changed, 14 insertions(+)
16
17diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
18index 633496f..d684cd0 100755
19--- a/giscanner/scannermain.py
20+++ b/giscanner/scannermain.py
21@@ -124,6 +124,9 @@ def _get_option_parser():
22 parser.add_option("", "--program",
23 action="store", dest="program", default=None,
24 help="program to execute")
25+ parser.add_option("", "--use-binary-wrapper",
26+ action="store", dest="wrapper", default=None,
27+ help="wrapper to use for running programs (useful when cross-compiling)")
28 parser.add_option("", "--program-arg",
29 action="append", dest="program_args", default=[],
30 help="extra arguments to program")
31@@ -419,6 +422,17 @@ def create_binary(transformer, options, args):
32 gdump_parser.get_error_quark_functions())
33
34 shlibs = resolve_shlibs(options, binary, options.libraries)
35+ if options.wrapper:
36+ # The wrapper needs the binary itself, not the libtool wrapper script,
37+ # so we check if libtool has sneaked the binary into .libs subdirectory
38+ # and adjust the path accordingly
39+ import os.path
40+ dir_name, binary_name = os.path.split(binary.args[0])
41+ libtool_binary = os.path.join(dir_name, '.libs', binary_name)
42+ if os.path.exists(libtool_binary):
43+ binary.args[0] = libtool_binary
44+ # Then prepend the wrapper to the command line to execute
45+ binary.args = [options.wrapper] + binary.args
46 gdump_parser.set_introspection_binary(binary)
47 gdump_parser.parse()
48 return shlibs
49--
502.7.0
51