Subject: [PATCH v2 2/3] gnu: kpmcore: Fix missing commands.

From: Sughosha <[email-masked]>
Date: Sun, 12 Jan 2025 14:24:36 +0530

* gnu/packages/kde.scm (kpmcore)[inputs]: Switch to the old input style; Add
coreutils, cryptsetup, eudev, lvm2, mdadm, smartmontools and util-linux.
[arguments]<#:phases>: Add patch-trustedprefixes-file phase.

Change-Id: I6b205596e2ae5d03010db27b0b41ddb42d4534b5
---
 gnu/packages/kde.scm | 37 ++++++++++++++++++++++++++++---------
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/kde.scm b/gnu/packages/kde.scm
index ce64619feb..7c02de246a 100644
--- a/gnu/packages/kde.scm
+++ b/gnu/packages/kde.scm
@@ -45,6 +45,7 @@ (define-module (gnu packages kde)
   #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (gnu packages)
+  #:use-module (gnu packages admin)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages apr)
   #:use-module (gnu packages astronomy)
@@ -58,6 +59,7 @@ (define-module (gnu packages kde)
   #:use-module (gnu packages code)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages cryptsetup)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages djvu)
   #:use-module (gnu packages documentation)
@@ -1269,14 +1271,21 @@ (define-public kpmcore
     (native-inputs
      (list extra-cmake-modules pkg-config))
     (inputs
-     (list kauth
-           kcoreaddons
-           ki18n
-           kwidgetsaddons
-           polkit-qt6
-           qtbase
-           qca-qt6
-           `(,util-linux "lib")))
+     `(("coreutils" ,coreutils)
+       ("cryptsetup" ,cryptsetup)
+       ("eudev" ,eudev)
+       ("kauth" ,kauth)
+       ("kcoreaddons" ,kcoreaddons)
+       ("ki18n" ,ki18n)
+       ("kwidgetsaddons" ,kwidgetsaddons)
+       ("lvm2" ,lvm2)
+       ("mdadm" ,mdadm)
+       ("polkit-qt6" ,polkit-qt6)
+       ("qtbase" ,qtbase)
+       ("qca-qt6" ,qca-qt6)
+       ("smartmontools" ,smartmontools)
+       ("util-linux" ,util-linux)
+       ("util-linux:lib" ,util-linux "lib")))
     (arguments
      (list
       #:phases
@@ -1287,7 +1296,17 @@ (define-public kpmcore
                 (("DESTINATION \\$\\{POLKITQT-1_POLICY_FILES_INSTALL_DIR\\}")
                  "DESTINATION share/polkit-1/actions"))
               (substitute* "src/backend/corebackend.cpp"
-                  (("\\/usr") #$output)))))))
+                  (("\\/usr") #$output))))
+          (add-before 'configure 'patch-trustedprefixes-file
+              (lambda _
+                (call-with-output-file "src/util/trustedprefixes"
+                  (lambda (port)
+                    (map (lambda (prefix)
+                           (display prefix port)
+                           (newline port))
+                         '("/run/current-system/profile"
+                           "/usr"
+                           "/")))))))))
     (home-page "https://community.kde.org/Frameworks")
     (synopsis "Library for managing partitions")
     (description "Library for managing partitions.")
-- 
2.47.1