Skip to contentSkip to conversation

package/gstreamer1/gstreamer1: add introspection support

PATCH New aduskett at gmail.com 2 participants 8 messages Mar 15, 2020 – Mar 22, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/6 package/gstreamer1/gstreamer1: add introspection support

From: Adam Duskett <[email protected]>

If gobject-introspection is selected, explicitly set -Dintrospection=enabled in the configure options and add a dependency for gobject-introspection.

This feature requires an upstream patch that allows introspection support even when cross-compiling.

---
 ...hen-cross-compiling-if-introspection.patch | 36 +++++++++++++++++++
 package/gstreamer1/gstreamer1/gstreamer1.mk   |  8 ++++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 package/gstreamer1/gstreamer1/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch
package/gstreamer1/gstreamer1/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch new file +36 -0
new file mode 100644
index 0000000000..fc290f6cc0
@@ -0,0 +1,36 @@
+From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
+From: Tim Philipp <[email protected]>
+Date: Thu, 17 Oct 2019 12:13:35 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+Fixes #454 and #381.
+
+Upstream commit: 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8
+Signed-off-by: Tim Philipp <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 90d98d8eb00..a47e7f34e8a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -453,7 +453,7 @@ rt_lib = cc.find_library('rt', required : false)
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+ 
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ 
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
+-- 
+2.24.1
+
package/gstreamer1/gstreamer1/gstreamer1.mk +7 -1
index 4eb3158b8f..47615aad1f 100644
@@ -16,7 +16,6 @@ GSTREAMER1_CONF_OPTS = \
 	-Dtests=disabled \
 	-Dbenchmarks=disabled \
 	-Dgtk_doc=disabled \
-	-Dintrospection=disabled \
 	-Dglib-asserts=disabled \
 	-Dglib-checks=disabled \
 	-Dgobject-cast-checks=disabled \
@@ -36,6 +35,13 @@ GSTREAMER1_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_VALGRIND),valgrind) \
 	$(TARGET_NLS_DEPENDENCIES)
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GSTREAMER1_CONF_OPTS += -Dintrospection=enabled
+GSTREAMER1_DEPENDENCIES += gobject-introspection
+else
+GSTREAMER1_CONF_OPTS += -Dintrospection=disabled
+endif
+
 GSTREAMER1_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
 
 $(eval $(meson-package))
Signature · 1 line
2.24.1
#1 lore raw

PATCH 2/6 package/gstreamer1/gst1-plugins-base: add introspection support

From: Adam Duskett <[email protected]>

If gobject-introspection is selected, explicitly set -Dintrospection=enabled in the configure options and add a dependency for gobject-introspection.

This feature requires an upstream patch that allows introspection support even when cross-compiling.

---
 ...hen-cross-compiling-if-introspection.patch | 35 +++++++++++++++++++
 .../gst1-plugins-base/gst1-plugins-base.mk    | 11 ++++--
 2 files changed, 44 insertions(+), 2 deletions(-)
 create mode 100644 package/gstreamer1/gst1-plugins-base/0002-meson-build-gir-even-when-cross-compiling-if-introspection.patch
package/gstreamer1/gst1-plugins-base/0002-meson-build-gir-even-when-cross-compiling-if-introspection.patch new file +35 -0
new file mode 100644
index 0000000000..a6cca0a4be
@@ -0,0 +1,35 @@
+From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
+From: Tim Philipp <[email protected]>
+Date: Thu, 17 Oct 2019 12:13:35 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.
+
+Upstream commit: 30672ba7d134553e59935ddc875104adba26f25c
+Signed-off-by: Tim Philipp <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 264d84c9e..c8147c224 100644
+--- a/meson.build
++++ b/meson.build
+@@ -371,7 +371,7 @@ endif
+ 
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
+     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
+-- 
+2.24.1
package/gstreamer1/gst1-plugins-base/gst1-plugins-base.mk +9 -2
index ccecbb3c08..fe80f4751c 100644
@@ -17,8 +17,7 @@ GST1_PLUGINS_BASE_CONF_OPTS = \
 	-Dgobject-cast-checks=disabled \
 	-Dglib-asserts=disabled \
 	-Dglib-checks=disabled \
