commit:     62fba13fd0b86e6428ea2eae77138219cb2110b6
Author:     Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Tue Jan 16 01:29:25 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 16 03:35:54 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62fba13f

media-sound/audacity: wire up tests

Patch not submitted upstream yet.

See: https://github.com/audacity/audacity/discussions/5841
Bug: https://bugs.gentoo.org/916258
Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/audacity/audacity-3.3.3.ebuild         | 20 +++++++----
 media-sound/audacity/audacity-9999.ebuild          | 20 +++++++----
 ...dacity-3.3.3-remove-conan-test-dependency.patch | 39 ++++++++++++++++++++++
 3 files changed, 67 insertions(+), 12 deletions(-)

diff --git a/media-sound/audacity/audacity-3.3.3.ebuild 
b/media-sound/audacity/audacity-3.3.3.ebuild
index 4e68dd30ca14..f77da513d7d2 100644
--- a/media-sound/audacity/audacity-3.3.3.ebuild
+++ b/media-sound/audacity/audacity-3.3.3.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 WX_GTK_VER="3.2-gtk3"
 
-inherit cmake wxwidgets xdg
+inherit cmake wxwidgets xdg virtualx
 
 DESCRIPTION="Free crossplatform audio editor"
 HOMEPAGE="https://www.audacityteam.org/";
@@ -37,10 +37,8 @@ LICENSE="GPL-2+
 "
 SLOT="0"
 IUSE="alsa audiocom ffmpeg +flac id3tag +ladspa +lv2 mad mpg123 ogg
-       opus +portmixer sbsms twolame vamp +vorbis wavpack"
-
-# The testsuite consists of two tests, 50% of which fail.
-RESTRICT="test"
+       opus +portmixer sbsms test twolame vamp +vorbis wavpack"
+RESTRICT="!test? ( test )"
 
 # dev-db/sqlite:3 hard dependency.
 # dev-libs/glib:2, x11-libs/gtk+:3 hard dependency, from
@@ -104,7 +102,8 @@ RDEPEND="dev-db/sqlite:3
        vorbis? ( media-libs/libvorbis )
        wavpack? ( media-sound/wavpack )
 "
-DEPEND="${RDEPEND}"
+DEPEND="${RDEPEND}
+       test? ( dev-cpp/catch:0 )"
 BDEPEND="app-arch/unzip
        sys-devel/gettext
        virtual/pkgconfig
@@ -135,6 +134,9 @@ PATCHES=(
 
        # gettext 0.22
        "${FILESDIR}/${PN}-3.3.3-gettext-0.22.patch"
+
+       # Allows running tests without conan
+       "${FILESDIR}/${PN}-3.3.3-remove-conan-test-dependency.patch"
 )
 
 src_prepare() {
@@ -215,11 +217,17 @@ src_configure() {
                ## Keep watch of PA_HAS_OSS in lib-src/portmixer/CMakeLists.txt;
                ## AFAICT it introduces no deps as-is, but that could change.
                ## Similar goes for PA_HAS_JACK.
+
+               -Daudacity_has_tests=$(usex test ON OFF)
        )
 
        cmake_src_configure
 }
 
+src_test() {
+       virtx cmake_src_test
+}
+
 src_install() {
        cmake_src_install
 

diff --git a/media-sound/audacity/audacity-9999.ebuild 
b/media-sound/audacity/audacity-9999.ebuild
index ad59e3249ef7..d245b905cad3 100644
--- a/media-sound/audacity/audacity-9999.ebuild
+++ b/media-sound/audacity/audacity-9999.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 WX_GTK_VER="3.2-gtk3"
 
-inherit cmake wxwidgets xdg
+inherit cmake wxwidgets xdg virtualx
 
 DESCRIPTION="Free crossplatform audio editor"
 HOMEPAGE="https://www.audacityteam.org/";
@@ -37,10 +37,8 @@ LICENSE="GPL-2+
 "
 SLOT="0"
 IUSE="alsa audiocom ffmpeg +flac id3tag +ladspa +lv2 mpg123 ogg
-       opus +portmixer sbsms twolame vamp +vorbis wavpack"
-
-# The testsuite consists of two tests, 50% of which fail.
-RESTRICT="test"
+       opus +portmixer sbsms test twolame vamp +vorbis wavpack"
+RESTRICT="!test? ( test )"
 
 # dev-db/sqlite:3 hard dependency.
 # dev-libs/glib:2, x11-libs/gtk+:3 hard dependency, from
@@ -103,7 +101,8 @@ RDEPEND="dev-db/sqlite:3
        vorbis? ( media-libs/libvorbis )
        wavpack? ( media-sound/wavpack )
 "
-DEPEND="${RDEPEND}"
+DEPEND="${RDEPEND}
+       test? ( dev-cpp/catch:0 )"
 BDEPEND="app-arch/unzip
        sys-devel/gettext
        virtual/pkgconfig
@@ -120,6 +119,9 @@ PATCHES=(
 
        # For has_networking
        "${FILESDIR}/${PN}-3.3.3-local-threadpool-libraries.patch"
+
+       # Allows running tests without conan
+       "${FILESDIR}/${PN}-3.3.3-remove-conan-test-dependency.patch"
 )
 
 src_prepare() {
@@ -199,11 +201,17 @@ src_configure() {
                ## Keep watch of PA_HAS_OSS in lib-src/portmixer/CMakeLists.txt;
                ## AFAICT it introduces no deps as-is, but that could change.
                ## Similar goes for PA_HAS_JACK.
+
+               -Daudacity_has_tests=$(usex test ON OFF)
        )
 
        cmake_src_configure
 }
 
+src_test() {
+       virtx cmake_src_test
+}
+
 src_install() {
        cmake_src_install
 

diff --git 
a/media-sound/audacity/files/audacity-3.3.3-remove-conan-test-dependency.patch 
b/media-sound/audacity/files/audacity-3.3.3-remove-conan-test-dependency.patch
new file mode 100644
index 000000000000..63dd3b58f0f0
--- /dev/null
+++ 
b/media-sound/audacity/files/audacity-3.3.3-remove-conan-test-dependency.patch
@@ -0,0 +1,39 @@
+https://bugs.gentoo.org/916258
+https://github.com/audacity/audacity/discussions/5841
+https://github.com/matoro/audacity/commit/270be88a9390eb25c2f4b16030f6897f08a6a685
+
+From 270be88a9390eb25c2f4b16030f6897f08a6a685 Mon Sep 17 00:00:00 2001
+From: matoro <mat...@users.noreply.github.com>
+Date: Mon, 15 Jan 2024 20:21:08 -0500
+Subject: [PATCH] Remove dependency on conan for unit tests
+
+These run fine with catch2 installed from system package manager; there
+is no reason to enforce conan dependency.
+---
+ CMakeLists.txt | 12 ++++--------
+ 1 file changed, 4 insertions(+), 8 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cbe79a43b933..7b682c4e729d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -228,15 +228,11 @@ cmd_option( ${_OPT}has_url_schemes_support
+    "Build custom URL schemes support into Audacity"
+    Off)
+ 
+-include( CMakeDependentOption )
+-
+-cmake_dependent_option(
+-   ${_OPT}has_tests
++cmd_option( ${_OPT}has_tests
+    "Enables automated testing support"
+-   On
+-   "${_OPT}conan_enabled"
+-   Off
+-)
++   On)
++
++include( CMakeDependentOption )
+ 
+ cmake_dependent_option(
+    ${_OPT}has_audiocom_upload

Reply via email to