From 9b5a119972e9c2d327500638d89063f4fce243ec Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 29 Apr 2018 19:38:24 +0200 Subject: pkgs/sandbox: Fix and pass through .desktop files Since the introduction and move of a few packages to use the sandbox, we no longer have XDG desktop entries, because the sandbox only creates wrappers for all programs in $drv/bin. This now also copies the XDG desktop files and replaces absolute paths to binaries to refer to the sandboxed binaries. I also modified the test to go through the XDG desktop file by default so we can ensure that this works properly. Signed-off-by: aszlig --- pkgs/build-support/build-sandbox/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'pkgs/build-support/build-sandbox') diff --git a/pkgs/build-support/build-sandbox/default.nix b/pkgs/build-support/build-sandbox/default.nix index fa4bac57..ba4f3625 100644 --- a/pkgs/build-support/build-sandbox/default.nix +++ b/pkgs/build-support/build-sandbox/default.nix @@ -68,6 +68,14 @@ in stdenv.mkDerivation ({ echo 'return true; }' >> params.c ''; + postInstall = '' + for df in "$drv/share/applications/"*.desktop; do + mkdir -p "$out/share/applications" + sed -e 's!'"$drv"'/bin!'"$out"'/bin!g' "$df" \ + > "$out/share/applications/$(basename "$df")" + done + ''; + nativeBuildInputs = [ pkgconfig ]; buildInputs = [ nix ]; makeFlags = [ "BINDIR=${drv}/bin" ]; -- cgit 1.4.1