New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnuplot_full: init with support for lua/tikz/tex #32957
Conversation
@@ -58,6 +62,9 @@ stdenv.mkDerivation rec { | |||
|
|||
enableParallelBuilding = true; | |||
|
|||
# Set TEXINPUTS to include us | |||
setupHook = lib.optionalString (withTeXLive) ./setup-hook.sh; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this setupHook is necessary for tests, then users won't be able to use tikz
outside nix-shell
, right? To fix this, replace the hook with makeWrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that gnuplot doesn't need TEXINPUTS set, but instead latex will need to know how to find gnuplot's tex files when building the output created using the tikz terminal.
That doesn't mean there isn't a cleaner way, which would be welcome! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not tested this (except that it evaluates), but you can try:
-stdenv.mkDerivation rec {
+lib.fix (self: stdenv.mkDerivation rec {
- ++ lib.optional withTeXLive (texlive.combine { inherit (texlive) scheme-small; })
+ ++ lib.optional withTeXLive (texlive.combine { inherit (texlive) scheme-small self; })
- configureFlagsArray+=(--with-texdir=$out/share/texmf-nix/tex/latex/gnuplot)
+ configureFlagsArray+=(--with-texdir=$out/share/texmf/tex/latex/gnuplot)
-}
+})
EDIT: this is incorrect, it will not evaluate with withTeXLive
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, if runCommand "tikz-plot"
succeeds and it needs TEXINPUTS, then the wrapper should be an adequate replacement for setupHook, and it will also support users outside nix-shell. However, I'd prefer my snippet if it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gnuplot does not invoke tex-- and so setting TEXINPUTS in the tex we pass it doesn't help. Honestly I'm not entirely sure what purpose passing tex as a buildInput
does, I'm not sure it's used at runtime.
The workflow is instead that gnuplot, when using the tikz terminal, generates output that is "incomplete" and needs gnuplot's generated files to be properly build using texlive.
So when the user includes this output in a document (tikz-pdf
generates a basic example of this) the tex
used needs to know how to find these pieces, hence the setup-hook.
If a wrapper were used, it would need to wrap tex or something, I think.
tikz-plot
doesn't need any tex bits, or TEXINPUTS to be set, but rather it's that TEXINPUTS is how the tex
in tikz-pdf
knows to resolve the gnuplot tikz package/extensions.
At first I wanted to do something like:
texlive.combine { inherit (texlive) scheme-small; inherit gnuplot_full; }
For this purpose (the tex in tikz-pdf
, not input to gnuplot
build) which maybe would remove the need for the setup-hook and should work outside of nix-shell ... if it evaluated O:).
Unfortunately that's not really how texlive.combiine
is meant to work, so instead of faking a texlive package for gnuplot or something I went the setup-hook route.
Make sense?
Closing due to lack of interest (myself very much included), can revisit if someone is interested in this. |
Motivation for this change
#32941
Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)Test included that both demonstrates how to use gnuplot_full with tikz terminal, as well as verifying it continues to work moving forward.