2023-06-03 15:32:35 +00:00
|
|
|
{ fetchurl, fetchpatch, lib, stdenv, libxml2, libxslt
|
|
|
|
, docbook_xml_dtd_45, docbook_xsl, flex, 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
|
|
|
};
|
|
|
|
|
2023-06-03 15:32:35 +00:00
|
|
|
# Note: These patches modify `xmlif/xmlif.l`, which requires `flex` to be rerun.
|
|
|
|
patches = [
|
|
|
|
# Fixes implicit `int` on `main`, which is an error with clang 16.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://pagure.io/xmlto/c/8e34f087bf410bcc5fe445933d6ad9bae54f24b5.patch";
|
|
|
|
hash = "sha256-z5riDBZBVuFeBcjI++dAl3nTIgOPau4Gag0MJbYt+cc=";
|
|
|
|
})
|
|
|
|
# Fixes implicit `int` on `ifsense`, which is also an error with clang 16.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://pagure.io/xmlto/c/1375e2df75530cd198bd16ac3de38e2b0d126276.patch";
|
|
|
|
hash = "sha256-fM6ZdTigrcC9cbXiKu6oa5Hs71mrREockB1wRlw6nDk=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
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.
|
2023-06-03 15:32:35 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper flex getopt ];
|
2018-12-11 00:28:47 +00:00
|
|
|
buildInputs = [ libxml2 libxslt docbook_xml_dtd_45 docbook_xsl ];
|
2008-03-11 08:44:22 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2008-09-26 08:56:03 +00:00
|
|
|
# `w3m' is needed for HTML to text conversions.
|
2022-10-25 09:41:36 +00:00
|
|
|
wrapProgram "$out/bin/xmlto" \
|
|
|
|
--prefix PATH : "${lib.makeBinPath [ libxslt libxml2 getopt 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;
|
2021-10-15 03:11:42 +00:00
|
|
|
homepage = "https://pagure.io/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
|
|
|
}
|