From c69a7311f62e626dd9741295561540ece75ab7e5 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Thu, 6 Feb 2025 00:15:17 +0100 Subject: [PATCH] gcr_4: build with ssh-agent This builds `gcr_4` with ssh-agent, in order to move away from `gnome-keyring-daemon`, which was [deprecated in 1.46.0](https://gitlab.gnome.org/GNOME/gnome-keyring/-/commit/25c5a1982467802fa12c6852b03c57924553ba73). Co-authored-by: lilyinstarlight --- pkgs/development/libraries/gcr/4.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/gcr/4.nix b/pkgs/development/libraries/gcr/4.nix index 33e85811a8f8..34a0e67a3e3a 100644 --- a/pkgs/development/libraries/gcr/4.nix +++ b/pkgs/development/libraries/gcr/4.nix @@ -1,4 +1,5 @@ { + pkgs, stdenv, lib, fetchurl, @@ -25,7 +26,9 @@ shared-mime-info, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd, }: - +let + ini = pkgs.formats.ini { }; +in stdenv.mkDerivation (finalAttrs: { pname = "gcr"; version = "4.4.0.1"; @@ -80,11 +83,20 @@ stdenv.mkDerivation (finalAttrs: { ]; mesonFlags = [ - # We are still using ssh-agent from gnome-keyring. - # https://github.com/NixOS/nixpkgs/issues/140824 - "-Dssh_agent=false" "-Dgpg_path=${lib.getBin gnupg}/bin/gpg" (lib.mesonEnable "systemd" systemdSupport) + "--cross-file=${ + ini.generate "cross-file.conf" { + binaries = + { + ssh-add = "'${lib.getExe' openssh "ssh-add"}'"; + ssh-agent = "'${lib.getExe' openssh "ssh-agent"}'"; + } + // lib.optionalAttrs systemdSupport { + systemctl = "'${lib.getExe' systemd "systemctl"}'"; + }; + } + }" ]; doCheck = false; # fails 21 out of 603 tests, needs dbus daemon