nixpkgs/pkgs/tools/misc/latex2html/default.nix
volth 46420bbaa3 treewide: name -> pname (easy cases) (#66585)
treewide replacement of

stdenv.mkDerivation rec {
  name = "*-${version}";
  version = "*";

to pname
2019-08-15 13:41:18 +01:00

53 lines
1.6 KiB
Nix

{ stdenv, fetchurl, makeWrapper
, ghostscript, netpbm, perl }:
# TODO: withTex
# Ported from Homebrew.
# https://github.com/Homebrew/homebrew-core/blob/21834573f690407d34b0bbf4250b82ec38dda4d6/Formula/latex2html.rb
stdenv.mkDerivation rec {
pname = "latex2html";
version = "2018";
src = fetchurl {
url = "http://mirrors.ctan.org/support/latex2html/latex2html-${version}.tar.gz";
sha256 = "1qnlg8ajh0amy9gy8rh8sp1l224ak54264i3dhk7rrv9s4k7bqq9";
};
buildInputs = [ ghostscript netpbm perl ];
nativeBuildInputs = [ makeWrapper ];
configurePhase = ''
./configure \
--prefix="$out" \
--without-mktexlsr \
--with-texpath=$out/share/texmf/tex/latex/html
'';
postInstall = ''
for p in $out/bin/{latex2html,pstoimg}; do \
wrapProgram $p --add-flags '--tmp="''${TMPDIR:-/tmp}"'
done
'';
meta = with stdenv.lib; {
description = "LaTeX-to-HTML translator";
longDescription = ''
A Perl program that translates LaTeX into HTML (HyperText Markup
Language), optionally creating separate HTML files corresponding to each
unit (e.g., section) of the document. LaTeX2HTML proceeds by interpreting
LaTeX (to the best of its abilities). It contains definitions from a wide
variety of classes and packages, and users may add further definitions by
writing Perl scripts that provide information about class/package
commands.
'';
homepage = https://www.ctan.org/pkg/latex2html;
license = licenses.gpl2;
platforms = with platforms; linux ++ darwin;
maintainers = with maintainers; [ yurrriq ];
};
}