Skip to contentSkip to conversation

gobject-introspection: new series

RFC Superseded Adam Duskett 4 participants 11 messages Feb 7, 2018 – Feb 8, 2018

v2 of 10 Superseded Latest is v10 →

lore
Share & tools
lore
#0 lore raw

v2 cover gobject-introspection: new series

After a lot more pounding away at the keyboard, I am now ready to release version 2 of the gobject-introspection series patch.

This new series has the following upgrades:
- It now works on arm. (More on that later)
- Gstreamer1 can now use it.
- General makefile cleanups.
- New patches that make cross-compiling a bit nicer (thanks, yocto!)

To start:

I have tested this with a cortex-a9/gcc7.3 and of course glibc. So far GStreamer can now compile, which means that everything as far as I can tell is setup correctly to give this thing a genuine shot finally at being put into mainline Buildroot!

What doesn't work:
For some reason, x86_64/i7 does not work. Qemu segfaults. I have a suspicion that this is why Yocto does pre-linking, but I am not 100% sure.

What I could use help with:

- Obviously automated testing. I had a conversation in IRC with Yann, and he said that perhaps just merging it in now with only a small set of architectures might be an excellent way to go.

- Package updates: I will get around to updating python-gobject as it's needed for GStreamer-python (the entire reason I started this venture)

- Comments on the patches themselves would also be appreciated!.

Thanks!

Adam

Adam Duskett (3):
qemu: add BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
gobject-introspection: new package
gstreamer1: support gobject-introspection

 package/gstreamer1/gstreamer1/gstreamer1.mk | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
2.14.3
#1 lore raw

RFC v2 1/3 qemu: add BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS

Match the style used with other packages such as valgrind.

---
 package/qemu/Config.in.host | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
package/qemu/Config.in.host +9 -4
index 71f38ef41f..78fe54a85c 100644
@@ -1,15 +1,20 @@
-config BR2_PACKAGE_HOST_QEMU
-	bool "host qemu"
-	depends on BR2_arm       || BR2_armeb       || BR2_aarch64      || \
+config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	bool
+	default y if BR2_arm || BR2_armeb       || BR2_aarch64      || \
 		BR2_i386         || BR2_m68k        || BR2_microblazeel || \
 		BR2_microblazebe || BR2_mips        || BR2_mipsel       || \
 		BR2_mips64       || BR2_mips64el    || BR2_powerpc      || \
 		BR2_powerpc64    || BR2_powerpc64le || BR2_sh           || \
 		BR2_sparc        || BR2_x86_64
+
+config BR2_PACKAGE_HOST_QEMU
+	bool "host qemu"
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
 	select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE \
 		if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
 	help
-	  QEMU is a generic and open source machine emulator and virtualizer.
+	  QEMU is a generic and open source machine emulator and
+	  virtualizer.
 
 	  This option builds an emulator for your selected architecture.
 
Signature · 1 line
2.14.3
#2 lore raw

RFC v2 1/3 qemu: add BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS

Adam, All,

On 2018-02-07 16:23 -0500, Adam Duskett spake thusly:

Quoted 3 lines

Match the style used with other packages such as valgrind.

However, small comment below...

Quoted 10 lines
---
 package/qemu/Config.in.host | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
package/qemu/Config.in.host +0 -1
index 71f38ef41f..78fe54a85c 100644
@@ -1,15 +1,20 @@
-config BR2_PACKAGE_HOST_QEMU

package/qemu/Config.in.host line 8

Quoted 10 lines
package/qemu/Config.in.host +3 -2
-	bool "host qemu"
-	depends on BR2_arm       || BR2_armeb       || BR2_aarch64      || \
+config BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	bool
+	default y if BR2_arm || BR2_armeb       || BR2_aarch64      || \
 		BR2_i386         || BR2_m68k        || BR2_microblazeel || \
 		BR2_microblazebe || BR2_mips        || BR2_mipsel       || \
 		BR2_mips64       || BR2_mips64el    || BR2_powerpc      || \
 		BR2_powerpc64    || BR2_powerpc64le || BR2_sh           || \
 		BR2_sparc        || BR2_x86_64

This would become more readable if we were to write:

    default y if BR2_arm || BR2_armeb
    default y if BR2_aarch64
    default y if BR2_i386 || BR2_x86_64
    etc...

But of course, not part of this patch. ;-)

package/qemu/Config.in.host line 17

Quoted 9 lines
package/qemu/Config.in.host +5 -1
+config BR2_PACKAGE_HOST_QEMU
+	bool "host qemu"
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
 	select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE \
 		if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
 	help