-	-Dgtk_doc=disabled \
-	-Dintrospection=disabled
+	-Dgtk_doc=disabled
 
 # Options which require currently unpackaged libraries
 GST1_PLUGINS_BASE_CONF_OPTS += \
@@ -37,6 +36,14 @@ GST1_PLUGINS_BASE_DEPENDENCIES = gstreamer1 $(TARGET_NLS_DEPENDENCIES)
 GST1_PLUGINS_BASE_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
 
 # These plugins are listed in the order from ./configure --help
+
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_PLUGINS_BASE_CONF_OPTS += -Dintrospection=enabled
+GST1_PLUGINS_BASE_DEPENDENCIES += gobject-introspection
+else
+GST1_PLUGINS_BASE_CONF_OPTS += -Dintrospection=disabled
+endif
+
 ifeq ($(BR2_PACKAGE_ORC),y)
 GST1_PLUGINS_BASE_DEPENDENCIES += orc
 GST1_PLUGINS_BASE_CONF_OPTS += -Dorc=enabled
Signature · 1 line
2.24.1
#2 lore raw

PATCH 3/6 package/gstreamer1/gst1-plugins-bad: add introspection support

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

If gobject-introspection is selected, explicitly set -Dintrospection=enabled in the configure options and add a dependency for gobject-introspection.

This feature requires an upstream patch that allows introspection support even when cross-compiling.

---
 ...hen-cross-compiling-if-introspection.patch | 36 +++++++++++++++++++
 .../gst1-plugins-bad/gst1-plugins-bad.mk      |  8 ++++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 package/gstreamer1/gst1-plugins-bad/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch
package/gstreamer1/gst1-plugins-bad/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch new file +36 -0
new file mode 100644
index 0000000000..dd3b6eca7d
@@ -0,0 +1,36 @@
+From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
+From: Tim Philipp <[email protected]>
+Date: Fri, 18 Oct 2019 00:39:12 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.
+
+Upstream commit: 97a4d0cd7de8cfbf983acc7e37ba2f8fb73c3e19
+Signed-off-by: Tim Philipp <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 67aeeb4d03..7b3314bd9f 100644
+--- a/meson.build
++++ b/meson.build
+@@ -405,7 +405,7 @@ python3 = import('python').find_installation()
+ 
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
+     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
+-- 
+2.24.1
+
package/gstreamer1/gst1-plugins-bad/gst1-plugins-bad.mk +7 -1
index ef36e4dc0a..e020c587d3 100644
@@ -23,7 +23,6 @@ GST1_PLUGINS_BAD_CONF_OPTS = \
 	-Dwinks=disabled \
 	-Dandroidmedia=disabled \
 	-Dapplemedia=disabled \
-	-Dintrospection=disabled \
 	-Dgobject-cast-checks=disabled \
 	-Dglib-asserts=disabled \
 	-Dglib-checks=disabled
@@ -63,6 +62,13 @@ GST1_PLUGINS_BAD_CONF_OPTS += \
 
 GST1_PLUGINS_BAD_DEPENDENCIES = gst1-plugins-base gstreamer1
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_PLUGINS_BAD_CONF_OPTS += -Dintrospection=enabled
+GST1_PLUGINS_BAD_DEPENDENCIES += gobject-introspection
+else
+GST1_PLUGINS_BAD_CONF_OPTS += -Dintrospection=disabled
+endif
+
 ifeq ($(BR2_PACKAGE_GST1_PLUGINS_BAD_PLUGIN_WAYLAND),y)
 GST1_PLUGINS_BAD_CONF_OPTS += -Dwayland=enabled
 GST1_PLUGINS_BAD_DEPENDENCIES += libdrm wayland wayland-protocols
