From d152a71090cc8ce005d41a1eea29a8a76e18a977 Mon Sep 17 00:00:00 2001 From: aucub <78630225+aucub@users.noreply.github.com> Date: Tue, 17 Dec 2024 07:30:50 +0800 Subject: [PATCH] zathura: wrap zathura-sandbox --- pkgs/applications/misc/zathura/wrapper.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/misc/zathura/wrapper.nix b/pkgs/applications/misc/zathura/wrapper.nix index 282034cc6b38..6f5d5bcee4e1 100644 --- a/pkgs/applications/misc/zathura/wrapper.nix +++ b/pkgs/applications/misc/zathura/wrapper.nix @@ -16,6 +16,7 @@ zathura_cb (if useMupdf then zathura_pdf_mupdf else zathura_pdf_poppler) ], + stdenv, }: symlinkJoin { inherit (zathura_core) version; @@ -36,7 +37,12 @@ symlinkJoin { let fishCompletion = "share/fish/vendor_completions.d/zathura.fish"; in - '' + (lib.optionalString stdenv.hostPlatform.isLinux '' + makeWrapper ${zathura_core.bin}/bin/zathura-sandbox $out/bin/zathura-sandbox \ + --prefix PATH ":" "${lib.makeBinPath [ file ]}" \ + --prefix ZATHURA_PLUGINS_PATH : "$out/lib/zathura" + '') + + '' makeWrapper ${zathura_core.bin}/bin/zathura $out/bin/zathura \ --prefix PATH ":" "${lib.makeBinPath [ file ]}" \ --prefix ZATHURA_PLUGINS_PATH : "$out/lib/zathura" @@ -46,11 +52,11 @@ symlinkJoin { # so we need to fix the path to reference $out instead. rm "$out/${fishCompletion}" substitute "${zathura_core.out}/${fishCompletion}" "$out/${fishCompletion}" \ - --replace "${zathura_core.out}" "$out" + --replace-fail "${zathura_core.out}" "$out" ''; - meta = with lib; { - homepage = "https://pwmt.org/projects/zathura/"; + meta = { + homepage = "https://pwmt.org/projects/zathura"; description = "Highly customizable and functional PDF viewer"; longDescription = '' Zathura is a highly customizable and functional PDF viewer based on the @@ -58,9 +64,9 @@ symlinkJoin { is an application that provides a minimalistic and space saving interface as well as an easy usage that mainly focuses on keyboard interaction. ''; - license = licenses.zlib; - platforms = platforms.unix; - maintainers = with maintainers; [ + license = lib.licenses.zlib; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ smironov globin TethysSvensson