-	  QEMU is a generic and open source machine emulator and virtualizer.
+	  QEMU is a generic and open source machine emulator and
+	  virtualizer.

Spurious wrapping. Not very important...

Regards,
Yann E. MORIN.

Quoted 9 lines
package/qemu/Config.in.host +0 -0
 	  This option builds an emulator for your selected architecture.
 
Signature · 6 lines
2.14.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

RFC v2 1/3 qemu: add BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS

In reply to Adam Duskett

Hello,

Quoted 6 lines · Adam Duskett

Match the style used with other packages such as valgrind.

---
 package/qemu/Config.in.host | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

Applied to next after dropping the spurious/unrelated change in the Config.in help text, as noticed by Yann. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

RFC v2 2/3 gobject-introspection: new package

In reply to Adam Duskett

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.

---
 DEVELOPERS                                         |   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            |  34 ++
 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 +++++
 17 files changed, 1097 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
index d0605af387..aaa412da4e 100644
@@ -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/
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
new file mode 100644
index 0000000000..5539b467a9
@@ -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
new file mode 100644
index 0000000000..661affda34
@@ -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 +34 -0
new file mode 100644
index 0000000000..42f58c8c0e
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+	bool "gobject-introspection"
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS #host-qemu
+	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
+	depends on BR2_LINUX_KERNEL # qemu-host
+	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_HOST_QEMU_ARCH_SUPPORTS
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
+		BR2_STATIC_LIBS || !BR2_TOOLCHAIN_USES_GLIBC
+
+comment "gobject-introspection needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
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
new file mode 100644
index 0000000000..b2f97ea870
@@ -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
new file mode 100644
index 0000000000..3313c877f8
@@ -0,0 +1,2 @@
+#!/bin/sh
+${TARGET_CROSS}ldd "$@"
package/gobject-introspection/g-ir-scanner-qemuwrapper.in new file +10 -0
new file mode 100644
index 0000000000..99838a9ce0
@@ -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 @LINUX_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
new file mode 100644
index 0000000000..71b1871cfd
@@ -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
new file mode 100644
index 0000000000..a41fb58a5f
@@ -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
#5 lore raw

RFC v2 2/3 gobject-introspection: new package

Hi Adam,

Thanks for working on this hard problem.

Quoted 6 lines · Adam Duskett
package/gobject-introspection/Config.in new file +0 -0
new file mode 100644
index 0000000000..42f58c8c0e

package/gobject-introspection/Config.in line 10

Quoted 10 lines
package/gobject-introspection/Config.in new file +10 -0
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+	bool "gobject-introspection"
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS #host-qemu
+	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
+	depends on BR2_LINUX_KERNEL # qemu-host

So the target board (not only architecture) must be one that qemu emulates. This is a pretty big limitation. Since GI does not require any specific hardware, would it be possible to use the qemu user space emulator[1] instead?

[1] https://qemu.weilnetz.de/doc/qemu-doc.html#QEMU-User-space-emulator

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#6 lore raw

RFC v2 2/3 gobject-introspection: new package

Hey Baruch! Thanks so much for emailing back!

Quoted 4 lines · Baruch Siach

Hi Adam,

Thanks for working on this hard problem.

Thanks! I must admit this isn't for completely selfless reasons. I want to use the gstreamer-python
bindings for a product I am working on, but alas it uses gobject-intropsection. :)

Quoted 13 lines · Adam Duskett
Quoted 12 lines
package/gobject-introspection/Config.in new file +6 -0
new file mode 100644
index 0000000000..42f58c8c0e
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+     bool "gobject-introspection"
+     depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS #host-qemu
+     depends on BR2_TOOLCHAIN_HAS_THREADS # libffi, libglib2
+     depends on BR2_TOOLCHAIN_USES_GLIBC
+     depends on BR2_USE_MMU # python3, libglib2
Quoted 9 lines

package/gobject-introspection/Config.in line 10

Quoted 4 lines
package/gobject-introspection/Config.in new file +4 -0
+     depends on BR2_USE_WCHAR # python3, libglib2 -> gettext
+     depends on !BR2_STATIC_LIBS
+     depends on !BR2_MIPS_NABI32
+     depends on BR2_LINUX_KERNEL # qemu-host

So the target board (not only architecture) must be one that qemu emulates. This is a pretty big limitation. Since GI does not require any specific hardware, would it be possible to use the qemu user space emulator[1] instead?

Good catch! I am using the qemu-userspace!

The only reason I am required BR2_LINUX_KERNEL is because I am using $(LINUX_VERSION) in gobject-introspection.mk here:
$(SED) "s|@LINUX_VERSION@|$(LINUX_VERSION)|g"

