1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "html2text";
5 version = "1.3.2a";
6
7 src = fetchurl {
8 url = "http://www.mbayer.de/html2text/downloads/html2text-${version}.tar.gz";
9 sha256 = "000b39d5d910b867ff7e087177b470a1e26e2819920dcffd5991c33f6d480392";
10 };
11
12 preConfigure = ''
13 substituteInPlace configure \
14 --replace /bin/echo echo \
15 --replace CXX=unknown ':'
16 '' + lib.optionalString stdenv.cc.isClang ''
17 substituteInPlace HTMLParser.C \
18 --replace "register " ""
19 '';
20
21 # the --prefix has no effect
22 installPhase = ''
23 mkdir -p $out/bin $out/man/man{1,5}
24 cp html2text $out/bin
25 cp html2text.1.gz $out/man/man1
26 cp html2textrc.5.gz $out/man/man5
27 '';
28
29 meta = {
30 description = "Convert HTML to plain text";
31 homepage = "http://www.mbayer.de/html2text/";
32 license = lib.licenses.gpl2Plus;
33 platforms = lib.platforms.unix;
34 maintainers = [ lib.maintainers.eikek ];
35 };
36}