Opened 3 months ago

Closed 3 months ago

#19206 closed defect (fixed)

Fix building Gwenview with kImageAnnotator-0.7.0

Reported by: Douglas R. Reno Owned by: Douglas R. Reno
Priority: normal Milestone: 12.1
Component: BOOK Version: git
Severity: normal Keywords:
Cc:

Description

When I was building Gwenview earlier, I encountered the following error:

CMake Warning at CMakeLists.txt:169 (find_package):
  By not providing "FindkImageAnnotator.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "kImageAnnotator", but CMake did not find one.

  Could not find a package configuration file provided by "kImageAnnotator"
  with any of the following names:

    kImageAnnotatorConfig.cmake
    kimageannotator-config.cmake

  Add the installation prefix of "kImageAnnotator" to CMAKE_PREFIX_PATH or
  set "kImageAnnotator_DIR" to a directory containing one of the above files.
  If "kImageAnnotator" provides a separate development package or SDK, be
  sure it has been installed.


-- libjpeg version: 62

I went hunting upstream a bit and I came across this issue: https://invent.kde.org/graphics/gwenview/-/merge_requests/245, though this is for Qt6 (and trying to port it to the Qt5 version didn't turn out well).

Looking a bit further I was able to find a pull request at kImageAnnotator where this was changed originally: https://github.com/ksnip/kImageAnnotator/pull/329 - where the Qt5 and Qt6 builds became coinstallable.

I found KDE's official flatpak build for Gwenview, where it was mentioned that Arch has a fix: https://github.com/flathub/org.kde.gwenview/pull/122

Arch's fix is to create symlinks from files in /usr/lib/cmake/kImageAnnotator-Qt5 to /usr/lib/cmake/kImageAnnotator. Since the next version of Gwenview (24.02) will be Qt6/KDE6 based we probably will need to do the same thing.

Here's what I had to do to make it build:

  • sudo mkdir -pv /usr/lib/cmake/kImageAnnotator
  • sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig.cmake
  • sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config-version.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig-version.cmake
  • sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config-version.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig-version.cmake
  • sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-Qt5Config-version.cmake /usr/lib/cmake/kImageAnnotator/kImageAnnotatorConfig-version.cmake
  • sudo ln -sfv /usr/lib/cmake/kImageAnnotator-Qt5/kImageAnnotator-targets* /usr/lib/cmake/kImageAnnotator/

This is identical to Arch's fix at https://gitlab.archlinux.org/archlinux/packaging/packages/kimageannotator/-/commit/2c10232b81bfbf726e835fee8d04425dddd663d0

Change History (4)

comment:1 by Douglas R. Reno, 3 months ago

For the book it's probably best to change into /usr/lib/cmake first.

comment:2 by Douglas R. Reno, 3 months ago

I've come up with a much easier solution:

find . -name CMakeLists.txt | xargs sed -i 's/kImageAnnotator_FOUND/kImageAnnotator-Qt5_FOUND/'

I've removed the symlinks I had for kImageAnnotator and kColorPicker and came up with that sed again (it's nice having a book on CMake handy!), and this seems to work a lot better.

comment:3 by Douglas R. Reno, 3 months ago

Owner: changed from blfs-book to Douglas R. Reno
Status: newassigned

comment:4 by Douglas R. Reno, 3 months ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.