commit:     ab14f16dc381de27c34747e413237bd7d6d79994
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 31 22:52:46 2021 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Jan 31 22:57:46 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab14f16d

media-sound/kid3: Use CMake 3.12's Python3 module to inject PYTHON

Bug: https://bugs.gentoo.org/768084
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../kid3/files/kid3-3.8.5-tests-optional.patch     | 37 +++++++++++++++++++++-
 media-sound/kid3/kid3-3.8.5.ebuild                 |  1 +
 2 files changed, 37 insertions(+), 1 deletion(-)

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
index 4db47a2f1af..d5b74ca5613 100644
--- a/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch
+++ b/media-sound/kid3/files/kid3-3.8.5-tests-optional.patch
@@ -1,7 +1,7 @@
 From 4efe62089eff54ac844c70382d432f2abb24c06e Mon Sep 17 00:00:00 2001
 From: Andreas Sturmlechner <[email protected]>
 Date: Sun, 31 Jan 2021 20:38:41 +0100
-Subject: [PATCH] Use include(CTest) and BUILD_TESTING to make Qt5Test and
+Subject: [PATCH 1/2] Use include(CTest) and BUILD_TESTING to make Qt5Test and
  Python optional
 
 Signed-off-by: Andreas Sturmlechner <[email protected]>
@@ -62,3 +62,38 @@ index 92d50265..557a208d 100644
 -- 
 2.30.0
 
+
+From 1e264e918686d5d09a5457513f3aadeea25d6e5e Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <[email protected]>
+Date: Sun, 31 Jan 2021 23:43:49 +0100
+Subject: [PATCH 2/2] Use CMake FindPython3 module if available (CMake >=3.12)
+
+Signed-off-by: Andreas Sturmlechner <[email protected]>
+---
+ CMakeLists.txt | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 557a208d..706167e6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -213,8 +213,14 @@ set(CFG_QMLSRCDIR "${kid3_SOURCE_DIR}/src/qml")
+ find_package(Threads)
+ include(CTest)
+ if(BUILD_TESTING)
+-  set(Python_ADDITIONAL_VERSIONS 3)
+-  find_package(PythonInterp REQUIRED)
++  if(CMAKE_VERSION VERSION_LESS 3.12.0)
++    set(Python_ADDITIONAL_VERSIONS 3)
++    find_package(PythonInterp REQUIRED)
++    # PythonInterp sets PYTHON_EXECUTABLE
++  else()
++    find_package(Python3 COMPONENTS Interpreter REQUIRED)
++    set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}")
++  endif()
+ endif()
+ include (CheckCXXSourceCompiles)
+ include (CheckCXXCompilerFlag)
+-- 
+2.30.0
+

diff --git a/media-sound/kid3/kid3-3.8.5.ebuild 
b/media-sound/kid3/kid3-3.8.5.ebuild
index 40385027d97..734a8c02465 100644
--- a/media-sound/kid3/kid3-3.8.5.ebuild
+++ b/media-sound/kid3/kid3-3.8.5.ebuild
@@ -91,6 +91,7 @@ src_configure() {
                -DBUILD_TESTING=$(usex test)
                -DWITH_VORBIS=$(usex vorbis)
        )
+       use test && mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
 
        if use kde ; then
                mycmakeargs+=( "-DWITH_APPS=KDE;CLI" )

Reply via email to