From 013ddbebb1dd25368b30849547baf79fbe2cd15e Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 26 Apr 2019 15:53:13 +0200 Subject: [PATCH] =?UTF-8?q?docbook-xsl-nons:=201.79.1=20=E2=86=92=201.79.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .../docbook-xsl/catalog-legacy-uris.patch | 10 ++ .../stylesheets/xslt/docbook-xsl/default.nix | 101 ++++++++++-------- .../docbook-xsl/docbook-xsl-ns-infinite.patch | 30 ------ pkgs/top-level/all-packages.nix | 8 +- 4 files changed, 72 insertions(+), 77 deletions(-) create mode 100644 pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/catalog-legacy-uris.patch delete mode 100644 pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/docbook-xsl-ns-infinite.patch diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/catalog-legacy-uris.patch b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/catalog-legacy-uris.patch new file mode 100644 index 000000000000..72922eee96c4 --- /dev/null +++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/catalog-legacy-uris.patch @@ -0,0 +1,10 @@ +--- a/catalog.xml ++++ b/catalog.xml +@@ -5,4 +5,7 @@ + + + ++ ++ ++ + diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix index ef7b1f93d74e..5297d5dbd5dc 100644 --- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix +++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix @@ -1,66 +1,77 @@ -{ 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"; - inherit sha256; - }; + src = fetchurl { + 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"; + }) - propagatedBuildInputs = [ findXMLCatalogs ]; + # Add legacy sourceforge.net URIs to the catalog + (substituteAll { + src = ./catalog-legacy-uris.patch; + inherit legacySuffix suffix version; + }) + ]; - dontBuild = true; + propagatedBuildInputs = [ findXMLCatalogs ]; - 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/ + dontBuild = true; - # Backwards compatibility. Will remove eventually. - mkdir -p $out/xml/xsl - ln -s $dst $out/xml/xsl/docbook - ''; + installPhase = '' + dst=$out/share/xml/${pname} + mkdir -p $dst + rm -rf RELEASE* README* INSTALL TODO NEWS* BUGS install.sh tools Makefile tests extensions webhelp + mv * $dst/ - passthru.dbtoepub = writeScriptBin "dbtoepub" - '' - #!${bash}/bin/bash - exec -a dbtoepub ${ruby}/bin/ruby ${self}/share/xml/${pname}/epub/bin/dbtoepub "$@" + # 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} ''; - 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; + passthru.dbtoepub = writeScriptBin "dbtoepub" + '' + #!${bash}/bin/bash + exec -a dbtoepub ${ruby}/bin/ruby ${self}/share/xml/${pname}/epub/bin/dbtoepub "$@" + ''; + + 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; + }; }; - }; 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"; }; } diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/docbook-xsl-ns-infinite.patch b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/docbook-xsl-ns-infinite.patch deleted file mode 100644 index 5729f9b43c80..000000000000 --- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/docbook-xsl-ns-infinite.patch +++ /dev/null @@ -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 @@ - - ******************************************************************** --> - -+ 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"> - - - -@@ -58,6 +61,9 @@ - - - -+ -+ -+ - - - diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c39fafb320e7..9e8e804a866c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };