summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/gstreamer1.0
diff options
context:
space:
mode:
authorCarlos Rafael Giani <crg7475@mailbox.org>2020-01-12 14:59:44 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-16 22:33:08 +0000
commit3e71919b865433ca007bf23f9b4f9015e25ac04e (patch)
tree7c94763af8b80871f44c0628207a6a37096450c4 /meta/recipes-multimedia/gstreamer/gstreamer1.0
parent01c1f63bdb779fe33df4b4409792f393eeee7cf9 (diff)
downloadpoky-3e71919b865433ca007bf23f9b4f9015e25ac04e.tar.gz
gstreamer1.0: Transition to meson based builds
* Moved 0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch from files/ to gstreamer1.0/ since it is gstreamer1.0 recipe specific. * Removed M4 specific patches: - 0001-introspection.m4-prefix-pkgconfig-paths-with-PKG_CON.patch - gtk-doc-tweaks.patch - add-a-target-to-compile-tests.patch * Added patches: - 0001-meson-build-gir-even-when-cross-compiling-if-introsp.patch Backport for enabling GIR support in meson based cross compilation - 0002-meson-Add-valgrind-feature.patch Make valgrind support configurable to be able to control it through a "valgrind" packageconfig - 0003-meson-Add-option-for-installed-tests.patch Add support for installable tests and for generating .test and shell scripts which can be used with the gnome-desktop-testing suite runner * PTest support: By default, GStreamer does not allow for installing tests, and requires meson to run its unit tests. The 0003 patch fixes this by installing the binaries themselves and by generating accompanying .test and shell scripts. The scripts set up the required environment files and then call the test binaries. The .test file list the shell scripts as Exec= command line. (From OE-Core rev: 0db7ba34ca41b107042306d13a6f0162885c123b) Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/gstreamer/gstreamer1.0')
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch35
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch36
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch74
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch257
4 files changed, 402 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
new file mode 100644
index 0000000000..67a872cddb
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch
@@ -0,0 +1,35 @@
1From a1d7c582392c8bc87fa9411af77b20e011944357 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Thu, 25 Jan 2018 17:55:02 +0200
4Subject: [PATCH] gst/gstpluginloader.c: when env var is set do not fall
5 through to system plugin scanner
6
7If we set a custom GST_PLUGIN_SCANNER env var, then we probably want to use that and only that.
8
9Falling through to the one installed on the system is problamatic in cross-compilation
10environemnts, regardless of whether one pointed to by the env var succeeded or failed.
11
12Upstream-Status: Pending
13Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
14---
15 gst/gstpluginloader.c | 4 +---
16 1 file changed, 1 insertion(+), 3 deletions(-)
17
18diff --git a/gst/gstpluginloader.c b/gst/gstpluginloader.c
19index 430829d..3a75731 100644
20--- a/gst/gstpluginloader.c
21+++ b/gst/gstpluginloader.c
22@@ -471,9 +471,7 @@ gst_plugin_loader_spawn (GstPluginLoader * loader)
23 helper_bin = g_strdup (env);
24 res = gst_plugin_loader_try_helper (loader, helper_bin);
25 g_free (helper_bin);
26- }
27-
28- if (!res) {
29+ } else {
30 GST_LOG ("Trying installed plugin scanner");
31
32 #ifdef G_OS_WIN32
33--
342.15.1
35
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch
new file mode 100644
index 0000000000..1ed7198a5c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-meson-build-gir-even-when-cross-compiling-if-introsp.patch
@@ -0,0 +1,36 @@
1From 35db4a2433fbdf8612cf98b5aab5b14aeb5372f8 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= <tim@centricular.com>
3Date: Thu, 17 Oct 2019 12:13:35 +0100
4Subject: [PATCH] meson: build gir even when cross-compiling if introspection
5 was enabled explicitly
6
7This can be made to work in certain circumstances when
8cross-compiling, so default to not building g-i stuff
9when cross-compiling, but allow it if introspection was
10enabled explicitly via -Dintrospection=enabled.
11
12Fixes #454 and #381.
13
14Upstream-Status: Backport [35db4a2433fbdf8612cf98b5aab5b14aeb5372f8]
15
16Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
17---
18 meson.build | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/meson.build b/meson.build
22index 90d98d8eb..a47e7f34e 100644
23--- a/meson.build
24+++ b/meson.build
25@@ -466,7 +466,7 @@ rt_lib = cc.find_library('rt', required : false)
26 gir = find_program('g-ir-scanner', required : get_option('introspection'))
27 gnome = import('gnome')
28
29-build_gir = gir.found() and not meson.is_cross_build()
30+build_gir = gir.found() and (not meson.is_cross_build() or get_option('introspection').enabled())
31
32 gir_init_section = [ '--add-init-section=extern void gst_init(gint*,gchar**);' + \
33 'g_setenv("GST_REGISTRY_DISABLE", "yes", TRUE);' + \
34--
352.17.1
36
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch
new file mode 100644
index 0000000000..f553340f4d
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0003-meson-Add-valgrind-feature.patch
@@ -0,0 +1,74 @@
1From f6c7973c03d9ba7dab60c496e768c5e6c4ee824c Mon Sep 17 00:00:00 2001
2From: Carlos Rafael Giani <crg7475@mailbox.org>
3Date: Sun, 20 Oct 2019 10:36:44 +0200
4Subject: [PATCH] meson: Add valgrind feature
5
6This allows for enabling/disabling Valgrind support. Since Valgrind is
7an external dependency, such a feature is needed by build environemnts
8such as Yocto to make sure builds are deterministic. These changes also
9add more Valgrind specific configure log output.
10
11Upstream-Status: Pending
12
13Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
14---
15 meson.build | 23 ++++++++++++++++++++++-
16 meson_options.txt | 1 +
17 2 files changed, 23 insertions(+), 1 deletion(-)
18
19diff --git a/meson.build b/meson.build
20index b55ecc5..4751761 100644
21--- a/meson.build
22+++ b/meson.build
23@@ -199,7 +199,6 @@ check_headers = [
24 'sys/wait.h',
25 'ucontext.h',
26 'unistd.h',
27- 'valgrind/valgrind.h',
28 'sys/resource.h',
29 ]
30
31@@ -214,6 +213,28 @@ foreach h : check_headers
32 endif
33 endforeach
34
35+valgrind_option = get_option('valgrind')
36+if valgrind_option.disabled()
37+ message('Valgrind support not requested; disabled.')
38+else
39+ valgrind_header = 'valgrind/valgrind.h'
40+ has_valgrind_header = cc.has_header(valgrind_header)
41+ if has_valgrind_header
42+ message('Valgrind support requested, and header ' + valgrind_header + \
43+ ' found. Enabled Valgrind support.')
44+ define = 'HAVE_' + valgrind_header.underscorify().to_upper()
45+ cdata.set(define, 1)
46+ else
47+ if valgrind_option.enabled()
48+ error('Valgrind support requested and set as required, but header ' + \
49+ valgrind_header + ' not found.')
50+ else
51+ message('Valgrind support requested, but header ' + valgrind_header + \
52+ ' not found. Disabling Valgrind support.')
53+ endif
54+ endif
55+endif
56+
57 if cc.has_member('struct tm', 'tm_gmtoff', prefix : '#include <time.h>')
58 cdata.set('HAVE_TM_GMTOFF', 1)
59 endif
60diff --git a/meson_options.txt b/meson_options.txt
61index e7ff7ba..8afde39 100644
62--- a/meson_options.txt
63+++ b/meson_options.txt
64@@ -19,6 +19,7 @@ option('memory-alignment', type: 'combo',
65
66 # Feature options
67 option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries')
68+option('valgrind', type : 'feature', value : 'auto', description : 'Enable Valgrind support')
69 option('libunwind', type : 'feature', value : 'auto', description : 'Use libunwind to generate backtraces')
70 option('libdw', type : 'feature', value : 'auto', description : 'Use libdw to generate better backtraces from libunwind')
71 option('dbghelp', type : 'feature', value : 'auto', description : 'Use dbghelp to generate backtraces')
72--
732.17.1
74
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch
new file mode 100644
index 0000000000..0e6c44ea32
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0004-meson-Add-option-for-installed-tests.patch
@@ -0,0 +1,257 @@
1From b843400284751968862751dfe93853f151551c64 Mon Sep 17 00:00:00 2001
2From: Carlos Rafael Giani <crg7475@mailbox.org>
3Date: Fri, 25 Oct 2019 00:06:26 +0200
4Subject: [PATCH] meson: Add option for installed tests
5
6This adds an option for producing installed versions of the unit tests.
7These versions don't need meson to run (only a small shell script). This
8makes it easier to run cross compiled tests on a target machine.
9
10Upstream-Status: Pending
11
12Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
13---
14 build-aux/gen-installed-test-desc.py | 18 ++++++
15 build-aux/gen-installed-test-shscript.py | 25 ++++++++
16 meson_options.txt | 2 +
17 tests/check/meson.build | 46 +++++++++++++-
18 tests/files/testfile | 80 ++++++++++++++++++++++++
19 5 files changed, 170 insertions(+), 1 deletion(-)
20 create mode 100644 build-aux/gen-installed-test-desc.py
21 create mode 100644 build-aux/gen-installed-test-shscript.py
22 create mode 100644 tests/files/testfile
23
24diff --git a/build-aux/gen-installed-test-desc.py b/build-aux/gen-installed-test-desc.py
25new file mode 100644
26index 0000000..69e8a0f
27--- /dev/null
28+++ b/build-aux/gen-installed-test-desc.py
29@@ -0,0 +1,18 @@
30+import sys
31+import os
32+import argparse
33+
34+def write_template(filename, data):
35+ with open(filename, 'w') as f:
36+ f.write(data)
37+
38+def build_template(testdir, testname):
39+ return "[Test]\nType=session\nExec={}\n".format(os.path.join(testdir, testname))
40+
41+argparser = argparse.ArgumentParser(description='Generate installed-test data.')
42+argparser.add_argument('--test-execdir', metavar='dir', required=True, help='Installed test directory')
43+argparser.add_argument('--testname', metavar='name', required=True, help='Installed test name')
44+argparser.add_argument('--output', metavar='file', required=True, help='Output file')
45+args = argparser.parse_args()
46+
47+write_template(args.output, build_template(args.test_execdir, args.testname))
48diff --git a/build-aux/gen-installed-test-shscript.py b/build-aux/gen-installed-test-shscript.py
49new file mode 100644
50index 0000000..5da86fb
51--- /dev/null
52+++ b/build-aux/gen-installed-test-shscript.py
53@@ -0,0 +1,25 @@
54+import sys
55+import os
56+import argparse
57+
58+def write_template(filename, data):
59+ with open(filename, 'w') as f:
60+ f.write(data)
61+
62+def build_template(testdir, testname):
63+ return ''.join([
64+ "#!/usr/bin/env sh\n",
65+ "export GST_STATE_IGNORE_ELEMENTS=''\n",
66+ "export CK_DEFAULT_TIMEOUT=20\n",
67+ "export GST_PLUGIN_LOADING_WHITELIST='gstreamer'\n",
68+ "{}\n".format(os.path.join(testdir, testname)),
69+ ])
70+
71+argparser = argparse.ArgumentParser(description='Generate installed-test data.')
72+argparser.add_argument('--test-execdir', metavar='dir', required=True, help='Installed test directory')
73+argparser.add_argument('--testname', metavar='name', required=True, help='Installed test name')
74+argparser.add_argument('--output', metavar='file', required=True, help='Output file')
75+args = argparser.parse_args()
76+
77+write_template(args.output, build_template(args.test_execdir, args.testname))
78+os.chmod(args.output, 0o755)
79diff --git a/meson_options.txt b/meson_options.txt
80index 8afde39..8884dcc 100644
81--- a/meson_options.txt
82+++ b/meson_options.txt
83@@ -16,6 +16,8 @@ option('poisoning', type : 'boolean', value : false, description : 'Enable poiso
84 option('memory-alignment', type: 'combo',
85 choices : ['1', '2', '4', '8', '16', '32', '64', '128', '256', '512', '1024', '2048', '4096', '8192', 'malloc', 'pagesize'],
86 value: 'malloc')
87+option('installed-tests', type : 'boolean', value : false, description : 'enable installed tests')
88+option('test-files-path', type : 'string', description : 'Path where to find test files')
89
90 # Feature options
91 option('check', type : 'feature', value : 'auto', description : 'Build unit test libraries')
92diff --git a/tests/check/meson.build b/tests/check/meson.build
93index 04da83f..2db7f76 100644
94--- a/tests/check/meson.build
95+++ b/tests/check/meson.build
96@@ -118,11 +118,17 @@ if add_languages('cpp', required : false)
97 ]
98 endif
99
100+test_files_path = get_option('test-files-path')
101+if test_files_path == ''
102+ test_files_path = meson.current_source_dir() + '/../files'
103+endif
104+message('Using path "@0@" as the path to read test files from'.format(test_files_path))
105+
106 test_defines = [
107 '-UG_DISABLE_ASSERT',
108 '-UG_DISABLE_CAST_CHECKS',
109 '-DGST_CHECK_TEST_ENVIRONMENT_BEACON="GST_STATE_IGNORE_ELEMENTS"',
110- '-DTESTFILE="' + meson.current_source_dir() + '/meson.build"',
111+ '-DTESTFILE="@0@"'.format(test_files_path + '/testfile'),
112 '-DGST_USE_UNSTABLE_API',
113 '-DGST_DISABLE_DEPRECATED',
114 ]
115@@ -137,6 +143,14 @@ endif
116 glib_deps = [gio_dep, gobject_dep, gmodule_dep, glib_dep]
117 gst_deps = [gst_dep, gst_base_dep, gst_check_dep, gst_net_dep, gst_controller_dep]
118
119+installed_tests_datadir = join_paths(prefix, get_option('datadir'), 'installed-tests', 'gstreamer-1.0')
120+installed_tests_execdir = join_paths(prefix, libexecdir, 'installed-tests', 'gstreamer-1.0')
121+installed_tests_enabled = get_option('installed-tests')
122+
123+python = import('python').find_installation()
124+gen_installed_test_desc = files('../../build-aux/gen-installed-test-desc.py')
125+gen_installed_test_shscript = files('../../build-aux/gen-installed-test-shscript.py')
126+
127 foreach t : core_tests
128 fname = t[0]
129 test_name = fname.split('.')[0].underscorify()
130@@ -150,8 +164,38 @@ foreach t : core_tests
131 include_directories : [configinc],
132 link_with : link_with_libs,
133 dependencies : test_deps + glib_deps + gst_deps,
134+ install_dir: installed_tests_execdir,
135+ install: installed_tests_enabled
136 )
137
138+ if installed_tests_enabled
139+ installed_test_shscript = test_name + '.sh'
140+ shscript = custom_target (test_name + '_shscript',
141+ output: installed_test_shscript,
142+ command: [
143+ python,
144+ gen_installed_test_shscript,
145+ '--test-execdir=@0@'.format(installed_tests_execdir),
146+ '--testname=@0@'.format(test_name),
147+ '--output=@0@'.format(join_paths('@OUTDIR@', installed_test_shscript)),
148+ ],
149+ install: true,
150+ install_dir: installed_tests_execdir)
151+
152+ installed_test_desc = test_name + '.test'
153+ data = custom_target(test_name + '_desc',
154+ output: installed_test_desc,
155+ command: [
156+ python,
157+ gen_installed_test_desc,
158+ '--test-execdir=@0@'.format(installed_tests_execdir),
159+ '--testname=@0@'.format(installed_test_shscript),
160+ '--output=@0@'.format(join_paths('@OUTDIR@', installed_test_desc)),
161+ ],
162+ install: true,
163+ install_dir: installed_tests_datadir)
164+ endif
165+
166 env = environment()
167 env.set('GST_PLUGIN_PATH_1_0', meson.build_root())
168 env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '')
169diff --git a/tests/files/testfile b/tests/files/testfile
170new file mode 100644
171index 0000000..89954e0
172--- /dev/null
173+++ b/tests/files/testfile
174@@ -0,0 +1,80 @@
175+................................................................................
176+................................................................................
177+................................................................................
178+................................................................................
179+................................................................................
180+................................................................................
181+................................................................................
182+................................................................................
183+................................................................................
184+................................................................................
185+................................................................................
186+................................................................................
187+................................................................................
188+................................................................................
189+................................................................................
190+................................................................................
191+................................................................................
192+................................................................................
193+................................................................................
194+................................................................................
195+................................................................................
196+................................................................................
197+................................................................................
198+................................................................................
199+................................................................................
200+................................................................................
201+................................................................................
202+................................................................................
203+................................................................................
204+................................................................................
205+................................................................................
206+................................................................................
207+................................................................................
208+................................................................................
209+................................................................................
210+................................................................................
211+................................................................................
212+................................................................................
213+................................................................................
214+................................................................................
215+................................................................................
216+................................................................................
217+................................................................................
218+................................................................................
219+................................................................................
220+................................................................................
221+................................................................................
222+................................................................................
223+................................................................................
224+................................................................................
225+................................................................................
226+................................................................................
227+................................................................................
228+................................................................................
229+................................................................................
230+................................................................................
231+................................................................................
232+................................................................................
233+................................................................................
234+................................................................................
235+................................................................................
236+................................................................................
237+................................................................................
238+................................................................................
239+................................................................................
240+................................................................................
241+................................................................................
242+................................................................................
243+................................................................................
244+................................................................................
245+................................................................................
246+................................................................................
247+................................................................................
248+................................................................................
249+................................................................................
250+................................................................................
251+................................................................................
252+................................................................................
253+................................................................................
254+................................................................................
255--
2562.17.1
257