1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-17 19:21:04 +00:00

Merge pull request #329470 from emilazy/push-omxsrkkkvymx

digikam: modernize, update, and use Qt 6; libsForQt5.libqtav: drop
This commit is contained in:
Emily 2024-07-26 23:33:14 +01:00 committed by GitHub
commit b8faf5d599
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 174 additions and 179 deletions

View 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()

View file

@ -1,149 +1,202 @@
{ stdenv, config, lib, fetchurl, cmake, doxygen, extra-cmake-modules, wrapGAppsHook3 {
stdenv,
config,
lib,
fetchFromGitLab,
fetchgit,
# For `digitaglinktree` cmake,
, perl, sqlite ninja,
extra-cmake-modules,
flex,
bison,
wrapGAppsHook3,
, libsForQt5 opencv,
libtiff,
libpng,
libjpeg,
libheif,
libjxl,
boost,
lcms2,
expat,
exiv2,
libxml2,
libxslt,
ffmpeg,
jasper,
eigen,
lensfun,
liblqr1,
libgphoto2,
libusb1,
imagemagick,
x265,
libGLX,
libGLU,
, bison kdePackages,
, boost
, eigen
, exiv2
, ffmpeg_4
, flex
, graphviz
, imagemagick
, lcms2
, lensfun
, libgphoto2
, liblqr1
, libusb1
, libheif
, libGL
, libGLU
, opencv
, pcre
, x265
, jasper
, bash # For `digitaglinktree`
# For panorama and focus stacking perl,
, enblend-enfuse sqlite,
, hugin
, gnumake
, cudaSupport ? config.cudaSupport runtimeShell,
, cudaPackages ? {} # For panorama and focus stacking
enblend-enfuse,
hugin,
gnumake,
}: }:
stdenv.mkDerivation rec { let
pname = "digikam"; testData = fetchgit {
version = "8.3.0"; url = "https://invent.kde.org/graphics/digikam-test-data.git";
rev = "d02dd20b23cc279792325a0f03d21688547a7a59";
src = fetchurl { fetchLFS = true;
url = "mirror://kde/stable/${pname}/${version}/digiKam-${version}-1.tar.xz"; hash = "sha256-SvsmcniDRorwu9x9OLtHD9ftgquyoE5Kl8qDgqi1XdQ=";
hash = "sha256-BbFF/38vIAX6IbxXnBUqsjyBkbZ4/ylEyPBAbWud5tg=";
}; };
in
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=";
};
patches = [ ./disable-tests-download.patch ];
strictDeps = true; strictDeps = true;
depsBuildBuild = [ cmake ];
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
doxygen ninja
extra-cmake-modules extra-cmake-modules
libsForQt5.kdoctools flex
libsForQt5.wrapQtAppsHook bison
kdePackages.wrapQtAppsHook
wrapGAppsHook3 wrapGAppsHook3
] ++ lib.optionals cudaSupport (with cudaPackages; [ ];
cuda_nvcc
]); # 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 = [ buildInputs = [
bison
boost
eigen
exiv2
ffmpeg_4
flex
graphviz
imagemagick
lcms2
lensfun
libgphoto2
libheif
liblqr1
libusb1
libGL
libGLU
opencv opencv
pcre libtiff
x265 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 jasper
] ++ (with libsForQt5; [ eigen
libkipi lensfun
libksane liblqr1
libqtav libgphoto2
libusb1
imagemagick
x265
libGLX
libGLU
qtbase kdePackages.qtbase
qtxmlpatterns kdePackages.qtnetworkauth
qtsvg kdePackages.qtscxml
qtwebengine kdePackages.qtsvg
qtnetworkauth kdePackages.qtwebengine
kdePackages.qt5compat
kdePackages.qtmultimedia
akonadi-contacts kdePackages.kconfig
kcalendarcore kdePackages.kxmlgui
kconfigwidgets kdePackages.ki18n
kcoreaddons kdePackages.kwindowsystem
kfilemetadata kdePackages.kservice
knotifications kdePackages.solid
knotifyconfig kdePackages.kcoreaddons
ktextwidgets kdePackages.knotifyconfig
kwidgetsaddons kdePackages.knotifications
kxmlgui 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.
];
breeze-icons checkInputs = [ kdePackages.qtdeclarative ];
marble
oxygen postConfigure = lib.optionalString finalAttrs.doCheck ''
threadweaver ln -s ${testData} $cmakeDir/test-data
]) ++ lib.optionals cudaSupport (with cudaPackages; [ '';
cuda_cudart
]);
postPatch = '' postPatch = ''
substituteInPlace \ substituteInPlace \
core/dplugins/bqm/custom/userscript/userscript.cpp \ core/dplugins/bqm/custom/userscript/userscript.cpp \
core/utilities/import/backend/cameracontroller.cpp \ core/utilities/import/backend/cameracontroller.cpp \
--replace-fail \"/bin/bash\" \"${lib.getExe bash}\" --replace-fail '"/bin/bash"' ${lib.escapeShellArg "\"${runtimeShell}\""}
''; '';
cmakeFlags = [ cmakeFlags = [
"-DENABLE_MYSQLSUPPORT=1" (lib.cmakeBool "BUILD_WITH_QT6" true)
"-DENABLE_INTERNALMYSQL=1" (lib.cmakeBool "ENABLE_KFILEMETADATASUPPORT" true)
"-DENABLE_MEDIAPLAYER=1" #(lib.cmakeBool "ENABLE_AKONADICONTACTSUPPORT" true)
"-DENABLE_QWEBENGINE=on" (lib.cmakeBool "ENABLE_MEDIAPLAYER" true)
"-DENABLE_APPSTYLES=on" (lib.cmakeBool "ENABLE_APPSTYLES" true)
"-DCMAKE_CXX_FLAGS=-I${libsForQt5.libksane}/include/KF5" # fix `#include <ksane_version.h>`
]; ];
# Tests segfault for some reason…
# TODO: Get them working.
doCheck = false;
dontWrapGApps = true; dontWrapGApps = true;
preFixup = '' preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}") qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
qtWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ gnumake hugin enblend-enfuse ]}) qtWrapperArgs+=(--prefix PATH : ${
qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${libsForQt5.qtbase.qtPluginPrefix}/${pname}) lib.makeBinPath [
gnumake
hugin
enblend-enfuse
]
})
qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${kdePackages.qtbase.qtPluginPrefix}/digikam)
substituteInPlace $out/bin/digitaglinktree \ substituteInPlace $out/bin/digitaglinktree \
--replace "/usr/bin/perl" "${perl}/bin/perl" \ --replace "/usr/bin/perl" "${perl}/bin/perl" \
--replace "/usr/bin/sqlite3" "${sqlite}/bin/sqlite3" --replace "/usr/bin/sqlite3" "${sqlite}/bin/sqlite3"
''; '';
meta = with lib; { meta = {
description = "Photo Management Program"; description = "Photo management application";
license = licenses.gpl2; homepage = "https://www.digikam.org/";
homepage = "https://www.digikam.org"; changelog = "${finalAttrs.src.meta.homepage}-/blob/master/project/NEWS.${finalAttrs.version}";
maintainers = with maintainers; [ ]; sourceProvenance = [ lib.sourceTypes.fromSource ];
platforms = platforms.linux; license = lib.licenses.gpl2Plus;
maintainers = [ ];
platforms = lib.platforms.linux;
mainProgram = "digikam"; mainProgram = "digikam";
}; };
} })

