kwalletcli: fix pinentry-kwallet

This commit is contained in:
Peter Hoeg 2019-04-27 17:20:34 +08:00
parent dfd8f84aef
commit 899e95582e

View File

@ -1,48 +1,48 @@
{ { mkDerivation, fetchFromGitHub, lib, makeWrapper, pkgconfig
mkDerivation, fetchurl, lib, , kcoreaddons, ki18n, kwallet, mksh, pinentry_qt5 }:
pkgconfig,
kcoreaddons, ki18n, kwallet,
mksh
}:
let mkDerivation rec {
pname = "kwalletcli"; pname = "kwalletcli";
version = "3.02"; version = "3.02";
in
mkDerivation rec {
name = "${pname}-${version}";
src = fetchurl { src = fetchFromGitHub {
url = "https://www.mirbsd.org/MirOS/dist/hosted/kwalletcli/${name}.tar.gz"; owner = "MirBSD";
sha256 = "05njayi07996ljfl8a6frlk2s60grk5w27f0f445nmvd5n0bzgpn"; repo = pname;
rev = "${pname}-${lib.replaceStrings [ "." ] [ "_" ] version}";
sha256 = "1gq45afb5nmmjfqxglv7wvcxcjd9822pc7nysq0350jmmmqwb474";
}; };
postPatch = '' postPatch = ''
substituteInPlace GNUmakefile \ substituteInPlace GNUmakefile \
--replace '-I/usr/include/KF5/KCoreAddons' '-I${kcoreaddons.dev}/include/KF5/KCoreAddons' \ --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/KI18n -I${ki18n.dev}/include/KF5/KI18n \
--replace '-I/usr/include/KF5/KWallet' '-I${kwallet.dev}/include/KF5/KWallet' \ --replace -I/usr/include/KF5/KWallet -I${kwallet.dev}/include/KF5/KWallet \
--replace /usr/bin $out/bin \ --replace /usr/bin $out/bin \
--replace /usr/share/man $out/share/man --replace /usr/share/man $out/share/man
substituteInPlace pinentry-kwallet \
--replace '/usr/bin/env mksh' ${mksh}/bin/mksh
''; '';
makeFlags = [ "KDE_VER=5" ]; makeFlags = [ "KDE_VER=5" ];
# we need this when building against qt 5.8+ nativeBuildInputs = [ makeWrapper pkgconfig ];
NIX_CFLAGS_COMPILE = [ "-std=c++11" ];
nativeBuildInputs = [ pkgconfig ];
# if using just kwallet, cmake will be added as a buildInput and fail the build # if using just kwallet, cmake will be added as a buildInput and fail the build
propagatedBuildInputs = [ kcoreaddons ki18n (lib.getLib kwallet) ]; propagatedBuildInputs = [ kcoreaddons ki18n (lib.getLib kwallet) ];
propagatedUserEnvPkgs = [ mksh ];
preInstall = '' preInstall = ''
mkdir -p $out/bin $out/share/man/man1 mkdir -p $out/bin $out/share/man/man1
''; '';
postInstall = ''
wrapProgram $out/bin/pinentry-kwallet \
--prefix PATH : $out/bin:${lib.makeBinPath [ pinentry_qt5 ]} \
--set-default PINENTRY pinentry-qt
'';
meta = with lib; { meta = with lib; {
description = "Command-Line Interface to the KDE Wallet"; description = "Command-Line Interface to the KDE Wallet";
homepage = http://www.mirbsd.org/kwalletcli.htm; homepage = https://www.mirbsd.org/kwalletcli.htm;
license = licenses.miros; license = licenses.miros;
maintainers = with maintainers; [ peterhoeg ]; maintainers = with maintainers; [ peterhoeg ];
}; };