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
This commit is contained in:
Grimmauld
2025-03-21 11:15:22 +01:00
parent d733d5558a
commit 224f4b03b6
+7 -3
View File
@@ -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 = {