summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2020-11-19 18:08:10 +0200
committerEfraim Flashner <efraim@flashner.co.il>2020-11-19 18:08:10 +0200
commitbf8f33c31fe68ae0479ed6bc2c762dae99318562 (patch)
tree4917f993ba1a2ebae236dbf6fa275d91ed83693c
parent6a81a9df17d94eb967c2c7a95e27a1f883d97ee7 (diff)
downloadguix-bf8f33c31fe68ae0479ed6bc2c762dae99318562.tar.gz
gnu: libxml2: Move documentation to its own output.
This saves about 75% of the space in the "out" output.

* gnu/packages/xml.scm (libxml2)[outputs]: Add doc.
[arguments]: Rename the 'move-static-libs phase to 'use-other-outputs
and adjust to move documentation to "doc" output.
-rw-r--r--gnu/packages/xml.scm18
1 files changed, 12 insertions, 6 deletions
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index f5e2f58459..f0e591bb5f 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -5,7 +5,7 @@
 ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
 ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2015 Raimon Grau <raimonster@gmail.com>
 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
 ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
@@ -171,24 +171,30 @@ hierarchical form with variable field lengths.")
               (base32
                "07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma"))))
     (build-system gnu-build-system)
-    (outputs '("out" "static"))
+    (outputs '("out" "static" "doc"))
     (arguments
      `(#:phases (modify-phases %standard-phases
-                  (add-after 'install 'move-static-libs
+                  (add-after 'install 'use-other-outputs
                     (lambda* (#:key outputs #:allow-other-keys)
-                      (let ((src (string-append (assoc-ref outputs "out") "/lib"))
+                      (let ((src (assoc-ref outputs "out"))
+                            (doc (string-append (assoc-ref outputs "doc") "/share"))
                             (dst (string-append (assoc-ref outputs "static")
                                                 "/lib")))
+                        (mkdir-p doc)
                         (mkdir-p dst)
+                        (for-each (lambda (dir)
+                                    (rename-file (string-append src "/share/" dir)
+                                                 (string-append doc "/" dir)))
+                                  '("doc" "gtk-doc"))
                         (for-each (lambda (ar)
                                     (rename-file ar (string-append dst "/"
                                                                    (basename ar))))
-                                  (find-files src "\\.a$"))
+                                  (find-files (string-append src "/lib") "\\.a$"))
 
                         ;; Remove reference to the static library from the .la
                         ;; file such that Libtool does the right thing when both
                         ;; the shared and static variants are available.
-                        (substitute* (string-append src "/libxml2.la")
+                        (substitute* (string-append src "/lib/libxml2.la")
                           (("^old_library='libxml2.a'") "old_library=''"))
                         #t))))))
     (home-page "http://www.xmlsoft.org/")