texlive.combine: allow dependencies for python scripts#55933
texlive.combine: allow dependencies for python scripts#55933romildo wants to merge 2 commits intoNixOS:masterfrom romildo:fix.texlive
Conversation
|
Thank you for looking into this. The problem is a bit more general than just the python case here. For example we have the same issue but with perl in #35537. I think the correct solution should be using the |
But there is the accompanying latex style file, which needs to be visible by latex and friends. |
|
@veprbl I have tried your suggestion to provide the complete For that purpose I changed the { stdenv, fetchFromBitbucket, python2Packages }:
python2Packages.buildPythonApplication rec {
pname = "pygmentex";
version = "0.8";
tlType = "run";
src = fetchFromBitbucket {
owner = "romildo";
repo = pname;
rev = version;
sha256 = "07dnv7hgppy15bda2kcbrlvfqzl6lhza80klc7133dwg8q92hm6m";
};
pythonPath = with python2Packages; [ pygments chardet ];
dontBuild = true;
doCheck = false;
installPhase = ''
mkdir -p $out/bin
cp -a pygmentex.py $out/bin
mkdir -p $out/tex/latex/pygmentex
cp -a pygmentex.sty $out/tex/latex/pygmentex
mkdir -p $out/doc/latex/pygmentex
cp -a README demo.* blueshade.png Factorial.java $out/doc/latex/pygmentex
'';
meta = with stdenv.lib; {
homepage = https://www.ctan.org/pkg/pygmentex;
description = "Auxiliary tool for typesetting code listings in LaTeX documents using Pygments";
longDescription = ''
PygmenTeX is a Python-based LaTeX package that can be used for
typesetting code listings in a LaTeX document using Pygments.
Pygments is a generic syntax highlighter for general use in all kinds of
software such as forum systems, wikis or other applications that need to
prettify source code.
This package installs just the script needed to process code listings
snippets extracted from the a LaTeX document by the pygmentex LaTeX
package. In order to use it effectivelly the texlive package pygmentex
also has to be installed. This can be done by adding pygmentex to
texlive.combine.
'';
license = licenses.lppl13c;
platforms = platforms.unix;
maintainers = with maintainers; [ romildo ];
};
}To test I used It works. Some downsides:
I think I still would prefer the solution presented by this PR, which wraps the python script setting |
|
@romildo I think this is a step in the right direction. If you could submit this as PR, I would gladly review it. As for this PR, I'm not yet convinced that this is the best solution. We are looking to fix not only pygmentex here, but few others. We already have a mature infrastructure for providing wrappers for scripted languages (commonly engaged via
Is this because you fetch src from your repo, so the source differs? What is the downside of that? |
Yes. Pygmentex would not update together with texlive when a new texlive is available. But this is minor. |
|
@romildo I don't see a problem with that. You are the upstream, so we probably get the best version of pygmentex here. The way we package texlive, from snapshots of a rolling release, there isn't really much guarantee about versions of things in the first place, I think. But we could, of course, change |
|
During a routine bump of texlive I found out how to override If you want to tie |
Motivation for this change
Some Python scripts from
texlivedepend on some Python modules and up to now there was no way of specifying them, given them a broken state.This PR allows to specify those dependencies, which are taken into account when wrapping the Python scripts.
It is a much better fix for #10885.
Tested with:
cc @vcunat
Things done
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)