Signature · 1 line
2.24.1
#3 lore raw

PATCH 4/6 package/gstreamer1/gst1-rtsp-server: add introspection support

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

If gobject-introspection is selected, explicitly set -Dintrospection=enabled in the configure options and add a dependency for gobject-introspection.

This feature requires an upstream patch that allows introspection support even when cross-compiling.

---
 ...hen-cross-compiling-if-introspection.patch | 36 +++++++++++++++++++
 .../gst1-rtsp-server/gst1-rtsp-server.mk      |  8 ++++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 package/gstreamer1/gst1-rtsp-server/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch
package/gstreamer1/gst1-rtsp-server/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch new file +36 -0
new file mode 100644
index 0000000000..0adf6d4e47
@@ -0,0 +1,36 @@
+From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
+From: Tim Philipp <[email protected]>
+Date:  Fri, 18 Oct 2019 00:42:12 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+See gstreamer/gstreamer#454 and gstreamer/gstreamer#381.
+
+Upstream commit: 95ce953e34cd0e9f5d42ce7900a9572e7bc8ca47
+Signed-off-by: Tim Philipp <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index e1e3b1d..3f45f0e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -173,7 +173,7 @@ endif
+ 
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_1.0", "@0@", TRUE);'.format(meson.current_build_dir() + '/gir_empty_registry.reg') + \
+     'g_setenv("GST_PLUGIN_PATH_1_0", "", TRUE);' + \
+-- 
+2.24.1
+
package/gstreamer1/gst1-rtsp-server/gst1-rtsp-server.mk +7 -1
index df873ad732..13653565bd 100644
@@ -25,11 +25,17 @@ GST1_RTSP_SERVER_CONF_OPTS = \
 GST1_RTSP_SERVER_CONF_OPTS += \
 	-Dexamples=disabled \
 	-Dtests=disabled \
-	-Dintrospection=disabled \
 	-Dgobject-cast-checks=disabled \
 	-Dglib-asserts=disabled \
 	-Dglib-checks=disabled
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GST1_RTSP_SERVER_CONF_OPTS += -Dintrospection=enabled
+GST1_RTSP_SERVER_DEPENDENCIES += gobject-introspection
+else
+GST1_RTSP_SERVER_CONF_OPTS += -Dintrospection=disabled
+endif
+
 ifeq ($(BR2_PACKAGE_LIBCGROUP),y)
 GST1_RTSP_SERVER_DEPENDENCIES += libcgroup
 endif
Signature · 1 line
2.24.1
#4 lore raw

PATCH 5/6 package/gstreamer1/gst1-python: new package

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

GStreamer Python binding overrides.

This package also includes a simple upstream patch that fixes building against python-3.8.

---
 DEVELOPERS                                    |  1 +
 package/gstreamer1/Config.in                  |  1 +
 .../0001-fix-builds-with-python-3.8.patch     | 43 +++++++++++++++++++
 package/gstreamer1/gst1-python/Config.in      | 24 +++++++++++
 .../gstreamer1/gst1-python/gst1-python.hash   |  3 ++
 package/gstreamer1/gst1-python/gst1-python.mk | 32 ++++++++++++++
 6 files changed, 104 insertions(+)
 create mode 100644 package/gstreamer1/gst1-python/0001-fix-builds-with-python-3.8.patch
 create mode 100644 package/gstreamer1/gst1-python/Config.in
 create mode 100644 package/gstreamer1/gst1-python/gst1-python.hash
 create mode 100644 package/gstreamer1/gst1-python/gst1-python.mk
DEVELOPERS +1 -0
index 5394150e5a..36b7f618aa 100644
@@ -38,6 +38,7 @@ F:	package/gstreamer1/gst1-plugins-bad/
 F:	package/gstreamer1/gst1-plugins-base/
 F:	package/gstreamer1/gst1-plugins-good/
 F:	package/gstreamer1/gst1-plugins-ugly/
