2024-06-20 14:57:18 +00:00
|
|
|
|
{
|
|
|
|
|
stdenv,
|
|
|
|
|
lib,
|
|
|
|
|
fetchurl,
|
|
|
|
|
fetchpatch,
|
|
|
|
|
pkg-config,
|
|
|
|
|
autoreconfHook,
|
|
|
|
|
wrapGAppsHook3,
|
|
|
|
|
libgpg-error,
|
|
|
|
|
libassuan,
|
|
|
|
|
libsForQt5,
|
|
|
|
|
qt6,
|
|
|
|
|
ncurses,
|
|
|
|
|
gtk2,
|
|
|
|
|
gcr,
|
|
|
|
|
withLibsecret ? true,
|
|
|
|
|
libsecret,
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
|
flavorInfo = {
|
2024-06-20 14:57:18 +00:00
|
|
|
|
tty = {
|
|
|
|
|
flag = "tty";
|
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
|
curses = {
|
|
|
|
|
flag = "curses";
|
|
|
|
|
buildInputs = [ ncurses ];
|
|
|
|
|
};
|
|
|
|
|
gtk2 = {
|
|
|
|
|
flag = "gtk2";
|
|
|
|
|
buildInputs = [ gtk2 ];
|
|
|
|
|
};
|
|
|
|
|
gnome3 = {
|
|
|
|
|
flag = "gnome3";
|
|
|
|
|
buildInputs = [ gcr ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
nativeBuildInputs = [ wrapGAppsHook3 ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
};
|
2024-06-20 14:57:18 +00:00
|
|
|
|
qt5 = {
|
|
|
|
|
flag = "qt5";
|
|
|
|
|
buildInputs = [
|
|
|
|
|
libsForQt5.qtbase
|
|
|
|
|
libsForQt5.kwayland
|
|
|
|
|
libsForQt5.qtx11extras
|
|
|
|
|
];
|
|
|
|
|
nativeBuildInputs = [ libsForQt5.wrapQtAppsHook ];
|
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
|
qt = {
|
|
|
|
|
flag = "qt";
|
2024-06-20 14:57:18 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
qt6.qtbase
|
|
|
|
|
qt6.qtwayland
|
|
|
|
|
];
|
|
|
|
|
nativeBuildInputs = [ qt6.wrapQtAppsHook ];
|
|
|
|
|
};
|
|
|
|
|
emacs = {
|
|
|
|
|
flag = "emacs";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
|
buildPinentry =
|
|
|
|
|
pinentryExtraPname: buildFlavors:
|
2024-04-21 15:54:59 +00:00
|
|
|
|
let
|
2024-06-20 14:57:18 +00:00
|
|
|
|
enableFeaturePinentry =
|
|
|
|
|
f: lib.enableFeature (lib.elem f buildFlavors) ("pinentry-" + flavorInfo.${f}.flag);
|
2024-04-21 15:54:59 +00:00
|
|
|
|
in
|
2024-10-11 05:15:48 +00:00
|
|
|
|
stdenv.mkDerivation rec {
|
2024-04-21 15:54:59 +00:00
|
|
|
|
pname = "pinentry-${pinentryExtraPname}";
|
2024-07-27 06:49:29 +00:00
|
|
|
|
version = "1.3.1";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
url = "mirror://gnupg/pinentry/pinentry-${version}.tar.bz2";
|
2024-07-27 06:49:29 +00:00
|
|
|
|
hash = "sha256-vHLuJ8cjkAerGJbDwvrlOwduLJvSSD3CdpoWkCvOjAQ=";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
pkg-config
|
|
|
|
|
autoreconfHook
|
|
|
|
|
] ++ lib.concatMap (f: flavorInfo.${f}.nativeBuildInputs or [ ]) buildFlavors;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
|
buildInputs =
|
|
|
|
|
[
|
|
|
|
|
libgpg-error
|
|
|
|
|
libassuan
|
|
|
|
|
]
|
2024-04-21 15:54:59 +00:00
|
|
|
|
++ lib.optional withLibsecret libsecret
|
|
|
|
|
++ lib.concatMap (f: flavorInfo.${f}.buildInputs or [ ]) buildFlavors;
|
|
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
|
patches =
|
|
|
|
|
[ ./autoconf-ar.patch ]
|
|
|
|
|
++ lib.optionals (lib.elem "gtk2" buildFlavors) [
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
url = "https://salsa.debian.org/debian/pinentry/raw/debian/1.1.0-1/debian/patches/0007-gtk2-When-X11-input-grabbing-fails-try-again-over-0..patch";
|
|
|
|
|
sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd";
|
|
|
|
|
})
|
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
|
"--with-libgpg-error-prefix=${libgpg-error.dev}"
|
|
|
|
|
"--with-libassuan-prefix=${libassuan.dev}"
|
|
|
|
|
(lib.enableFeature withLibsecret "libsecret")
|
|
|
|
|
] ++ (map enableFeaturePinentry (lib.attrNames flavorInfo));
|
|
|
|
|
|
|
|
|
|
postInstall =
|
|
|
|
|
lib.optionalString (lib.elem "gnome3" buildFlavors) ''
|
|
|
|
|
wrapGApp $out/bin/pinentry-gnome3
|
2024-06-20 14:57:18 +00:00
|
|
|
|
''
|
|
|
|
|
+ lib.optionalString (lib.elem "qt5" buildFlavors) ''
|
|
|
|
|
wrapQtApp $out/bin/pinentry-qt5
|
|
|
|
|
ln -sf $out/bin/pinentry-qt5 $out/bin/pinentry-qt
|
|
|
|
|
''
|
|
|
|
|
+ lib.optionalString (lib.elem "qt" buildFlavors) ''
|
2024-04-21 15:54:59 +00:00
|
|
|
|
wrapQtApp $out/bin/pinentry-qt
|
|
|
|
|
'';
|
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
flavors = buildFlavors;
|
|
|
|
|
};
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
|
meta = {
|
2024-04-21 15:54:59 +00:00
|
|
|
|
homepage = "https://gnupg.org/software/pinentry/index.html";
|
|
|
|
|
description = "GnuPG’s interface to passphrase input";
|
2024-06-20 14:57:18 +00:00
|
|
|
|
license = lib.licenses.gpl2Plus;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
platforms =
|
2024-06-20 14:57:18 +00:00
|
|
|
|
if lib.elem "gnome3" buildFlavors then
|
|
|
|
|
lib.platforms.linux
|
|
|
|
|
else if (lib.elem "qt5" buildFlavors || lib.elem "qt" buildFlavors) then
|
|
|
|
|
(lib.remove "aarch64-darwin" lib.platforms.all)
|
|
|
|
|
else
|
|
|
|
|
lib.platforms.all;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
longDescription = ''
|
|
|
|
|
Pinentry provides a console and (optional) GTK and Qt GUIs allowing users
|
|
|
|
|
to enter a passphrase when `gpg` or `gpg2` is run and needs it.
|
|
|
|
|
'';
|
2024-06-20 14:57:18 +00:00
|
|
|
|
maintainers = with lib.maintainers; [ fpletz ];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
mainProgram = "pinentry";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
{
|
2024-06-20 14:57:18 +00:00
|
|
|
|
pinentry-curses = buildPinentry "curses" [
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
];
|
|
|
|
|
pinentry-emacs = buildPinentry "emacs" [
|
|
|
|
|
"emacs"
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
];
|
|
|
|
|
pinentry-gnome3 = buildPinentry "gnome3" [
|
|
|
|
|
"gnome3"
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
];
|
|
|
|
|
pinentry-gtk2 = buildPinentry "gtk2" [
|
|
|
|
|
"gtk2"
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
];
|
|
|
|
|
pinentry-qt5 = buildPinentry "qt5" [
|
|
|
|
|
"qt5"
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
];
|
|
|
|
|
pinentry-qt = buildPinentry "qt" [
|
|
|
|
|
"qt"
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
|
pinentry-tty = buildPinentry "tty" [ "tty" ];
|
2024-06-20 14:57:18 +00:00
|
|
|
|
pinentry-all = buildPinentry "all" [
|
|
|
|
|
"curses"
|
|
|
|
|
"tty"
|
|
|
|
|
"gtk2"
|
|
|
|
|
"gnome3"
|
|
|
|
|
"qt"
|
|
|
|
|
"emacs"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}
|