gobject-introspection: new package
RFC v3 1/1 gobject-introspection: new package
GObject introspection is a middleware layer between C libraries (using GObject) and language bindings. The C library can be scanned at compile time and generate a metadata file, in addition to the actual native C library. Then at runtime, language bindings can read this metadata and automatically provide bindings to call into the C library.
---
Changes v1 -> v2:
- Fixed wrappers
- Added 0007-giscanner-add-a-lib-dirs-envvar-option.patch
- Added 0008-add-Float128.patch
Changes v2 -> v3:
- Removed Linux kernel dependency (baruch)
- Changed $(LINUX_VERSION) to $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) (baruch)
- Changed @LINUX_VERSION@ in g-ir-scanner-qemuwrapper.in to @TOOLCHAIN_HEADERS_VERSION@ to match the above variable change.
- Added BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET in Config.in with only BR2_arm selected for now.
- Removed BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS in favor of the above change.
- Added two new lines in the base Makefile which removes any remaining .gir or .rnc files from the target filing system, as these are not needed for runtime, only compile time.
DEVELOPERS | 1 + Makefile | 2 + package/Config.in | 1 + ...ncomplete-upstream-attempt-at-cross-compi.patch | 50 +++ ...c-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch | 203 ++++++++++++ ...3-giscanner-add-use-binary-wrapper-option.patch | 52 +++ ...04-giscanner-add-a-use-ldd-wrapper-option.patch | 48 +++ ...config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch | 97 ++++++ .../0006-add-PYTHON_INCLUDES-override.patch | 39 +++ ...07-giscanner-add-a-lib-dirs-envvar-option.patch | 73 +++++ .../gobject-introspection/0008-add-Float128.patch | 28 ++ package/gobject-introspection/Config.in | 35 ++ package/gobject-introspection/cross-ldd | 362 +++++++++++++++++++++ package/gobject-introspection/g-ir-compiler.in | 2 + .../g-ir-scanner-lddwrapper.in | 2 + .../g-ir-scanner-qemuwrapper.in | 10 + package/gobject-introspection/g-ir-scanner.in | 3 + .../gobject-introspection.hash | 4 + .../gobject-introspection/gobject-introspection.mk | 89 +++++ 19 files changed, 1101 insertions(+) create mode 100644 package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch create mode 100644 package/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch create mode 100644 package/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch create mode 100644 package/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch create mode 100644 package/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch create mode 100644 package/gobject-introspection/0006-add-PYTHON_INCLUDES-override.patch create mode 100644 package/gobject-introspection/0007-giscanner-add-a-lib-dirs-envvar-option.patch create mode 100644 package/gobject-introspection/0008-add-Float128.patch create mode 100644 package/gobject-introspection/Config.in create mode 100644 package/gobject-introspection/cross-ldd create mode 100644 package/gobject-introspection/g-ir-compiler.in create mode 100644 package/gobject-introspection/g-ir-scanner-lddwrapper.in create mode 100644 package/gobject-introspection/g-ir-scanner-qemuwrapper.in create mode 100644 package/gobject-introspection/g-ir-scanner.in create mode 100644 package/gobject-introspection/gobject-introspection.hash create mode 100644 package/gobject-introspection/gobject-introspection.mk
DEVELOPERS +1 -0
@@ -34,6 +34,7 @@ F: package/audit/ F: package/busybox/ F: package/checkpolicy/ F: package/cppdb/ +F: package/gobject-introspection/ F: package/gstreamer1/gstreamer1/ F: package/gstreamer1/gstreamer1-mm/ F: package/gstreamer1/gst1-plugins-bad/
Makefile +2 -0
@@ -688,6 +688,8 @@ target-finalize: $(PACKAGES) $(TARGET_DIR)/usr/lib/pkgconfig $(TARGET_DIR)/usr/share/pkgconfig \ $(TARGET_DIR)/usr/lib/cmake $(TARGET_DIR)/usr/share/cmake find $(TARGET_DIR)/usr/{lib,share}/ -name '*.cmake' -print0 | xargs -0 rm -f + find $(TARGET_DIR)/usr/share/ -name '*.gir' -print0 | xargs -0 rm -f + find $(TARGET_DIR)/usr/share/ -name '*.rnc' -print0 | xargs -0 rm -f find $(TARGET_DIR)/lib/ $(TARGET_DIR)/usr/lib/ $(TARGET_DIR)/usr/libexec/ \ \( -name '*.a' -o -name '*.la' \) -print0 | xargs -0 rm -f ifneq ($(BR2_PACKAGE_GDB),y)
package/Config.in +1 -0
@@ -1473,6 +1473,7 @@ menu "Other" source "package/glibmm/Config.in" source "package/glm/Config.in" source "package/gmp/Config.in" + source "package/gobject-introspection/Config.in" source "package/gsl/Config.in" source "package/gtest/Config.in" source "package/jemalloc/Config.in"
package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch new file +50 -0
50 lines not on this page · raw message
package/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch new file +203 -0
203 lines not on this page · raw message
package/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch new file +52 -0
52 lines not on this page · raw message
package/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch new file +48 -0
48 lines not on this page · raw message
package/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch new file +97 -0
97 lines not on this page · raw message
package/gobject-introspection/0006-add-PYTHON_INCLUDES-override.patch new file +39 -0
@@ -0,0 +1,39 @@ +From 08ee7e704d3ebbb783e26768074a5969d6843204 Mon Sep 17 00:00:00 2001 +From: Adam Duskett <[email protected]> +Date: Wed, 18 Oct 2017 17:31:19 -0400 +Subject: [PATCH] add PYTHON_INCLUDES override + +As the configure script mixes up host/target python. Equivalent to the +similar code in dbus-python. + +Signed-off-by: Adam Duskett <[email protected]> +--- + m4/python.m4 | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/m4/python.m4 b/m4/python.m4 +index ed5559d..9853263 100644 +--- a/m4/python.m4 ++++ b/m4/python.m4 +@@ -43,7 +43,17 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS], + [AC_REQUIRE([AM_PATH_PYTHON]) + AC_MSG_CHECKING(for headers required to compile python extensions) + dnl deduce PYTHON_INCLUDES +-PYTHON_INCLUDES=`$PYTHON-config --includes` ++if test "${PYTHON_INCLUDES+set}" = set; then ++ AC_MSG_NOTICE([PYTHON_INCLUDES overridden to: $PYTHON_INCLUDES]) ++else ++ if test -x "$PYTHON_CONFIG"; then ++ PYTHON_INCLUDES=`$PYTHON_CONFIG --includes 2>/dev/null` ++ else ++ PYTHON_INCLUDES=`$PYTHON -c "import distutils.sysconfig, sys; sys.stdout.write(distutils.sysconfig.get_python_inc(True))"` ++ PYTHON_INCLUDES="-I$PYTHON_INCLUDES" ++ fi ++fi ++ + AC_SUBST(PYTHON_INCLUDES) + dnl check if the headers exist: + save_CPPFLAGS="$CPPFLAGS" +-- +2.13.6 +
package/gobject-introspection/0007-giscanner-add-a-lib-dirs-envvar-option.patch new file +73 -0
73 lines not on this page · raw message
package/gobject-introspection/0008-add-Float128.patch new file +28 -0
@@ -0,0 +1,28 @@ +scanner: Add _Float128 + +The ISO/IEC TS 18661-3:2015 standard added new floating point types to +the C standard. + +Newer versions of the GNU C library started exposing `_Float128` in the +headers, which means we need to add this type to the known tokens, to +avoid warnings. + +original commit: +https://github.com/GNOME/gobject-introspection/commit/8cf3e8e5cf6d0d49db359f50c6eb0bc9ca22fbef + +Signed-off-by: Adam Duskett <[email protected]> +--- + +diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l +index 7dbab5c8..218024e9 100644 +--- a/giscanner/scannerlexer.l ++++ b/giscanner/scannerlexer.l +@@ -192,7 +192,7 @@ stringtext ([^\\\"])|(\\.) + "__stdcall" { /* ignore */ } + "__w64" { /* ignore */ } + "__int64" { return INT; } +- ++"_Float128" { return FLOAT; } + + "G_GINT64_CONSTANT" { return INTL_CONST; } + "G_GUINT64_CONSTANT" { return INTUL_CONST; }
package/gobject-introspection/Config.in new file +35 -0
@@ -0,0 +1,35 @@ +config BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET + bool + # Only tested on these architectures + default y if BR2_arm + +config BR2_PACKAGE_GOBJECT_INTROSPECTION + bool "gobject-introspection" + depends on BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET + depends on BR2_TOOLCHAIN_HAS_THREADS # libffi, libglib2 + depends on BR2_TOOLCHAIN_USES_GLIBC + depends on BR2_USE_MMU # python3, libglib2 + depends on BR2_USE_WCHAR # python3, libglib2 -> gettext + depends on !BR2_STATIC_LIBS + depends on !BR2_MIPS_NABI32 + select BR2_PACKAGE_LIBFFI + select BR2_PACKAGE_ZLIB + select BR2_PACKAGE_LIBGLIB2 + select BR2_PACKAGE_HOST_QEMU + select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE + select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON + help + GObject introspection is a middleware layer between C + libraries (using GObject) and language bindings. The C library + can be scanned at compile time and generate a metadata file, + in addition to the actual native C library. Then at runtime, + language bindings can read this metadata and automatically + provide bindings to call into the C library. + + https://wiki.gnome.org/action/show/Projects/GObjectIntrospection + +comment "gobject-introspection needs a glibc toolchain w/ wchar, threads, dynamic library" + depends on BR2_USE_MMU + depends on BR2_PACKAGE_GOBJECT_INTROSPECTION_ARCH_SUPPORTS_TARGET + depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \ + BR2_STATIC_LIBS || !BR2_TOOLCHAIN_USES_GLIBC
package/gobject-introspection/cross-ldd new file +362 -0
362 lines not on this page · raw message
package/gobject-introspection/g-ir-compiler.in new file +2 -0
@@ -0,0 +1,2 @@ +#!/bin/sh +$STAGING_DIR/usr/bin/g-ir-scanner-qemuwrapper $STAGING_DIR/usr/bin/g-ir-compiler.real "$@"
package/gobject-introspection/g-ir-scanner-lddwrapper.in new file +2 -0
@@ -0,0 +1,2 @@ +#!/bin/sh +${TARGET_CROSS}ldd "$@"
package/gobject-introspection/g-ir-scanner-qemuwrapper.in new file +10 -0
@@ -0,0 +1,10 @@ +#!/bin/sh +# Use a modules directory which does not exist so we don't load random things +# which may then get deleted (or their dependencies) and potentially segfault +export GIO_MODULE_DIR=$STAGING_DIR/usr/lib/gio/modules-dummy +PSEUDO_UNLOAD=1 $HOST_DIR/bin/qemu- at HOST_QEMU_ARCH@ -r @TOOLCHAIN_HEADERS_VERSION@ -L $STAGING_DIR -E LD_LIBRARY_PATH=$GIR_EXTRA_LIBS_PATH:.libs:$STAGING_DIR/usr/lib:$STAGING_DIR/lib "$@" +if [[ $? -ne 0 ]]; then + echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the .mk file should help." + echo '(typically like this: GIR_EXTRA_LIBS_PATH="$(@D}/.libs")' + exit 1 +fi
package/gobject-introspection/g-ir-scanner.in new file +3 -0
@@ -0,0 +1,3 @@ +#!/bin/sh +export GI_SCANNER_DISABLE_CACHE=1 +$HOST_DIR/bin/g-ir-scanner --lib-dirs-envvar=GIR_EXTRA_LIBS_PATH --use-binary-wrapper=$STAGING_DIR/usr/bin/g-ir-scanner-qemuwrapper --use-ldd-wrapper=$STAGING_DIR/usr/bin/g-ir-scanner-lddwrapper --add-include-path=$STAGING_DIR/usr/share/gir-1.0 "$@"
package/gobject-introspection/gobject-introspection.hash new file +4 -0
@@ -0,0 +1,4 @@ +#From http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/1.54/gobject-introspection-1.54.1.sha256sum +sha256 b88ded5e5f064ab58a93aadecd6d58db2ec9d970648534c63807d4f9a7bb877e gobject-introspection-1.54.1.tar.xz +sha256 d245807f90032872d1438d741ed21e2490e1175dc8aa3afa5ddb6c8e529b58e5 COPYING.LGPL +sha256 32b1062f7da84967e7019d01ab805935caa7ab7321a7ced0e30ebe75e5df1670 COPYING.GPL
package/gobject-introspection/gobject-introspection.mk new file +89 -0
89 lines not on this page · raw message
Signature · 1 line
2.14.3