nixpkgs/pkgs/tools/security/kwalletcli/default.nix

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

55 lines
1.8 KiB
Nix
Raw Normal View History

2021-01-17 03:51:22 +00:00
{ mkDerivation, fetchFromGitHub, lib, makeWrapper, pkg-config
, kcoreaddons, ki18n, kwallet, mksh, pinentry-qt }:
2019-04-27 09:20:34 +00:00
mkDerivation rec {
2017-06-01 11:11:21 +00:00
pname = "kwalletcli";
2021-01-30 11:06:40 +00:00
version = "3.03";
2017-06-01 11:11:21 +00:00
2019-04-27 09:20:34 +00:00
src = fetchFromGitHub {
owner = "MirBSD";
repo = pname;
rev = "${pname}-${lib.replaceStrings [ "." ] [ "_" ] version}";
2021-01-30 11:06:40 +00:00
sha256 = "sha256-DUtaQITzHhQrqA9QJd0U/5EDjH0IzY9/kal/7SYQ/Ck=";
2017-06-01 11:11:21 +00:00
};
2017-05-16 15:56:41 +00:00
postPatch = ''
substituteInPlace GNUmakefile \
2019-04-27 09:20:34 +00:00
--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
2017-05-16 15:56:41 +00:00
'';
makeFlags = [ "KDE_VER=5" ];
2021-01-17 03:51:22 +00:00
nativeBuildInputs = [ makeWrapper pkg-config ];
2017-05-16 15:56:41 +00:00
# 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
'';
2019-04-27 09:20:34 +00:00
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
2019-04-27 09:20:34 +00:00
'';
2017-05-16 15:56:41 +00:00
meta = with lib; {
description = "Command-Line Interface to the KDE Wallet";
homepage = "https://www.mirbsd.org/kwalletcli.htm";
2017-05-16 15:56:41 +00:00
license = licenses.miros;
maintainers = with maintainers; [ peterhoeg ];
};
2017-06-01 11:11:21 +00:00
}