1{ stdenv, lib, fetchurl, extra-cmake-modules
2, qca-qt5, kauth, kio, polkit-qt, qtbase
3, util-linux
4}:
5
6stdenv.mkDerivation rec {
7 pname = "kpmcore";
8 # NOTE: When changing this version, also change the version of `partition-manager`.
9 version = "22.08.0";
10
11 src = fetchurl {
12 url = "mirror://kde/stable/release-service/${version}/src/${pname}-${version}.tar.xz";
13 hash = "sha256-Ws20hKX2iDdke5yBBKXukVUD4OnLf1OmwlhW+jUXL24=";
14 };
15
16 patches = [
17 ./nixostrustedprefix.patch
18 ];
19
20 nativeBuildInputs = [ extra-cmake-modules ];
21
22 buildInputs = [
23 qca-qt5
24 kauth
25 kio
26 polkit-qt
27
28 util-linux # Needs blkid in configure script (note that this is not provided by util-linux-compat)
29 ];
30
31 dontWrapQtApps = true;
32
33 preConfigure = ''
34 substituteInPlace src/util/CMakeLists.txt \
35 --replace \$\{POLKITQT-1_POLICY_FILES_INSTALL_DIR\} $out/share/polkit-1/actions
36 substituteInPlace src/backend/corebackend.cpp \
37 --replace /usr/share/polkit-1/actions/org.kde.kpmcore.externalcommand.policy $out/share/polkit-1/actions/org.kde.kpmcore.externalcommand.policy
38 '';
39
40 meta = with lib; {
41 description = "KDE Partition Manager core library";
42 homepage = "https://invent.kde.org/system/kpmcore";
43 license = with licenses; [ cc-by-40 cc0 gpl3Plus mit ];
44 maintainers = with maintainers; [ peterhoeg oxalica ];
45 # The build requires at least Qt 5.14:
46 broken = versionOlder qtbase.version "5.14";
47 };
48}