Works correctly when installed
Changed cmake locally to "import asdfasdf"
Got the correct error message and an aborted build
ngraham | |
krop | |
zzag |
Plasma |
Works correctly when installed
Changed cmake locally to "import asdfasdf"
Got the correct error message and an aborted build
No Linters Available |
No Unit Test Coverage |
Buildable 7119 | |
Build 7137: arc lint + arc unit |
For me it fails even though I have python-cairo installed, e.g.
$ python Python 3.7.2 (default, Jan 10 2019, 23:51:51) [GCC 8.2.1 20181127] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import cairo >>> cairo.__file__ '/usr/lib/python3.7/site-packages/cairo/__init__.py' >>>
Works for me and CMake code looks good. For now we should probably ship this here for the 5.15 release, but maybe this should also go into ECM and then we can use it from there in subsequent releases?
That's strange. Here's my output:
$ (arcpatch-D18244) cmake -DCMAKE_INSTALL_PREFIX=/usr . -- The following RUNTIME packages have been found: * GTKEngine, Pixmap/Pixbuf theme engine for GTK 2, <http://www.gtk.org/> Required for GTK 2 theme -- The following REQUIRED packages have been found: * ECM (required version >= 0.0.9) * Sass, SASS compiler, <https://sass-lang.com/> Required for building GTK themes * PythonInterp (required version >= 3) * PythonCairo Required to render assets * Breeze Required to build the Breeze GTK+ styles * Qt5 * Qt5Core -- Configuring done -- Generating done -- Build files have been written to: /home/dev/repos/breeze-gtk
$ (arcpatch-D18244) cmake -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_EXECUTABLE=/usr/bin/python3 . -- The following RUNTIME packages have been found: * GTKEngine, Pixmap/Pixbuf theme engine for GTK 2, <http://www.gtk.org/> Required for GTK 2 theme -- The following REQUIRED packages have been found: * ECM (required version >= 0.0.9) * Sass, SASS compiler, <https://sass-lang.com/> Required for building GTK themes * PythonInterp (required version >= 3) * PythonCairo Required to render assets * Breeze Required to build the Breeze GTK+ styles * Qt5 * Qt5Core -- Configuring done -- Generating done -- Build files have been written to: /home/dev/repos/breeze-gtk
Trying Python 2:
dev@dev-pc:~/repos/breeze-gtk$ (arcpatch-D18244) cmake -DCMAKE_INSTALL_PREFIX=/usr -DPYTHON_EXECUTABLE=/usr/bin/python2 . CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find PythonInterp: Found unsuitable version "2.7.15", but required is at least "3" (found /usr/bin/python2) Call Stack (most recent call first): /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.10/Modules/FindPythonInterp.cmake:152 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) cmake/FindPythonCairo.cmake:2 (find_package) CMakeLists.txt:13 (find_package) -- Configuring incomplete, errors occurred! See also "/home/dev/repos/breeze-gtk/CMakeFiles/CMakeOutput.log".
Well, something like this works fine, though this is a quick and dirty solution.
if (CMAKE_VERSION VERSION_LESS 3.12.0) find_package (PythonInterp 3 REQUIRED) set (_py_exe ${PYTHON_EXECUTABLE}) else () find_package (Python 3.0 REQUIRED COMPONENTS Interpreter) set (_py_exe ${Python_EXECUTABLE}) endif () execute_process (COMMAND "${_py_exe}" "-c" "import re, cairo; print(re.compile('/__init__.py.*').sub('',cairo.__file__))" RESULT_VARIABLE _PY_cairo_status OUTPUT_VARIABLE _PY_cairo_location ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE ) if (_PY_cairo_status EQUAL 0) set (PY_CAIRO ${_PY_cairo_location} CACHE STRING "Location of pycairo") endif () find_package_handle_standard_args (PythonCairo DEFAULT_MSG PY_CAIRO)
cmake/FindPythonCairo.cmake | ||
---|---|---|
9 | FindPython3.cmake doesn't define PYTHON_EXECUTABLE but Python3_EXECUTABLE, you need e.g set(PYTHON_EXECUTABLE "${Python3_EXECUTABLE}") after line 4. |
cmake/FindPythonCairo.cmake | ||
---|---|---|
6 | Shouldn't it be right after find_package(Python3)? |
cmake/FindPythonCairo.cmake | ||
---|---|---|
6 | Correct, or this will be empty with CMake < 3.12 |
This breaks NeonKubuntu builds, whereas previously the builds were working as I explicitly had added python3-cairo to the build depends. It is there still, but cmake thinks not.
EDIT: seems specific to cmake < 3.12 in Bionic. Kubuntu Cosmic/Disco build with cmake 3.12 finds python3-cairo, but fails on another issue probably related a different recent commit.
https://build.neon.kde.org/job/bionic_unstable_kde_breeze-gtk_bin_amd64/51/consoleFull
02:43:04 -- The following REQUIRED packages have not been found:
02:43:04
02:43:04 * PythonCairo
02:43:04 Required to render assets
From the build log:
03:42:04 The following NEW packages will be installed:
[...] libcairo-script-interpreter2{a} libcairo2-dev{a}
python3-cairo isn't installed.