commit:     639f62636b5ce8dd284fdeb3a5e95dd08bd59115
Author:     Niklāvs Koļesņikovs <89q1r14hd <AT> relay <DOT> firefox <DOT> com>
AuthorDate: Wed Sep 15 11:32:40 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep 15 17:06:10 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=639f6263

media-video/pipewire: enable support for test IUSE

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ber-0.4.2-meson-Build-tests-conditionally.patch | 41 ++++++++++++++++++++++
 .../wireplumber/wireplumber-0.4.2-r1.ebuild        |  9 ++++-
 media-video/wireplumber/wireplumber-9999.ebuild    |  5 ++-
 3 files changed, 53 insertions(+), 2 deletions(-)

diff --git 
a/media-video/wireplumber/files/wireplumber-0.4.2-meson-Build-tests-conditionally.patch
 
b/media-video/wireplumber/files/wireplumber-0.4.2-meson-Build-tests-conditionally.patch
new file mode 100644
index 00000000000..dab53c71bf4
--- /dev/null
+++ 
b/media-video/wireplumber/files/wireplumber-0.4.2-meson-Build-tests-conditionally.patch
@@ -0,0 +1,41 @@
+From 3b24c419b497c283e64df23b3b5eecd4c3d51927 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Tue, 14 Sep 2021 05:07:41 +0100
+Subject: [PATCH 1/5] meson: Build tests conditionally
+
+It's useful downstream to be able to control building
+tests, as there's not much use building them if we're
+not going to run them.
+
+Signed-off-by: Sam James <[email protected]>
+---
+ meson.build       | 5 ++++-
+ meson_options.txt | 2 ++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 3712a82..5f87ade 100644
+--- a/meson.build
++++ b/meson.build
+@@ -109,4 +109,7 @@ subdir('lib')
+ subdir('docs')
+ subdir('modules')
+ subdir('src')
+-subdir('tests')
++
++if get_option('tests')
++  subdir('tests')
++endif
+diff --git a/meson_options.txt b/meson_options.txt
+index a7a0a89..4008864 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -24,3 +24,5 @@ option('systemd-user-unit-dir',
+        description : 'Directory for user systemd units')
+ option('glib-supp', type : 'string', value : '',
+        description: 'The glib.supp valgrind suppressions file to be used when 
running valgrind')
++option('tests', type : 'boolean', value : 'true',
++       description : 'Build the test suite')
+-- 
+2.33.0
+

diff --git a/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild 
b/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild
index 6e5080a5e1d..ed677c4b5aa 100644
--- a/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild
+++ b/media-video/wireplumber/wireplumber-0.4.2-r1.ebuild
@@ -21,10 +21,12 @@ 
HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber";
 
 LICENSE="MIT"
 SLOT="0/0.4"
-IUSE="systemd"
+IUSE="systemd test"
 
 REQUIRED_USE="${LUA_REQUIRED_USE}"
 
+RESTRICT="!test? ( test )"
+
 # introspection? ( dev-libs/gobject-introspection ) is valid but likely only 
used for doc building
 BDEPEND="
        dev-libs/glib
@@ -48,6 +50,10 @@ RDEPEND="${DEPEND}"
 
 DOCS=( {NEWS,README}.rst )
 
+PATCHES=(
+        "${FILESDIR}"/${PN}-0.4.2-meson-Build-tests-conditionally.patch
+)
+
 src_configure() {
        local emesonargs=(
                -Dintrospection=disabled # Only used for Sphinx doc generation
@@ -58,6 +64,7 @@ src_configure() {
                $(meson_use systemd systemd-user-service)
                -Dsystemd-system-unit-dir=$(systemd_get_systemunitdir)
                -Dsystemd-user-unit-dir=$(systemd_get_userunitdir)
+               $(meson_use test tests)
        )
 
        meson_src_configure

diff --git a/media-video/wireplumber/wireplumber-9999.ebuild 
b/media-video/wireplumber/wireplumber-9999.ebuild
index 6e5080a5e1d..6477107a785 100644
--- a/media-video/wireplumber/wireplumber-9999.ebuild
+++ b/media-video/wireplumber/wireplumber-9999.ebuild
@@ -21,10 +21,12 @@ 
HOMEPAGE="https://gitlab.freedesktop.org/pipewire/wireplumber";
 
 LICENSE="MIT"
 SLOT="0/0.4"
-IUSE="systemd"
+IUSE="systemd test"
 
 REQUIRED_USE="${LUA_REQUIRED_USE}"
 
+RESTRICT="!test? ( test )"
+
 # introspection? ( dev-libs/gobject-introspection ) is valid but likely only 
used for doc building
 BDEPEND="
        dev-libs/glib
@@ -58,6 +60,7 @@ src_configure() {
                $(meson_use systemd systemd-user-service)
                -Dsystemd-system-unit-dir=$(systemd_get_systemunitdir)
                -Dsystemd-user-unit-dir=$(systemd_get_userunitdir)
+               $(meson_use test tests)
        )
 
        meson_src_configure

Reply via email to