mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-21 20:34:06 +00:00
digikam: use Qt 6
This commit is contained in:
parent
94a39c9ace
commit
5ca94336fd
15
pkgs/by-name/di/digikam/disable-tests-download.patch
Normal file
15
pkgs/by-name/di/digikam/disable-tests-download.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 43636fa9b9...e8da76c480 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -208,10 +208,6 @@
|
||||
# For CI runners to run tests, the following custom target serves to perform the download automatically.
|
||||
# If the directory "test-data" has already been created, the target becomes a "no-op".
|
||||
#
|
||||
- add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/test-data
|
||||
- COMMENT "Checkout unit-test data repository. Please wait..."
|
||||
- COMMAND git
|
||||
- ARGS clone https://invent.kde.org/graphics/digikam-test-data.git ${CMAKE_SOURCE_DIR}/test-data)
|
||||
add_custom_target(test-data ALL DEPENDS ${CMAKE_SOURCE_DIR}/test-data)
|
||||
|
||||
endif()
|
@ -3,49 +3,61 @@
|
||||
config,
|
||||
lib,
|
||||
fetchFromGitLab,
|
||||
fetchgit,
|
||||
|
||||
cmake,
|
||||
ninja,
|
||||
doxygen,
|
||||
extra-cmake-modules,
|
||||
flex,
|
||||
bison,
|
||||
wrapGAppsHook3,
|
||||
|
||||
opencv,
|
||||
libtiff,
|
||||
libpng,
|
||||
libjpeg,
|
||||
libheif,
|
||||
libjxl,
|
||||
boost,
|
||||
lcms2,
|
||||
expat,
|
||||
exiv2,
|
||||
libxml2,
|
||||
libxslt,
|
||||
ffmpeg,
|
||||
jasper,
|
||||
eigen,
|
||||
lensfun,
|
||||
liblqr1,
|
||||
libgphoto2,
|
||||
libusb1,
|
||||
imagemagick,
|
||||
x265,
|
||||
libGLX,
|
||||
libGLU,
|
||||
|
||||
kdePackages,
|
||||
|
||||
# For `digitaglinktree`
|
||||
perl,
|
||||
sqlite,
|
||||
|
||||
libsForQt5,
|
||||
|
||||
bison,
|
||||
boost,
|
||||
eigen,
|
||||
exiv2,
|
||||
ffmpeg_4,
|
||||
flex,
|
||||
graphviz,
|
||||
imagemagick,
|
||||
lcms2,
|
||||
lensfun,
|
||||
libgphoto2,
|
||||
liblqr1,
|
||||
libusb1,
|
||||
libheif,
|
||||
libGL,
|
||||
libGLU,
|
||||
opencv,
|
||||
pcre,
|
||||
x265,
|
||||
jasper,
|
||||
|
||||
bash,
|
||||
runtimeShell,
|
||||
# For panorama and focus stacking
|
||||
enblend-enfuse,
|
||||
hugin,
|
||||
gnumake,
|
||||
|
||||
cudaSupport ? config.cudaSupport,
|
||||
cudaPackages ? { },
|
||||
}:
|
||||
|
||||
let
|
||||
testData = fetchgit {
|
||||
url = "https://invent.kde.org/graphics/digikam-test-data.git";
|
||||
rev = "d02dd20b23cc279792325a0f03d21688547a7a59";
|
||||
fetchLFS = true;
|
||||
hash = "sha256-SvsmcniDRorwu9x9OLtHD9ftgquyoE5Kl8qDgqi1XdQ=";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "digikam";
|
||||
version = "8.4.0";
|
||||
@ -58,85 +70,108 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
hash = "sha256-GJYlxJkvFEXppVk0yC9ojszylfAGt3eBMAjNUu60XDY=";
|
||||
};
|
||||
|
||||
patches = [ ./disable-tests-download.patch ];
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
doxygen
|
||||
extra-cmake-modules
|
||||
libsForQt5.kdoctools
|
||||
libsForQt5.wrapQtAppsHook
|
||||
flex
|
||||
bison
|
||||
kdePackages.wrapQtAppsHook
|
||||
wrapGAppsHook3
|
||||
] ++ lib.optionals cudaSupport (with cudaPackages; [ cuda_nvcc ]);
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
bison
|
||||
boost
|
||||
eigen
|
||||
exiv2
|
||||
ffmpeg_4
|
||||
flex
|
||||
graphviz
|
||||
imagemagick
|
||||
lcms2
|
||||
lensfun
|
||||
libgphoto2
|
||||
libheif
|
||||
liblqr1
|
||||
libusb1
|
||||
libGL
|
||||
libGLU
|
||||
opencv
|
||||
pcre
|
||||
x265
|
||||
jasper
|
||||
]
|
||||
++ (with libsForQt5; [
|
||||
libkipi
|
||||
libksane
|
||||
# Based on <https://www.digikam.org/api/index.html#externaldeps>,
|
||||
# but it doesn’t have everything, so you also have to check the
|
||||
# CMake files…
|
||||
#
|
||||
# We list non‐Qt dependencies first to override Qt’s propagated
|
||||
# build inputs.
|
||||
|
||||
qtbase
|
||||
qtxmlpatterns
|
||||
qtsvg
|
||||
qtwebengine
|
||||
qtnetworkauth
|
||||
buildInputs = [
|
||||
opencv
|
||||
libtiff
|
||||
libpng
|
||||
# TODO: Figure out how on earth to get it to pick up libjpeg8 for
|
||||
# lossy DNG support.
|
||||
libjpeg
|
||||
libheif
|
||||
libjxl
|
||||
boost
|
||||
lcms2
|
||||
expat
|
||||
exiv2
|
||||
libxml2
|
||||
libxslt
|
||||
# Qt WebEngine uses and propagates FFmpeg, and if it’s a
|
||||
# different version it causes linker warnings.
|
||||
#ffmpeg
|
||||
jasper
|
||||
eigen
|
||||
lensfun
|
||||
liblqr1
|
||||
libgphoto2
|
||||
libusb1
|
||||
imagemagick
|
||||
x265
|
||||
libGLX
|
||||
libGLU
|
||||
|
||||
akonadi-contacts
|
||||
kcalendarcore
|
||||
kconfigwidgets
|
||||
kcoreaddons
|
||||
kfilemetadata
|
||||
knotifications
|
||||
knotifyconfig
|
||||
ktextwidgets
|
||||
kwidgetsaddons
|
||||
kxmlgui
|
||||
kdePackages.qtbase
|
||||
kdePackages.qtnetworkauth
|
||||
kdePackages.qtscxml
|
||||
kdePackages.qtsvg
|
||||
kdePackages.qtwebengine
|
||||
kdePackages.qt5compat
|
||||
kdePackages.qtmultimedia
|
||||
|
||||
breeze-icons
|
||||
marble
|
||||
oxygen
|
||||
threadweaver
|
||||
])
|
||||
++ lib.optionals cudaSupport (with cudaPackages; [ cuda_cudart ]);
|
||||
kdePackages.kconfig
|
||||
kdePackages.kxmlgui
|
||||
kdePackages.ki18n
|
||||
kdePackages.kwindowsystem
|
||||
kdePackages.kservice
|
||||
kdePackages.solid
|
||||
kdePackages.kcoreaddons
|
||||
kdePackages.knotifyconfig
|
||||
kdePackages.knotifications
|
||||
kdePackages.threadweaver
|
||||
kdePackages.kiconthemes
|
||||
kdePackages.kfilemetadata
|
||||
kdePackages.kcalendarcore
|
||||
kdePackages.kio
|
||||
kdePackages.sonnet
|
||||
# libksane and akonadi-contacts do not yet work when building for
|
||||
# Qt 6.
|
||||
];
|
||||
|
||||
checkInputs = [ kdePackages.qtdeclarative ];
|
||||
|
||||
postConfigure = lib.optionalString finalAttrs.doCheck ''
|
||||
ln -s ${testData} $cmakeDir/test-data
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace \
|
||||
core/dplugins/bqm/custom/userscript/userscript.cpp \
|
||||
core/utilities/import/backend/cameracontroller.cpp \
|
||||
--replace-fail \"/bin/bash\" \"${lib.getExe bash}\"
|
||||
--replace-fail '"/bin/bash"' ${lib.escapeShellArg "\"${runtimeShell}\""}
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DENABLE_MYSQLSUPPORT=1"
|
||||
"-DENABLE_INTERNALMYSQL=1"
|
||||
"-DENABLE_MEDIAPLAYER=1"
|
||||
"-DENABLE_QWEBENGINE=on"
|
||||
"-DENABLE_APPSTYLES=on"
|
||||
"-DCMAKE_CXX_FLAGS=-I${libsForQt5.libksane}/include/KF5" # fix `#include <ksane_version.h>`
|
||||
(lib.cmakeBool "BUILD_WITH_QT6" true)
|
||||
(lib.cmakeBool "ENABLE_KFILEMETADATASUPPORT" true)
|
||||
#(lib.cmakeBool "ENABLE_AKONADICONTACTSUPPORT" true)
|
||||
(lib.cmakeBool "ENABLE_MEDIAPLAYER" true)
|
||||
(lib.cmakeBool "ENABLE_APPSTYLES" true)
|
||||
];
|
||||
|
||||
# Tests segfault for some reason…
|
||||
# TODO: Get them working.
|
||||
doCheck = false;
|
||||
|
||||
dontWrapGApps = true;
|
||||
|
||||
preFixup = ''
|
||||
@ -148,7 +183,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
enblend-enfuse
|
||||
]
|
||||
})
|
||||
qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${libsForQt5.qtbase.qtPluginPrefix}/digikam)
|
||||
qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${kdePackages.qtbase.qtPluginPrefix}/digikam)
|
||||
substituteInPlace $out/bin/digitaglinktree \
|
||||
--replace "/usr/bin/perl" "${perl}/bin/perl" \
|
||||
--replace "/usr/bin/sqlite3" "${sqlite}/bin/sqlite3"
|
||||
|
Loading…
Reference in New Issue
Block a user