Skip to content
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

texlive.bin.pygmentex: use new bin container instead of buildPythonApplication #248745

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions pkgs/tools/typesetting/tex/texlive/bin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -387,43 +387,6 @@ dvipng = stdenv.mkDerivation {
enableParallelBuilding = true;
};

pygmentex = python3Packages.buildPythonApplication rec {
pname = "pygmentex";
inherit (src) version;
format = "other";

src = assertFixedHash pname (lib.head (builtins.filter (p: p.tlType == "run") texlive.pygmentex.pkgs));

propagatedBuildInputs = with python3Packages; [ pygments chardet ];

dontBuild = true;

doCheck = false;

installPhase = ''
runHook preInstall

install -D ./scripts/pygmentex/pygmentex.py "$out"/bin/pygmentex

runHook postInstall
'';

meta = with 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.
'';
license = licenses.lppl13c;
maintainers = with maintainers; [ romildo ];
};
};

inherit asymptote;

inherit biber;
Expand Down
6 changes: 4 additions & 2 deletions pkgs/tools/typesetting/tex/texlive/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ let
ulqda.extraBuildInputs = [ (perl.withPackages (ps: with ps; [ DigestSHA1 ])) ];

#### python packages
pygmentex.extraBuildInputs = [ (python3.withPackages (ps: with ps; [ pygments chardet ])) ];
pythontex.extraBuildInputs = [ (python3.withPackages (ps: with ps; [ pygments ])) ];

#### other runtime PATH dependencies
Expand Down Expand Up @@ -618,13 +619,14 @@ in

bin = assert assertions; bin // {
# for backward compatibility
latexindent = lib.findFirst (p: p.tlType == "bin") tl.latexindent.pkgs;
latexindent = lib.findFirst (p: p.tlType == "bin") null tl.latexindent.pkgs;
pygmentex = lib.findFirst (p: p.tlType == "bin") null tl.pygmentex.pkgs;
};
combine = assert assertions; combine;

# Pre-defined combined packages for TeX Live schemes,
# to make nix-env usage more comfortable and build selected on Hydra.
combined = with lib;
combined = assert assertions; with lib;
let
# these license lists should be the sorted union of the licenses of the packages the schemes contain.
# The correctness of this collation is tested by tests.texlive.licenses
Expand Down
6 changes: 4 additions & 2 deletions pkgs/tools/typesetting/tex/texlive/patch-scripts.sed
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
1{
/python/{
N;
N
# add script folder to path, unless we interfere with a docstring
/\nr"""/b skip-python-path-patch
s!\n!\nimport sys; sys.path.insert(0,'@scriptsFolder@')\n!
# skip encoding declarations
/\n\s*#.*coding[=:]\s*[-a-zA-Z0-9_.]/N
s!\n\([^\n]*\)$!\nimport sys; sys.path.insert(0,'@scriptsFolder@')\n\1!
:skip-python-path-patch
}

Expand Down