diff options
author | aszlig <aszlig@nix.build> | 2018-04-29 19:38:24 +0200 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2018-04-29 19:38:24 +0200 |
commit | 9b5a119972e9c2d327500638d89063f4fce243ec (patch) | |
tree | e2edb88c951326406deeb2f527444c5dfcd34f70 /pkgs | |
parent | 0c3e4e2626856261da20c741f8664dbe08e5cafc (diff) |
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 <aszlig@nix.build>
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/build-support/build-sandbox/default.nix | 8 |
1 files changed, 8 insertions, 0 deletions
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" ]; |