From 86d945e616671e5ed177ea6f53168b5cb35bc1f1 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 28 Dec 2015 00:36:17 +0100 Subject: gobject-introspection: new package Signed-off-by: Michael Olbrich --- ...1-giscanner-add-use-binary-wrapper-option.patch | 47 +++++++++++ ...02-giscanner-add-a-use-ldd-wrapper-option.patch | 43 ++++++++++ ...c-add-host-gi-and-gi-cross-wrapper-option.patch | 76 ++++++++++++++++++ .../0004-avoid-Python2-dependency.patch | 93 ++++++++++++++++++++++ .../0005-fix-env-shebang.patch | 19 +++++ patches/gobject-introspection-1.46.0/autogen.sh | 1 + patches/gobject-introspection-1.46.0/series | 8 ++ 7 files changed, 287 insertions(+) create mode 100644 patches/gobject-introspection-1.46.0/0001-giscanner-add-use-binary-wrapper-option.patch create mode 100644 patches/gobject-introspection-1.46.0/0002-giscanner-add-a-use-ldd-wrapper-option.patch create mode 100644 patches/gobject-introspection-1.46.0/0003-configure.ac-add-host-gi-and-gi-cross-wrapper-option.patch create mode 100644 patches/gobject-introspection-1.46.0/0004-avoid-Python2-dependency.patch create mode 100644 patches/gobject-introspection-1.46.0/0005-fix-env-shebang.patch create mode 120000 patches/gobject-introspection-1.46.0/autogen.sh create mode 100644 patches/gobject-introspection-1.46.0/series (limited to 'patches') diff --git a/patches/gobject-introspection-1.46.0/0001-giscanner-add-use-binary-wrapper-option.patch b/patches/gobject-introspection-1.46.0/0001-giscanner-add-use-binary-wrapper-option.patch new file mode 100644 index 000000000..320f976cd --- /dev/null +++ b/patches/gobject-introspection-1.46.0/0001-giscanner-add-use-binary-wrapper-option.patch @@ -0,0 +1,47 @@ +From: Alexander Kanavin +Date: Mon, 19 Oct 2015 18:26:40 +0300 +Subject: [PATCH] giscanner: add --use-binary-wrapper option + +With this option, giscanner will use a wrapper executable to run +binaries it's producing, instead of running them directly. This +is useful when binaries are cross-compiled and cannot be run directly, +but they can be run using for example QEMU emulation. + +Upstream-Status: Pending [review on oe-core list] +Signed-off-by: Alexander Kanavin +--- + giscanner/scannermain.py | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py +index 89ec193775c4..2cae03764800 100755 +--- a/giscanner/scannermain.py ++++ b/giscanner/scannermain.py +@@ -118,6 +118,9 @@ def _get_option_parser(): + parser.add_option("", "--program", + action="store", dest="program", default=None, + help="program to execute") ++ parser.add_option("", "--use-binary-wrapper", ++ action="store", dest="wrapper", default=None, ++ help="wrapper to use for running programs (useful when cross-compiling)") + parser.add_option("", "--program-arg", + action="append", dest="program_args", default=[], + help="extra arguments to program") +@@ -412,6 +415,17 @@ def create_binary(transformer, options, args): + gdump_parser.get_error_quark_functions()) + + shlibs = resolve_shlibs(options, binary, options.libraries) ++ if options.wrapper: ++ # The wrapper needs the binary itself, not the libtool wrapper script, ++ # so we check if libtool has sneaked the binary into .libs subdirectory ++ # and adjust the path accordingly ++ import os.path ++ dir_name, binary_name = os.path.split(binary.args[0]) ++ libtool_binary = os.path.join(dir_name, '.libs', binary_name) ++ if os.path.exists(libtool_binary): ++ binary.args[0] = libtool_binary ++ # Then prepend the wrapper to the command line to execute ++ binary.args = [options.wrapper] + binary.args + gdump_parser.set_introspection_binary(binary) + gdump_parser.parse() + return shlibs diff --git a/patches/gobject-introspection-1.46.0/0002-giscanner-add-a-use-ldd-wrapper-option.patch b/patches/gobject-introspection-1.46.0/0002-giscanner-add-a-use-ldd-wrapper-option.patch new file mode 100644 index 000000000..a5e140c97 --- /dev/null +++ b/patches/gobject-introspection-1.46.0/0002-giscanner-add-a-use-ldd-wrapper-option.patch @@ -0,0 +1,43 @@ +From: Alexander Kanavin +Date: Fri, 30 Oct 2015 16:28:46 +0200 +Subject: [PATCH] giscanner: add a --use-ldd-wrapper option + +This is useful in cross-compile environments where system's ldd +command does not work on binaries built for a different architecture + +Upstream-Status: Pending [review in oe-core] +Signed-off-by: Alexander Kanavin +--- + giscanner/scannermain.py | 3 +++ + giscanner/shlibs.py | 4 +++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py +index 2cae03764800..5afcc2895697 100755 +--- a/giscanner/scannermain.py ++++ b/giscanner/scannermain.py +@@ -121,6 +121,9 @@ def _get_option_parser(): + parser.add_option("", "--use-binary-wrapper", + action="store", dest="wrapper", default=None, + help="wrapper to use for running programs (useful when cross-compiling)") ++ parser.add_option("", "--use-ldd-wrapper", ++ action="store", dest="ldd_wrapper", default=None, ++ help="wrapper to use instead of ldd (useful when cross-compiling)") + parser.add_option("", "--program-arg", + action="append", dest="program_args", default=[], + help="extra arguments to program") +diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py +index 838d34303d90..87a59a90fcb9 100644 +--- a/giscanner/shlibs.py ++++ b/giscanner/shlibs.py +@@ -100,7 +100,9 @@ def _resolve_non_libtool(options, binary, libraries): + args.extend(libtool) + args.append('--mode=execute') + platform_system = platform.system() +- if platform_system == 'Darwin': ++ if options.ldd_wrapper: ++ args.extend([options.ldd_wrapper, binary.args[0]]) ++ elif platform_system == 'Darwin': + args.extend(['otool', '-L', binary.args[0]]) + else: + args.extend(['ldd', binary.args[0]]) diff --git a/patches/gobject-introspection-1.46.0/0003-configure.ac-add-host-gi-and-gi-cross-wrapper-option.patch b/patches/gobject-introspection-1.46.0/0003-configure.ac-add-host-gi-and-gi-cross-wrapper-option.patch new file mode 100644 index 000000000..ae340338f --- /dev/null +++ b/patches/gobject-introspection-1.46.0/0003-configure.ac-add-host-gi-and-gi-cross-wrapper-option.patch @@ -0,0 +1,76 @@ +From: Michael Olbrich +Date: Mon, 28 Dec 2015 11:42:16 +0100 +Subject: [PATCH] configure.ac: add host-gi and gi-cross-wrapper options + +Based on a patch from Alexander Kanavin + +Note: Not for upstream. It depends on PTXdist modifying the configure script. + +Signed-off-by: Michael Olbrich +--- + common.mk | 12 +++++++++++- + configure.ac | 14 ++++++++++++++ + 2 files changed, 25 insertions(+), 1 deletion(-) + +diff --git a/common.mk b/common.mk +index e26c6377838a..2a6774cc2156 100644 +--- a/common.mk ++++ b/common.mk +@@ -6,6 +6,15 @@ + # module itself. + # + ++if USE_HOST_GI ++INTROSPECTION_SCANNER = \ ++ env PATH="$(PATH)" \ ++ LPATH=.libs \ ++ CC="$(CC)" \ ++ PYTHONPATH=$(top_builddir):$(top_srcdir) \ ++ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \ ++ g-ir-scanner ++else + INTROSPECTION_SCANNER = \ + env PATH=".libs:$(PATH)" \ + LPATH=.libs \ +@@ -14,6 +23,7 @@ INTROSPECTION_SCANNER = \ + UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) \ + UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \ + $(top_builddir)/g-ir-scanner ++endif + + INTROSPECTION_SCANNER_ARGS = \ + --verbose \ +@@ -26,7 +36,7 @@ INTROSPECTION_SCANNER_ARGS = \ + + INTROSPECTION_COMPILER = \ + env PATH=".libs:$(PATH)" \ +- $(top_builddir)/g-ir-compiler$(EXEEXT) ++ $(GI_CROSS_WRAPPER) $(top_builddir)/g-ir-compiler$(EXEEXT) + + INTROSPECTION_COMPILER_ARGS = \ + --includedir=$(srcdir) \ +diff --git a/configure.ac b/configure.ac +index b11596be573c..a7b78715cdf3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -250,6 +250,20 @@ AC_FUNC_STRTOD + AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull]) + AC_CHECK_FUNCS([backtrace backtrace_symbols]) + ++AC_ARG_ENABLE([gi-cross-wrapper], ++[AS_HELP_STRING([--enable-gi-cross-wrapper=path],[Use a wrapper to run gicompiler and binaries produced by giscanner (useful when cross-compiling)])], ++[GI_CROSS_WRAPPER="${enableval}"], [GI_CROSS_WRAPPER=]) ++AC_SUBST(GI_CROSS_WRAPPER) ++ ++AC_ARG_ENABLE([host-gi], ++[AS_HELP_STRING([--enable-host-gi],[Use gobject introspection tools installed in the host system (useful when cross-compiling)])], ++[case "${enableval}" in ++ yes) host_gi=true ;; ++ no) host_gi=false ;; ++ *) AC_MSG_ERROR([bad value ${enableval} for --enable-host-gi]) ;; ++esac],[host_gi=false]) ++AM_CONDITIONAL([USE_HOST_GI], [test x$host_gi = xtrue]) ++ + # Python + AM_PATH_PYTHON([2.7]) + case "$host" in diff --git a/patches/gobject-introspection-1.46.0/0004-avoid-Python2-dependency.patch b/patches/gobject-introspection-1.46.0/0004-avoid-Python2-dependency.patch new file mode 100644 index 000000000..106021a51 --- /dev/null +++ b/patches/gobject-introspection-1.46.0/0004-avoid-Python2-dependency.patch @@ -0,0 +1,93 @@ +From: Michael Olbrich +Date: Sun, 27 Dec 2015 17:15:09 +0100 +Subject: [PATCH] avoid Python2 dependency + +Signed-off-by: Michael Olbrich +--- + Makefile-gir.am | 5 ++++- + Makefile-tools.am | 4 ++++ + Makefile.am | 2 ++ + configure.ac | 2 ++ + 4 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/Makefile-gir.am b/Makefile-gir.am +index 9aca664290c8..d605c8ee7ffa 100644 +--- a/Makefile-gir.am ++++ b/Makefile-gir.am +@@ -87,7 +87,10 @@ endif + + BUILT_GIRSOURCES += GLib-2.0.gir + +-GLib-2.0.gir: g-ir-scanner g-ir-compiler$(EXEEXT) ++if !USE_HOST_GI ++GLib-2.0.gir: g-ir-scanner ++endif ++GLib-2.0.gir: g-ir-compiler$(EXEEXT) + + gir/DBusGLib-1.0.typelib: GObject-2.0.gir + +diff --git a/Makefile-tools.am b/Makefile-tools.am +index dbd264c31df4..840530ee8db1 100644 +--- a/Makefile-tools.am ++++ b/Makefile-tools.am +@@ -1,15 +1,18 @@ + bin_PROGRAMS += g-ir-compiler g-ir-generate ++if !USE_HOST_GI + bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool + + if BUILD_DOCTOOL + bin_SCRIPTS += g-ir-doc-tool + endif ++endif + + EXTRA_DIST += \ + tools/g-ir-tool-template.in + + TOOL_SUBSTITUTIONS = -e s,@libdir\@,$(libdir), -e s,@datarootdir\@,$(datarootdir), -e s,@PYTHON\@,$(PYTHON), + ++if !USE_HOST_GI + g-ir-scanner: tools/g-ir-tool-template.in _giscanner.la Makefile + $(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,scannermain, -e s,@TOOL_FUNCTION\@,scanner_main, $< > $@.tmp && mv $@.tmp $@ + @chmod a+x $@ +@@ -21,6 +24,7 @@ g-ir-annotation-tool: tools/g-ir-tool-template.in _giscanner.la Makefile + g-ir-doc-tool: tools/g-ir-tool-template.in _giscanner.la Makefile + $(AM_V_GEN) sed $(TOOL_SUBSTITUTIONS) -e s,@TOOL_MODULE\@,docmain, -e s,@TOOL_FUNCTION\@,doc_main, $< > $@.tmp && mv $@.tmp $@ + @chmod a+x $@ ++endif + + g_ir_compiler_SOURCES = tools/compiler.c + g_ir_compiler_CPPFLAGS = -DGIREPO_DEFAULT_SEARCH_PATH="\"$(libdir)\"" \ +diff --git a/Makefile.am b/Makefile.am +index 437c673ffc3c..ca76f352bfdb 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -19,7 +19,9 @@ include Makefile.introspection + + include Makefile-cmph.am + include Makefile-girepository.am ++if !USE_HOST_GI + include Makefile-giscanner.am ++endif + include Makefile-examples.am + include Makefile-gir.am + include Makefile-tools.am +diff --git a/configure.ac b/configure.ac +index a7b78715cdf3..b3d2767ccf07 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -264,6 +264,7 @@ AC_ARG_ENABLE([host-gi], + esac],[host_gi=false]) + AM_CONDITIONAL([USE_HOST_GI], [test x$host_gi = xtrue]) + ++AS_IF([ test x$host_gi != xtrue], [ + # Python + AM_PATH_PYTHON([2.7]) + case "$host" in +@@ -277,6 +278,7 @@ AM_CHECK_PYTHON_HEADERS(, AC_MSG_ERROR([Python headers not found])) + if test "x$os_win32" = "xyes"; then + AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.])) + fi ++]) + + dnl Not enabled by default until 3.6 cycle when we can propose mako as + dnl an external dependency diff --git a/patches/gobject-introspection-1.46.0/0005-fix-env-shebang.patch b/patches/gobject-introspection-1.46.0/0005-fix-env-shebang.patch new file mode 100644 index 000000000..0ef3084c5 --- /dev/null +++ b/patches/gobject-introspection-1.46.0/0005-fix-env-shebang.patch @@ -0,0 +1,19 @@ +From: Michael Olbrich +Date: Sun, 27 Dec 2015 18:14:25 +0100 +Subject: [PATCH] fix env shebang + +Signed-off-by: Michael Olbrich +--- + tests/offsets/gen-gitestoffsets | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/offsets/gen-gitestoffsets b/tests/offsets/gen-gitestoffsets +index 77351060cd5b..5bf5f562e7d2 100755 +--- a/tests/offsets/gen-gitestoffsets ++++ b/tests/offsets/gen-gitestoffsets +@@ -1,4 +1,4 @@ +-#!/bin/env python ++#!/usr/bin/env python + # -*- Mode: Python -*- + # GObject-Introspection - a framework for introspecting GObject libraries + # Copyright (C) 2008 Red Hat, Inc. diff --git a/patches/gobject-introspection-1.46.0/autogen.sh b/patches/gobject-introspection-1.46.0/autogen.sh new file mode 120000 index 000000000..9f8a4cb7d --- /dev/null +++ b/patches/gobject-introspection-1.46.0/autogen.sh @@ -0,0 +1 @@ +../autogen.sh \ No newline at end of file diff --git a/patches/gobject-introspection-1.46.0/series b/patches/gobject-introspection-1.46.0/series new file mode 100644 index 000000000..aaeb47861 --- /dev/null +++ b/patches/gobject-introspection-1.46.0/series @@ -0,0 +1,8 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-giscanner-add-use-binary-wrapper-option.patch +0002-giscanner-add-a-use-ldd-wrapper-option.patch +0003-configure.ac-add-host-gi-and-gi-cross-wrapper-option.patch +0004-avoid-Python2-dependency.patch +0005-fix-env-shebang.patch +# 8d3fd65c073b2de3dc240a42878cef80 - git-ptx-patches magic -- cgit v1.2.3