summary refs log tree commit diff
path: root/gnu/packages/gcc.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-07-15 15:10:32 -0400
committerMark H Weaver <mhw@netris.org>2015-07-15 15:10:32 -0400
commit35995769b516d228793940c5333ad522de992a6c (patch)
tree366b81995e9afbf8f94ecf7d4237b325ec07a0a1 /gnu/packages/gcc.scm
parentc6f909809aecb225b66dc27e4afd3ff46ec31a38 (diff)
parente03f6d5e956b348c142d0ffd9f89af845f05eb86 (diff)
downloadguix-35995769b516d228793940c5333ad522de992a6c.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/gcc.scm')
-rw-r--r--gnu/packages/gcc.scm63
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 8b88dff4dc..6aa0942674 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -27,6 +27,10 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages texinfo)
+  #:use-module (gnu packages doxygen)
+  #:use-module (gnu packages xml)
+  #:use-module (gnu packages docbook)
+  #:use-module (gnu packages graphviz)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages perl)
   #:use-module (guix packages)
@@ -544,6 +548,65 @@ using compilers other than GCC."
 (define-public gcc-objc++-4.8
   (custom-gcc gcc-4.8 "gcc-objc++" '("obj-c++")))
 
+(define (make-libstdc++-doc gcc)
+  "Return a package with the libstdc++ documentation for GCC."
+  (package
+    (inherit gcc)
+    (name "libstdc++-doc")
+    (version (package-version gcc))
+    (synopsis "GNU libstdc++ documentation")
+    (outputs '("out"))
+    (native-inputs `(("doxygen" ,doxygen)
+                     ("texinfo" ,texinfo)
+                     ("libxml2" ,libxml2)
+                     ("libxslt" ,libxslt)
+                     ("docbook-xml" ,docbook-xml)
+                     ("docbook-xsl" ,docbook-xsl)
+                     ("graphviz" ,graphviz))) ;for 'dot', invoked by 'doxygen'
+    (inputs '())
+    (propagated-inputs '())
+    (arguments
+     '(#:out-of-source? #t
+       #:tests? #f                                ;it's just documentation
+       #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'chdir
+                              (lambda _
+                                (chdir "libstdc++-v3")))
+                  (add-before 'configure 'set-xsl-directory
+                              (lambda* (#:key inputs #:allow-other-keys)
+                                (let ((docbook (assoc-ref inputs "docbook-xsl")))
+                                  (substitute* (find-files "doc"
+                                                           "^Makefile\\.in$")
+                                    (("@XSL_STYLE_DIR@")
+                                     (string-append
+                                      docbook "/xml/xsl/"
+                                      (string-drop
+                                       docbook
+                                       (+ 34
+                                          (string-length
+                                           (%store-directory))))))))))
+                  (replace 'build
+                           (lambda _
+                             ;; XXX: There's also a 'doc-info' target, but it
+                             ;; relies on docbook2X, which itself relies on
+                             ;; DocBook 4.1.2, which is not really usable
+                             ;; (lacks a catalog.xml.)
+                             (zero? (system* "make"
+                                             "doc-html"
+                                             "doc-man"))))
+                  (replace 'install
+                           (lambda* (#:key outputs #:allow-other-keys)
+                             (let ((out (assoc-ref outputs "out")))
+                               (zero? (system* "make"
+                                               "doc-install-html"
+                                               "doc-install-man"))))))))))
+
+(define-public libstdc++-doc-4.9
+  (make-libstdc++-doc gcc-4.9))
+
+(define-public libstdc++-doc-5.1
+  (make-libstdc++-doc gcc-5.1))
+
 (define-public isl
   (package
     (name "isl")