From adbba9d5f6f1769fe3bedc7033910cfbd8c9c2c6 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 18 Jul 2017 01:44:55 +0200 Subject: [PATCH 1/6] gnome3.gcr: propagate pkg-config dependencies The pinentry_gnome package requires gcr. Unfortunately, when configure asks about the library (or `pkg-config --libs gcr-base-3` is used) it fails because glib is not in scope. ``` $ pkg-config --libs gcr-base-3 Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable Package 'glib-2.0', required by 'gcr-base-3', not found ``` This commit moves glib and gtk to `propagatedBuildInputs` so pkgconfig could find them. See also 38b58bab62d60c3cd8a1cb0d3ccf3ade5d9cb2ee --- pkgs/desktops/gnome-3/core/gcr/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/desktops/gnome-3/core/gcr/default.nix b/pkgs/desktops/gnome-3/core/gcr/default.nix index 0798d69f9e6..e04bb734aea 100644 --- a/pkgs/desktops/gnome-3/core/gcr/default.nix +++ b/pkgs/desktops/gnome-3/core/gcr/default.nix @@ -8,11 +8,11 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; buildInputs = [ - pkgconfig intltool gnupg glib gobjectIntrospection libxslt - libgcrypt libtasn1 dbus_glib gtk pango gdk_pixbuf atk makeWrapper vala_0_32 + pkgconfig intltool gnupg gobjectIntrospection libxslt + libgcrypt libtasn1 dbus_glib pango gdk_pixbuf atk makeWrapper vala_0_32 ]; - propagatedBuildInputs = [ p11_kit ]; + propagatedBuildInputs = [ glib gtk p11_kit ]; #doCheck = true; From 4ad98786a0dd5b87f0d200ec27c05e02fceee3b9 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Mon, 17 Jul 2017 22:37:09 +0200 Subject: [PATCH 2/6] pinentry: add GNOME 3 frontend support --- pkgs/tools/security/pinentry/default.nix | 7 ++++--- pkgs/top-level/all-packages.nix | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix index 667831373c5..51fd4714161 100644 --- a/pkgs/tools/security/pinentry/default.nix +++ b/pkgs/tools/security/pinentry/default.nix @@ -1,12 +1,12 @@ { fetchurl, fetchpatch, stdenv, lib, pkgconfig -, libgpgerror, libassuan, libcap ? null, ncurses ? null, gtk2 ? null, qt4 ? null +, libgpgerror, libassuan, libcap ? null, ncurses ? null, gtk2 ? null, gcr ? null, qt4 ? null }: let mkFlag = pfxTrue: pfxFalse: cond: name: "--${if cond then pfxTrue else pfxFalse}-${name}"; mkEnable = mkFlag "enable" "disable"; mkWith = mkFlag "with" "without"; - hasX = gtk2 != null || qt4 != null; + hasX = gtk2 != null || gcr != null || qt4 != null; in with stdenv.lib; stdenv.mkDerivation rec { @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { sha256 = "0ni7g4plq6x78p32al7m8h2zsakvg1rhfz0qbc3kdc7yq7nw4whn"; }; - buildInputs = [ libgpgerror libassuan libcap gtk2 ncurses qt4 ]; + buildInputs = [ libgpgerror libassuan libcap gtk2 gcr ncurses qt4 ]; prePatch = '' substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses @@ -44,6 +44,7 @@ stdenv.mkDerivation rec { (mkEnable (ncurses != null) "pinentry-curses") (mkEnable true "pinentry-tty") (mkEnable (gtk2 != null) "pinentry-gtk2") + (mkEnable (gcr != null) "pinentry-gnome3") (mkEnable (qt4 != null) "pinentry-qt4") ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0fced3a1bb8..97815af9045 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3866,6 +3866,10 @@ with pkgs; gtk2 = null; }; + pinentry_gnome = pinentry_ncurses.override { + gcr = gnome3.gcr; + }; + pinentry_qt4 = pinentry_ncurses.override { inherit qt4; }; From 75bf151d251e3dc03e3188991f36c482f6eeed7d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 18 Jul 2017 04:32:36 +0200 Subject: [PATCH 3/6] pinentry: fix configure arguments pinentry 0.9.6 changed the `qt4` flag to just `qt`. Additionally, the `--with-x` option has not been there for a while. This commit renames and removes the flags, respectively. --- pkgs/tools/security/pinentry/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/tools/security/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix index 51fd4714161..10a9d3504ac 100644 --- a/pkgs/tools/security/pinentry/default.nix +++ b/pkgs/tools/security/pinentry/default.nix @@ -6,7 +6,6 @@ let mkFlag = pfxTrue: pfxFalse: cond: name: "--${if cond then pfxTrue else pfxFalse}-${name}"; mkEnable = mkFlag "enable" "disable"; mkWith = mkFlag "with" "without"; - hasX = gtk2 != null || gcr != null || qt4 != null; in with stdenv.lib; stdenv.mkDerivation rec { @@ -40,12 +39,11 @@ stdenv.mkDerivation rec { configureFlags = [ (mkWith (libcap != null) "libcap") - (mkWith (hasX) "x") (mkEnable (ncurses != null) "pinentry-curses") (mkEnable true "pinentry-tty") (mkEnable (gtk2 != null) "pinentry-gtk2") (mkEnable (gcr != null) "pinentry-gnome3") - (mkEnable (qt4 != null) "pinentry-qt4") + (mkEnable (qt4 != null) "pinentry-qt") ]; nativeBuildInputs = [ pkgconfig ]; From feddf1b2780cb97e120d3102259084c15dbd975f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 18 Jul 2017 06:06:57 +0200 Subject: [PATCH 4/6] pinentry: add optional libsecret dependency libsecret is used for cacheing passwords. --- pkgs/tools/security/pinentry/default.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/security/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix index 10a9d3504ac..0d957fc97e0 100644 --- a/pkgs/tools/security/pinentry/default.nix +++ b/pkgs/tools/security/pinentry/default.nix @@ -1,5 +1,5 @@ { fetchurl, fetchpatch, stdenv, lib, pkgconfig -, libgpgerror, libassuan, libcap ? null, ncurses ? null, gtk2 ? null, gcr ? null, qt4 ? null +, libgpgerror, libassuan, libcap ? null, libsecret ? null, ncurses ? null, gtk2 ? null, gcr ? null, qt4 ? null }: let @@ -16,7 +16,7 @@ stdenv.mkDerivation rec { sha256 = "0ni7g4plq6x78p32al7m8h2zsakvg1rhfz0qbc3kdc7yq7nw4whn"; }; - buildInputs = [ libgpgerror libassuan libcap gtk2 gcr ncurses qt4 ]; + buildInputs = [ libgpgerror libassuan libcap libsecret gtk2 gcr ncurses qt4 ]; prePatch = '' substituteInPlace pinentry/pinentry-curses.c --replace ncursesw ncurses @@ -38,12 +38,13 @@ stdenv.mkDerivation rec { ''; configureFlags = [ - (mkWith (libcap != null) "libcap") - (mkEnable (ncurses != null) "pinentry-curses") - (mkEnable true "pinentry-tty") - (mkEnable (gtk2 != null) "pinentry-gtk2") - (mkEnable (gcr != null) "pinentry-gnome3") - (mkEnable (qt4 != null) "pinentry-qt") + (mkWith (libcap != null) "libcap") + (mkEnable (libsecret != null) "libsecret") + (mkEnable (ncurses != null) "pinentry-curses") + (mkEnable true "pinentry-tty") + (mkEnable (gtk2 != null) "pinentry-gtk2") + (mkEnable (gcr != null) "pinentry-gnome3") + (mkEnable (qt4 != null) "pinentry-qt") ]; nativeBuildInputs = [ pkgconfig ]; From b34a8912955ef23c166e4f3d0e5af42f1c10c24a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 18 Jul 2017 15:54:47 +0200 Subject: [PATCH 5/6] gnome3.gcr: prevent dependency cycle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When overriding gnupg to uss pinentry gnome3 frontend, there is a dependency cycle: gnupg → pinentry_gnome → gcr → gnupg This commit overrides the gnupg required by gcr to not build GUI. --- pkgs/desktops/gnome-3/core/gcr/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome-3/core/gcr/default.nix b/pkgs/desktops/gnome-3/core/gcr/default.nix index e04bb734aea..21b9d89e3c3 100644 --- a/pkgs/desktops/gnome-3/core/gcr/default.nix +++ b/pkgs/desktops/gnome-3/core/gcr/default.nix @@ -7,8 +7,10 @@ stdenv.mkDerivation rec { outputs = [ "out" "dev" ]; - buildInputs = [ - pkgconfig intltool gnupg gobjectIntrospection libxslt + buildInputs = let + gpg = gnupg.override { guiSupport = false; }; # prevent build cycle with pinentry_gnome + in [ + pkgconfig intltool gpg gobjectIntrospection libxslt libgcrypt libtasn1 dbus_glib pango gdk_pixbuf atk makeWrapper vala_0_32 ]; From 3f7e3db74426f658b4625505d262c1f7b288606d Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sun, 3 Sep 2017 18:32:50 +0200 Subject: [PATCH 6/6] pinentry: make GTK3 the default front-end See: https://github.com/NixOS/nixpkgs/issues/18559 --- nixos/modules/config/no-x-libs.nix | 2 +- pkgs/top-level/all-packages.nix | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/nixos/modules/config/no-x-libs.nix b/nixos/modules/config/no-x-libs.nix index ae3e17ac27b..ec3103b4a40 100644 --- a/nixos/modules/config/no-x-libs.nix +++ b/nixos/modules/config/no-x-libs.nix @@ -35,7 +35,7 @@ with lib; networkmanager_pptp = pkgs.networkmanager_pptp.override { withGnome = false; }; networkmanager_vpnc = pkgs.networkmanager_vpnc.override { withGnome = false; }; networkmanager_iodine = pkgs.networkmanager_iodine.override { withGnome = false; }; - pinentry = pkgs.pinentry.override { gtk2 = null; qt4 = null; }; + pinentry = pkgs.pinentry.override { gcr = null; gtk2 = null; qt4 = null; }; }; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 97815af9045..b778fa33146 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3860,14 +3860,16 @@ with pkgs; pinentry = callPackage ../tools/security/pinentry { libcap = if stdenv.isDarwin then null else libcap; qt4 = null; + gtk2 = null; + gcr = gnome3.gcr; }; pinentry_ncurses = pinentry.override { - gtk2 = null; + gcr = null; }; - pinentry_gnome = pinentry_ncurses.override { - gcr = gnome3.gcr; + pinentry_gtk2 = pinentry_ncurses.override { + inherit gtk2; }; pinentry_qt4 = pinentry_ncurses.override {