diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2021-01-31 21:07:10 +0100 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2021-01-31 21:14:43 +0100 |
commit | 542871fe71bcd4488787425a7d634544f146ff16 (patch) | |
tree | 976b07896dd5b88e1e44cecbba98ba53afc1f1c4 /media-sound/kid3 | |
parent | x11-wm/mutter: add misc upstream backports (diff) | |
download | gentoo-542871fe71bcd4488787425a7d634544f146ff16.tar.gz gentoo-542871fe71bcd4488787425a7d634544f146ff16.tar.bz2 gentoo-542871fe71bcd4488787425a7d634544f146ff16.zip |
media-sound/kid3: Make test dependencies optional, add missing BDEPEND
Closes: https://bugs.gentoo.org/768084
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-sound/kid3')
-rw-r--r-- | media-sound/kid3/files/kid3-3.8.5-tests-optional.patch | 64 | ||||
-rw-r--r-- | media-sound/kid3/kid3-3.8.5.ebuild | 21 |
2 files changed, 81 insertions, 4 deletions
diff --git a/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch b/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch new file mode 100644 index 000000000000..4db47a2f1aff --- /dev/null +++ b/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch @@ -0,0 +1,64 @@ +From 4efe62089eff54ac844c70382d432f2abb24c06e Mon Sep 17 00:00:00 2001 +From: Andreas Sturmlechner <asturm@gentoo.org> +Date: Sun, 31 Jan 2021 20:38:41 +0100 +Subject: [PATCH] Use include(CTest) and BUILD_TESTING to make Qt5Test and + Python optional + +Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org> +--- + CMakeLists.txt | 25 ++++++++++++++++--------- + 1 file changed, 16 insertions(+), 9 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 92d50265..557a208d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -211,8 +211,11 @@ endif() + set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/qml") + + find_package(Threads) +-set(Python_ADDITIONAL_VERSIONS 3) +-find_package(PythonInterp REQUIRED) ++include(CTest) ++if(BUILD_TESTING) ++ set(Python_ADDITIONAL_VERSIONS 3) ++ find_package(PythonInterp REQUIRED) ++endif() + include (CheckCXXSourceCompiles) + include (CheckCXXCompilerFlag) + include (CheckLibraryExists) +@@ -256,7 +259,10 @@ else() + find_package(Qt5Core) + endif() + if(Qt5Core_FOUND) +- set(_qtComponents Core Gui Widgets Network Xml Multimedia LinguistTools Test) ++ set(_qtComponents Core Gui Widgets Network Xml Multimedia LinguistTools) ++ if(BUILD_TESTING) ++ set(_qtComponents ${_qtComponents} Test) ++ endif() + if(WITH_DBUS) + set(_qtComponents ${_qtComponents} DBus) + endif() +@@ -472,12 +478,13 @@ if(ANDROID) + endif() + + +-enable_testing() +-add_test(NAME test_cli_functions +- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/test/test_cli_functions.py) +-add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure) +-if(NOT CMAKE_VERSION VERSION_LESS "3.17") +- list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure) ++if(BUILD_TESTING) ++ add_test(NAME test_cli_functions ++ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/test/test_cli_functions.py) ++ add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure) ++ if(NOT CMAKE_VERSION VERSION_LESS "3.17") ++ list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure) ++ endif() + endif() + + +-- +2.30.0 + diff --git a/media-sound/kid3/kid3-3.8.5.ebuild b/media-sound/kid3/kid3-3.8.5.ebuild index a047ed173a3d..40385027d97a 100644 --- a/media-sound/kid3/kid3-3.8.5.ebuild +++ b/media-sound/kid3/kid3-3.8.5.ebuild @@ -3,7 +3,8 @@ EAPI=7 -inherit kde.org cmake xdg +PYTHON_COMPAT=( python3_{7..9} ) +inherit cmake kde.org python-any-r1 xdg DESCRIPTION="Simple tag editor based on Qt" HOMEPAGE="https://kid3.kde.org/" @@ -15,15 +16,17 @@ fi LICENSE="GPL-2+" SLOT="5" -IUSE="acoustid flac kde mp3 mp4 +mpris +taglib vorbis" +IUSE="acoustid flac kde mp3 mp4 +mpris +taglib test vorbis" REQUIRED_USE="flac? ( vorbis )" +RESTRICT+=" !test? ( test )" BDEPEND=" dev-qt/linguist-tools:5 kde? ( kde-frameworks/extra-cmake-modules:5 ) + test? ( ${PYTHON_DEPS} ) " -DEPEND=" +COMMON_DEPEND=" dev-qt/qtcore:5 dev-qt/qtdeclarative:5 dev-qt/qtgui:5 @@ -57,10 +60,19 @@ DEPEND=" media-libs/libvorbis ) " -RDEPEND="${DEPEND} +DEPEND="${COMMON_DEPEND} + test? ( dev-qt/qttest:5 ) +" +RDEPEND="${COMMON_DEPEND} !media-sound/kid3:4 " +PATCHES=( "${FILESDIR}/${P}-tests-optional.patch" ) + +pkg_setup() { + use test && python-any-r1_pkg_setup +} + src_prepare() { # overengineered upstream build system cmake_src_prepare @@ -76,6 +88,7 @@ src_configure() { -DWITH_ID3LIB=$(usex mp3) -DWITH_MP4V2=$(usex mp4) -DWITH_TAGLIB=$(usex taglib) + -DBUILD_TESTING=$(usex test) -DWITH_VORBIS=$(usex vorbis) ) |