Bug 476451 - Compilation error with OpenJPEG
Summary: Compilation error with OpenJPEG
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: * Unknown (show other bugs)
Version: 5.2.0
Platform: NixOS Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-02 03:08 UTC by Amedeo Molnár
Modified: 2023-11-04 03:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Compilation error (499 bytes, text/x-log)
2023-11-02 03:08 UTC, Amedeo Molnár
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amedeo Molnár 2023-11-02 03:08:49 UTC
Created attachment 162812 [details]
Compilation error

SUMMARY

When compiling krita 5.2.0 through nix (see https://github.com/nek0/nixpkgs/tree/krita_5_2_0/pkgs/applications/graphics/krita for the nix buiild files used) I run into the attached error 


STEPS TO REPRODUCE
1. check out branch from github
2. run 'nix-build default.nix -A krita'
3. see the compilation break at roughly 75%

OBSERVED RESULT

Compilation breaks

EXPECTED RESULT

Compilation succeeds

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma:  NixOS 23.11pre
(available in About System)
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
Comment 1 Halla Rempt 2023-11-02 04:03:49 UTC
I'm afraid that this really is something that users of the Nix platform or the Nix krita package maintainer need to investigate in way more detail, preferably proposing a patch that doesn't break other platforms. None of the Krita developers use Nix nor do we use platform builds of Krita.

It might be related or the same as the issue that prevents the openjpeg plugin to be built on FreeBSD, but since the same holds for FreeBSD as for Nix (i.e., users of the platform need to fix the issue, because it's not a platform any of use use), and nobody stepped up to help out, I was forced to disable the plugin on freebsd:

commit 0018d78eeb099aaff7c606b75588cf1b07fe51dd
Author: Halla Rempt <halla@valdyas.org>
Date:   Fri Nov 22 15:08:29 2019 +0100

    Don't build the jp2 plugin on freebsd
    
    It's broken, and I don't know why.

diff --git a/plugins/impex/CMakeLists.txt b/plugins/impex/CMakeLists.txt
index 80961161b5..499b1c97d0 100644
--- a/plugins/impex/CMakeLists.txt
+++ b/plugins/impex/CMakeLists.txt
@@ -27,7 +27,7 @@ if(Poppler_Qt5_FOUND)
     add_subdirectory(pdf)
 endif()
 
-if(OpenJPEG_FOUND)
+if(OpenJPEG_FOUND AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
     add_subdirectory(jp2)
 endif()

I'm not dismissing the issue, but without access to and knowledge of the platform, we cannot begin to guess why cmake/modules/FindOpenJPEG.cmake apparently doesn't provide the right include paths. Best would be to contact the authors of the Krita nix package first, and then come back to us with more information.
Comment 2 Halla Rempt 2023-11-02 04:11:41 UTC
Ah, I saw https://invent.kde.org/graphics/krita/-/merge_requests/1985 only after the bug report. Was there a problem with that patch? Please if you submit a merge request and a bug report at the same time, make sure they link to each other...
Comment 3 Amedeo Molnár 2023-11-03 04:38:28 UTC
The Problem with the patch was that it id not fix the error at all. it just prevented the OpenJPEG library to be found.
Comment 4 Halla Rempt 2023-11-03 07:06:04 UTC
Ah, clear. Thanks for the update!
Comment 5 Bug Janitor Service 2023-11-04 03:45:48 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.