3
0
Fork 0
forked from mirrors/nixpkgs

docbook-xsl-nons: 1.79.1 → 1.79.2

Nothing much changed other than adding the suffix -nons to Docbook 4 styles,
making the Docbook 5 the variant without suffix:

https://github.com/docbook/xslt10-stylesheets/releases/tag/release%2F1.79.2

I have decided to make docbook_xsl an alias of docbook-xsl-nons for now,
to avoid confusion.

I also updated patch link that was broken to a newer version of the patch
and started sharing it between the two packages.
This commit is contained in:
Jan Tojnar 2019-04-26 15:53:13 +02:00
parent dfd8f84aef
commit 013ddbebb1
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
4 changed files with 72 additions and 77 deletions

View file

@ -0,0 +1,10 @@
--- a/catalog.xml
+++ b/catalog.xml
@@ -5,4 +5,7 @@
<rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl@suffix@/current/" rewritePrefix="./"/>
<rewriteURI uriStartString="http://cdn.docbook.org/release/xsl@suffix@/@version@/" rewritePrefix="./"/>
<rewriteSystem systemIdStartString="http://cdn.docbook.org/release/xsl@suffix@/@version@/" rewritePrefix="./"/>
+ <!-- legacy URIs -->
+ <rewriteURI uriStartString="http://docbook.sourceforge.net/release/xsl@legacySuffix@/current/" rewritePrefix="./"/>
+ <rewriteSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl@legacySuffix@/current/" rewritePrefix="./"/>
</catalog>

View file

@ -1,16 +1,33 @@
{ lib, stdenv, fetchurl, fetchpatch, findXMLCatalogs, writeScriptBin, ruby, bash }:
{ lib, stdenv, substituteAll, fetchurl, fetchpatch, findXMLCatalogs, writeScriptBin, ruby, bash }:
let
common = { pname, sha256, patches ? [] }: let self = stdenv.mkDerivation rec {
name = "${pname}-1.79.1";
common = { pname, sha256, suffix ? "" }: let
legacySuffix = if suffix == "-nons" then "" else "-ns";
self = stdenv.mkDerivation rec {
inherit pname;
version = "1.79.2";
src = fetchurl {
url = "mirror://sourceforge/docbook/${name}.tar.bz2";
url = "https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F${version}/docbook-xsl${suffix}-${version}.tar.bz2";
inherit sha256;
};
inherit patches;
patches = [
# Prevent a potential stack overflow
# https://github.com/docbook/xslt10-stylesheets/pull/37
(fetchpatch {
url = https://src.fedoraproject.org/rpms/docbook-style-xsl/raw/e3ae7a97ed1d185594dd35954e1a02196afb205a/f/docbook-style-xsl-non-recursive-string-subst.patch;
sha256 = "0lrjjg5kpwwmbhkxzz6i5zmimb6lsvrrdhzc2qgjmb3r6jnsmii3";
stripLen = "1";
})
# Add legacy sourceforge.net URIs to the catalog
(substituteAll {
src = ./catalog-legacy-uris.patch;
inherit legacySuffix suffix version;
})
];
propagatedBuildInputs = [ findXMLCatalogs ];
@ -19,12 +36,15 @@ let
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
rm -rf RELEASE* README* INSTALL TODO NEWS* BUGS install.sh tools Makefile tests extensions webhelp
mv * $dst/
# Backwards compatibility. Will remove eventually.
mkdir -p $out/xml/xsl
ln -s $dst $out/xml/xsl/docbook
# More backwards compatibility
ln -s $dst $out/share/xml/docbook-xsl${legacySuffix}
'';
passthru.dbtoepub = writeScriptBin "dbtoepub"
@ -39,28 +59,19 @@ let
maintainers = [ lib.maintainers.eelco ];
platforms = lib.platforms.all;
};
}; in self;
};
in self;
in {
docbook_xsl = common {
pname = "docbook-xsl";
sha256 = "0s59lihif2fr7rznckxr2kfyrvkirv76r1zvidp9b5mj28p4apvj";
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";
})];
docbook-xsl-nons = common {
pname = "docbook-xsl-nons";
suffix = "-nons";
sha256 = "00i1hdyxim8jymv2dz68ix3wbs5w6isxm8ijb03qk3vs1g59x2zf";
};
docbook_xsl_ns = common {
docbook-xsl-ns = common {
pname = "docbook-xsl-ns";
sha256 = "170ggf5dgjar65kkn5n33kvjr3pdinpj66nnxfx8b2avw0k91jin";
patches = [ ./docbook-xsl-ns-infinite.patch ];
sha256 = "0wd33z41kdsybyx3ay21w6bdlmgpd9kyn3mr5y520lsf8km28r9i";
};
}

View file

@ -1,30 +0,0 @@
Description: Remove infinite recursion
Attribute: docbook5_xsl
Version: 1.79.1
URL: https://github.com/NixOS/nixpkgs/issues/39090
diff -ru a/lib/lib.xsl b/lib/lib.xsl
--- a/lib/lib.xsl 2015-12-26 15:15:37.000000000 -0800
+++ b/lib/lib.xsl 2018-03-22 11:52:45.311949264 -0700
@@ -11,8 +11,10 @@
******************************************************************** -->
<xsl:stylesheet exclude-result-prefixes="d"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d="http://docbook.org/ns/docbook"
-version="1.0">
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:d="http://docbook.org/ns/docbook"
+ xmlns:str="http://exslt.org/strings"
+ version="1.0">
<xsl:template name="dot.count">
<!-- Returns the number of "." characters in a string -->
@@ -58,6 +61,9 @@
<xsl:param name="replacement"/>
<xsl:choose>
+ <xsl:when test="function-available('str:replace')">
+ <xsl:value-of select="str:replace($string, string($target), string($replacement))"/>
+ </xsl:when>
<xsl:when test="contains($string, $target)">
<xsl:variable name="rest">
<xsl:call-template name="string.subst">

View file

@ -15915,8 +15915,12 @@ in
docbook_xml_ebnf_dtd = callPackage ../data/sgml+xml/schemas/xml-dtd/docbook-ebnf { };
inherit (callPackages ../data/sgml+xml/stylesheets/xslt/docbook-xsl { })
docbook_xsl
docbook_xsl_ns;
docbook-xsl-nons
docbook-xsl-ns;
# TODO: move this to aliases
docbook_xsl = docbook-xsl-nons;
docbook_xsl_ns = docbook-xsl-ns;
documentation-highlighter = callPackage ../misc/documentation-highlighter { };