From f150e3d3a0071210412a05ed11ef15ee5521117f Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Fri, 27 Sep 2024 18:46:36 +0000 Subject: [PATCH 1/4] calligra: move to pkgs/kde Calligra's information is generated alongside the usual KDE updates, so let's make use of them. Signed-off-by: Fernando Rodrigues --- pkgs/kde/default.nix | 1 + pkgs/{applications/office => kde/misc}/calligra/default.nix | 0 pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 1 insertion(+), 2 deletions(-) rename pkgs/{applications/office => kde/misc}/calligra/default.nix (100%) diff --git a/pkgs/kde/default.nix b/pkgs/kde/default.nix index ee011c3a7ae8..f5092b6da53d 100644 --- a/pkgs/kde/default.nix +++ b/pkgs/kde/default.nix @@ -68,6 +68,7 @@ let selenium-webdriver-at-spi = null; # Used for integration tests that we don't run, stub alpaka = self.callPackage ./misc/alpaka { }; + calligra = self.callPackage ./misc/calligra { }; kdiagram = self.callPackage ./misc/kdiagram { }; kdevelop-pg-qt = self.callPackage ./misc/kdevelop-pg-qt { }; kdsoap-ws-discovery-client = self.callPackage ./misc/kdsoap-ws-discovery-client { }; diff --git a/pkgs/applications/office/calligra/default.nix b/pkgs/kde/misc/calligra/default.nix similarity index 100% rename from pkgs/applications/office/calligra/default.nix rename to pkgs/kde/misc/calligra/default.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2bdc99a11d17..f1d518468bba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28711,8 +28711,6 @@ with pkgs; calicoctl confd-calico; - calligra = libsForQt5.callPackage ../applications/office/calligra { }; - perkeep = callPackage ../applications/misc/perkeep { }; canto-curses = callPackage ../applications/networking/feedreaders/canto-curses { }; From 79a8ac5d96fbb131eab590153370d0df5fb6a4b2 Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Fri, 27 Sep 2024 19:03:38 +0000 Subject: [PATCH 2/4] aliases: add calligra alias The package is now called kdePackages.calligra. Signed-off-by: Fernando Rodrigues --- pkgs/top-level/aliases.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index bcaf0dc28f39..0a7102d03950 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -215,6 +215,7 @@ mapAliases { ### C ### + calligra = kdePackages.calligra; # Added 2024-09-27 callPackage_i686 = pkgsi686Linux.callPackage; cadence = throw "cadence has been removed from nixpkgs, as it was archived upstream"; # Added 2023-10-28 cask = emacs.pkgs.cask; # Added 2022-11-12 From 5bcdd2ec4418132a4c1568f27c7985cee6eda926 Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Fri, 27 Sep 2024 18:47:18 +0000 Subject: [PATCH 3/4] kdePackages.calligra: format with nixfmt-rfc-style Intermediate commit to facilitate review. Signed-off-by: Fernando Rodrigues --- pkgs/kde/misc/calligra/default.nix | 164 +++++++++++++++++++++++++---- 1 file changed, 142 insertions(+), 22 deletions(-) diff --git a/pkgs/kde/misc/calligra/default.nix b/pkgs/kde/misc/calligra/default.nix index 611336b8a908..fb0b662e9a36 100644 --- a/pkgs/kde/misc/calligra/default.nix +++ b/pkgs/kde/misc/calligra/default.nix @@ -1,14 +1,73 @@ -{ mkDerivation, lib, fetchpatch, fetchurl, extra-cmake-modules, kdoctools -, boost, qtwebkit, qtx11extras, shared-mime-info -, breeze-icons, kactivities, karchive, kcodecs, kcompletion, kconfig, kconfigwidgets -, kcoreaddons, kdbusaddons, kdiagram, kguiaddons, khtml, ki18n -, kiconthemes, kitemviews, kjobwidgets, kcmutils, kdelibs4support, kio, kross -, knotifications, knotifyconfig, kparts, ktextwidgets, kwallet, kwidgetsaddons -, kwindowsystem, kxmlgui, sonnet, threadweaver -, kcontacts, akonadi, akonadi-calendar, akonadi-contacts -, eigen, git, gsl, ilmbase, kproperty, kreport, lcms2, marble, pcre, libgit2, libodfgen -, librevenge, libvisio, libwpd, libwpg, libwps, okular, openexr, openjpeg, phonon -, poppler, pstoedit, qca-qt5, vc, fontconfig +{ + mkDerivation, + lib, + fetchpatch, + fetchurl, + extra-cmake-modules, + kdoctools, + boost, + qtwebkit, + qtx11extras, + shared-mime-info, + breeze-icons, + kactivities, + karchive, + kcodecs, + kcompletion, + kconfig, + kconfigwidgets, + kcoreaddons, + kdbusaddons, + kdiagram, + kguiaddons, + khtml, + ki18n, + kiconthemes, + kitemviews, + kjobwidgets, + kcmutils, + kdelibs4support, + kio, + kross, + knotifications, + knotifyconfig, + kparts, + ktextwidgets, + kwallet, + kwidgetsaddons, + kwindowsystem, + kxmlgui, + sonnet, + threadweaver, + kcontacts, + akonadi, + akonadi-calendar, + akonadi-contacts, + eigen, + git, + gsl, + ilmbase, + kproperty, + kreport, + lcms2, + marble, + pcre, + libgit2, + libodfgen, + librevenge, + libvisio, + libwpd, + libwpg, + libwps, + okular, + openexr, + openjpeg, + phonon, + poppler, + pstoedit, + qca-qt5, + vc, + fontconfig, # TODO: package Spnav, m2mml LibEtonyek, Libqgit2 }: @@ -53,17 +112,72 @@ mkDerivation rec { --replace 'CMAKE_CXX_STANDARD 11' 'CMAKE_CXX_STANDARD 17' ''; - nativeBuildInputs = [ extra-cmake-modules kdoctools ]; + nativeBuildInputs = [ + extra-cmake-modules + kdoctools + ]; buildInputs = [ - boost qtwebkit qtx11extras shared-mime-info - kactivities karchive kcodecs kcompletion kconfig kconfigwidgets kcoreaddons - kdbusaddons kdiagram kguiaddons khtml ki18n kiconthemes kitemviews - kjobwidgets kcmutils kdelibs4support kio kross knotifications knotifyconfig kparts - ktextwidgets kwallet kwidgetsaddons kwindowsystem kxmlgui sonnet threadweaver - kcontacts akonadi akonadi-calendar akonadi-contacts - eigen git gsl ilmbase kproperty kreport lcms2 marble pcre libgit2 libodfgen librevenge - libvisio libwpd libwpg libwps okular openexr openjpeg phonon poppler qca-qt5 vc + boost + qtwebkit + qtx11extras + shared-mime-info + kactivities + karchive + kcodecs + kcompletion + kconfig + kconfigwidgets + kcoreaddons + kdbusaddons + kdiagram + kguiaddons + khtml + ki18n + kiconthemes + kitemviews + kjobwidgets + kcmutils + kdelibs4support + kio + kross + knotifications + knotifyconfig + kparts + ktextwidgets + kwallet + kwidgetsaddons + kwindowsystem + kxmlgui + sonnet + threadweaver + kcontacts + akonadi + akonadi-calendar + akonadi-contacts + eigen + git + gsl + ilmbase + kproperty + kreport + lcms2 + marble + pcre + libgit2 + libodfgen + librevenge + libvisio + libwpd + libwpg + libwps + okular + openexr + openjpeg + phonon + poppler + qca-qt5 + vc fontconfig ]; @@ -86,8 +200,14 @@ mkDerivation rec { vector graphics. ''; homepage = "https://www.calligra.org/"; - maintainers = with maintainers; [ ebzzry zraexy ]; + maintainers = with maintainers; [ + ebzzry + zraexy + ]; platforms = platforms.linux; - license = with licenses; [ gpl2 lgpl2 ]; + license = with licenses; [ + gpl2 + lgpl2 + ]; }; } From faa4fdb825cd537621e90ccfce4ddc45d1e69409 Mon Sep 17 00:00:00 2001 From: Fernando Rodrigues Date: Fri, 27 Sep 2024 18:49:22 +0000 Subject: [PATCH 4/4] kdePackages.calligra: 3.2.1 -> 4.0.1 Massively simplifies the build. We remove most of the meta attributes, all of the downstream patches, and nuke most of the unecessary dependencies. The result is a pretty feature-complete build of Calligra 4.0 that's only missing legacy components that nobody should be using anyway. Signed-off-by: Fernando Rodrigues --- pkgs/kde/misc/calligra/default.nix | 201 +++++------------------------ 1 file changed, 32 insertions(+), 169 deletions(-) diff --git a/pkgs/kde/misc/calligra/default.nix b/pkgs/kde/misc/calligra/default.nix index fb0b662e9a36..ff407e1a142f 100644 --- a/pkgs/kde/misc/calligra/default.nix +++ b/pkgs/kde/misc/calligra/default.nix @@ -1,57 +1,11 @@ { - mkDerivation, + mkKdeDerivation, lib, - fetchpatch, fetchurl, - extra-cmake-modules, - kdoctools, boost, - qtwebkit, - qtx11extras, - shared-mime-info, - breeze-icons, - kactivities, - karchive, - kcodecs, - kcompletion, - kconfig, - kconfigwidgets, - kcoreaddons, - kdbusaddons, - kdiagram, - kguiaddons, - khtml, - ki18n, - kiconthemes, - kitemviews, - kjobwidgets, - kcmutils, - kdelibs4support, - kio, - kross, - knotifications, - knotifyconfig, - kparts, - ktextwidgets, - kwallet, - kwidgetsaddons, - kwindowsystem, - kxmlgui, - sonnet, - threadweaver, - kcontacts, - akonadi, - akonadi-calendar, - akonadi-contacts, eigen, - git, - gsl, - ilmbase, - kproperty, - kreport, - lcms2, - marble, - pcre, + imath, + libetonyek, libgit2, libodfgen, librevenge, @@ -60,110 +14,27 @@ libwpg, libwps, okular, - openexr, - openjpeg, - phonon, + perl, + pkg-config, poppler, - pstoedit, - qca-qt5, - vc, - fontconfig, -# TODO: package Spnav, m2mml LibEtonyek, Libqgit2 + qtkeychain, + qtsvg, }: -mkDerivation rec { +mkKdeDerivation rec { pname = "calligra"; - version = "3.2.1"; + version = "4.0.1"; src = fetchurl { - url = "mirror://kde/stable/${pname}/${version}/${pname}-${version}.tar.xz"; - sha256 = "0iqi6z6gkck2afgy200dacgcspq7i7887alcj0pklm08hbmsdy5i"; + url = "mirror://kde/stable/calligra/calligra-${version}.tar.xz"; + hash = "sha256-1AH15z9PG9wLNUjqGlCwrBd4we3jCmozWUTtf72I2V8="; }; - patches = [ - # Fix fontconfig underlinking: https://github.com/NixOS/nixpkgs/issues/137794 - # Can be dropped on next release. - (fetchpatch { - name = "fix-fontconfig-linking.patch"; - url = "https://github.com/KDE/calligra/commit/62f510702ef9c34ac50f8d8601a4290ab558464c.patch"; - sha256 = "11dzrp9q05dmvnwp4vk4ihcibqcf4xyr0ijscpi716cyy730flma"; - excludes = [ "CMakeLists.txt" ]; - }) - # Fixes for building calligra with gcc11/c++17 - (fetchpatch { - name = "build_c++17_poppler.patch"; - url = "https://github.com/archlinux/svntogit-packages/raw/bbbe35f97eb1033798f1cf95d427890168598199/trunk/068cd9ae.patch"; - sha256 = "sha256-d9/ILwSeW+ov11DF191hzIaUafO/rjQrAeONwqDSKbA="; - }) - # Fixes for building calligra with modern poppler[-qt5] - (fetchpatch { - name = "calligra-poppler-22.03.patch"; - url = "https://invent.kde.org/office/calligra/-/commit/236bacbe13739414e919de868283b0caf2df5d8a.patch"; - sha256 = "sha256-9DmKPCvEFy2Cs3g7350iOCF5Vrx1HL+/8jr+Tb44CyE="; - }) - (fetchpatch { - name = "calligra-poppler-22.04.patch"; - url = "https://invent.kde.org/office/calligra/-/commit/6b75bec784c9835c78993349845d8c2ef22ec3de.patch"; - sha256 = "sha256-z9/4he4x0WN2K/ZGrDAAtHF/W5X1PAtpeO6s7fgL/fA="; - }) - ]; - postPatch = '' - substituteInPlace CMakeLists.txt \ - --replace 'CMAKE_CXX_STANDARD 11' 'CMAKE_CXX_STANDARD 17' - ''; - - nativeBuildInputs = [ - extra-cmake-modules - kdoctools - ]; - - buildInputs = [ + extraBuildInputs = [ boost - qtwebkit - qtx11extras - shared-mime-info - kactivities - karchive - kcodecs - kcompletion - kconfig - kconfigwidgets - kcoreaddons - kdbusaddons - kdiagram - kguiaddons - khtml - ki18n - kiconthemes - kitemviews - kjobwidgets - kcmutils - kdelibs4support - kio - kross - knotifications - knotifyconfig - kparts - ktextwidgets - kwallet - kwidgetsaddons - kwindowsystem - kxmlgui - sonnet - threadweaver - kcontacts - akonadi - akonadi-calendar - akonadi-contacts eigen - git - gsl - ilmbase - kproperty - kreport - lcms2 - marble - pcre + imath + libetonyek libgit2 libodfgen librevenge @@ -172,42 +43,34 @@ mkDerivation rec { libwpg libwps okular - openexr - openjpeg - phonon poppler - qca-qt5 - vc - fontconfig + qtkeychain + qtsvg ]; - propagatedUserEnvPkgs = [ kproperty ]; - - env.NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR"; - - qtWrapperArgs = [ - "--prefix PATH : ${lib.getBin pstoedit}/bin" - "--prefix XDG_DATA_DIRS : ${breeze-icons}/share" + extraNativeBuildInputs = [ + perl + pkg-config ]; - meta = with lib; { - description = "Suite of productivity applications"; - longDescription = '' - Calligra Suite is a set of applications written to help - you to accomplish your work. Calligra includes efficient - and capable office components: Words for text processing, - Sheets for computations, Plan for planning, and Karbon for - vector graphics. - ''; - homepage = "https://www.calligra.org/"; - maintainers = with maintainers; [ + # Recommended by the upstream packaging instructions. RELEASE_BUILD disables + # unmaintained components, like Braindump, from being built, and KDE_NO_DEBUG_OUTPUT + # is supposed to improve performance in the finished package. + extraCmakeFlags = [ + (lib.cmakeBool "RELEASE_BUILD" true) + (lib.cmakeFeature "CMAKE_CXX_FLAGS" "-DKDE_NO_DEBUG_OUTPUT") + ]; + + meta = { + maintainers = with lib.maintainers; [ ebzzry zraexy + sigmasquadron ]; - platforms = platforms.linux; - license = with licenses; [ + license = with lib.licenses; [ gpl2 lgpl2 ]; + mainProgram = "calligralauncher"; }; }