diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2024-05-10 09:03:00 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2024-05-11 11:09:42 +0200 |
commit | 0d67b5508d11f4c5314df646cb92a5a7863f8fbd (patch) | |
tree | 7c54ce86464123c130a51aa9495b3693e0b8d387 /pkgs/tools/backup | |
parent | bb76cc9ce3407846c3759c4ddef69ca4ddfc6f88 (diff) |
duplicity: Fix finding Gio typelib
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.
Diffstat (limited to 'pkgs/tools/backup')
-rw-r--r-- | pkgs/tools/backup/duplicity/default.nix | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix index 1da3131f85b04..fd5c7c60f0c9e 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 = '' |