+F:	package/gstreamer1/gst1-python/
 F:	package/gstreamer1/gst1-vaapi/
 F:	package/imx-usb-loader/
 F:	package/janus-gateway/
package/gstreamer1/Config.in +1 -0
index bb5c1d2af8..0e47d78e68 100644
@@ -11,6 +11,7 @@ source "package/gstreamer1/gst1-plugins-ugly/Config.in"
 source "package/gstreamer1/gst1-imx/Config.in"
 source "package/gstreamer1/gst1-interpipe/Config.in"
 source "package/gstreamer1/gst1-libav/Config.in"
+source "package/gstreamer1/gst1-python/Config.in"
 source "package/gstreamer1/gst1-rtsp-server/Config.in"
 source "package/gstreamer1/gst1-shark/Config.in"
 source "package/gstreamer1/gst1-validate/Config.in"
package/gstreamer1/gst1-python/0001-fix-builds-with-python-3.8.patch new file +43 -0

43 lines not on this page · raw message

package/gstreamer1/gst1-python/Config.in new file +24 -0
new file mode 100644
index 0000000000..9149703354
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_GST1_PYTHON
+	bool "gst1-python"
+	depends on BR2_USE_MMU # libglib2, gobject-introspection
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS # gobject-introspection
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # gobject-introspection
+	depends on BR2_TOOLCHAIN_USES_GLIBC # gobject-introspection
+	depends on BR2_PACKAGE_PYTHON3 # gobject-introspection
+	select BR2_PACKAGE_GOBJECT_INTROSPECTION
+	select BR2_PACKAGE_LIBGLIB2
+	select BR2_PACKAGE_PYTHON_GOBJECT
+	help
+	  GStreamer python overrides for the gobject-introspection-based
+	  pygst bindings.
+
+	  https://gstreamer.freedesktop.org/modules/gst-python.html
+
+comment "gst1-python needs python3"
+	depends on !BR2_PACKAGE_PYTHON3
+
+comment "gst1-python needs a glibc toolchain, gcc >= 4.9"
+	depends on BR2_USE_MMU
+	depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/gstreamer1/gst1-python/gst1-python.hash new file +3 -0
new file mode 100644
index 0000000000..1d3c687dd4
@@ -0,0 +1,3 @@
+# From https://gstreamer.freedesktop.org/src/gst-python/gst-python-1.16.2.tar.xz.sha256sum
+sha256  208df3148d73d9f416d016564737585d8ea763d91201732d44b5fe688c6288a8  gst-python-1.16.2.tar.xz
+sha256  ea3ad127610e5ded2210b3a86a46314f2b3b28e438eccffdae19a4d6fbcdb0c2  COPYING
package/gstreamer1/gst1-python/gst1-python.mk new file +32 -0
new file mode 100644
index 0000000000..f0a3bacd1f
@@ -0,0 +1,32 @@
+################################################################################
+#
+# gst1-python
+#
+################################################################################
+
+GST1_PYTHON_VERSION = 1.16.2
+GST1_PYTHON_SOURCE = gst-python-$(GST1_PYTHON_VERSION).tar.xz
+GST1_PYTHON_SITE = https://gstreamer.freedesktop.org/src/gst-python
+GST1_PYTHON_INSTALL_STAGING = YES
+GST1_PYTHON_LICENSE_FILES = COPYING
+GST1_PYTHON_LICENSE = LGPL-2.1+
+
+GST1_PYTHON_DEPENDENCIES = \
+	gstreamer1 \
+	python-gobject
+
+# A sysconfigdata_name must be manually specified or the resulting .so
+# will have a x86_64 prefix, which causes "from gi.repository import Gst"
+# to fail.A pythonpath must be specified or the host python path will be used resulting
+# in a "not a valid python" error.
+GST1_PYTHON_CONF_ENV += \
+	_PYTHON_SYSCONFIGDATA_NAME=$(PKG_PYTHON_SYSCONFIGDATA_NAME) \
+	PYTHONPATH=$(PYTHON3_PATH)
+
+# Due to the CONF_ENV options, libpython-dir must be set to the host directory
+# or else the error: "Python dynamic library path could not be determined"
+# will occure
+GST1_PYTHON_CONF_OPTS += \
+	-Dlibpython-dir=$(HOST_DIR)/lib/python3.8
+
+$(eval $(meson-package))
Signature · 1 line
2.24.1
#5 lore raw

