From a5a5d5c45d41be63f13a461135cffc82562642ba Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Wed, 22 Aug 2018 00:27:31 +0900 Subject: [PATCH 1/2] zathura: wrap binary in the wrapper --- pkgs/applications/misc/zathura/core/default.nix | 9 ++------- pkgs/applications/misc/zathura/wrapper.nix | 6 ++++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix index 56701cffb8c..3a5618b4c93 100644 --- a/pkgs/applications/misc/zathura/core/default.nix +++ b/pkgs/applications/misc/zathura/core/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, meson, ninja, makeWrapper, pkgconfig , appstream-glib, desktop-file-utils, python3 , gtk, girara, gettext, libxml2 -, file, sqlite, glib, texlive, libintl, libseccomp +, sqlite, glib, texlive, libintl, libseccomp , gtk-mac-integration, synctexSupport ? true }: @@ -24,16 +24,11 @@ stdenv.mkDerivation rec { ]; buildInputs = [ - file gtk girara libintl libseccomp + gtk girara libintl libseccomp sqlite glib ] ++ optional synctexSupport texlive.bin.core ++ optional stdenv.isDarwin [ gtk-mac-integration ]; - postInstall = '' - wrapProgram "$out/bin/zathura" \ - --prefix PATH ":" "${makeBinPath [ file ]}" - ''; - meta = { homepage = https://pwmt.org/projects/zathura/; description = "A core component for zathura PDF viewer"; diff --git a/pkgs/applications/misc/zathura/wrapper.nix b/pkgs/applications/misc/zathura/wrapper.nix index 64f617782f2..dfae9fa1c3a 100644 --- a/pkgs/applications/misc/zathura/wrapper.nix +++ b/pkgs/applications/misc/zathura/wrapper.nix @@ -1,4 +1,4 @@ -{ symlinkJoin, lib, makeWrapper, zathura_core, plugins ? [] }: +{ symlinkJoin, lib, makeWrapper, zathura_core, file, plugins ? [] }: let pluginsPath = lib.makeSearchPath "lib/zathura" plugins; @@ -11,7 +11,9 @@ in symlinkJoin { buildInputs = [ makeWrapper ]; postBuild = '' - wrapProgram $out/bin/zathura --add-flags --plugins-dir=${pluginsPath} + wrapProgram $out/bin/zathura \ + --prefix PATH ":" "${lib.makeBinPath [ file ]}" \ + --add-flags --plugins-dir=${pluginsPath} ''; meta = with lib; { From 7bf3f0911fc29e0e85b47e0960a569dc75a0f562 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Nakamura Date: Sun, 12 Aug 2018 02:04:06 +0900 Subject: [PATCH 2/2] zathura: keep wrapper's WM_CLASS consistent with wrapped binary --- pkgs/applications/misc/zathura/core/default.nix | 2 ++ pkgs/applications/misc/zathura/wrapper.nix | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix index 3a5618b4c93..4cf05a21636 100644 --- a/pkgs/applications/misc/zathura/core/default.nix +++ b/pkgs/applications/misc/zathura/core/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { sha256 = "1znr3psqda06xklzj8mn452w908llapcg1rj468jwpg0wzv6pxfn"; }; + outputs = [ "bin" "man" "dev" "out" ]; + nativeBuildInputs = [ meson ninja pkgconfig appstream-glib desktop-file-utils python3.pkgs.sphinx gettext makeWrapper libxml2 diff --git a/pkgs/applications/misc/zathura/wrapper.nix b/pkgs/applications/misc/zathura/wrapper.nix index dfae9fa1c3a..b81d12947e4 100644 --- a/pkgs/applications/misc/zathura/wrapper.nix +++ b/pkgs/applications/misc/zathura/wrapper.nix @@ -6,12 +6,12 @@ let in symlinkJoin { name = "zathura-with-plugins-${zathura_core.version}"; - paths = [ zathura_core ]; + paths = with zathura_core; [ man dev out ]; buildInputs = [ makeWrapper ]; postBuild = '' - wrapProgram $out/bin/zathura \ + makeWrapper ${zathura_core.bin}/bin/zathura $out/bin/zathura \ --prefix PATH ":" "${lib.makeBinPath [ file ]}" \ --add-flags --plugins-dir=${pluginsPath} '';