Skip to content
This repository was archived by the owner on May 30, 2023. It is now read-only.

Commit 98db1ce

Browse files
committed
Do not rely on #!/usr/bin/env for the Python helper
Distros do not like having script interpreters soft-coded that way. See, e.g.: https://fedoraproject.org/wiki/Packaging:Guidelines#Shebang_lines Therefore, look for the actual path to the Python 3 interpreter and substitute it in kcm_ufw_helper.py (which is already run through configure_file anyway). The only tricky thing is that finding KCMUtils will look for a Python interpreter without specifying a version and take the first one it finds. Unfortunately, that is typically /usr/bin/python, which is often (still) Python 2. So a later call to "find_package(PythonInterp 3 REQUIRED)" will then attempt to use the cached PYTHON_EXECUTABLE and fail because it is not the required version. Thus, look for Python 3 before looking for the Qt5 and KF5 libraries.
1 parent e46458f commit 98db1ce

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ set(QT_MIN_VERSION "5.7.0")
1010
#-----------------------------------------------------------------------------
1111
# DEPENDENCIES
1212
#-----------------------------------------------------------------------------
13+
# Python3 (search for this first so that we will not get Python2 by accident)
14+
find_package(PythonInterp 3 REQUIRED)
15+
1316
# Qt5
1417
find_package(Qt5 REQUIRED COMPONENTS
1518
Core

plugins/ufw/helper/kcm_ufw_helper.py.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3
1+
#!@PYTHON_EXECUTABLE@
22

33
#
44
# UFW KControl Module

0 commit comments

Comments
 (0)