commit:     5cff97f8ec69978d0b899b54e4aff82587592b69
Author:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 17:12:04 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 21:16:53 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cff97f8

media-sound/lmms: add missing testsuite dependency

It needs dev-qt/qttest in order to link tests successfully. And there is
also a cmake warning that Qt5::Test was linked to, but not found, and
that's a bug -- due to cmake's excellent, world-class type safety, this
is NOT obviously a detectable error when you can simply assume maybe it
means `-lQt5::Test`, but in the minimum version that the live ebuild
uses, the fact that the string name includes "::" means cmake can and in
fact does error out since "::" is reserved for imported libraries.

So the live ebuild actually fails to configure without qttest, but even
the versioned release would error out when running the testsuite and
attempting to compile the test program. Of course, the versioned release
also doesn't *connect* the testsuite, and one of the test cases appears
to fail anyway even if you manually cd and run it by hand.

Naturally, there is no buildsystem option to disable this. Instead, we
use a filthy sed to the test directory when not building tests.

Closes: https://bugs.gentoo.org/879567
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 media-sound/lmms/lmms-1.2.2-r2.ebuild | 24 +++++++++++++++++++++++-
 media-sound/lmms/lmms-9999.ebuild     | 20 +++++++++++++++++++-
 2 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/media-sound/lmms/lmms-1.2.2-r2.ebuild 
b/media-sound/lmms/lmms-1.2.2-r2.ebuild
index 15bb77c03a9d..20dd54d2f656 100644
--- a/media-sound/lmms/lmms-1.2.2-r2.ebuild
+++ b/media-sound/lmms/lmms-1.2.2-r2.ebuild
@@ -21,7 +21,13 @@ S="${WORKDIR}/${PN}"
 LICENSE="GPL-2 LGPL-2"
 SLOT="0"
 
-IUSE="alsa debug fluidsynth jack libgig mp3 ogg portaudio pulseaudio sdl 
soundio stk vst"
+IUSE="alsa debug fluidsynth jack libgig mp3 ogg portaudio pulseaudio sdl 
soundio stk test vst"
+
+# FAIL!  : AutomatableModelTest::LinkTests() 'm1Changed' returned FALSE. ()
+#
+# Did not previously pass, did not previously run. Maintain status quo.
+# Fixed upstream in git.
+RESTRICT="test"
 
 COMMON_DEPEND="
        dev-qt/qtcore:5
@@ -54,6 +60,7 @@ COMMON_DEPEND="
 "
 DEPEND="${COMMON_DEPEND}
        dev-qt/qtx11extras:5
+       test? ( dev-qt/qttest:5 )
 "
 BDEPEND="
        dev-qt/linguist-tools:5
@@ -74,6 +81,14 @@ PATCHES=(
        "${FILESDIR}/${PN}-1.2.2-kwidgetsaddons.patch"
 )
 
+src_prepare() {
+       cmake_src_prepare
+
+       if use !test; then
+               sed -i '/ADD_SUBDIRECTORY(tests)/d' CMakeLists.txt || die
+       fi
+}
+
 src_configure() {
        local mycmakeargs=(
                -DUSE_WERROR=FALSE
@@ -99,3 +114,10 @@ src_configure() {
 
        cmake_src_configure
 }
+
+src_test() {
+       # does not use ctest
+       cmake_build tests/tests
+       "${BUILD_DIR}"/tests/tests || die
+
+}

diff --git a/media-sound/lmms/lmms-9999.ebuild 
b/media-sound/lmms/lmms-9999.ebuild
index ec73afb24dd9..f003402e4f33 100644
--- a/media-sound/lmms/lmms-9999.ebuild
+++ b/media-sound/lmms/lmms-9999.ebuild
@@ -19,7 +19,9 @@ fi
 LICENSE="GPL-2 LGPL-2"
 SLOT="0"
 
-IUSE="alsa debug fluidsynth jack libgig mp3 ogg portaudio pulseaudio sdl 
soundio stk vst"
+IUSE="alsa debug fluidsynth jack libgig mp3 ogg portaudio pulseaudio sdl 
soundio stk test vst"
+
+RESTRICT="!test? ( test )"
 
 COMMON_DEPEND="
        dev-qt/qtcore:5
@@ -52,6 +54,7 @@ COMMON_DEPEND="
 "
 DEPEND="${COMMON_DEPEND}
        dev-qt/qtx11extras:5
+       test? ( dev-qt/qttest:5 )
 "
 BDEPEND="
        dev-qt/linguist-tools:5
@@ -71,6 +74,14 @@ PATCHES=(
        "${FILESDIR}/${PN}-9999-plugin-path.patch" #907285
 )
 
+src_prepare() {
+       cmake_src_prepare
+
+       if use !test; then
+               sed -i '/ADD_SUBDIRECTORY(tests)/d' CMakeLists.txt || die
+       fi
+}
+
 src_configure() {
        local mycmakeargs=(
                -DUSE_WERROR=FALSE
@@ -95,3 +106,10 @@ src_configure() {
 
        cmake_src_configure
 }
+
+src_test() {
+       # tests are hidden inside a subdir and ctest does not detect them 
without
+       # running inside that subdir
+       local BUILD_DIR="${BUILD_DIR}/tests"
+       cmake_src_test
+}

Reply via email to