nixpkgs/pkgs/tools/misc/btrfs-assistant/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
1.9 KiB
Nix
Raw Normal View History

2023-07-28 19:10:31 +00:00
{ lib
, stdenv
, fetchFromGitLab
, bash
, btrfs-progs
, cmake
, coreutils
, git
, pkg-config
, qtbase
, qtsvg
, qttools
, snapper
, util-linux
, wrapQtAppsHook
2023-08-08 17:58:40 +00:00
, enableSnapper ? true
2023-07-28 19:10:31 +00:00
}:
stdenv.mkDerivation (finalAttrs: {
pname = "btrfs-assistant";
version = "1.8";
src = fetchFromGitLab {
owner = "btrfs-assistant";
repo = "btrfs-assistant";
rev = finalAttrs.version;
hash = "sha256-Ay2wxDVue+tG09RgAo4Zg2ktlq6dk7GdIwAlbuVULB4=";
};
nativeBuildInputs = [
cmake
git
pkg-config
];
buildInputs = [
btrfs-progs
qtbase
qtsvg
qttools
];
propagatedBuildInputs = [ wrapQtAppsHook ];
prePatch = ''
substituteInPlace src/util/System.cpp \
2023-08-08 17:58:40 +00:00
--replace '/bin/bash' "${lib.getExe bash}"
''
+ lib.optionalString enableSnapper ''
substituteInPlace src/main.cpp \
--replace '/usr/bin/snapper' "${lib.getExe snapper}"
2023-07-28 19:10:31 +00:00
'';
postPatch = ''
substituteInPlace src/org.btrfs-assistant.pkexec.policy \
--replace '/usr/bin' "$out/bin"
substituteInPlace src/btrfs-assistant \
--replace 'btrfs-assistant-bin' "$out/bin/btrfs-assistant-bin"
substituteInPlace src/btrfs-assistant-launcher \
--replace 'btrfs-assistant' "$out/bin/btrfs-assistant"
2023-08-08 17:58:40 +00:00
''
+ lib.optionalString enableSnapper ''
2023-07-28 19:10:31 +00:00
substituteInPlace src/btrfs-assistant.conf \
2023-08-08 17:58:40 +00:00
--replace '/usr/bin/snapper' "${lib.getExe snapper}"
2023-07-28 19:10:31 +00:00
'';
2023-08-08 17:58:40 +00:00
qtWrapperArgs =
let
runtimeDeps = lib.makeBinPath ([
coreutils
util-linux
]
++ lib.optionals enableSnapper [ snapper ]);
in
[
"--prefix PATH : ${runtimeDeps}"
];
2023-07-28 19:10:31 +00:00
meta = {
description = "A GUI management tool to make managing a Btrfs filesystem easier";
homepage = "https://gitlab.com/btrfs-assistant/btrfs-assistant";
license = lib.licenses.gpl3Only;
mainProgram = "btrfs-assistant-bin";
maintainers = with lib.maintainers; [ khaneliman ];
platforms = lib.platforms.linux;
};
})