From 766688b5179933bc1772c4572efcd884c4d8159f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Thu, 20 May 2021 00:01:40 +0200 Subject: [PATCH] DEB uncrustify: Fix Python detection on CMake < 3.12. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- .../debian/changelog | 6 +++++ ...6_fix_python_detection_on_older_cmake.diff | 22 +++++++++++++++++++ .../debian/patches/series | 1 + 3 files changed, 29 insertions(+) create mode 100644 debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/006_fix_python_detection_on_older_cmake.diff diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/changelog b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/changelog index b61797af..44baffc7 100644 --- a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/changelog +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/changelog @@ -1,3 +1,9 @@ +uncrustify-trinity (0.73.0-0debian11.0.0+2) unstable; urgency=medium + + * Fix Python detection on CMake < 3.12. + + -- Slávek Banko Wed, 20 May 2021 00:00:40 +0200 + uncrustify-trinity (0.73.0-0debian11.0.0+1) unstable; urgency=medium * Backported commits cb1a42dd from upstream. diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/006_fix_python_detection_on_older_cmake.diff b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/006_fix_python_detection_on_older_cmake.diff new file mode 100644 index 00000000..3b11610d --- /dev/null +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/006_fix_python_detection_on_older_cmake.diff @@ -0,0 +1,22 @@ +Fix Python detection on CMake < 3.12. +=================================================================== +--- uncrustify-trinity-0.73.0.orig/CMakeLists.txt ++++ uncrustify-trinity-0.73.0/CMakeLists.txt +@@ -17,8 +17,15 @@ include(CheckCXXSymbolExists) + include(CheckTypeSize) + include(CTest) + +-find_package(Python3 REQUIRED) +-set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) ++if( ${CMAKE_VERSION} VERSION_LESS "3.12" ) ++ find_package( PythonInterp ) ++ if( NOT PYTHON_EXECUTABLE ) ++ message( FATAL_ERROR "Python is required, but was not found on your system" ) ++ endif() ++ else( ) ++ find_package(Python3 REQUIRED) ++ set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) ++endif() + + # + # Check compiler flags diff --git a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/series b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/series index 2b804c34..cd199706 100644 --- a/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/series +++ b/debian/uncrustify-trinity/uncrustify-trinity-0.73.0/debian/patches/series @@ -3,3 +3,4 @@ 003_allow_older_distributions.diff 004_fixed_usage.diff 005_upstream_cb1a42dd.diff +006_fix_python_detection_on_older_cmake.diff