Initial commit

This commit is contained in:
2026-03-21 12:43:00 -05:00
commit 83bf16823c
438 changed files with 33617 additions and 0 deletions
@@ -0,0 +1,33 @@
Description: use EXSLT "replace" function when available
A recursive implementation of string.subst is problematic,
long strings with many matches will cause stack overflows.
Author: Peter De Wachter <pdewacht@gmail.com>
Bug-Debian: https://bugs.debian.org/750593
diff --git a/lib/lib.xsl b/lib/lib.xsl
index e65776a..bc45cd8 100644
--- a/lib/lib.xsl
+++ b/lib/lib.xsl
@@ -6,7 +6,11 @@
This module implements DTD-independent functions
- ******************************************************************** --><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ ******************************************************************** -->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:str="http://exslt.org/strings"
+ exclude-result-prefixes="str"
+ version="1.0">
<xsl:template name="dot.count">
<!-- Returns the number of "." characters in a string -->
@@ -52,6 +56,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">
+44
View File
@@ -0,0 +1,44 @@
#!/bin/sh
set -eu
src_base=$(basename "$PWD")
version=${src_base##*-}
docbook_root="$DESTDIR/usr/share/xml/docbook"
style_root="$docbook_root/xsl-stylesheets-nons-$version"
install -dm755 "$style_root"
for path in \
VERSION \
assembly \
common \
eclipse \
epub \
epub3 \
extensions \
fo \
highlighting \
html \
htmlhelp \
images \
javahelp \
lib \
manpages \
params \
profiling \
roundtrip \
slides \
template \
tests \
tools \
webhelp \
website \
xhtml \
xhtml-1_1 \
xhtml5
do
cp -a "$path" "$style_root/"
done
ln -sf VERSION "$style_root/VERSION.xsl"
ln -sfn "xsl-stylesheets-nons-$version" "$docbook_root/xsl-stylesheets-nons"
+26
View File
@@ -0,0 +1,26 @@
[package]
name = "docbook-xsl"
version = "1.79.2"
description = "XSL stylesheets for transforming XML DocBook files"
homepage = "https://github.com/docbook/xslt10-stylesheets"
license = "DocBook-Stylesheet"
[[source]]
url = "https://github.com/docbook/xslt10-stylesheets/releases/download/release%2F$version/docbook-xsl-nons-$version.tar.gz"
sha256 = "f89425b44e48aad24319a2f0d38e0cb6059fdc7dbaf31787c8346c748175ca8e"
extract_dir = "$name-nons-$version"
patches = [ "765567_non-recursive_string_subst.patch" ]
[[manual_sources]]
file = "765567_non-recursive_string_subst.patch"
sha256 = "42d69ef938ff85e01cd5fe825cc3e70cd8dceaa88277d4940383b56fefd02dac"
[build]
type = "custom"
[build.flags]
no_flags = true
skip_tests = true
[dependencies]
runtime = [ "docbook-xml", "libxml215", "libxslt" ]
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
catalog=etc/xml/catalog
target="file:///usr/share/xml/docbook/xsl-stylesheets-nons"
uris="http://cdn.docbook.org/release/xsl-nons http://docbook.sourceforge.net/release/xsl"
if [ ! -f "$catalog" ]; then
xmlcatalog --noout --create "$catalog"
fi
for uri in $uris; do
xmlcatalog --noout --del "$uri/current" "$catalog" 2>/dev/null || true
xmlcatalog --noout --del "$uri/current" "$catalog" 2>/dev/null || true
xmlcatalog --noout --add "rewriteSystem" "$uri/current" "$target" "$catalog"
xmlcatalog --noout --add "rewriteURI" "$uri/current" "$target" "$catalog"
done
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
catalog=etc/xml/catalog
target="file:///usr/share/xml/docbook/xsl-stylesheets-nons"
uris="http://cdn.docbook.org/release/xsl-nons http://docbook.sourceforge.net/release/xsl"
if [ ! -f "$catalog" ]; then
xmlcatalog --noout --create "$catalog"
fi
for uri in $uris; do
xmlcatalog --noout --del "$uri/current" "$catalog" 2>/dev/null || true
xmlcatalog --noout --del "$uri/current" "$catalog" 2>/dev/null || true
xmlcatalog --noout --add "rewriteSystem" "$uri/current" "$target" "$catalog"
xmlcatalog --noout --add "rewriteURI" "$uri/current" "$target" "$catalog"
done
+14
View File
@@ -0,0 +1,14 @@
#!/bin/sh
set -eu
catalog=etc/xml/catalog
uris="http://cdn.docbook.org/release/xsl-nons http://docbook.sourceforge.net/release/xsl"
if ! command -v xmlcatalog >/dev/null 2>&1 || [ ! -f "$catalog" ]; then
exit 0
fi
for uri in $uris; do
xmlcatalog --noout --del "$uri/current" "$catalog" 2>/dev/null || true
xmlcatalog --noout --del "$uri/current" "$catalog" 2>/dev/null || true
done