1{ stdenv, fetchurl, perlPackages, ncurses, lynx, makeWrapper }:
2
3perlPackages.buildPerlPackage rec {
4 name = "wml-2.0.11";
5
6 src = fetchurl {
7 url = "http://thewml.org/distrib/${name}.tar.gz";
8 sha256 = "0jjxpq91x7y2mgixz7ghqp01m24qa37wl3zz515rrzv7x8cyy4cf";
9 };
10
11 # Getting lots of Non-ASCII character errors from pod2man.
12 # Inserting =encoding utf8 before the first =head occurrence.
13 # Wasn't able to fix mp4h.
14 preConfigure = ''
15 touch Makefile.PL
16 for i in wml_backend/p6_asubst/asubst.src wml_aux/freetable/freetable.src wml_docs/*.pod wml_include/des/*.src wml_include/fmt/*.src; do
17 sed -i '0,/^=head/{s/^=head/=encoding utf8\n=head/}' $i
18 done
19 sed -i 's/ doc / /g' wml_backend/p2_mp4h/Makefile.in
20 sed -i '/p2_mp4h\/doc/d' Makefile.in
21 '';
22
23 buildInputs = [ perlPackages.perl ncurses lynx makeWrapper ];
24
25 patches = [ ./redhat-with-thr.patch ./dynaloader.patch ./no_bitvector.patch ];
26
27 preFixup = ''
28 substituteInPlace $out/bin/wml \
29 --replace "File::PathConvert::realpath" "Cwd::realpath" \
30 --replace "File::PathConvert::abs2rel" "File::Spec->abs2rel" \
31 --replace "File::PathConvert" "File::Spec"
32
33 wrapProgram $out/bin/wml \
34 --set PERL5LIB ${with perlPackages; stdenv.lib.makePerlPath [
35 BitVector TermReadKey ImageSize
36 ]}
37 '';
38
39 enableParallelBuilding = true;
40
41 meta = with stdenv.lib; {
42 homepage = http://thewml.org/;
43 description = "Off-line HTML generation toolkit for Unix";
44 license = licenses.gpl2;
45 platforms = platforms.linux;
46 # Not sure what broke this build, it used to work
47 broken = true;
48 };
49}