From 224f4b03b673e38efbe1084cae5a7dce0624dbea Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Fri, 21 Mar 2025 11:15:22 +0100 Subject: [PATCH] graphviz: provide $PATH to vimdot vimdot expects dot to be in $PATH [1]. This meant previoiusly vimdot would only work if graphviz was in the $PATH, breaking vimdot in certain scenarios (e.g. executing `result/bin/vimdot`). Wrapping vimdot to put the graphviz output bin into PATH fixes this issue. [1] https://gitlab.com/graphviz/graphviz/-/blob/2649f2366435525085cc79fb1e95ec23c84eb047/plugin/xlib/vimdot.sh#L45 --- pkgs/tools/graphics/graphviz/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/graphics/graphviz/default.nix b/pkgs/tools/graphics/graphviz/default.nix index 79f5bac7f88c..9bc51c2183b0 100644 --- a/pkgs/tools/graphics/graphviz/default.nix +++ b/pkgs/tools/graphics/graphviz/default.nix @@ -12,6 +12,7 @@ , libjpeg , libpng , libtool +, makeWrapper , pango , bash , bison @@ -43,6 +44,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook + makeWrapper pkg-config python3 bison @@ -81,9 +83,11 @@ stdenv.mkDerivation rec { postFixup = optionalString withXorg '' substituteInPlace $out/bin/vimdot \ - --replace '"/usr/bin/vi"' '"$(command -v vi)"' \ - --replace '"/usr/bin/vim"' '"$(command -v vim)"' \ - --replace /usr/bin/vimdot $out/bin/vimdot \ + --replace-warn '"/usr/bin/vi"' '"$(command -v vi)"' \ + --replace-warn '"/usr/bin/vim"' '"$(command -v vim)"' \ + --replace-warn /usr/bin/vimdot $out/bin/vimdot + + wrapProgram $out/bin/vimdot --prefix PATH : "$out/bin" ''; passthru.tests = {