From 042afa604cfd90f5386ad25cfc90cb12442e43ec Mon Sep 17 00:00:00 2001 From: Markus Hauck Date: Thu, 10 Oct 2024 08:32:28 +0200 Subject: [PATCH] gpclient: add gio-networking for embedded browser Without this, login with the non-external browser results in: > 2024-10-10T06:15:23Z WARN gpauth::auth_window] Failed to load uri: with error: TLS/SSL support not available; install glib-networking The login flow seems to work after adding glib-networking to GIO_EXTRA_MODULES by wrapping the `gpclient` program. --- pkgs/by-name/gp/gpclient/package.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/gp/gpclient/package.nix b/pkgs/by-name/gp/gpclient/package.nix index 786123e74d44..49277a0a2462 100644 --- a/pkgs/by-name/gp/gpclient/package.nix +++ b/pkgs/by-name/gp/gpclient/package.nix @@ -1,6 +1,8 @@ { rustPlatform, + glib-networking, gpauth, + makeWrapper, openconnect, openssl, perl, @@ -15,11 +17,15 @@ rustPlatform.buildRustPackage rec { buildAndTestSubdir = "apps/gpclient"; cargoHash = "sha256-aJYFBvVrj1n2+9WLLBH5WTRRzTle19LsdJ2DielJYik="; - nativeBuildInputs = [ perl ]; + nativeBuildInputs = [ + perl + makeWrapper + ]; buildInputs = [ gpauth openconnect openssl + glib-networking ]; preConfigure = '' @@ -34,6 +40,11 @@ rustPlatform.buildRustPackage rec { cp packaging/files/usr/share/applications/gpgui.desktop $out/share/applications/gpgui.desktop ''; + preFixup = '' + wrapProgram "$out/bin/gpclient" \ + --prefix GIO_EXTRA_MODULES : ${glib-networking}/lib/gio/modules + ''; + postFixup = '' substituteInPlace $out/share/applications/gpgui.desktop \ --replace-fail /usr/bin/gpclient $out/bin/gpclient