From 60b1c879b2a20b83c44e8c5987c9c3b73ae58d30 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 15 Jul 2024 11:44:59 +0100 Subject: [PATCH 1/6] digikam: reformat with `nixfmt-rfc-style` --- pkgs/by-name/di/digikam/package.nix | 180 +++++++++++++++------------- 1 file changed, 97 insertions(+), 83 deletions(-) diff --git a/pkgs/by-name/di/digikam/package.nix b/pkgs/by-name/di/digikam/package.nix index 8a83cf6583cc..c3c8a913cafd 100644 --- a/pkgs/by-name/di/digikam/package.nix +++ b/pkgs/by-name/di/digikam/package.nix @@ -1,43 +1,52 @@ -{ stdenv, config, lib, fetchurl, cmake, doxygen, extra-cmake-modules, wrapGAppsHook3 +{ + stdenv, + config, + lib, + fetchurl, + cmake, + doxygen, + extra-cmake-modules, + wrapGAppsHook3, -# For `digitaglinktree` -, perl, sqlite + # For `digitaglinktree` + perl, + sqlite, -, libsForQt5 + libsForQt5, -, bison -, boost -, eigen -, exiv2 -, ffmpeg_4 -, flex -, graphviz -, imagemagick -, lcms2 -, lensfun -, libgphoto2 -, liblqr1 -, libusb1 -, libheif -, libGL -, libGLU -, opencv -, pcre -, x265 -, jasper + bison, + boost, + eigen, + exiv2, + ffmpeg_4, + flex, + graphviz, + imagemagick, + lcms2, + lensfun, + libgphoto2, + liblqr1, + libusb1, + libheif, + libGL, + libGLU, + opencv, + pcre, + x265, + jasper, -, bash -# For panorama and focus stacking -, enblend-enfuse -, hugin -, gnumake + bash, + # For panorama and focus stacking + enblend-enfuse, + hugin, + gnumake, -, cudaSupport ? config.cudaSupport -, cudaPackages ? {} + cudaSupport ? config.cudaSupport, + cudaPackages ? { }, }: stdenv.mkDerivation rec { - pname = "digikam"; + pname = "digikam"; version = "8.3.0"; src = fetchurl { @@ -56,60 +65,59 @@ stdenv.mkDerivation rec { libsForQt5.kdoctools libsForQt5.wrapQtAppsHook wrapGAppsHook3 - ] ++ lib.optionals cudaSupport (with cudaPackages; [ - cuda_nvcc - ]); + ] ++ 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 - libqtav + 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 + libqtav - qtbase - qtxmlpatterns - qtsvg - qtwebengine - qtnetworkauth + qtbase + qtxmlpatterns + qtsvg + qtwebengine + qtnetworkauth - akonadi-contacts - kcalendarcore - kconfigwidgets - kcoreaddons - kfilemetadata - knotifications - knotifyconfig - ktextwidgets - kwidgetsaddons - kxmlgui + akonadi-contacts + kcalendarcore + kconfigwidgets + kcoreaddons + kfilemetadata + knotifications + knotifyconfig + ktextwidgets + kwidgetsaddons + kxmlgui - breeze-icons - marble - oxygen - threadweaver - ]) ++ lib.optionals cudaSupport (with cudaPackages; [ - cuda_cudart - ]); + breeze-icons + marble + oxygen + threadweaver + ]) + ++ lib.optionals cudaSupport (with cudaPackages; [ cuda_cudart ]); postPatch = '' substituteInPlace \ @@ -131,7 +139,13 @@ stdenv.mkDerivation rec { preFixup = '' qtWrapperArgs+=("''${gappsWrapperArgs[@]}") - qtWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ gnumake hugin enblend-enfuse ]}) + qtWrapperArgs+=(--prefix PATH : ${ + lib.makeBinPath [ + gnumake + hugin + enblend-enfuse + ] + }) qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${libsForQt5.qtbase.qtPluginPrefix}/${pname}) substituteInPlace $out/bin/digitaglinktree \ --replace "/usr/bin/perl" "${perl}/bin/perl" \ From c363e27c573cd3fa374cc38a444194c08696a7ab Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 15 Jul 2024 11:57:36 +0100 Subject: [PATCH 2/6] digikam: modernize --- pkgs/by-name/di/digikam/package.nix | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/di/digikam/package.nix b/pkgs/by-name/di/digikam/package.nix index c3c8a913cafd..7d75b3c6388f 100644 --- a/pkgs/by-name/di/digikam/package.nix +++ b/pkgs/by-name/di/digikam/package.nix @@ -45,12 +45,12 @@ cudaPackages ? { }, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "digikam"; version = "8.3.0"; src = fetchurl { - url = "mirror://kde/stable/${pname}/${version}/digiKam-${version}-1.tar.xz"; + url = "mirror://kde/stable/digikam/${finalAttrs.version}/digiKam-${finalAttrs.version}-1.tar.xz"; hash = "sha256-BbFF/38vIAX6IbxXnBUqsjyBkbZ4/ylEyPBAbWud5tg="; }; @@ -146,18 +146,19 @@ stdenv.mkDerivation rec { enblend-enfuse ] }) - qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${libsForQt5.qtbase.qtPluginPrefix}/${pname}) + qtWrapperArgs+=(--suffix DK_PLUGIN_PATH : ${placeholder "out"}/${libsForQt5.qtbase.qtPluginPrefix}/digikam) substituteInPlace $out/bin/digitaglinktree \ --replace "/usr/bin/perl" "${perl}/bin/perl" \ --replace "/usr/bin/sqlite3" "${sqlite}/bin/sqlite3" ''; - meta = with lib; { - description = "Photo Management Program"; - license = licenses.gpl2; - homepage = "https://www.digikam.org"; - maintainers = with maintainers; [ ]; - platforms = platforms.linux; + meta = { + description = "Photo management application"; + homepage = "https://www.digikam.org/"; + sourceProvenance = [ lib.sourceTypes.fromSource ]; + license = lib.licenses.gpl2Plus; + maintainers = [ ]; + platforms = lib.platforms.linux; mainProgram = "digikam"; }; -} +}) From 282f3440bb8965669df136c05291fcf90b7915c2 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 15 Jul 2024 14:36:34 +0100 Subject: [PATCH 3/6] digikam: drop libqtav dependency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This isn’t being used any more; on Qt 5 they use QtAVPlayer and on Qt 6 they use the Qt Multimedia module. --- pkgs/by-name/di/digikam/package.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/by-name/di/digikam/package.nix b/pkgs/by-name/di/digikam/package.nix index 7d75b3c6388f..297fc12f7d4b 100644 --- a/pkgs/by-name/di/digikam/package.nix +++ b/pkgs/by-name/di/digikam/package.nix @@ -93,7 +93,6 @@ stdenv.mkDerivation (finalAttrs: { ++ (with libsForQt5; [ libkipi libksane - libqtav qtbase qtxmlpatterns From 94a39c9ace2906bfdc082f12a2f67496dac6cf55 Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 15 Jul 2024 11:58:53 +0100 Subject: [PATCH 4/6] digikam: 8.3.0 -> 8.4.0 Includes fixes for FFmpeg 7. --- pkgs/by-name/di/digikam/package.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/di/digikam/package.nix b/pkgs/by-name/di/digikam/package.nix index 297fc12f7d4b..9a0e0e67de3f 100644 --- a/pkgs/by-name/di/digikam/package.nix +++ b/pkgs/by-name/di/digikam/package.nix @@ -2,8 +2,9 @@ stdenv, config, lib, - fetchurl, + fetchFromGitLab, cmake, + ninja, doxygen, extra-cmake-modules, wrapGAppsHook3, @@ -47,19 +48,21 @@ stdenv.mkDerivation (finalAttrs: { pname = "digikam"; - version = "8.3.0"; + version = "8.4.0"; - src = fetchurl { - url = "mirror://kde/stable/digikam/${finalAttrs.version}/digiKam-${finalAttrs.version}-1.tar.xz"; - hash = "sha256-BbFF/38vIAX6IbxXnBUqsjyBkbZ4/ylEyPBAbWud5tg="; + src = fetchFromGitLab { + domain = "invent.kde.org"; + owner = "graphics"; + repo = "digikam"; + rev = "v${finalAttrs.version}"; + hash = "sha256-GJYlxJkvFEXppVk0yC9ojszylfAGt3eBMAjNUu60XDY="; }; strictDeps = true; - depsBuildBuild = [ cmake ]; - nativeBuildInputs = [ cmake + ninja doxygen extra-cmake-modules libsForQt5.kdoctools @@ -154,6 +157,7 @@ stdenv.mkDerivation (finalAttrs: { meta = { description = "Photo management application"; homepage = "https://www.digikam.org/"; + changelog = "${finalAttrs.src.meta.homepage}-/blob/master/project/NEWS.${finalAttrs.version}"; sourceProvenance = [ lib.sourceTypes.fromSource ]; license = lib.licenses.gpl2Plus; maintainers = [ ]; From 5ca94336fde213567be80b27f172e3b38a841a4c Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 16 Jul 2024 14:56:48 +0100 Subject: [PATCH 5/6] digikam: use Qt 6 --- .../di/digikam/disable-tests-download.patch | 15 ++ pkgs/by-name/di/digikam/package.nix | 209 ++++++++++-------- 2 files changed, 137 insertions(+), 87 deletions(-) create mode 100644 pkgs/by-name/di/digikam/disable-tests-download.patch diff --git a/pkgs/by-name/di/digikam/disable-tests-download.patch b/pkgs/by-name/di/digikam/disable-tests-download.patch new file mode 100644 index 000000000000..7ec21b52eb4e --- /dev/null +++ b/pkgs/by-name/di/digikam/disable-tests-download.patch @@ -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() diff --git a/pkgs/by-name/di/digikam/package.nix b/pkgs/by-name/di/digikam/package.nix index 9a0e0e67de3f..1454eae6717a 100644 --- a/pkgs/by-name/di/digikam/package.nix +++ b/pkgs/by-name/di/digikam/package.nix @@ -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 , + # 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 ` + (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" From fee2b5c4dc9fb52ffc245be3bff8f8725c5f2ac5 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 14 Jul 2024 10:13:52 +0100 Subject: [PATCH 6/6] libsForQt5.libqtav: drop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Abandoned upstream, only works with old versions of FFmpeg, and the only reverse dependency (digiKam) hadn’t actually been using it in quite a while. --- .../development/libraries/libqtav/default.nix | 71 ------------------- pkgs/top-level/qt5-packages.nix | 2 - 2 files changed, 73 deletions(-) delete mode 100644 pkgs/development/libraries/libqtav/default.nix diff --git a/pkgs/development/libraries/libqtav/default.nix b/pkgs/development/libraries/libqtav/default.nix deleted file mode 100644 index 17862e23b75b..000000000000 --- a/pkgs/development/libraries/libqtav/default.nix +++ /dev/null @@ -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; - }; -} diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index f3ce480c9ac0..2b1ec20bfa7d 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -173,8 +173,6 @@ in (noExtraAttrs (kdeFrameworks // plasmaMobileGear // plasma5 // plasma5.thirdP libqofono = callPackage ../development/libraries/libqofono { }; - libqtav = callPackage ../development/libraries/libqtav { }; - libquotient = callPackage ../development/libraries/libquotient { }; libqaccessibilityclient = callPackage ../development/libraries/libqaccessibilityclient { };