1 { lib, fetchurl, perlPackages, ncurses, lynx, makeWrapper }:
3 perlPackages.buildPerlPackage {
8 url = "http://thewml.org/distrib/wml-2.0.11.tar.gz";
9 sha256 = "0jjxpq91x7y2mgixz7ghqp01m24qa37wl3zz515rrzv7x8cyy4cf";
12 setOutputFlags = false;
14 # Getting lots of Non-ASCII character errors from pod2man.
15 # Inserting =encoding utf8 before the first =head occurrence.
16 # Wasn't able to fix mp4h.
19 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
20 sed -i '0,/^=head/{s/^=head/=encoding utf8\n=head/}' $i
22 sed -i 's/ doc / /g' wml_backend/p2_mp4h/Makefile.in
23 sed -i '/p2_mp4h\/doc/d' Makefile.in
26 nativeBuildInputs = [ makeWrapper ];
27 buildInputs = with perlPackages;
28 [ perl TermReadKey GD BitVector ncurses lynx ImageSize ];
30 patches = [ ./redhat-with-thr.patch ./dynaloader.patch ./no_bitvector.patch ];
32 # Workaround build failure on -fno-common toolchains:
33 # ld: iselect_browse.o:(.bss+0x2020): multiple definition of `Line'; iselect_main.o:(.bss+0x100000): first defined here
34 env.NIX_CFLAGS_COMPILE = "-fcommon";
36 hardeningDisable = [ "format" ];
39 substituteInPlace wml_frontend/wml.src \
40 --replace "File::PathConvert::realpath" "Cwd::realpath" \
41 --replace "File::PathConvert::abs2rel" "File::Spec->abs2rel" \
42 --replace "File::PathConvert" "File::Spec"
44 for i in wml_include/des/imgbg.src wml_include/des/imgdot.src; do
45 substituteInPlace $i \
46 --replace "WML::GD" "GD"
49 rm wml_test/t/11-wmk.t
53 wrapProgram $out/bin/wml \
54 --set PERL5LIB ${with perlPackages; makePerlPath [
55 BitVector TermReadKey ImageSize
59 enableParallelBuilding = false;
61 installTargets = [ "install" ];
64 homepage = "https://www.shlomifish.org/open-source/projects/website-meta-language/";
65 description = "Off-line HTML generation toolkit for Unix";
66 license = licenses.gpl2;
67 platforms = platforms.linux;