2018-01-29 20:25:07 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, findXMLCatalogs, writeScriptBin, ruby, bash }:
|
2003-11-25 16:59:07 +00:00
|
|
|
|
2015-08-27 16:01:45 +01:00
|
|
|
let
|
2015-08-27 15:56:43 +01:00
|
|
|
|
2018-01-30 18:49:44 +00:00
|
|
|
common = { pname, sha256, patches ? [] }: let self = stdenv.mkDerivation rec {
|
2016-03-27 12:29:09 +01:00
|
|
|
name = "${pname}-1.79.1";
|
2015-08-27 16:01:45 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/docbook/${name}.tar.bz2";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2018-01-30 18:49:44 +00:00
|
|
|
inherit patches;
|
2018-01-29 20:25:07 +00:00
|
|
|
|
2017-10-06 23:05:38 +01:00
|
|
|
propagatedBuildInputs = [ findXMLCatalogs ];
|
|
|
|
|
2016-05-04 11:08:35 +01:00
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
dst=$out/share/xml/${pname}
|
|
|
|
mkdir -p $dst
|
|
|
|
rm -rf RELEASE* README* INSTALL TODO NEWS* BUGS install.sh svn* tools log Makefile tests extensions webhelp
|
|
|
|
mv * $dst/
|
|
|
|
|
|
|
|
# Backwards compatibility. Will remove eventually.
|
|
|
|
mkdir -p $out/xml/xsl
|
|
|
|
ln -s $dst $out/xml/xsl/docbook
|
|
|
|
'';
|
2015-08-27 16:01:45 +01:00
|
|
|
|
2017-11-22 14:12:00 +00:00
|
|
|
passthru.dbtoepub = writeScriptBin "dbtoepub"
|
|
|
|
''
|
|
|
|
#!${bash}/bin/bash
|
|
|
|
exec -a dbtoepub ${ruby}/bin/ruby ${self}/share/xml/${pname}/epub/bin/dbtoepub "$@"
|
|
|
|
'';
|
|
|
|
|
2015-08-27 16:01:45 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://wiki.docbook.org/topic/DocBookXslStylesheets;
|
|
|
|
description = "XSL stylesheets for transforming DocBook documents into HTML and various other formats";
|
|
|
|
maintainers = [ lib.maintainers.eelco ];
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
2017-11-22 14:12:00 +00:00
|
|
|
}; in self;
|
2015-08-27 15:56:43 +01:00
|
|
|
|
2015-08-27 16:01:45 +01:00
|
|
|
in {
|
2015-08-27 15:56:43 +01:00
|
|
|
|
2015-08-27 16:01:45 +01:00
|
|
|
docbook_xsl = common {
|
|
|
|
pname = "docbook-xsl";
|
2016-03-27 12:29:09 +01:00
|
|
|
sha256 = "0s59lihif2fr7rznckxr2kfyrvkirv76r1zvidp9b5mj28p4apvj";
|
2018-01-30 18:49:44 +00:00
|
|
|
|
|
|
|
patches = [(fetchpatch {
|
|
|
|
name = "potential-infinite-template-recursion.patch";
|
|
|
|
url = "https://src.fedoraproject.org/cgit/rpms/docbook-style-xsl.git/"
|
|
|
|
+ "plain/docbook-style-xsl-non-recursive-string-subst.patch?id=bf9e5d16fd";
|
|
|
|
sha256 = "1pfb468bsj3j879ip0950waih0r1s6rzfbm2p70glbz0g3903p7h";
|
|
|
|
stripLen = "1";
|
|
|
|
})];
|
|
|
|
|
2015-08-27 16:01:45 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
docbook_xsl_ns = common {
|
|
|
|
pname = "docbook-xsl-ns";
|
2016-03-27 12:29:09 +01:00
|
|
|
sha256 = "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin";
|
2015-08-27 15:56:43 +01:00
|
|
|
|
2018-03-22 18:55:19 +00:00
|
|
|
patches = [ ./docbook-xsl-ns-infinite.patch ];
|
|
|
|
};
|
2003-11-25 16:59:07 +00:00
|
|
|
}
|