PATCH 5/6 package/gstreamer1/gst1-python: new package

All;

Quoted 160 lines · On Sun, Mar 15, 2020 at 1:10 PM <[email protected]> wrote:

From: Adam Duskett <[email protected]>

GStreamer Python binding overrides.

This package also includes a simple upstream patch that fixes building against python-3.8.

---
 DEVELOPERS                                    |  1 +
 package/gstreamer1/Config.in                  |  1 +
 .../0001-fix-builds-with-python-3.8.patch     | 43 +++++++++++++++++++
 package/gstreamer1/gst1-python/Config.in      | 24 +++++++++++
 .../gstreamer1/gst1-python/gst1-python.hash   |  3 ++
 package/gstreamer1/gst1-python/gst1-python.mk | 32 ++++++++++++++
 6 files changed, 104 insertions(+)
 create mode 100644 package/gstreamer1/gst1-python/0001-fix-builds-with-python-3.8.patch
 create mode 100644 package/gstreamer1/gst1-python/Config.in
 create mode 100644 package/gstreamer1/gst1-python/gst1-python.hash
 create mode 100644 package/gstreamer1/gst1-python/gst1-python.mk
DEVELOPERS +1 -0
index 5394150e5a..36b7f618aa 100644
@@ -38,6 +38,7 @@ F:    package/gstreamer1/gst1-plugins-bad/
 F:     package/gstreamer1/gst1-plugins-base/
 F:     package/gstreamer1/gst1-plugins-good/
 F:     package/gstreamer1/gst1-plugins-ugly/
+F:     package/gstreamer1/gst1-python/
 F:     package/gstreamer1/gst1-vaapi/
 F:     package/imx-usb-loader/
 F:     package/janus-gateway/
package/gstreamer1/Config.in +1 -0
index bb5c1d2af8..0e47d78e68 100644
@@ -11,6 +11,7 @@ source "package/gstreamer1/gst1-plugins-ugly/Config.in"
 source "package/gstreamer1/gst1-imx/Config.in"
 source "package/gstreamer1/gst1-interpipe/Config.in"
 source "package/gstreamer1/gst1-libav/Config.in"
+source "package/gstreamer1/gst1-python/Config.in"
 source "package/gstreamer1/gst1-rtsp-server/Config.in"
 source "package/gstreamer1/gst1-shark/Config.in"
 source "package/gstreamer1/gst1-validate/Config.in"
