Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{partition-manager,libsForQt5.kpmcore}: 3.3.1 -> 4.2.0 and fix build #114016

Merged
merged 2 commits into from Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Expand Up @@ -155,6 +155,7 @@
./programs/nm-applet.nix
./programs/npm.nix
./programs/oblogout.nix
./programs/partition-manager.nix
./programs/plotinus.nix
./programs/proxychains.nix
./programs/qt5ct.nix
Expand Down
19 changes: 19 additions & 0 deletions nixos/modules/programs/partition-manager.nix
@@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:

with lib;

{
meta.maintainers = [ maintainers.oxalica ];

###### interface
options = {
programs.partition-manager.enable = mkEnableOption "KDE Partition Manager";
};

###### implementation
config = mkIf config.programs.partition-manager.enable {
services.dbus.packages = [ pkgs.libsForQt5.kpmcore ];
# `kpmcore` need to be installed to pull in polkit actions.
environment.systemPackages = [ pkgs.libsForQt5.kpmcore pkgs.partition-manager ];
};
}
42 changes: 29 additions & 13 deletions pkgs/development/libraries/kpmcore/default.nix
@@ -1,34 +1,50 @@
{ stdenv, lib, fetchurl, extra-cmake-modules
, qtbase, kio
, libatasmart, parted
, util-linux }:
{ stdenv, lib, fetchurl, fetchpatch, extra-cmake-modules
, qca-qt5, kauth, kio, polkit-qt, qtbase
, util-linux
}:

stdenv.mkDerivation rec {
pname = "kpmcore";
version = "3.3.0";
# NOTE: When changing this version, also change the version of `partition-manager`.
version = "4.2.0";

src = fetchurl {
url = "mirror://kde/stable/${pname}/${version}/src/${pname}-${version}.tar.xz";
sha256 = "0s6v0jfrhjg31ri5p6h9n4w29jvasf5dj954j3vfpzl91lygmmmq";
hash = "sha256-MvW0CqvFZtzcJlya6DIpzorPbKJai6fxt7nKsKpJn54=";
};

buildInputs = [
qtbase
libatasmart
parted # we only need the library
patches = [
# Fix build with `kcoreaddons` >= 5.77.0
(fetchpatch {
url = "https://github.com/KDE/kpmcore/commit/07e5a3ac2858e6d38cc698e0f740e7a693e9f302.patch";
sha256 = "sha256-LYzea888euo2HXM+acWaylSw28iwzOdZBvPBt/gjP1s=";
})
# Fix crash when `fstab` omits mount options.
(fetchpatch {
url = "https://github.com/KDE/kpmcore/commit/eea84fb60525803a789e55bb168afb968464c130.patch";
sha256 = "sha256-NJ3PvyRC6SKNSOlhJPrDDjepuw7IlAoufPgvml3fap0=";
})
];

buildInputs = [
qca-qt5
kauth
kio
polkit-qt

util-linux # needs blkid (note that this is not provided by util-linux-compat)
util-linux # Needs blkid in configure script (note that this is not provided by util-linux-compat)
];

nativeBuildInputs = [ extra-cmake-modules ];

dontWrapQtApps = true;

meta = with lib; {
oxalica marked this conversation as resolved.
Show resolved Hide resolved
maintainers = with lib.maintainers; [ peterhoeg ];
description = "KDE Partition Manager core library";
homepage = "https://invent.kde.org/system/kpmcore";
license = with licenses; [ cc-by-40 cc0 gpl3Plus mit ];
maintainers = with maintainers; [ peterhoeg oxalica ];
# The build requires at least Qt 5.14:
broken = lib.versionOlder qtbase.version "5.14";
broken = versionOlder qtbase.version "5.14";
};
}
60 changes: 48 additions & 12 deletions pkgs/tools/misc/partition-manager/default.nix
@@ -1,30 +1,66 @@
{ mkDerivation, fetchurl, lib
{ mkDerivation, fetchurl, lib, makeWrapper
, extra-cmake-modules, kdoctools, wrapGAppsHook, wrapQtAppsHook
, kconfig, kcrash, kinit, kpmcore
, eject, libatasmart , util-linux, qtbase
, cryptsetup, lvm2, mdadm, smartmontools, systemdMinimal, util-linux
, btrfs-progs, dosfstools, e2fsprogs, exfat, f2fs-tools, fatresize, hfsprogs
, jfsutils, nilfs-utils, ntfs3g, reiser4progs, reiserfsprogs, udftools, xfsprogs, zfs
}:

let
pname = "partitionmanager";
# External programs are resolved by `partition-manager` and then
# invoked by `kpmcore_externalcommand` from `kpmcore` as root.
# So these packages should be in PATH of `partition-manager`.
# https://github.com/KDE/kpmcore/blob/06f15334ecfbe871730a90dbe2b694ba060ee998/src/util/externalcommand_whitelist.h
runtimeDeps = lib.makeBinPath [
cryptsetup
lvm2
mdadm
smartmontools
systemdMinimal
util-linux

btrfs-progs
dosfstools
e2fsprogs
exfat
f2fs-tools
fatresize
hfsprogs
jfsutils
nilfs-utils
ntfs3g
reiser4progs
reiserfsprogs
udftools
xfsprogs
zfs

# FIXME: Missing command: tune.exfat hfsck hformat fsck.nilfs2 {fsck,mkfs,debugfs,tunefs}.ocfs2
];

in mkDerivation rec {
name = "${pname}-${version}";
version = "3.3.1";
pname = "partitionmanager";
# NOTE: When changing this version, also change the version of `kpmcore`.
version = "4.2.0";

src = fetchurl {
url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.xz";
sha256 = "0jhggb4xksb0k0mj752n6pz0xmccnbzlp984xydqbz3hkigra1si";
url = "mirror://kde/stable/${pname}/${version}/src/${pname}-${version}.tar.xz";
hash = "sha256-6Qlt1c47Eek6TkWWBzTyBZYJ1jfhtwsC9X5q5h6IhPg=";
};

nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook wrapQtAppsHook ];
nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook wrapQtAppsHook makeWrapper ];

# refer to kpmcore for the use of eject
buildInputs = [ eject libatasmart util-linux ];
propagatedBuildInputs = [ kconfig kcrash kinit kpmcore ];

postFixup = ''
wrapProgram $out/bin/partitionmanager \
--prefix PATH : "${runtimeDeps}"
'';

meta = with lib; {
description = "KDE Partition Manager";
license = licenses.gpl2;
license = with licenses; [ cc-by-40 cc0 gpl3Plus lgpl3Plus mit ];
homepage = "https://www.kde.org/applications/system/kdepartitionmanager/";
maintainers = with maintainers; [ peterhoeg ];
maintainers = with maintainers; [ peterhoeg oxalica ];
};
}