which get's turned into:
PSEUDO_UNLOAD=1 $HOST_DIR/bin/qemu-x86_64 -r 3.10 -L ...

So a question then: Is there a variable I could use to use the toolchains kernel header version instead? That would be an ideal solution in this instance.

Quoted 8 lines

[1] https://qemu.weilnetz.de/doc/qemu-doc.html#QEMU-User-space-emulator

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#7 lore raw

RFC v2 2/3 gobject-introspection: new package

Side note:

BR2_TOOLCHAIN_HEADERS_AT_LEAST looks like it may provide what I would need, which would allow me to drop the linux dependency.

Would this work for everybody?

Adam

Quoted 56 lines · Adam Duskett

Hey Baruch! Thanks so much for emailing back!

Quoted 4 lines · Baruch Siach

Hi Adam,

Thanks for working on this hard problem.

Thanks! I must admit this isn't for completely selfless reasons. I want to use the gstreamer-python
bindings for a product I am working on, but alas it uses gobject-intropsection. :)

Quoted 13 lines · Adam Duskett
Quoted 12 lines
package/gobject-introspection/Config.in new file +6 -0
new file mode 100644
index 0000000000..42f58c8c0e
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+     bool "gobject-introspection"
+     depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS #host-qemu
+     depends on BR2_TOOLCHAIN_HAS_THREADS # libffi, libglib2
+     depends on BR2_TOOLCHAIN_USES_GLIBC
+     depends on BR2_USE_MMU # python3, libglib2
Quoted 9 lines

package/gobject-introspection/Config.in line 10

Quoted 4 lines
package/gobject-introspection/Config.in new file +4 -0
+     depends on BR2_USE_WCHAR # python3, libglib2 -> gettext
+     depends on !BR2_STATIC_LIBS
+     depends on !BR2_MIPS_NABI32
+     depends on BR2_LINUX_KERNEL # qemu-host

So the target board (not only architecture) must be one that qemu emulates. This is a pretty big limitation. Since GI does not require any specific hardware, would it be possible to use the qemu user space emulator[1] instead?

Good catch! I am using the qemu-userspace!

The only reason I am required BR2_LINUX_KERNEL is because I am using $(LINUX_VERSION) in gobject-introspection.mk here:
$(SED) "s|@LINUX_VERSION@|$(LINUX_VERSION)|g"

which get's turned into:
PSEUDO_UNLOAD=1 $HOST_DIR/bin/qemu-x86_64 -r 3.10 -L ...

So a question then: Is there a variable I could use to use the toolchains kernel header version instead? That would be an ideal solution in this instance.

Quoted 8 lines

[1] https://qemu.weilnetz.de/doc/qemu-doc.html#QEMU-User-space-emulator

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#8 lore raw

RFC v2 2/3 gobject-introspection: new package

Hi Adam,

Quoted 6 lines · Adam Duskett

Side note:

BR2_TOOLCHAIN_HEADERS_AT_LEAST looks like it may provide what I would need, which would allow me to drop the linux dependency.

Would this work for everybody?

I think that BR2_TOOLCHAIN_HEADERS_AT_LEAST is indeed what you need. As I understand, GI needs the toolchain headers version, not the target kernel version. They are not always the same.

baruch

Quoted 48 lines · Adam Duskett
Quoted 47 lines

Hey Baruch! Thanks so much for emailing back!

Quoted 2 lines · Baruch Siach

Thanks for working on this hard problem.

Thanks! I must admit this isn't for completely selfless reasons. I want to use the gstreamer-python
bindings for a product I am working on, but alas it uses gobject-intropsection. :)

Quoted 13 lines · Adam Duskett
Quoted 12 lines
package/gobject-introspection/Config.in new file +6 -0
new file mode 100644
index 0000000000..42f58c8c0e
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+     bool "gobject-introspection"
+     depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS #host-qemu
+     depends on BR2_TOOLCHAIN_HAS_THREADS # libffi, libglib2
+     depends on BR2_TOOLCHAIN_USES_GLIBC
+     depends on BR2_USE_MMU # python3, libglib2
Quoted 9 lines

package/gobject-introspection/Config.in line 10

Quoted 4 lines
package/gobject-introspection/Config.in new file +4 -0
+     depends on BR2_USE_WCHAR # python3, libglib2 -> gettext
+     depends on !BR2_STATIC_LIBS
+     depends on !BR2_MIPS_NABI32
+     depends on BR2_LINUX_KERNEL # qemu-host

