File: 0005-Drop-python2-support.patch

package info (click to toggle)
cairo-dock-plug-ins 3.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 27,900 kB
  • sloc: ansic: 90,452; python: 782; xml: 545; sh: 503; cs: 427; ruby: 283; makefile: 28
file content (53 lines) | stat: -rw-r--r-- 2,168 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 175c0cc695624e8557c276753f8e0a9112f7d5a6 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Date: Sat, 2 Jan 2021 21:56:58 +0900
Subject: [PATCH] Drop python2 support

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
---
 CMakeLists.txt | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -452,17 +452,12 @@
 if (enable-python-interface)
 	message (STATUS " * Python:")
 	# find python executables
-	find_program (PYTHON2_EXECUTABLE python2)  # if both python2&3 are installed, usually we will have 'python2' and 'python3' available (one of them being a link to 'python')
-	if (PYTHON2_EXECUTABLE AND EXISTS ${PYTHON2_EXECUTABLE})
-		set (PYTHON2_FOUND TRUE)
-		set (with_python2 yes)
-	endif()
 	find_program (PYTHON3_EXECUTABLE python3)
 	if (PYTHON3_EXECUTABLE AND EXISTS ${PYTHON3_EXECUTABLE})
 		set (PYTHON3_FOUND TRUE)
 		set (with_python3 yes)
 	endif()
-	if (NOT PYTHON2_FOUND OR NOT PYTHON3_FOUND)  # if we didn't find one of them, 
+	if (NOT PYTHON3_FOUND)  # if we didn't find one of them, 
 		find_program (PYTHON_EXECUTABLE python)
 		if (PYTHON_EXECUTABLE AND EXISTS ${PYTHON_EXECUTABLE})
 			EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c
@@ -470,11 +465,7 @@
 				OUTPUT_VARIABLE PYTHON_VERSION)
 			STRING (REGEX REPLACE "\\..*" "" PYTHON_VERSION ${PYTHON_VERSION})
 			message (STATUS "   Python Version: ${PYTHON_VERSION}")
-			if ("${PYTHON_VERSION}" STREQUAL "2")
-				set (PYTHON2_EXECUTABLE ${PYTHON_EXECUTABLE})
-				set (PYTHON2_FOUND TRUE)
-				set (with_python2 yes)
-			elseif ("${PYTHON_VERSION}" STREQUAL "3")
+			if ("${PYTHON_VERSION}" STREQUAL "3")
 				set (PYTHON3_EXECUTABLE ${PYTHON_EXECUTABLE})
 				set (PYTHON3_FOUND TRUE)
 				set (with_python3 yes)
@@ -483,7 +474,7 @@
 	endif()
 	
 	# see if we found anything
-	if (NOT PYTHON2_FOUND AND NOT PYTHON3_FOUND)
+	if (NOT PYTHON3_FOUND)
 		message (STATUS "Could not find Python, won't install Python interface.")
 		message (WARNING "This program is required to compile DBus applet with Python interface: python (version 2)")
 		set (PROGRAMS_MISSING "${PROGRAMS_MISSING} python")