2021-01-15 09:19:50 +00:00
|
|
|
{ fetchurl, lib, 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 {
|
2020-11-06 21:53:46 +00:00
|
|
|
pname = "xmlto";
|
|
|
|
version = "0.0.28";
|
2008-03-11 08:44:22 +00:00
|
|
|
src = fetchurl {
|
2020-11-06 21:53:46 +00:00
|
|
|
url = "https://releases.pagure.org/${pname}/${pname}-${version}.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" \
|
2021-01-15 09:19:50 +00:00
|
|
|
--prefix PATH : "${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.
|
|
|
|
'';
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://fedorahosted.org/xmlto/";
|
2021-01-15 09:19:50 +00:00
|
|
|
platforms = lib.platforms.unix;
|
2008-03-11 08:44:22 +00:00
|
|
|
};
|
2009-09-18 18:22:42 +00:00
|
|
|
}
|