1 { mkDerivation, lib, stdenv, fetchpatch, fetchurl, cmake, extra-cmake-modules
2 , karchive, kconfig, kwidgetsaddons, kcompletion, kcoreaddons
3 , kguiaddons, ki18n, kitemmodels, kitemviews, kwindowsystem
4 , kio, kcrash, breeze-icons
5 , boost, libraw, fftw, eigen, exiv2, fribidi, libaom, libheif, libkdcraw, lcms2, gsl, openexr, giflib
6 , libjxl, mlt , openjpeg, opencolorio, xsimd, poppler, curl, ilmbase, immer, kseexpr, lager
7 , libmypaint , libunibreak, libwebp
8 , qtmultimedia, qtx11extras, quazip, SDL2, zug, pkg-config
16 pname = "krita-unwrapped";
20 url = "mirror://kde/${kde-channel}/krita/${version}/krita-${version}.tar.gz";
25 # Fixes build with SIP 6.8
27 name = "bump-SIP-ABI-version-to-12.8.patch";
28 url = "https://invent.kde.org/graphics/krita/-/commit/2d71c47661d43a4e3c1ab0c27803de980bdf2bb2.diff";
29 hash = "sha256-U3E44nj4vra++PJV20h4YHjES78kgrJtr4ktNeQfOdA=";
33 nativeBuildInputs = [ cmake extra-cmake-modules pkg-config python3Packages.sip ];
36 karchive kconfig kwidgetsaddons kcompletion kcoreaddons kguiaddons
37 ki18n kitemmodels kitemviews kwindowsystem kio kcrash breeze-icons
38 boost libraw fftw eigen exiv2 fribidi lcms2 gsl openexr lager libaom libheif libkdcraw giflib
39 libjxl mlt openjpeg opencolorio xsimd poppler curl ilmbase immer kseexpr libmypaint
40 libunibreak libwebp qtmultimedia qtx11extras quazip SDL2 zug
44 env.NIX_CFLAGS_COMPILE = toString ([ "-I${ilmbase.dev}/include/OpenEXR" ]
45 ++ lib.optional stdenv.cc.isGNU "-Wno-deprecated-copy");
47 # Krita runs custom python scripts in CMake with custom PYTHONPATH which krita determined in their CMake script.
48 # Patch the PYTHONPATH so python scripts can import sip successfully.
50 pythonPath = python3Packages.makePythonPath (with python3Packages; [ sip setuptools ]);
52 substituteInPlace cmake/modules/FindSIP.cmake \
53 --replace 'PYTHONPATH=''${_sip_python_path}' 'PYTHONPATH=${pythonPath}'
54 substituteInPlace cmake/modules/SIPMacros.cmake \
55 --replace 'PYTHONPATH=''${_krita_python_path}' 'PYTHONPATH=${pythonPath}'
57 substituteInPlace plugins/impex/jp2/jp2_converter.cc \
58 --replace '<openjpeg.h>' '<${openjpeg.incDir}/openjpeg.h>'
61 cmakeBuildType = "RelWithDebInfo";
64 "-DPYQT5_SIP_DIR=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
65 "-DPYQT_SIP_DIR_OVERRIDE=${python3Packages.pyqt5}/${python3Packages.python.sitePackages}/PyQt5/bindings"
66 "-DBUILD_KRITA_QT_DESIGNER_PLUGINS=ON"
70 description = "Free and open source painting application";
71 homepage = "https://krita.org/";
72 maintainers = with maintainers; [ abbradar sifmelcara nek0 ];
73 mainProgram = "krita";
74 platforms = platforms.linux;
75 license = licenses.gpl3Only;