<div dir="ltr"><div> ${<span class="gmail-il">GST_TEST_SUITE_NAME</span>} is not actually defined anywhere? I believe this has the undesired effect of running all installed test suites rather than just gstreamer, including glib and others.</div><div><br></div><div><br></div><div>Alex<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 12 Jan 2020 at 15:31, Carlos Rafael Giani &lt;<a href="mailto:crg7475@mailbox.org">crg7475@mailbox.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">* gstreamer1.0-plugins-common.inc<br>
  The old gstreamer1.0-plugins.inc file, adapted for meson<br>
* gstreamer1.0-plugins-packaging.inc<br>
  The old gst-plugins-package.inc file, adapted for meson<br>
* gstreamer1.0-ptest.inc<br>
  Common code for meson based PTest support; autogenerates the run-ptest<br>
  file and is designed to use the gnome-desktop-testing suite runner<br>
  (which is why the .inc files inherits from ptest-gnome)<br>
<br>
Signed-off-by: Carlos Rafael Giani &lt;<a href="mailto:crg7475@mailbox.org" target="_blank">crg7475@mailbox.org</a>&gt;<br>
---<br>
 .../gstreamer/gstreamer1.0-plugins-common.inc | 47 +++++++++++++<br>
 .../gstreamer1.0-plugins-packaging.inc        | 70 +++++++++++++++++++<br>
 .../gstreamer/gstreamer1.0-ptest.inc          | 21 ++++++<br>
 3 files changed, 138 insertions(+)<br>
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc<br>
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc<br>
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc<br>
<br>
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc<br>
new file mode 100644<br>
index 0000000000..ccf55500a9<br>
--- /dev/null<br>
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc<br>
@@ -0,0 +1,47 @@<br>
+# This .inc file contains the common setup for the gstreamer1.0-plugins-*<br>
+# plugin set recipes.<br>
+<br>
+# SUMMARY is set in the actual .bb recipes<br>
+HOMEPAGE = &quot;<a href="https://gstreamer.freedesktop.org/" rel="noreferrer" target="_blank">https://gstreamer.freedesktop.org/</a>&quot;<br>
+BUGTRACKER = &quot;<a href="https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer" rel="noreferrer" target="_blank">https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer</a>&quot;<br>
+SECTION = &quot;multimedia&quot;<br>
+<br>
+DEPENDS = &quot;gstreamer1.0 glib-2.0-native&quot;<br>
+<br>
+inherit gettext meson pkgconfig upstream-version-is-even<br>
+<br>
+require gstreamer1.0-plugins-packaging.inc<br>
+<br>
+# Orc enables runtime JIT compilation of data processing routines from Orc<br>
+# bytecode to SIMD instructions for various architectures (currently SSE, MMX,<br>
+# MIPS, Altivec and NEON are supported).<br>
+# This value is used in the PACKAGECONFIG values for each plugin set recipe.<br>
+# By modifying it, Orc can be enabled/disabled in all of these recipes at once.<br>
+GSTREAMER_ORC ?= &quot;orc&quot;<br>
+<br>
+PACKAGECONFIG[orc] = &quot;-Dorc=enabled,-Dorc=disabled,orc orc-native&quot;<br>
+<br>
+# TODO: put this in a gettext.bbclass patch (with variables to allow for<br>
+# configuring the option name and the enabled/disabled values).<br>
+def gettext_oemeson(d):<br>
+    if d.getVar(&#39;USE_NLS&#39;) == &#39;no&#39;:<br>
+        return &#39;-Dnls=disabled&#39;<br>
+    # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set<br>
+    if d.getVar(&#39;INHIBIT_DEFAULT_DEPS&#39;) and not oe.utils.inherits(d, &#39;cross-canadian&#39;):<br>
+        return &#39;-Dnls=disabled&#39;<br>
+    return &#39;-Dnls=enabled&#39;<br>
+<br>
+# Not all plugin sets contain examples, so the -Dexamples<br>
+# option needs to be added conditionally.<br>
+GST_PLUGIN_SET_HAS_EXAMPLES ?= &quot;1&quot;<br>
+<br>
+EXTRA_OEMESON += &quot; \<br>
+    ${@bb.utils.contains(&#39;GST_PLUGIN_SET_HAS_EXAMPLES&#39;, &#39;1&#39;, &#39;-Dexamples=disabled&#39;, &#39;&#39;, d)} \<br>
+    ${@gettext_oemeson(d)} \<br>
+&quot;<br>
+<br>
+GIR_MESON_ENABLE_FLAG = &quot;enabled&quot;<br>
+GIR_MESON_DISABLE_FLAG = &quot;disabled&quot;<br>
+<br>
+# Dynamically generate packages for all enabled plugins<br>
+PACKAGES_DYNAMIC = &quot;^${PN}-.*&quot;<br>
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc<br>
new file mode 100644<br>
index 0000000000..9a7a1b6afe<br>
--- /dev/null<br>
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc<br>
@@ -0,0 +1,70 @@<br>
+# This .inc file contains functionality for automatically splitting<br>
+# built plugins into individual packages for each plugin. A -meta<br>
+# package is also set up that has no files of its own, but contains<br>
+# the names of all plugin packages in its RDEPENDS list.<br>
+#<br>
+# This is mainly used by the gstreamer1.0-plugins-* plugin set recipes,<br>
+# but can be used in any recipe that produces GStreamer plugins.<br>
+<br>
+PACKAGESPLITFUNCS_prepend = &quot; split_gstreamer10_packages &quot;<br>
+PACKAGESPLITFUNCS_append = &quot; set_gstreamer10_metapkg_rdepends &quot;<br>
+<br>
+python split_gstreamer10_packages () {<br>
+    gst_libdir = d.expand(&#39;${libdir}/gstreamer-1.0&#39;)<br>
+    postinst = d.getVar(&#39;plugin_postinst&#39;)<br>
+    glibdir = d.getVar(&#39;libdir&#39;)<br>
+<br>
+    # GStreamer libraries<br>
+    do_split_packages(d, glibdir, r&#39;^lib(.*)\.so\.*&#39;, &#39;lib%s&#39;, &#39;GStreamer 1.0 %s library&#39;, extra_depends=&#39;&#39;, allow_links=True)<br>
+    # GStreamer plugin shared objects<br>
+    do_split_packages(d, gst_libdir, r&#39;libgst(.*)\.so$&#39;, d.expand(&#39;${PN}-%s&#39;), &#39;GStreamer 1.0 plugin for %s&#39;, postinst=postinst, extra_depends=&#39;&#39;)<br>
+    # GObject introspection files for GStreamer plugins<br>
+    do_split_packages(d, glibdir+&#39;/girepository-1.0&#39;, r&#39;Gst(.*)-1.0\.typelib$&#39;, d.expand(&#39;${PN}-%s-typelib&#39;), &#39;GStreamer 1.0 typelib file for %s&#39;, postinst=postinst, extra_depends=&#39;&#39;)<br>
+    # Static GStreamer libraries for development<br>
+    do_split_packages(d, gst_libdir, r&#39;libgst(.*)\.a$&#39;, d.expand(&#39;${PN}-%s-staticdev&#39;), &#39;GStreamer 1.0 plugin for %s (static development files)&#39;, extra_depends=&#39;${PN}-staticdev&#39;)<br>
+}<br>
+<br>
+python set_gstreamer10_metapkg_rdepends () {<br>
+    import os<br>
+    import oe.utils<br>
+<br>
+    # Go through all generated packages (excluding the main package and<br>
+    # the -meta package itself) and add them to the -meta package as RDEPENDS.<br>
+<br>
+    pn = d.getVar(&#39;PN&#39;)<br>
+    metapkg =  pn + &#39;-meta&#39;<br>
+    d.setVar(&#39;ALLOW_EMPTY_&#39; + metapkg, &quot;1&quot;)<br>
+    d.setVar(&#39;FILES_&#39; + metapkg, &quot;&quot;)<br>
+    blacklist = [ pn, pn + &#39;-meta&#39; ]<br>
+    metapkg_rdepends = []<br>
+    pkgdest = d.getVar(&#39;PKGDEST&#39;)<br>
+    for pkg in oe.utils.packages_filter_out_system(d):<br>
+        if pkg not in blacklist and pkg not in metapkg_rdepends:<br>
+            # See if the package is empty by looking at the contents of its PKGDEST subdirectory.<br>
+            # If this subdirectory is empty, then the package is.<br>
+            # Empty packages do not get added to the meta package&#39;s RDEPENDS<br>
+            pkgdir = os.path.join(pkgdest, pkg)<br>
+            if os.path.exists(pkgdir):<br>
+                dir_contents = os.listdir(pkgdir) or []<br>
+            else:<br>
+                dir_contents = []<br>
+            is_empty = len(dir_contents) == 0<br>
+            if not is_empty:<br>
+                metapkg_rdepends.append(pkg)<br>
+    d.setVar(&#39;RDEPENDS_&#39; + metapkg, &#39; &#39;.join(metapkg_rdepends))<br>
+    d.setVar(&#39;DESCRIPTION_&#39; + metapkg, pn + &#39; meta package&#39;)<br>
+}<br>
+<br>
+# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev<br>
+# so we need them even when empty (like in gst-plugins-good case)<br>
+ALLOW_EMPTY_${PN} = &quot;1&quot;<br>
+ALLOW_EMPTY_${PN}-dev = &quot;1&quot;<br>
+ALLOW_EMPTY_${PN}-staticdev = &quot;1&quot;<br>
+<br>
+PACKAGES += &quot;${PN}-apps ${PN}-meta ${PN}-glib&quot;<br>
+<br>
+FILES_${PN} = &quot;&quot;<br>
+FILES_${PN}-apps = &quot;${bindir}&quot;<br>
+FILES_${PN}-glib = &quot;${datadir}/glib-2.0&quot;<br>
+<br>
+RRECOMMENDS_${PN} += &quot;${PN}-meta&quot;<br>
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc<br>
new file mode 100644<br>
index 0000000000..74368c4cd8<br>
--- /dev/null<br>
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc<br>
@@ -0,0 +1,21 @@<br>
+inherit ptest-gnome<br>
+<br>
+TEST_FILES_PATH = &quot;${datadir}/installed-tests/gstreamer-1.0/test-files&quot;<br>
+RUN_PTEST_FILE = &quot;${D}${PTEST_PATH}/run-ptest&quot;<br>
+<br>
+EXTRA_OEMESON += &quot;-Dtest-files-path=${TEST_FILES_PATH}&quot;<br>
+<br>
+# Using do_install_ptest_base instead of do_install_ptest, since<br>
+# the default do_install_ptest_base is hardcoded to expect Makefiles.<br>
+do_install_ptest_base() {<br>
+    # Generate run-ptest file<br>
+    echo &quot;#!/usr/bin/env sh&quot; &gt; &quot;${RUN_PTEST_FILE}&quot;<br>
+    echo &quot;gnome-desktop-testing-runner ${GST_TEST_SUITE_NAME}&quot; &gt;&gt; &quot;${RUN_PTEST_FILE}&quot;<br>
+    chmod 0755 &quot;${RUN_PTEST_FILE}&quot;<br>
+<br>
+    # Install additional files required by tests<br>
+    if [ -d &quot;${S}/tests/files&quot; ] ; then<br>
+        install -d &quot;${D}/${TEST_FILES_PATH}&quot;<br>
+        install -m 0644 &quot;${S}/tests/files&quot;/* &quot;${D}/${TEST_FILES_PATH}&quot;<br>
+    fi<br>
+}<br>
-- <br>
2.17.1<br>
<br>
-- <br>
_______________________________________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.openembedded.org</a><br>
<a href="http://lists.openembedded.org/mailman/listinfo/openembedded-core" rel="noreferrer" target="_blank">http://lists.openembedded.org/mailman/listinfo/openembedded-core</a><br>
</blockquote></div>