nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeWrapper,
6 ghostscript,
7 netpbm,
8 perl,
9}:
10# TODO: withTex
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "latex2html";
14 version = "2025";
15
16 src = fetchFromGitHub {
17 owner = "latex2html";
18 repo = "latex2html";
19 rev = "v${finalAttrs.version}";
20 sha256 = "sha256-xylIU2GY/1t9mA8zJzEjHwAIlvVxZmUAUdQ/IXEy+Wg=";
21 };
22
23 buildInputs = [
24 ghostscript
25 netpbm
26 perl
27 ];
28
29 nativeBuildInputs = [ makeWrapper ];
30
31 configurePhase = ''
32 runHook preConfigure
33
34 ./configure \
35 --prefix="$out" \
36 --without-mktexlsr \
37 --with-texpath=$out/share/texmf/tex/latex/html
38
39 runHook postConfigure
40 '';
41
42 postInstall = ''
43 for p in $out/bin/{latex2html,pstoimg}; do \
44 wrapProgram $p --add-flags '--tmp="''${TMPDIR:-/tmp}"'
45 done
46 '';
47
48 meta = {
49 description = "LaTeX-to-HTML translator";
50 longDescription = ''
51 A Perl program that translates LaTeX into HTML (HyperText Markup
52 Language), optionally creating separate HTML files corresponding to each
53 unit (e.g., section) of the document. LaTeX2HTML proceeds by interpreting
54 LaTeX (to the best of its abilities). It contains definitions from a wide
55 variety of classes and packages, and users may add further definitions by
56 writing Perl scripts that provide information about class/package
57 commands.
58 '';
59
60 homepage = "https://www.ctan.org/pkg/latex2html";
61
62 license = lib.licenses.gpl2Only;
63 platforms = with lib.platforms; linux ++ darwin;
64 maintainers = with lib.maintainers; [ yurrriq ];
65 };
66})