Files
nixpkgs/pkgs/tools/security/kwalletcli/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

72 lines
1.8 KiB
Nix

{
mkDerivation,
fetchFromGitHub,
lib,
makeWrapper,
pkg-config,
kcoreaddons,
ki18n,
kwallet,
mksh,
pinentry-qt,
}:
mkDerivation rec {
pname = "kwalletcli";
version = "3.03";
src = fetchFromGitHub {
owner = "MirBSD";
repo = pname;
rev = "${pname}-${lib.replaceStrings [ "." ] [ "_" ] version}";
sha256 = "sha256-DUtaQITzHhQrqA9QJd0U/5EDjH0IzY9/kal/7SYQ/Ck=";
};
postPatch = ''
substituteInPlace GNUmakefile \
--replace -I/usr/include/KF5/KCoreAddons -I${kcoreaddons.dev}/include/KF5/KCoreAddons \
--replace -I/usr/include/KF5/KI18n -I${ki18n.dev}/include/KF5/KI18n \
--replace -I/usr/include/KF5/KWallet -I${kwallet.dev}/include/KF5/KWallet \
--replace /usr/bin $out/bin \
--replace /usr/share/man $out/share/man
substituteInPlace pinentry-kwallet \
--replace '/usr/bin/env mksh' ${mksh}/bin/mksh
substituteInPlace kwalletcli_getpin \
--replace '/usr/bin/env mksh' ${mksh}/bin/mksh
'';
makeFlags = [ "KDE_VER=5" ];
nativeBuildInputs = [
makeWrapper
pkg-config
];
# if using just kwallet, cmake will be added as a buildInput and fail the build
propagatedBuildInputs = [
kcoreaddons
ki18n
(lib.getLib kwallet)
];
preInstall = ''
mkdir -p $out/bin $out/share/man/man1
'';
postInstall = ''
for program in pinentry-kwallet kwalletcli_getpin; do
wrapProgram $out/bin/$program \
--prefix PATH : $out/bin:${lib.makeBinPath [ pinentry-qt ]} \
--set-default PINENTRY pinentry-qt
done
'';
meta = {
description = "Command-Line Interface to the KDE Wallet";
homepage = "https://www.mirbsd.org/kwalletcli.htm";
license = lib.licenses.miros;
maintainers = with lib.maintainers; [ peterhoeg ];
};
}