So the target board (not only architecture) must be one that qemu emulates. This is a pretty big limitation. Since GI does not require any specific hardware, would it be possible to use the qemu user space emulator[1] instead?

Good catch! I am using the qemu-userspace!

The only reason I am required BR2_LINUX_KERNEL is because I am using $(LINUX_VERSION) in gobject-introspection.mk here:
$(SED) "s|@LINUX_VERSION@|$(LINUX_VERSION)|g"

which get's turned into:
PSEUDO_UNLOAD=1 $HOST_DIR/bin/qemu-x86_64 -r 3.10 -L ...

So a question then: Is there a variable I could use to use the toolchains kernel header version instead? That would be an ideal solution in this instance.

Quoted 1 line

[1] https://qemu.weilnetz.de/doc/qemu-doc.html#QEMU-User-space-emulator

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#9 lore raw

RFC v2 2/3 gobject-introspection: new package

Hey Baruch;

Quoted 8 lines · Baruch Siach

Hi Adam,

Quoted 5 lines · Adam Duskett

Side note:

BR2_TOOLCHAIN_HEADERS_AT_LEAST looks like it may provide what I would need, which would allow me to drop the linux dependency.

Quoted 8 lines
Quoted 1 line

Would this work for everybody?

I think that BR2_TOOLCHAIN_HEADERS_AT_LEAST is indeed what you need. As I understand, GI needs the toolchain headers version, not the target kernel version. They are not always the same.

baruch

Great! I tried that out and it works correctly.

Quoted 53 lines
Quoted 40 lines · Adam Duskett
Quoted 39 lines

Hey Baruch! Thanks so much for emailing back!

Quoted 2 lines · Baruch Siach

Thanks for working on this hard problem.

Thanks! I must admit this isn't for completely selfless reasons. I want to use the gstreamer-python
bindings for a product I am working on, but alas it uses gobject-intropsection. :)

Quoted 13 lines · Adam Duskett
Quoted 12 lines
package/gobject-introspection/Config.in new file +6 -0
new file mode 100644
index 0000000000..42f58c8c0e
@@ -0,0 +1,34 @@
+config BR2_PACKAGE_GOBJECT_INTROSPECTION
+     bool "gobject-introspection"
+     depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS #host-qemu
+     depends on BR2_TOOLCHAIN_HAS_THREADS # libffi, libglib2
+     depends on BR2_TOOLCHAIN_USES_GLIBC
+     depends on BR2_USE_MMU # python3, libglib2
Quoted 9 lines

package/gobject-introspection/Config.in line 10

Quoted 4 lines
package/gobject-introspection/Config.in new file +4 -0
+     depends on BR2_USE_WCHAR # python3, libglib2 -> gettext
+     depends on !BR2_STATIC_LIBS
+     depends on !BR2_MIPS_NABI32
+     depends on BR2_LINUX_KERNEL # qemu-host

So the target board (not only architecture) must be one that qemu emulates. This is a pretty big limitation. Since GI does not require any specific hardware, would it be possible to use the qemu user space emulator[1] instead?

Good catch! I am using the qemu-userspace!

The only reason I am required BR2_LINUX_KERNEL is because I am using $(LINUX_VERSION) in gobject-introspection.mk here:
$(SED) "s|@LINUX_VERSION@|$(LINUX_VERSION)|g"

Quoted 8 lines
Quoted 8 lines

which get's turned into:
PSEUDO_UNLOAD=1 $HOST_DIR/bin/qemu-x86_64 -r 3.10 -L ...

So a question then: Is there a variable I could use to use the toolchains kernel header version instead? That would be an ideal solution in this instance.

Quoted 1 line

[1] https://qemu.weilnetz.de/doc/qemu-doc.html#QEMU-User-space-emulator

--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

#10 lore raw

RFC v2 3/3 gstreamer1: support gobject-introspection

In reply to Adam Duskett
---
 package/gstreamer1/gstreamer1/gstreamer1.mk | 5 +++++
 1 file changed, 5 insertions(+)
package/gstreamer1/gstreamer1/gstreamer1.mk +5 -0
index ea9f29a4f3..022676ca23 100644
@@ -31,4 +31,9 @@ GSTREAMER1_DEPENDENCIES = \
 	libglib2 \
 	$(if $(BR2_PACKAGE_LIBUNWIND),libunwind)
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GSTREAMER1_DEPENDENCIES += gobject-introspection
+TARGET_MAKE_ENV += GIR_EXTRA_LIBS_PATH="$(@D)/gst/.libs:$(@D)/libs/gst/base/.libs"
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
2.14.3