1 |
commit: 542871fe71bcd4488787425a7d634544f146ff16 |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 31 20:07:10 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 31 20:14:43 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=542871fe |
7 |
|
8 |
media-sound/kid3: Make test dependencies optional, add missing BDEPEND |
9 |
|
10 |
Closes: https://bugs.gentoo.org/768084 |
11 |
Package-Manager: Portage-3.0.14, Repoman-3.0.2 |
12 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
13 |
|
14 |
.../kid3/files/kid3-3.8.5-tests-optional.patch | 64 ++++++++++++++++++++++ |
15 |
media-sound/kid3/kid3-3.8.5.ebuild | 21 +++++-- |
16 |
2 files changed, 81 insertions(+), 4 deletions(-) |
17 |
|
18 |
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 |
19 |
new file mode 100644 |
20 |
index 00000000000..4db47a2f1af |
21 |
--- /dev/null |
22 |
+++ b/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch |
23 |
@@ -0,0 +1,64 @@ |
24 |
+From 4efe62089eff54ac844c70382d432f2abb24c06e Mon Sep 17 00:00:00 2001 |
25 |
+From: Andreas Sturmlechner <asturm@g.o> |
26 |
+Date: Sun, 31 Jan 2021 20:38:41 +0100 |
27 |
+Subject: [PATCH] Use include(CTest) and BUILD_TESTING to make Qt5Test and |
28 |
+ Python optional |
29 |
+ |
30 |
+Signed-off-by: Andreas Sturmlechner <asturm@g.o> |
31 |
+--- |
32 |
+ CMakeLists.txt | 25 ++++++++++++++++--------- |
33 |
+ 1 file changed, 16 insertions(+), 9 deletions(-) |
34 |
+ |
35 |
+diff --git a/CMakeLists.txt b/CMakeLists.txt |
36 |
+index 92d50265..557a208d 100644 |
37 |
+--- a/CMakeLists.txt |
38 |
++++ b/CMakeLists.txt |
39 |
+@@ -211,8 +211,11 @@ endif() |
40 |
+ set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/qml") |
41 |
+ |
42 |
+ find_package(Threads) |
43 |
+-set(Python_ADDITIONAL_VERSIONS 3) |
44 |
+-find_package(PythonInterp REQUIRED) |
45 |
++include(CTest) |
46 |
++if(BUILD_TESTING) |
47 |
++ set(Python_ADDITIONAL_VERSIONS 3) |
48 |
++ find_package(PythonInterp REQUIRED) |
49 |
++endif() |
50 |
+ include (CheckCXXSourceCompiles) |
51 |
+ include (CheckCXXCompilerFlag) |
52 |
+ include (CheckLibraryExists) |
53 |
+@@ -256,7 +259,10 @@ else() |
54 |
+ find_package(Qt5Core) |
55 |
+ endif() |
56 |
+ if(Qt5Core_FOUND) |
57 |
+- set(_qtComponents Core Gui Widgets Network Xml Multimedia LinguistTools Test) |
58 |
++ set(_qtComponents Core Gui Widgets Network Xml Multimedia LinguistTools) |
59 |
++ if(BUILD_TESTING) |
60 |
++ set(_qtComponents ${_qtComponents} Test) |
61 |
++ endif() |
62 |
+ if(WITH_DBUS) |
63 |
+ set(_qtComponents ${_qtComponents} DBus) |
64 |
+ endif() |
65 |
+@@ -472,12 +478,13 @@ if(ANDROID) |
66 |
+ endif() |
67 |
+ |
68 |
+ |
69 |
+-enable_testing() |
70 |
+-add_test(NAME test_cli_functions |
71 |
+- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/test/test_cli_functions.py) |
72 |
+-add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure) |
73 |
+-if(NOT CMAKE_VERSION VERSION_LESS "3.17") |
74 |
+- list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure) |
75 |
++if(BUILD_TESTING) |
76 |
++ add_test(NAME test_cli_functions |
77 |
++ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/test/test_cli_functions.py) |
78 |
++ add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure) |
79 |
++ if(NOT CMAKE_VERSION VERSION_LESS "3.17") |
80 |
++ list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure) |
81 |
++ endif() |
82 |
+ endif() |
83 |
+ |
84 |
+ |
85 |
+-- |
86 |
+2.30.0 |
87 |
+ |
88 |
|
89 |
diff --git a/media-sound/kid3/kid3-3.8.5.ebuild b/media-sound/kid3/kid3-3.8.5.ebuild |
90 |
index a047ed173a3..40385027d97 100644 |
91 |
--- a/media-sound/kid3/kid3-3.8.5.ebuild |
92 |
+++ b/media-sound/kid3/kid3-3.8.5.ebuild |
93 |
@@ -3,7 +3,8 @@ |
94 |
|
95 |
EAPI=7 |
96 |
|
97 |
-inherit kde.org cmake xdg |
98 |
+PYTHON_COMPAT=( python3_{7..9} ) |
99 |
+inherit cmake kde.org python-any-r1 xdg |
100 |
|
101 |
DESCRIPTION="Simple tag editor based on Qt" |
102 |
HOMEPAGE="https://kid3.kde.org/" |
103 |
@@ -15,15 +16,17 @@ fi |
104 |
|
105 |
LICENSE="GPL-2+" |
106 |
SLOT="5" |
107 |
-IUSE="acoustid flac kde mp3 mp4 +mpris +taglib vorbis" |
108 |
+IUSE="acoustid flac kde mp3 mp4 +mpris +taglib test vorbis" |
109 |
|
110 |
REQUIRED_USE="flac? ( vorbis )" |
111 |
+RESTRICT+=" !test? ( test )" |
112 |
|
113 |
BDEPEND=" |
114 |
dev-qt/linguist-tools:5 |
115 |
kde? ( kde-frameworks/extra-cmake-modules:5 ) |
116 |
+ test? ( ${PYTHON_DEPS} ) |
117 |
" |
118 |
-DEPEND=" |
119 |
+COMMON_DEPEND=" |
120 |
dev-qt/qtcore:5 |
121 |
dev-qt/qtdeclarative:5 |
122 |
dev-qt/qtgui:5 |
123 |
@@ -57,10 +60,19 @@ DEPEND=" |
124 |
media-libs/libvorbis |
125 |
) |
126 |
" |
127 |
-RDEPEND="${DEPEND} |
128 |
+DEPEND="${COMMON_DEPEND} |
129 |
+ test? ( dev-qt/qttest:5 ) |
130 |
+" |
131 |
+RDEPEND="${COMMON_DEPEND} |
132 |
!media-sound/kid3:4 |
133 |
" |
134 |
|
135 |
+PATCHES=( "${FILESDIR}/${P}-tests-optional.patch" ) |
136 |
+ |
137 |
+pkg_setup() { |
138 |
+ use test && python-any-r1_pkg_setup |
139 |
+} |
140 |
+ |
141 |
src_prepare() { |
142 |
# overengineered upstream build system |
143 |
cmake_src_prepare |
144 |
@@ -76,6 +88,7 @@ src_configure() { |
145 |
-DWITH_ID3LIB=$(usex mp3) |
146 |
-DWITH_MP4V2=$(usex mp4) |
147 |
-DWITH_TAGLIB=$(usex taglib) |
148 |
+ -DBUILD_TESTING=$(usex test) |
149 |
-DWITH_VORBIS=$(usex vorbis) |
150 |
) |