about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/doc/manual/default.nix4
-rw-r--r--pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix6
-rw-r--r--pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/fix-man-options-duplication.patch11
3 files changed, 20 insertions, 1 deletions
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index e96bc47b4a53b..bcb5d0d02f74f 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -14,6 +14,10 @@ with pkgs;
 let
   lib = pkgs.lib;
 
+  docbook_xsl_ns = pkgs.docbook-xsl-ns.override {
+    withManOptDedupPatch = true;
+  };
+
   # We need to strip references to /nix/store/* from options,
   # including any `extraSources` if some modules came from elsewhere,
   # or else the build will fail.
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 735dfdb4f81b3..2f9d22e57d89e 100644
--- a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix
+++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, substituteAll, fetchurl, fetchpatch, findXMLCatalogs, writeScriptBin, ruby, bash }:
+{ lib, stdenv, substituteAll, fetchurl, fetchpatch, findXMLCatalogs, writeScriptBin, ruby, bash, withManOptDedupPatch ? false }:
 
 let
 
@@ -36,6 +36,10 @@ let
           src = ./catalog-legacy-uris.patch;
           inherit legacySuffix suffix version;
         })
+      ] ++ lib.optionals withManOptDedupPatch [
+        # Fixes https://github.com/NixOS/nixpkgs/issues/166304
+        # https://github.com/docbook/xslt10-stylesheets/pull/241
+        ./fix-man-options-duplication.patch
       ];
 
       propagatedBuildInputs = [ findXMLCatalogs ];
diff --git a/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/fix-man-options-duplication.patch b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/fix-man-options-duplication.patch
new file mode 100644
index 0000000000000..304d9781e6aab
--- /dev/null
+++ b/pkgs/data/sgml+xml/stylesheets/xslt/docbook-xsl/fix-man-options-duplication.patch
@@ -0,0 +1,11 @@
+--- a/manpages/lists.xsl
++++ b/manpages/lists.xsl
+@@ -110,7 +110,7 @@
+   <xsl:text>.RE&#10;</xsl:text>
+ </xsl:template>
+ 
+-<xsl:template match="d:varlistentry/d:term"/>
++<xsl:template match="d:varlistentry/d:term" priority="1"/>
+ <xsl:template match="d:glossentry/d:glossterm"/>
+ 
+ <xsl:template match="d:variablelist[ancestor::d:listitem or ancestor::d:step or ancestor::d:glossdef]|