summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Rafael Giani <crg7475@mailbox.org>2020-01-12 14:59:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-16 22:33:08 +0000
commit01c1f63bdb779fe33df4b4409792f393eeee7cf9 (patch)
treef29f23b2fdfd3545298639c8d3403fd1c241a274
parent31e5bc2b586c51ad3b9fdb79af8b549d8d7ce743 (diff)
downloadpoky-01c1f63bdb779fe33df4b4409792f393eeee7cf9.tar.gz
gstreamer: Add common .inc files for meson based recipes
* gstreamer1.0-plugins-common.inc The old gstreamer1.0-plugins.inc file, adapted for meson * gstreamer1.0-plugins-packaging.inc The old gst-plugins-package.inc file, adapted for meson * gstreamer1.0-ptest.inc Common code for meson based PTest support; autogenerates the run-ptest file and is designed to use the gnome-desktop-testing suite runner (which is why the .inc files inherits from ptest-gnome) (From OE-Core rev: 075aa7a617d38d6a698cee97dcb7550e72741eb5) Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc47
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc70
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc21
3 files changed, 138 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc
new file mode 100644
index 0000000000..ccf55500a9
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-common.inc
@@ -0,0 +1,47 @@
1# This .inc file contains the common setup for the gstreamer1.0-plugins-*
2# plugin set recipes.
3
4# SUMMARY is set in the actual .bb recipes
5HOMEPAGE = "https://gstreamer.freedesktop.org/"
6BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
7SECTION = "multimedia"
8
9DEPENDS = "gstreamer1.0 glib-2.0-native"
10
11inherit gettext meson pkgconfig upstream-version-is-even
12
13require gstreamer1.0-plugins-packaging.inc
14
15# Orc enables runtime JIT compilation of data processing routines from Orc
16# bytecode to SIMD instructions for various architectures (currently SSE, MMX,
17# MIPS, Altivec and NEON are supported).
18# This value is used in the PACKAGECONFIG values for each plugin set recipe.
19# By modifying it, Orc can be enabled/disabled in all of these recipes at once.
20GSTREAMER_ORC ?= "orc"
21
22PACKAGECONFIG[orc] = "-Dorc=enabled,-Dorc=disabled,orc orc-native"
23
24# TODO: put this in a gettext.bbclass patch (with variables to allow for
25# configuring the option name and the enabled/disabled values).
26def gettext_oemeson(d):
27 if d.getVar('USE_NLS') == 'no':
28 return '-Dnls=disabled'
29 # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
30 if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'):
31 return '-Dnls=disabled'
32 return '-Dnls=enabled'
33
34# Not all plugin sets contain examples, so the -Dexamples
35# option needs to be added conditionally.
36GST_PLUGIN_SET_HAS_EXAMPLES ?= "1"
37
38EXTRA_OEMESON += " \
39 ${@bb.utils.contains('GST_PLUGIN_SET_HAS_EXAMPLES', '1', '-Dexamples=disabled', '', d)} \
40 ${@gettext_oemeson(d)} \
41"
42
43GIR_MESON_ENABLE_FLAG = "enabled"
44GIR_MESON_DISABLE_FLAG = "disabled"
45
46# Dynamically generate packages for all enabled plugins
47PACKAGES_DYNAMIC = "^${PN}-.*"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc
new file mode 100644
index 0000000000..9a7a1b6afe
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc
@@ -0,0 +1,70 @@
1# This .inc file contains functionality for automatically splitting
2# built plugins into individual packages for each plugin. A -meta
3# package is also set up that has no files of its own, but contains
4# the names of all plugin packages in its RDEPENDS list.
5#
6# This is mainly used by the gstreamer1.0-plugins-* plugin set recipes,
7# but can be used in any recipe that produces GStreamer plugins.
8
9PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages "
10PACKAGESPLITFUNCS_append = " set_gstreamer10_metapkg_rdepends "
11
12python split_gstreamer10_packages () {
13 gst_libdir = d.expand('${libdir}/gstreamer-1.0')
14 postinst = d.getVar('plugin_postinst')
15 glibdir = d.getVar('libdir')
16
17 # GStreamer libraries
18 do_split_packages(d, glibdir, r'^lib(.*)\.so\.*', 'lib%s', 'GStreamer 1.0 %s library', extra_depends='', allow_links=True)
19 # GStreamer plugin shared objects
20 do_split_packages(d, gst_libdir, r'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer 1.0 plugin for %s', postinst=postinst, extra_depends='')
21 # GObject introspection files for GStreamer plugins
22 do_split_packages(d, glibdir+'/girepository-1.0', r'Gst(.*)-1.0\.typelib$', d.expand('${PN}-%s-typelib'), 'GStreamer 1.0 typelib file for %s', postinst=postinst, extra_depends='')
23 # Static GStreamer libraries for development
24 do_split_packages(d, gst_libdir, r'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer 1.0 plugin for %s (static development files)', extra_depends='${PN}-staticdev')
25}
26
27python set_gstreamer10_metapkg_rdepends () {
28 import os
29 import oe.utils
30
31 # Go through all generated packages (excluding the main package and
32 # the -meta package itself) and add them to the -meta package as RDEPENDS.
33
34 pn = d.getVar('PN')
35 metapkg = pn + '-meta'
36 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
37 d.setVar('FILES_' + metapkg, "")
38 blacklist = [ pn, pn + '-meta' ]
39 metapkg_rdepends = []
40 pkgdest = d.getVar('PKGDEST')
41 for pkg in oe.utils.packages_filter_out_system(d):
42 if pkg not in blacklist and pkg not in metapkg_rdepends:
43 # See if the package is empty by looking at the contents of its PKGDEST subdirectory.
44 # If this subdirectory is empty, then the package is.
45 # Empty packages do not get added to the meta package's RDEPENDS
46 pkgdir = os.path.join(pkgdest, pkg)
47 if os.path.exists(pkgdir):
48 dir_contents = os.listdir(pkgdir) or []
49 else:
50 dir_contents = []
51 is_empty = len(dir_contents) == 0
52 if not is_empty:
53 metapkg_rdepends.append(pkg)
54 d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
55 d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
56}
57
58# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev
59# so we need them even when empty (like in gst-plugins-good case)
60ALLOW_EMPTY_${PN} = "1"
61ALLOW_EMPTY_${PN}-dev = "1"
62ALLOW_EMPTY_${PN}-staticdev = "1"
63
64PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
65
66FILES_${PN} = ""
67FILES_${PN}-apps = "${bindir}"
68FILES_${PN}-glib = "${datadir}/glib-2.0"
69
70RRECOMMENDS_${PN} += "${PN}-meta"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc
new file mode 100644
index 0000000000..74368c4cd8
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-ptest.inc
@@ -0,0 +1,21 @@
1inherit ptest-gnome
2
3TEST_FILES_PATH = "${datadir}/installed-tests/gstreamer-1.0/test-files"
4RUN_PTEST_FILE = "${D}${PTEST_PATH}/run-ptest"
5
6EXTRA_OEMESON += "-Dtest-files-path=${TEST_FILES_PATH}"
7
8# Using do_install_ptest_base instead of do_install_ptest, since
9# the default do_install_ptest_base is hardcoded to expect Makefiles.
10do_install_ptest_base() {
11 # Generate run-ptest file
12 echo "#!/usr/bin/env sh" > "${RUN_PTEST_FILE}"
13 echo "gnome-desktop-testing-runner ${GST_TEST_SUITE_NAME}" >> "${RUN_PTEST_FILE}"
14 chmod 0755 "${RUN_PTEST_FILE}"
15
16 # Install additional files required by tests
17 if [ -d "${S}/tests/files" ] ; then
18 install -d "${D}/${TEST_FILES_PATH}"
19 install -m 0644 "${S}/tests/files"/* "${D}/${TEST_FILES_PATH}"
20 fi
21}