Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/kde:master commit in: media-sound/kid3/files/, media-sound/kid3/
Date: Sun, 31 Jan 2021 23:00:53
Message-Id: 1612133999.bc0cde8e770d972fd2dd2061fe1d26e7a4c3a220.asturm@gentoo
1 commit: bc0cde8e770d972fd2dd2061fe1d26e7a4c3a220
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 22:59:59 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/kde.git/commit/?id=bc0cde8e
7
8 media-sound/kid3: Make test dependencies optional, add missing BDEPEND
9
10 Use CMake 3.12's Python3 module to inject PYTHON
11
12 Bug: https://bugs.gentoo.org/768084
13 Package-Manager: Portage-3.0.14, Repoman-3.0.2
14 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
15
16 .../kid3/files/kid3-3.8.5-tests-optional.patch | 99 ++++++++++++++++++++++
17 media-sound/kid3/kid3-9999.ebuild | 21 +++--
18 2 files changed, 115 insertions(+), 5 deletions(-)
19
20 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
21 new file mode 100644
22 index 0000000000..d5b74ca561
23 --- /dev/null
24 +++ b/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch
25 @@ -0,0 +1,99 @@
26 +From 4efe62089eff54ac844c70382d432f2abb24c06e Mon Sep 17 00:00:00 2001
27 +From: Andreas Sturmlechner <asturm@g.o>
28 +Date: Sun, 31 Jan 2021 20:38:41 +0100
29 +Subject: [PATCH 1/2] Use include(CTest) and BUILD_TESTING to make Qt5Test and
30 + Python optional
31 +
32 +Signed-off-by: Andreas Sturmlechner <asturm@g.o>
33 +---
34 + CMakeLists.txt | 25 ++++++++++++++++---------
35 + 1 file changed, 16 insertions(+), 9 deletions(-)
36 +
37 +diff --git a/CMakeLists.txt b/CMakeLists.txt
38 +index 92d50265..557a208d 100644
39 +--- a/CMakeLists.txt
40 ++++ b/CMakeLists.txt
41 +@@ -211,8 +211,11 @@ endif()
42 + set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/qml")
43 +
44 + find_package(Threads)
45 +-set(Python_ADDITIONAL_VERSIONS 3)
46 +-find_package(PythonInterp REQUIRED)
47 ++include(CTest)
48 ++if(BUILD_TESTING)
49 ++ set(Python_ADDITIONAL_VERSIONS 3)
50 ++ find_package(PythonInterp REQUIRED)
51 ++endif()
52 + include (CheckCXXSourceCompiles)
53 + include (CheckCXXCompilerFlag)
54 + include (CheckLibraryExists)
55 +@@ -256,7 +259,10 @@ else()
56 + find_package(Qt5Core)
57 + endif()
58 + if(Qt5Core_FOUND)
59 +- set(_qtComponents Core Gui Widgets Network Xml Multimedia LinguistTools Test)
60 ++ set(_qtComponents Core Gui Widgets Network Xml Multimedia LinguistTools)
61 ++ if(BUILD_TESTING)
62 ++ set(_qtComponents ${_qtComponents} Test)
63 ++ endif()
64 + if(WITH_DBUS)
65 + set(_qtComponents ${_qtComponents} DBus)
66 + endif()
67 +@@ -472,12 +478,13 @@ if(ANDROID)
68 + endif()
69 +
70 +
71 +-enable_testing()
72 +-add_test(NAME test_cli_functions
73 +- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/test/test_cli_functions.py)
74 +-add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure)
75 +-if(NOT CMAKE_VERSION VERSION_LESS "3.17")
76 +- list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure)
77 ++if(BUILD_TESTING)
78 ++ add_test(NAME test_cli_functions
79 ++ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/test/test_cli_functions.py)
80 ++ add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure)
81 ++ if(NOT CMAKE_VERSION VERSION_LESS "3.17")
82 ++ list(APPEND CMAKE_CTEST_ARGUMENTS --output-on-failure)
83 ++ endif()
84 + endif()
85 +
86 +
87 +--
88 +2.30.0
89 +
90 +
91 +From 1e264e918686d5d09a5457513f3aadeea25d6e5e Mon Sep 17 00:00:00 2001
92 +From: Andreas Sturmlechner <asturm@g.o>
93 +Date: Sun, 31 Jan 2021 23:43:49 +0100
94 +Subject: [PATCH 2/2] Use CMake FindPython3 module if available (CMake >=3.12)
95 +
96 +Signed-off-by: Andreas Sturmlechner <asturm@g.o>
97 +---
98 + CMakeLists.txt | 10 ++++++++--
99 + 1 file changed, 8 insertions(+), 2 deletions(-)
100 +
101 +diff --git a/CMakeLists.txt b/CMakeLists.txt
102 +index 557a208d..706167e6 100644
103 +--- a/CMakeLists.txt
104 ++++ b/CMakeLists.txt
105 +@@ -213,8 +213,14 @@ set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/qml")
106 + find_package(Threads)
107 + include(CTest)
108 + if(BUILD_TESTING)
109 +- set(Python_ADDITIONAL_VERSIONS 3)
110 +- find_package(PythonInterp REQUIRED)
111 ++ if(CMAKE_VERSION VERSION_LESS 3.12.0)
112 ++ set(Python_ADDITIONAL_VERSIONS 3)
113 ++ find_package(PythonInterp REQUIRED)
114 ++ # PythonInterp sets PYTHON_EXECUTABLE
115 ++ else()
116 ++ find_package(Python3 COMPONENTS Interpreter REQUIRED)
117 ++ set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
118 ++ endif()
119 + endif()
120 + include (CheckCXXSourceCompiles)
121 + include (CheckCXXCompilerFlag)
122 +--
123 +2.30.0
124 +
125
126 diff --git a/media-sound/kid3/kid3-9999.ebuild b/media-sound/kid3/kid3-9999.ebuild
127 index a047ed173a..5e87f72029 100644
128 --- a/media-sound/kid3/kid3-9999.ebuild
129 +++ b/media-sound/kid3/kid3-9999.ebuild
130 @@ -3,7 +3,8 @@
131
132 EAPI=7
133
134 -inherit kde.org cmake xdg
135 +PYTHON_COMPAT=( python3_{7..9} )
136 +inherit cmake kde.org python-any-r1 xdg
137
138 DESCRIPTION="Simple tag editor based on Qt"
139 HOMEPAGE="https://kid3.kde.org/"
140 @@ -15,15 +16,17 @@ fi
141
142 LICENSE="GPL-2+"
143 SLOT="5"
144 -IUSE="acoustid flac kde mp3 mp4 +mpris +taglib vorbis"
145 +IUSE="acoustid flac kde mp3 mp4 +mpris +taglib test vorbis"
146
147 REQUIRED_USE="flac? ( vorbis )"
148 +RESTRICT+=" !test? ( test )"
149
150 BDEPEND="
151 dev-qt/linguist-tools:5
152 kde? ( kde-frameworks/extra-cmake-modules:5 )
153 + test? ( ${PYTHON_DEPS} )
154 "
155 -DEPEND="
156 +RDEPEND="
157 dev-qt/qtcore:5
158 dev-qt/qtdeclarative:5
159 dev-qt/qtgui:5
160 @@ -57,10 +60,16 @@ DEPEND="
161 media-libs/libvorbis
162 )
163 "
164 -RDEPEND="${DEPEND}
165 - !media-sound/kid3:4
166 +DEPEND="${RDEPEND}
167 + test? ( dev-qt/qttest:5 )
168 "
169
170 +PATCHES=( "${FILESDIR}/${PN}-3.8.5-tests-optional.patch" )
171 +
172 +pkg_setup() {
173 + use test && python-any-r1_pkg_setup
174 +}
175 +
176 src_prepare() {
177 # overengineered upstream build system
178 cmake_src_prepare
179 @@ -76,8 +85,10 @@ src_configure() {
180 -DWITH_ID3LIB=$(usex mp3)
181 -DWITH_MP4V2=$(usex mp4)
182 -DWITH_TAGLIB=$(usex taglib)
183 + -DBUILD_TESTING=$(usex test)
184 -DWITH_VORBIS=$(usex vorbis)
185 )
186 + use test && mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
187
188 if use kde ; then
189 mycmakeargs+=( "-DWITH_APPS=KDE;CLI" )