Open lbssousa opened 2 years ago
It would be possible. But it's hard to decide which external packages and/or perl libs should be included. I don't know if it is helpful to add more external dependencies (the sdk is already quite bloated as it is).
I'm getting an error
Can't locate LatexIndent/Document.pm in @INC (you may need to install the LatexIndent::Document module) (@INC contains: /usr/lib/sdk/texlive/share/texmf-dist/scripts/latexindent /usr/lib/sdk/texlive/lib/perl5/site_perl/5.36.0/x86_64-linux /usr/lib/sdk/texlive/lib/perl5/site_perl/5.36.0 /usr/lib/sdk/texlive/lib/perl5/5.36.0/x86_64-linux /usr/lib/sdk/texlive/lib/perl5/5.36.0) at /usr/lib/sdk/texlive/bin/x86_64-linux/latexindent line 27.
BEGIN failed--compilation aborted at /usr/lib/sdk/texlive/bin/x86_64-linux/latexindent line 27.
In other words, LatexIndent::Document
is missing.
I'm pretty sure I had this working at some point so I'm not sure if something changed.
Also latexindent documentation (https://latexindentpl.readthedocs.io/en/latest/sec-appendices.html#ubuntu-debian) does seem to mandate the perl modules requested by OP so I think you should ship them
This seems like it can be fixed with
export PERL5LIB=/usr/lib/sdk/texlive/texmf-dist/scripts/latexindent
but I dont understand why it's necessary
OK no it does cause the error because there are missing perl modules
[13:34:42][Format][TeX] stderr: Can't locate File/HomeDir.pm in @INC (you may need to install the File::HomeDir module) (@INC contains: /usr/lib/sdk/texlive/share/texmf-dist/scripts/latexindent /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent /usr/lib/sdk/texlive/lib/perl5/site_perl/5.36.0/x86_64-linux /usr/lib/sdk/texlive/lib/perl5/site_perl/5.36.0 /usr/lib/sdk/texlive/lib/perl5/5.36.0/x86_64-linux /usr/lib/sdk/texlive/lib/perl5/5.36.0) at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 23.
BEGIN failed--compilation aborted at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/GetYamlSettings.pm line 23.
Compilation failed in require at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
BEGIN failed--compilation aborted at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/Verbatim.pm line 22.
Compilation failed in require at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
BEGIN failed--compilation aborted at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/Lines.pm line 22.
Compilation failed in require at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
BEGIN failed--compilation aborted at /usr/lib/sdk/texlive/texmf-dist/scripts/latexindent/LatexIndent/Document.pm line 28.
Compilation failed in require at /usr/lib/sdk/texlive/bin/x86_64-linux/latexindent line 27.
BEGIN failed--compilation aborted at /usr/lib/sdk/texlive/bin/x86_64-linux/latexindent line 27.
I swear this was working at some point but I think those modules should definitely ship with this otherwise part of the functionality of texlive is broken by default
Could you try to pass the following arguments?
--env=PERL5LIB=/app/texlive/lib/perl5/site_perl/5.34.0/:/app/texlive/lib/perl5/5.34.0/ # add include paths for Perl @INC variable
--env=LD_LIBRARY_PATH=/app/texlive/lib/:/app/texlive/lib/perl5/5.34.0/x86_64-linux/CORE/:/app/texlive/lib/perl5/5.34.0/aarch64-linux/CORE/ # add library paths
It doesn't fix the problem, also that path looks suspect to me anyway, I had to use /usr/lib/sdk/texlive
to find anything instead of /app/texlive
(which could be a function of the application I'm using, vscode)
That said the probem is that File::HomeDir
is missing (Can't locate File/HomeDir.pm
), which would be fixed by including the requisite perl package as the latexindent docs request.
I want to ping you on this again, I had to set up a new environment and was reminded of this issue
latexindent is part of the texlive package, latexindent requires these modules to run, therefore if this extension is shipping texlive it has to ship these perl libraries with it.
@Queuecumber Could you try https://github.com/flathub/org.freedesktop.Sdk.Extension.texlive/pull/143 when the build is done?
Absolutely, how do I try it?
That is actually a good question.
FYI this has been reported a number of times in macOS too, the solutions involve installing the missing Perl packages with cpan. An alternative is to install it with brew using this formula. As you can see it's installing a number of Perl packages. In my case I use basictex, so I assumed they were missing because of that and would be shipped by the full distribution, but maybe not.
Would it be possible to include the following perl modules in order to make
latexindent
work properly?File/Homedir.pm
YAML/Tiny.pm
Unicode/GCString.pm