commit:     e4af99e14590eb004027e01c6adb09ccfccfa47b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 19 06:08:54 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun 19 16:59:56 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4af99e1

media-sound/strawberry: wire up tests

* Wire up tests by running the custom target in src_test
* Avoid unconditional gtest dependency by hacking w/ find_package

Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/strawberry/strawberry-1.2.7.ebuild | 24 +++++++++++++++++-------
 media-sound/strawberry/strawberry-9999.ebuild  | 24 +++++++++++++++++-------
 2 files changed, 34 insertions(+), 14 deletions(-)

diff --git a/media-sound/strawberry/strawberry-1.2.7.ebuild 
b/media-sound/strawberry/strawberry-1.2.7.ebuild
index 65ceefa8c00c..d6cae1b2c2a3 100644
--- a/media-sound/strawberry/strawberry-1.2.7.ebuild
+++ b/media-sound/strawberry/strawberry-1.2.7.ebuild
@@ -3,10 +3,11 @@
 
 EAPI=8
 
-inherit cmake flag-o-matic xdg
+inherit cmake flag-o-matic virtualx xdg
 
 DESCRIPTION="Modern music player and library organizer based on Clementine and 
Qt"
 HOMEPAGE="https://www.strawberrymusicplayer.org/";
+
 if [[ ${PV} == *9999* ]]; then
        EGIT_REPO_URI="https://github.com/strawberrymusicplayer/strawberry";
        inherit git-r3
@@ -17,14 +18,15 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE="alsa cdda chromaprint +dbus debug kde +loudness ipod moodbar mtp 
+pulseaudio streaming +udisks X"
+IUSE="alsa cdda chromaprint +dbus debug kde +loudness ipod moodbar mtp 
+pulseaudio streaming test +udisks X"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
        sys-devel/gettext
        virtual/pkgconfig
 "
 
-#INFO: alsa-lib is always required in linux even if its not built
+# alsa-lib is always required in linux even if it's not built
 COMMON_DEPEND="
        dev-db/sqlite:=
        dev-libs/glib:2
@@ -46,16 +48,19 @@ COMMON_DEPEND="
        loudness? ( media-libs/libebur128 )
        pulseaudio? ( media-libs/libpulse )
 "
-# Note: sqlite driver of dev-qt/qtsql is bundled, so no sqlite use is 
required; check if this can be overcome someway;
-RDEPEND="${COMMON_DEPEND}
+# Note: sqlite driver of dev-qt/qtsql is bundled, so no sqlite use is required.
+# Check if this can be overcome someway.
+RDEPEND="
+       ${COMMON_DEPEND}
        media-plugins/gst-plugins-meta:1.0
        media-plugins/gst-plugins-taglib
        udisks? ( sys-fs/udisks:2 )
        kde? ( kde-frameworks/kglobalaccel )
 "
-DEPEND="${COMMON_DEPEND}
-       dev-cpp/gtest
+DEPEND="
+       ${COMMON_DEPEND}
        dev-libs/boost
+       test? ( dev-cpp/gtest )
 "
 
 DOCS=( Changelog README.md )
@@ -68,6 +73,7 @@ REQUIRED_USE="
 src_configure() {
        # spotify is not in portage
        local mycmakeargs=(
+               $(cmake_use_find_package test GTest)
                $(cmake_use_find_package X X11)
                -DBUILD_WERROR=OFF
                # avoid automagically enabling of ccache (bug #611010)
@@ -99,6 +105,10 @@ src_configure() {
        cmake_src_configure
 }
 
+src_test() {
+       virtx cmake_build run_strawberry_tests
+}
+
 pkg_postinst() {
        xdg_pkg_postinst
 

diff --git a/media-sound/strawberry/strawberry-9999.ebuild 
b/media-sound/strawberry/strawberry-9999.ebuild
index 48b5f0aeac42..40b6f3af6141 100644
--- a/media-sound/strawberry/strawberry-9999.ebuild
+++ b/media-sound/strawberry/strawberry-9999.ebuild
@@ -3,10 +3,11 @@
 
 EAPI=8
 
-inherit cmake flag-o-matic xdg
+inherit cmake flag-o-matic virtualx xdg
 
 DESCRIPTION="Modern music player and library organizer based on Clementine and 
Qt"
 HOMEPAGE="https://www.strawberrymusicplayer.org/";
+
 if [[ ${PV} == *9999* ]]; then
        EGIT_REPO_URI="https://github.com/strawberrymusicplayer/strawberry";
        inherit git-r3
@@ -17,14 +18,15 @@ fi
 
 LICENSE="GPL-3"
 SLOT="0"
-IUSE="alsa cdda chromaprint dbus debug kde +loudness ipod moodbar mtp 
+pulseaudio streaming +udisks X"
+IUSE="alsa cdda chromaprint +dbus debug kde +loudness ipod moodbar mtp 
+pulseaudio streaming test +udisks X"
+RESTRICT="!test? ( test )"
 
 BDEPEND="
        sys-devel/gettext
        virtual/pkgconfig
 "
 
-#INFO: alsa-lib is always required in linux even if its not built
+# alsa-lib is always required in linux even if it's not built
 COMMON_DEPEND="
        dev-db/sqlite:=
        dev-libs/glib:2
@@ -46,16 +48,19 @@ COMMON_DEPEND="
        loudness? ( media-libs/libebur128 )
        pulseaudio? ( media-libs/libpulse )
 "
-# Note: sqlite driver of dev-qt/qtsql is bundled, so no sqlite use is 
required; check if this can be overcome someway;
-RDEPEND="${COMMON_DEPEND}
+# Note: sqlite driver of dev-qt/qtsql is bundled, so no sqlite use is required.
+# Check if this can be overcome someway.
+RDEPEND="
+       ${COMMON_DEPEND}
        media-plugins/gst-plugins-meta:1.0
        media-plugins/gst-plugins-taglib
        udisks? ( sys-fs/udisks:2 )
        kde? ( kde-frameworks/kglobalaccel )
 "
-DEPEND="${COMMON_DEPEND}
-       dev-cpp/gtest
+DEPEND="
+       ${COMMON_DEPEND}
        dev-libs/boost
+       test? ( dev-cpp/gtest )
 "
 
 DOCS=( Changelog README.md )
@@ -67,6 +72,7 @@ REQUIRED_USE="
 src_configure() {
        # spotify is not in portage
        local mycmakeargs=(
+               $(cmake_use_find_package test GTest)
                $(cmake_use_find_package X X11)
                -DBUILD_WERROR=OFF
                # avoid automagically enabling of ccache (bug #611010)
@@ -98,6 +104,10 @@ src_configure() {
        cmake_src_configure
 }
 
+src_test() {
+       virtx cmake_build run_strawberry_tests
+}
+
 pkg_postinst() {
        xdg_pkg_postinst
 

Reply via email to