View file

@ -1,71 +0,0 @@
{ mkDerivation
, lib
, fetchFromGitHub
, extra-cmake-modules
, qtbase
, qtmultimedia
, qttools
, libGL
, libX11
, libass
, openal
, ffmpeg_4
, libuchardet
, alsa-lib
, libpulseaudio
, libva
}:
mkDerivation rec {
pname = "libqtav";
version = "unstable-2020-09-10";
nativeBuildInputs = [ extra-cmake-modules qttools ];
buildInputs = [
qtbase
qtmultimedia
libGL
libX11
libass
openal
ffmpeg_4
libuchardet
alsa-lib
libpulseaudio
libva
];
src = fetchFromGitHub {
sha256 = "0qwrk40dihkbwmm7krz6qaqyn9v3qdjnd2k9b4s3a67x4403pib3";
rev = "2a470d2a8d2fe22fae969bee5d594909a07b350a";
repo = "QtAV";
owner = "wang-bin";
fetchSubmodules = true;
};
# Make sure libqtav finds its libGL dependency at both link and run time
# by adding libGL to rpath. Not sure why it wasn't done automatically like
# the other libraries as `libGL` is part of our `buildInputs`.
NIX_CFLAGS_LINK = "-Wl,-rpath,${libGL}/lib";
cmakeFlags = [
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
"-DCMAKE_SKIP_BUILD_RPATH=ON"
];
preFixup = ''
mkdir -p "$out/bin"
cp -a "./bin/"* "$out/bin"
'';
stripDebugList = [ "lib" "libexec" "bin" "qml" ];
meta = with lib; {
description = "Multimedia playback framework based on Qt + FFmpeg";
#license = licenses.lgpl21; # For the libraries / headers only.
license = licenses.gpl3; # With the examples (under bin) and most likely some of the optional dependencies used.
homepage = "http://www.qtav.org/";
maintainers = [ maintainers.jraygauthier ];
platforms = platforms.linux;
};
}

View file

@ -171,8 +171,6 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP
libqofono = callPackage ../development/libraries/libqofono { }; libqofono = callPackage ../development/libraries/libqofono { };
libqtav = callPackage ../development/libraries/libqtav { };
libquotient = callPackage ../development/libraries/libquotient { }; libquotient = callPackage ../development/libraries/libquotient { };
libqaccessibilityclient = callPackage ../development/libraries/libqaccessibilityclient { }; libqaccessibilityclient = callPackage ../development/libraries/libqaccessibilityclient { };