From a303630c781f9791f20a3e721c4cfe55e1867a1c Mon Sep 17 00:00:00 2001
From: g0dil <g0dil@wiback.org>
Date: Thu, 21 Dec 2006 08:12:18 +0000
Subject: [PATCH] Add broken doxygen namesoace handling workaround

---
 senfscons/SatSCons.py  | 10 ++++++++++
 senfscons/tagmunge.xsl | 17 +++++++++++++++++
 2 files changed, 27 insertions(+)
 create mode 100644 senfscons/tagmunge.xsl

diff --git a/senfscons/SatSCons.py b/senfscons/SatSCons.py
index 6c8bcc900..bed67e0bf 100644
--- a/senfscons/SatSCons.py
+++ b/senfscons/SatSCons.py
@@ -160,6 +160,16 @@ def DoxyGlob(exclude=[]):
 
 def Doxygen(env, doxyfile="Doxyfile", extra_sources = []):
     docs = env.Doxygen(doxyfile)
+    # The last target is the (optional) tagfile
+    if os.path.basename(str(docs[-1])) != '.stamp':
+        # Postprocess the tag file to remove the (broken) namespace
+        # references
+        env.AddPostAction(
+            docs,
+            env.Action([ "xsltproc -o ${TARGETS[-1]}.temp %s ${TARGETS[-1]}"
+                         % os.path.join(basedir,"tagmunge.xsl"),
+                         "mv ${TARGETS[-1]}.temp ${TARGETS[-1]}" ]))
+        env.Clean(docs[-1],"$TARGET.temp")
     env.Depends(docs,extra_sources)
     env.Alias('all_docs', *docs)
     return docs
diff --git a/senfscons/tagmunge.xsl b/senfscons/tagmunge.xsl
new file mode 100644
index 000000000..67f1f3d00
--- /dev/null
+++ b/senfscons/tagmunge.xsl
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+  
+  <xsl:output method="xml"/>
+    
+  <xsl:template match="compound[@kind='namespace']">
+  </xsl:template>
+
+  <xsl:template match="*">
+    <xsl:copy>
+      <xsl:for-each select="@*"><xsl:copy/></xsl:for-each>
+      <xsl:apply-templates/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
-- 
GitLab