package/gstreamer1/gst1-python/0001-fix-builds-with-python-3.8.patch new file +43 -0
new file mode 100644
index 0000000000..edff445a7a
@@ -0,0 +1,43 @@
+From 10707f437f2fc3632067c6a0efa4432f7ebaf362 Mon Sep 17 00:00:00 2001
+From: Sebastian Dr?ge <[email protected]>
+Date: Fri, 13 Dec 2019 10:46:20 +0200
+Subject: [PATCH] backport of "fix build with Python 3.8 by also checking for
+ python-3.X-embed.pc"
+
+Since Python 3.8 the normal checks don't include the Python libraries
+anymore and linking of the gst-python module would fail.
+
+See also https://github.com/mesonbuild/meson/issues/5629
+
+Fixes https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
+
+Upstream commit: 22f28155d86e27c4134de4ed2861264003fcfd23
+
+Signed-off-by: Sebastian Dr?ge <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 744b7ce..492af1a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -25,6 +25,14 @@ pygobject_dep = dependency('pygobject-3.0', fallback: ['pygobject', 'pygobject_d
+ pymod = import('python')
+ python = pymod.find_installation(get_option('python'))
+ python_dep = python.dependency(required : true)
++pythonver = python.language_version()
++
++# Workaround for https://github.com/mesonbuild/meson/issues/5629
++# https://gitlab.freedesktop.org/gstreamer/gst-python/issues/28
++python_dep = dependency('python- at 0@-embed'.format(pythonver), version: '>=3', required: false)
++if not python_dep.found()
++  python_dep = python.dependency(required : true)
++endif
+
+ python_abi_flags = python.get_variable('ABIFLAGS', '')
+ pylib_loc = get_option('libpython-dir')
+--
+2.24.1
+
package/gstreamer1/gst1-python/Config.in new file +24 -0
new file mode 100644
index 0000000000..9149703354
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_GST1_PYTHON
+       bool "gst1-python"
+       depends on BR2_USE_MMU # libglib2, gobject-introspection
+       depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS # gobject-introspection
+       depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # gobject-introspection
+       depends on BR2_TOOLCHAIN_USES_GLIBC # gobject-introspection
+       depends on BR2_PACKAGE_PYTHON3 # gobject-introspection
+       select BR2_PACKAGE_GOBJECT_INTROSPECTION
+       select BR2_PACKAGE_LIBGLIB2
+       select BR2_PACKAGE_PYTHON_GOBJECT
+       help
+         GStreamer python overrides for the gobject-introspection-based
+         pygst bindings.
+
+         https://gstreamer.freedesktop.org/modules/gst-python.html
+
+comment "gst1-python needs python3"
+       depends on !BR2_PACKAGE_PYTHON3
+
+comment "gst1-python needs a glibc toolchain, gcc >= 4.9"
+       depends on BR2_USE_MMU
+       depends on BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS
+       depends on !BR2_TOOLCHAIN_USES_GLIBC || \
+               !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
package/gstreamer1/gst1-python/gst1-python.hash new file +3 -0
new file mode 100644
index 0000000000..1d3c687dd4
@@ -0,0 +1,3 @@
+# From https://gstreamer.freedesktop.org/src/gst-python/gst-python-1.16.2.tar.xz.sha256sum
+sha256  208df3148d73d9f416d016564737585d8ea763d91201732d44b5fe688c6288a8  gst-python-1.16.2.tar.xz
+sha256  ea3ad127610e5ded2210b3a86a46314f2b3b28e438eccffdae19a4d6fbcdb0c2  COPYING
package/gstreamer1/gst1-python/gst1-python.mk new file +20 -0
new file mode 100644
index 0000000000..f0a3bacd1f
@@ -0,0 +1,32 @@
+################################################################################
+#
+# gst1-python
+#
+################################################################################
+
+GST1_PYTHON_VERSION = 1.16.2
+GST1_PYTHON_SOURCE = gst-python-$(GST1_PYTHON_VERSION).tar.xz
+GST1_PYTHON_SITE = https://gstreamer.freedesktop.org/src/gst-python
+GST1_PYTHON_INSTALL_STAGING = YES
+GST1_PYTHON_LICENSE_FILES = COPYING
+GST1_PYTHON_LICENSE = LGPL-2.1+
+
+GST1_PYTHON_DEPENDENCIES = \
+       gstreamer1 \
+       python-gobject
+
+# A sysconfigdata_name must be manually specified or the resulting .so
+# will have a x86_64 prefix, which causes "from gi.repository import Gst"
+# to fail.A pythonpath must be specified or the host python path will be used resulting

package/gstreamer1/gst1-python/gst1-python.mk line 30

Quoted 10 lines
package/gstreamer1/gst1-python/gst1-python.mk new file +10 -0
+# in a "not a valid python" error.
+GST1_PYTHON_CONF_ENV += \
+       _PYTHON_SYSCONFIGDATA_NAME=$(PKG_PYTHON_SYSCONFIGDATA_NAME) \
+       PYTHONPATH=$(PYTHON3_PATH)
+
+# Due to the CONF_ENV options, libpython-dir must be set to the host directory
+# or else the error: "Python dynamic library path could not be determined"
+# will occure
+GST1_PYTHON_CONF_OPTS += \
+       -Dlibpython-dir=$(HOST_DIR)/lib/python3.8

This is a mistake that I missed. It should be
$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)

Quoted 5 lines
package/gstreamer1/gst1-python/gst1-python.mk new file +2 -1
+
+$(eval $(meson-package))
--

2.24.1

Adam

#6 lore raw

PATCH 6/6 support/testing: add gst1-python test case

In reply to aduskett at gmail.com

From: Adam Duskett <[email protected]>

This test case runs a simple pipeline for 100 frames to ensure that gst1-python works properly.

---
 .gitlab-ci.yml                                |  1 +
 DEVELOPERS                                    |  1 +
 .../tests/package/sample_gst1_python.py       | 21 ++++++++++++++
 .../testing/tests/package/test_gst1_python.py | 29 +++++++++++++++++++
 4 files changed, 52 insertions(+)
 create mode 100644 support/testing/tests/package/sample_gst1_python.py
 create mode 100644 support/testing/tests/package/test_gst1_python.py
.gitlab-ci.yml +1 -0
index 4b84a5b709..e6363014e9 100644
@@ -383,6 +383,7 @@ tests.package.test_crudini.TestCrudiniPy3: { extends: .runtime_test }
 tests.package.test_docker_compose.TestDockerCompose: { extends: .runtime_test }
 tests.package.test_dropbear.TestDropbear: { extends: .runtime_test }
 tests.package.test_glxinfo.TestGlxinfo: { extends: .runtime_test }
+tests.package.test_gst1_python.TestGst1Python: { extends: .runtime_test }
 tests.package.test_ipython.TestIPythonPy3: { extends: .runtime_test }
 tests.package.test_libftdi1.TestPythonPy2Libftdi1: { extends: .runtime_test }
 tests.package.test_libftdi1.TestPythonPy3Libftdi1: { extends: .runtime_test }
DEVELOPERS +1 -0
index 36b7f618aa..ec33506c08 100644
@@ -85,6 +85,7 @@ F:	package/setools/
 F:	package/sngrep/
 F:	package/spidermonkey/
 F:	package/systemd/
+F:	support/testing/tests/package/test_gst1_python.py
 F:	support/testing/tests/package/test_python_gobject.py
 
 N:	Adam Heinrich <[email protected]>
support/testing/tests/package/sample_gst1_python.py new file +21 -0
new file mode 100644
index 0000000000..41eccbe5fd
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+"""A simple test that uses gst1-python to run a fake videotestsrc for 100 frames"""
+import sys
+import gi
+import time
+gi.require_version('Gst', '1.0')
+from gi.repository import Gst, GLib
+
+
+def main():
+    # Initializes Gstreamer
+    Gst.init(sys.argv)
+    pipeline = Gst.parse_launch("videotestsrc num-buffers=100 ! autovideosink")
+    bus = pipeline.get_bus()
+    bus.add_signal_watch()
+    pipeline.set_state(Gst.State.PLAYING)
+    loop = GLib.MainLoop()
+    bus.connect("message", on_message, loop)
+    loop.run()
+    pipeline.set_state(Gst.State.EOS)
+    exit(0)
\ No newline at end of file
support/testing/tests/package/test_gst1_python.py new file +29 -0
new file mode 100644
index 0000000000..8d6efcbe4a
@@ -0,0 +1,29 @@
+import os
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestGst1Python(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        BR2_cortex_a9=y
+        BR2_ARM_ENABLE_VFP=y
+        BR2_ARM_EABIHF=y
+        BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM=y
+        BR2_PACKAGE_GOBJECT_INTROSPECTION=y
+        BR2_PACKAGE_GSTREAMER1=y
+        BR2_PACKAGE_GST1_PYTHON=y
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_GOBJECT=y
+        """
+
+    def login(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        self.emulator.boot(arch="armv7",
+                           kernel="builtin",
+                           options=["-initrd", cpio_file])
+        self.emulator.login()
+    sample_scripts = ["tests/package/sample_gst1_python.py"]
+
Signature · 1 line
2.24.1
#7 lore raw

PATCH 1/6 package/gstreamer1/gstreamer1: add introspection support

In reply to aduskett at gmail.com

Adam, All,

On 2020-03-15 13:10 -0700, aduskett at gmail.com spake thusly:

Quoted 9 lines

From: Adam Duskett <[email protected]>

If gobject-introspection is selected, explicitly set -Dintrospection=enabled in the configure options and add a dependency for gobject-introspection.

This feature requires an upstream patch that allows introspection support even when cross-compiling.

Whole series applied, thanks!

Needless to say that the runtime test helped a lot getting some confidence in the changes. Thanks! :-)

I just fixed the little not in patch 5, as you already spotted.

Regards,
Yann E. MORIN.

Quoted 81 lines
---
 ...hen-cross-compiling-if-introspection.patch | 36 +++++++++++++++++++
 package/gstreamer1/gstreamer1/gstreamer1.mk   |  8 ++++-
 2 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 package/gstreamer1/gstreamer1/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch
package/gstreamer1/gstreamer1/0001-meson-build-gir-even-when-cross-compiling-if-introspection.patch new file +36 -0
new file mode 100644
index 0000000000..fc290f6cc0
@@ -0,0 +1,36 @@
+From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
+From: Tim Philipp <[email protected]>
+Date: Thu, 17 Oct 2019 12:13:35 +0100
+Subject: [PATCH] meson: build gir even when cross-compiling if introspection
+ was enabled explicitly
+
+This can be made to work in certain circumstances when
+cross-compiling, so default to not building g-i stuff
+when cross-compiling, but allow it if introspection was
+enabled explicitly via -Dintrospection=enabled.
+
+Fixes #454 and #381.
+
+Upstream commit: 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8
+Signed-off-by: Tim Philipp <[email protected]>
+Signed-off-by: Adam Duskett <[email protected]>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 90d98d8eb00..a47e7f34e8a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -453,7 +453,7 @@ rt_lib = cc.find_library('rt', required : false)
+ gir = find_program('g-ir-scanner', required : get_option('introspection'))
+ gnome = import('gnome')
+ 
+-build_gir = gir.found() and not meson.is_cross_build()
++build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
+ 
+ gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
+     'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
+-- 
+2.24.1
+
package/gstreamer1/gstreamer1/gstreamer1.mk +7 -1
index 4eb3158b8f..47615aad1f 100644
@@ -16,7 +16,6 @@ GSTREAMER1_CONF_OPTS = \
 	-Dtests=disabled \
 	-Dbenchmarks=disabled \
 	-Dgtk_doc=disabled \
-	-Dintrospection=disabled \
 	-Dglib-asserts=disabled \
 	-Dglib-checks=disabled \
 	-Dgobject-cast-checks=disabled \
@@ -36,6 +35,13 @@ GSTREAMER1_DEPENDENCIES = \
 	$(if $(BR2_PACKAGE_VALGRIND),valgrind) \
 	$(TARGET_NLS_DEPENDENCIES)
 
+ifeq ($(BR2_PACKAGE_GOBJECT_INTROSPECTION),y)
+GSTREAMER1_CONF_OPTS += -Dintrospection=enabled
+GSTREAMER1_DEPENDENCIES += gobject-introspection
+else
+GSTREAMER1_CONF_OPTS += -Dintrospection=disabled
+endif
+
 GSTREAMER1_LDFLAGS = $(TARGET_LDFLAGS) $(TARGET_NLS_LIBS)
 
 $(eval $(meson-package))
Signature · 6 lines
2.24.1

_______________________________________________
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 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'