Merge pull request #316792 from fpletz/pkg/pinentry-1.3.0

pinentry: 1.2.1 -> 1.3.0

authored by Ben Siraphob and committed by GitHub 6f35d8d7 077deb8f

+116 -53
+116 -53
pkgs/tools/security/pinentry/default.nix
··· 1 - { stdenv 2 - , lib 3 - , fetchurl 4 - , fetchpatch 5 - , pkg-config 6 - , autoreconfHook 7 - , wrapGAppsHook3 8 - , libgpg-error 9 - , libassuan 10 - , libsForQt5 11 - , ncurses 12 - , gtk2 13 - , gcr 14 - , withLibsecret ? true 15 - , libsecret 1 + { 2 + stdenv, 3 + lib, 4 + fetchurl, 5 + fetchpatch, 6 + pkg-config, 7 + autoreconfHook, 8 + wrapGAppsHook3, 9 + libgpg-error, 10 + libassuan, 11 + libsForQt5, 12 + qt6, 13 + ncurses, 14 + gtk2, 15 + gcr, 16 + withLibsecret ? true, 17 + libsecret, 16 18 }: 17 19 18 20 let 19 21 flavorInfo = { 20 - tty = { flag = "tty"; }; 22 + tty = { 23 + flag = "tty"; 24 + }; 21 25 curses = { 22 26 flag = "curses"; 23 27 buildInputs = [ ncurses ]; ··· 31 35 buildInputs = [ gcr ]; 32 36 nativeBuildInputs = [ wrapGAppsHook3 ]; 33 37 }; 38 + qt5 = { 39 + flag = "qt5"; 40 + buildInputs = [ 41 + libsForQt5.qtbase 42 + libsForQt5.kwayland 43 + libsForQt5.qtx11extras 44 + ]; 45 + nativeBuildInputs = [ libsForQt5.wrapQtAppsHook ]; 46 + }; 34 47 qt = { 35 48 flag = "qt"; 36 - buildInputs = [ libsForQt5.qtbase ]; 37 - nativeBuildInputs = [ libsForQt5.wrapQtAppsHook ]; 49 + buildInputs = [ 50 + qt6.qtbase 51 + qt6.qtwayland 52 + ]; 53 + nativeBuildInputs = [ qt6.wrapQtAppsHook ]; 54 + }; 55 + emacs = { 56 + flag = "emacs"; 38 57 }; 39 - emacs = { flag = "emacs"; }; 40 58 }; 41 59 42 - buildPinentry = pinentryExtraPname: buildFlavors: 60 + buildPinentry = 61 + pinentryExtraPname: buildFlavors: 43 62 let 44 - enableFeaturePinentry = f: 45 - lib.enableFeature (lib.elem f buildFlavors) ("pinentry-" + flavorInfo.${f}.flag); 63 + enableFeaturePinentry = 64 + f: lib.enableFeature (lib.elem f buildFlavors) ("pinentry-" + flavorInfo.${f}.flag); 46 65 47 66 pinentryMkDerivation = 48 - if (lib.elem "qt" buildFlavors) 49 - then libsForQt5.mkDerivation 50 - else stdenv.mkDerivation; 51 - 67 + if (lib.elem "qt5" buildFlavors) then libsForQt5.mkDerivation else stdenv.mkDerivation; 52 68 in 53 69 pinentryMkDerivation rec { 54 70 pname = "pinentry-${pinentryExtraPname}"; 55 - version = "1.2.1"; 71 + version = "1.3.0"; 56 72 57 73 src = fetchurl { 58 74 url = "mirror://gnupg/pinentry/pinentry-${version}.tar.bz2"; 59 - hash = "sha256-RXoYXlqFI4+5RalV3GNSq5YtyLSHILYvyfpIx1QKQGc="; 75 + hash = "sha256-mzzVIm51l/L97TmaO8ZZkjNRU2VZ6dsIJpgbyjFklN4="; 60 76 }; 61 77 62 - nativeBuildInputs = [ pkg-config autoreconfHook ] 63 - ++ lib.concatMap (f: flavorInfo.${f}.nativeBuildInputs or [ ]) buildFlavors; 78 + nativeBuildInputs = [ 79 + pkg-config 80 + autoreconfHook 81 + ] ++ lib.concatMap (f: flavorInfo.${f}.nativeBuildInputs or [ ]) buildFlavors; 64 82 65 - buildInputs = [ libgpg-error libassuan ] 83 + buildInputs = 84 + [ 85 + libgpg-error 86 + libassuan 87 + ] 66 88 ++ lib.optional withLibsecret libsecret 67 89 ++ lib.concatMap (f: flavorInfo.${f}.buildInputs or [ ]) buildFlavors; 68 90 69 91 dontWrapGApps = true; 70 92 dontWrapQtApps = true; 71 93 72 - patches = [ 73 - ./autoconf-ar.patch 74 - ] ++ lib.optionals (lib.elem "gtk2" buildFlavors) [ 75 - (fetchpatch { 76 - 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"; 77 - sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd"; 78 - }) 79 - ]; 94 + patches = 95 + [ ./autoconf-ar.patch ] 96 + ++ lib.optionals (lib.elem "gtk2" buildFlavors) [ 97 + (fetchpatch { 98 + 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"; 99 + sha256 = "15r1axby3fdlzz9wg5zx7miv7gqx2jy4immaw4xmmw5skiifnhfd"; 100 + }) 101 + ]; 80 102 81 103 configureFlags = [ 82 104 "--with-libgpg-error-prefix=${libgpg-error.dev}" ··· 87 109 postInstall = 88 110 lib.optionalString (lib.elem "gnome3" buildFlavors) '' 89 111 wrapGApp $out/bin/pinentry-gnome3 90 - '' + lib.optionalString (lib.elem "qt" buildFlavors) '' 112 + '' 113 + + lib.optionalString (lib.elem "qt5" buildFlavors) '' 114 + wrapQtApp $out/bin/pinentry-qt5 115 + ln -sf $out/bin/pinentry-qt5 $out/bin/pinentry-qt 116 + '' 117 + + lib.optionalString (lib.elem "qt" buildFlavors) '' 91 118 wrapQtApp $out/bin/pinentry-qt 92 119 ''; 93 120 94 - passthru = { flavors = buildFlavors; }; 121 + passthru = { 122 + flavors = buildFlavors; 123 + }; 95 124 96 - meta = with lib; { 125 + meta = { 97 126 homepage = "https://gnupg.org/software/pinentry/index.html"; 98 127 description = "GnuPG’s interface to passphrase input"; 99 - license = licenses.gpl2Plus; 128 + license = lib.licenses.gpl2Plus; 100 129 platforms = 101 - if elem "gnome3" buildFlavors then platforms.linux else 102 - if elem "qt" buildFlavors then (remove "aarch64-darwin" platforms.all) else 103 - platforms.all; 130 + if lib.elem "gnome3" buildFlavors then 131 + lib.platforms.linux 132 + else if (lib.elem "qt5" buildFlavors || lib.elem "qt" buildFlavors) then 133 + (lib.remove "aarch64-darwin" lib.platforms.all) 134 + else 135 + lib.platforms.all; 104 136 longDescription = '' 105 137 Pinentry provides a console and (optional) GTK and Qt GUIs allowing users 106 138 to enter a passphrase when `gpg` or `gpg2` is run and needs it. 107 139 ''; 108 - maintainers = with maintainers; [ fpletz ]; 140 + maintainers = with lib.maintainers; [ fpletz ]; 109 141 mainProgram = "pinentry"; 110 142 }; 111 143 }; 112 144 in 113 145 { 114 - pinentry-curses = buildPinentry "curses" [ "curses" "tty" ]; 115 - pinentry-emacs = buildPinentry "emacs" [ "emacs" "curses" "tty" ]; 116 - pinentry-gnome3 = buildPinentry "gnome3" [ "gnome3" "curses" "tty" ]; 117 - pinentry-gtk2 = buildPinentry "gtk2" [ "gtk2" "curses" "tty" ]; 118 - pinentry-qt = buildPinentry "qt" [ "qt" "curses" "tty" ]; 146 + pinentry-curses = buildPinentry "curses" [ 147 + "curses" 148 + "tty" 149 + ]; 150 + pinentry-emacs = buildPinentry "emacs" [ 151 + "emacs" 152 + "curses" 153 + "tty" 154 + ]; 155 + pinentry-gnome3 = buildPinentry "gnome3" [ 156 + "gnome3" 157 + "curses" 158 + "tty" 159 + ]; 160 + pinentry-gtk2 = buildPinentry "gtk2" [ 161 + "gtk2" 162 + "curses" 163 + "tty" 164 + ]; 165 + pinentry-qt5 = buildPinentry "qt5" [ 166 + "qt5" 167 + "curses" 168 + "tty" 169 + ]; 170 + pinentry-qt = buildPinentry "qt" [ 171 + "qt" 172 + "curses" 173 + "tty" 174 + ]; 119 175 pinentry-tty = buildPinentry "tty" [ "tty" ]; 120 - pinentry-all = buildPinentry "all" [ "curses" "tty" "gtk2" "gnome3" "qt" "emacs" ]; 176 + pinentry-all = buildPinentry "all" [ 177 + "curses" 178 + "tty" 179 + "gtk2" 180 + "gnome3" 181 + "qt" 182 + "emacs" 183 + ]; 121 184 }