2018-07-21 00:44:44 +00:00
|
|
|
{ fetchurl, stdenv, libxml2, libxslt
|
2016-03-27 15:07:45 +00:00
|
|
|
, docbook_xml_dtd_45, docbook_xsl, w3m
|
2010-05-04 13:32:04 +00:00
|
|
|
, bash, getopt, makeWrapper }:
|
2008-03-11 08:44:22 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-03-27 15:07:45 +00:00
|
|
|
name = "xmlto-0.0.28";
|
2008-03-11 08:44:22 +00:00
|
|
|
src = fetchurl {
|
2010-05-04 13:32:04 +00:00
|
|
|
url = "http://fedorahosted.org/releases/x/m/xmlto/${name}.tar.bz2";
|
2016-03-27 15:07:45 +00:00
|
|
|
sha256 = "0xhj8b2pwp4vhl9y16v3dpxpsakkflfamr191mprzsspg4xdyc0i";
|
2008-03-11 08:44:22 +00:00
|
|
|
};
|
|
|
|
|
2018-08-08 21:44:46 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs xmlif/test/run-test
|
|
|
|
|
2008-03-11 08:44:22 +00:00
|
|
|
substituteInPlace "xmlto.in" \
|
2008-03-11 09:16:12 +00:00
|
|
|
--replace "/bin/bash" "${bash}/bin/bash"
|
2008-03-11 08:44:22 +00:00
|
|
|
substituteInPlace "xmlto.in" \
|
2009-09-18 18:22:42 +00:00
|
|
|
--replace "/usr/bin/locale" "$(type -P locale)"
|
2010-05-04 13:32:04 +00:00
|
|
|
substituteInPlace "xmlto.in" \
|
|
|
|
--replace "mktemp" "$(type -P mktemp)"
|
2008-03-11 08:44:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# `libxml2' provides `xmllint', needed at build-time and run-time.
|
|
|
|
# `libxslt' provides `xsltproc', used by `xmlto' at run-time.
|
2018-12-11 00:28:47 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper getopt ];
|
|
|
|
buildInputs = [ libxml2 libxslt docbook_xml_dtd_45 docbook_xsl ];
|
2008-03-11 08:44:22 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2010-05-04 13:32:04 +00:00
|
|
|
wrapProgram "$out/bin/xmlto" \
|
2016-08-22 22:06:51 +00:00
|
|
|
--prefix PATH : "${stdenv.lib.makeBinPath [ libxslt libxml2 getopt ]}"
|
2008-09-26 08:56:03 +00:00
|
|
|
|
|
|
|
# `w3m' is needed for HTML to text conversions.
|
|
|
|
substituteInPlace "$out/share/xmlto/format/docbook/txt" \
|
|
|
|
--replace "/usr/bin/w3m" "${w3m}/bin/w3m"
|
2008-03-11 08:44:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "Front-end to an XSL toolchain";
|
2008-09-26 08:56:03 +00:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
xmlto is a front-end to an XSL toolchain. It chooses an
|
|
|
|
appropriate stylesheet for the conversion you want and applies
|
|
|
|
it using an external XSL-T processor. It also performs any
|
|
|
|
necessary post-processing.
|
|
|
|
'';
|
|
|
|
|
2014-06-19 04:19:00 +00:00
|
|
|
license = stdenv.lib.licenses.gpl2Plus;
|
2010-05-04 13:32:04 +00:00
|
|
|
homepage = https://fedorahosted.org/xmlto/;
|
2016-08-02 17:50:55 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2008-03-11 08:44:22 +00:00
|
|
|
};
|
2009-09-18 18:22:42 +00:00
|
|
|
}
|