git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #65339 from ttuegel/wrap-pinentry_qt5

pinentry: Use qt5.wrapQtApps as needed

commit294e75e832594cda1a25df817f7717adb9ed49b6 authorThomas Tuegel <ttuegel@mailbox.org> dateWed 24 Jul 2019, 16:07 (7 years ago) parent5806e719235a8e
3 files changed+25−7
nixos/modules/config/no-x-libs.nix+1−1 pkgs/tools/security/pinentry/default.nix+18−4 pkgs/top-level/all-packages.nix+6−2
nixos/modules/config/no-x-libs.nix+1−1
@@ -34,7 +34,7 @@ with lib;
3434 networkmanager-openvpn = super.networkmanager-openvpn.override { withGnome = false; };
3535 networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; };
3636 networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; };
37− pinentry = super.pinentry.override { gtk2 = null; gcr = null; qt = null; };
37+ pinentry = super.pinentry.override { gtk2 = null; gcr = null; qt4 = null; qt5 = null; };
3838 gobject-introspection = super.gobject-introspection.override { x11Support = false; };
3939 }));
4040 };
pkgs/tools/security/pinentry/default.nix+18−4
@@ -1,9 +1,21 @@
11{ fetchurl, fetchpatch, stdenv, lib, pkgconfig
2−, libgpgerror, libassuan, libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null, qt ? null
2+, libgpgerror, libassuan
3+, libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null
4+, qt4 ? null, qt5 ? null
35, enableEmacs ? false
46}:
57
6−stdenv.mkDerivation rec {
8+assert qt5 != null -> qt4 == null;
9+assert qt4 != null -> qt5 == null;
10+
11+let
12+ mkDerivation =
13+ if qt5 != null
14+ then qt5.mkDerivation
15+ else stdenv.mkDerivation;
16+in
17+
18+mkDerivation rec {
719 name = "pinentry-1.1.0";
820
921 src = fetchurl {
@@ -12,7 +24,9 @@ stdenv.mkDerivation rec {
1224 };
1325
1426 nativeBuildInputs = [ pkgconfig ];
15− buildInputs = [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt ];
27+ buildInputs =
28+ [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt4 ]
29+ ++ stdenv.lib.optional (qt5 != null) qt5.qtbase;
1630
1731 prePatch = ''
1832 substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses
@@ -34,7 +48,7 @@ stdenv.mkDerivation rec {
3448 (stdenv.lib.enableFeature enableEmacs "pinentry-emacs")
3549 (stdenv.lib.enableFeature (gtk2 != null) "pinentry-gtk2")
3650 (stdenv.lib.enableFeature (gcr != null) "pinentry-gnome3")
37− (stdenv.lib.enableFeature (qt != null) "pinentry-qt")
51+ (stdenv.lib.enableFeature (qt4 != null || qt5 != null) "pinentry-qt")
3852
3953 "--with-libassuan-prefix=${libassuan.dev}"
4054 "--with-libgpg-error-prefix=${libgpgerror.dev}"
pkgs/top-level/all-packages.nix+6−2
@@ -5318,6 +5318,8 @@ in
53185318 pinentry = callPackage ../tools/security/pinentry {
53195319 libcap = if stdenv.isDarwin then null else libcap;
53205320 gcr = null;
5321+ qt4 = null;
5322+ qt5 = null;
53215323 };
53225324
53235325 pinentry_ncurses = res.pinentry.override {
@@ -5333,11 +5335,13 @@ in
53335335 };
53345336
53355337 pinentry_qt4 = res.pinentry.override {
5336− qt = qt4;
5338+ gtk2 = null;
5339+ inherit qt4;
53375340 };
53385341
53395342 pinentry_qt5 = res.pinentry.override {
5340− qt = qt5.qtbase;
5343+ gtk2 = null;
5344+ inherit qt5;
53415345 };
53425346
53435347 pinentry_mac = callPackage ../tools/security/pinentry/mac.nix {