From 0d67b5508d11f4c5314df646cb92a5a7863f8fbd Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 10 May 2024 09:03:00 +0200 Subject: [PATCH] duplicity: Fix finding Gio typelib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, if a package just depended on GLib (or other bindings shipped with gobject-introspection), wrapper was not needed since `${gobject-introspection}/lib/girepository-1.0` is implicitly on typelib path. Now that GLib bindings were moved to `glib` package, `${glib}/lib/girepository-1.0` must be added to `GI_TYPELIB_PATH` by the wrapper (or `gobject-introspection` setup hook for build time). Simplest way to ensure that is using `wrapGApps*` hook. Let’s also ensure that there is just one wrapper instead of three. --- pkgs/tools/backup/duplicity/default.nix | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix index 1da3131f85b0..fd5c7c60f0c9 100644 --- a/pkgs/tools/backup/duplicity/default.nix +++ b/pkgs/tools/backup/duplicity/default.nix @@ -3,6 +3,7 @@ , fetchFromGitLab , python3 , librsync +, glib , ncftp , gnupg , gnutar @@ -10,6 +11,7 @@ , util-linux , rsync , makeWrapper +, wrapGAppsNoGuiHook , gettext , getconf , testers @@ -57,11 +59,14 @@ let self = python3.pkgs.buildPythonApplication rec { makeWrapper gettext python3.pkgs.wrapPython + wrapGAppsNoGuiHook python3.pkgs.setuptools-scm ]; buildInputs = [ librsync + # For Gio typelib + glib ]; pythonPath = with python3.pkgs; [ @@ -99,7 +104,10 @@ let self = python3.pkgs.buildPythonApplication rec { fasteners ]); - postInstall = let + # Prevent double wrapping, let the Python wrapper use the args in preFixup. + dontWrapGApps = true; + + preFixup = let binPath = lib.makeBinPath ([ gnupg ncftp @@ -107,8 +115,16 @@ let self = python3.pkgs.buildPythonApplication rec { ] ++ lib.optionals stdenv.isDarwin [ getconf ]); in '' - wrapProgram $out/bin/duplicity \ + makeWrapperArgsBak=("''${makeWrapperArgs[@]}") + makeWrapperArgs+=( + "''${gappsWrapperArgs[@]}" --prefix PATH : "${binPath}" + ) + ''; + + postFixup = '' + # Restore previous value for tests wrapping in preInstallCheck + makeWrapperArgs=("''${makeWrapperArgsBak[@]}") ''; preCheck = ''