nixpkgs/pkgs/by-name/di/digikam/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

216 lines
4.6 KiB
Nix
Raw Normal View History

{
stdenv,
config,
lib,
fetchFromGitLab,
2024-07-16 13:56:48 +00:00
fetchgit,
2024-10-10 16:46:16 +00:00
fetchpatch,
2024-07-16 13:56:48 +00:00
cmake,
ninja,
extra-cmake-modules,
2024-07-16 13:56:48 +00:00
flex,
bison,
wrapGAppsHook3,
2024-08-06 00:41:17 +00:00
exiftool,
2024-07-16 13:56:48 +00:00
opencv,
libtiff,
libpng,
libjpeg,
libheif,
libjxl,
boost,
lcms2,
2024-07-16 13:56:48 +00:00
expat,
exiv2,
libxml2,
libxslt,
ffmpeg,
jasper,
eigen,
lensfun,
liblqr1,
2024-07-16 13:56:48 +00:00
libgphoto2,
libusb1,
2024-07-16 13:56:48 +00:00
imagemagick,
x265,
2024-07-16 13:56:48 +00:00
libGLX,
libGLU,
kdePackages,
2024-07-16 13:56:48 +00:00
# For `digitaglinktree`
perl,
sqlite,
runtimeShell,
# For panorama and focus stacking
enblend-enfuse,
hugin,
gnumake,
}:
2024-07-16 13:56:48 +00:00
let
testData = fetchgit {
url = "https://invent.kde.org/graphics/digikam-test-data.git";
rev = "d02dd20b23cc279792325a0f03d21688547a7a59";
fetchLFS = true;
hash = "sha256-SvsmcniDRorwu9x9OLtHD9ftgquyoE5Kl8qDgqi1XdQ=";
};
in
2024-07-15 10:57:36 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "digikam";
version = "8.4.0";
src = fetchFromGitLab {
domain = "invent.kde.org";
owner = "graphics";
repo = "digikam";
rev = "v${finalAttrs.version}";
hash = "sha256-GJYlxJkvFEXppVk0yC9ojszylfAGt3eBMAjNUu60XDY=";
};
2024-10-10 16:46:16 +00:00
patches = [
./disable-tests-download.patch
# Fix build with Qt 6.8
# FIXME: remove in next update
(fetchpatch {
url = "https://invent.kde.org/graphics/digikam/-/commit/a8b49ed8df676cae0f48b3369831edde2b74903e.patch";
hash = "sha256-93kQ/Dg/A9FR83ChyiUaRwyelE1Iq14eIecUteVbnqI=";
})
];
2024-07-16 13:56:48 +00:00
2024-01-20 16:57:25 +00:00
strictDeps = true;
nativeBuildInputs = [
cmake
ninja
extra-cmake-modules
2024-07-16 13:56:48 +00:00
flex
bison
kdePackages.wrapQtAppsHook
wrapGAppsHook3
2024-07-16 13:56:48 +00:00
];
# Based on <https://www.digikam.org/api/index.html#externaldeps>,
# but it doesnt have everything, so you also have to check the
# CMake files…
#
# We list nonQt dependencies first to override Qts propagated
# build inputs.
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 its a
# different version it causes linker warnings.
#ffmpeg
jasper
eigen
lensfun
liblqr1
libgphoto2
libusb1
imagemagick
x265
libGLX
libGLU
kdePackages.qtbase
kdePackages.qtnetworkauth
kdePackages.qtscxml
kdePackages.qtsvg
2024-08-09 15:25:48 +00:00
kdePackages.qtwayland
2024-07-16 13:56:48 +00:00
kdePackages.qtwebengine
kdePackages.qt5compat
kdePackages.qtmultimedia
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.finalPackage.doCheck ''
2024-07-16 13:56:48 +00:00
ln -s ${testData} $cmakeDir/test-data
'';
postPatch = ''
substituteInPlace \
core/dplugins/bqm/custom/userscript/userscript.cpp \
core/utilities/import/backend/cameracontroller.cpp \
2024-07-16 13:56:48 +00:00
--replace-fail '"/bin/bash"' ${lib.escapeShellArg "\"${runtimeShell}\""}
'';
cmakeFlags = [
2024-07-16 13:56:48 +00:00
(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)
];
2024-07-16 13:56:48 +00:00
# Tests segfault for some reason…
# TODO: Get them working.
doCheck = false;
2020-11-01 14:22:55 +00:00
dontWrapGApps = true;
2017-05-16 15:56:41 +00:00
preFixup = ''
2020-11-01 14:22:55 +00:00
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
qtWrapperArgs+=(--prefix PATH : ${
lib.makeBinPath [
gnumake
hugin
enblend-enfuse
2024-08-06 00:41:17 +00:00
exiftool
]
})
2024-07-16 13:56:48 +00:00
qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${kdePackages.qtbase.qtPluginPrefix}/digikam)
substituteInPlace $out/bin/digitaglinktree \
2024-08-06 00:42:06 +00:00
--replace "/usr/bin/perl" "${lib.getExe perl}" \
--replace "/usr/bin/sqlite3" "${lib.getExe sqlite}"
'';
2024-07-15 10:57:36 +00:00
meta = {
description = "Photo management application";
homepage = "https://www.digikam.org/";
changelog = "${finalAttrs.src.meta.homepage}-/blob/master/project/NEWS.${finalAttrs.version}";
2024-07-15 10:57:36 +00:00
sourceProvenance = [ lib.sourceTypes.fromSource ];
license = lib.licenses.gpl2Plus;
maintainers = [ ];
platforms = lib.platforms.linux;
mainProgram = "digikam";
};
2024-07-15 10:57:36 +00:00
})