Archived
1
0
Fork 0

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.
This commit is contained in:
Efraim Flashner 2020-11-19 18:08:10 +02:00
parent 6a81a9df17
commit bf8f33c31f
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -5,7 +5,7 @@
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com> ;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
;;; Copyright © 2015, 2016, 2017, 2018, 2020 Ricardo Wurmus <rekado@elephly.net> ;;; 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 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 © 2015 Raimon Grau <raimonster@gmail.com>
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org> ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name> ;;; Copyright © 2016, 2017 Leo Famulari <leo@famulari.name>
@ -171,24 +171,30 @@ hierarchical form with variable field lengths.")
(base32 (base32
"07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma")))) "07xynh8hcxb2yb1fs051xrgszjvj37wnxvxgsj10rzmqzy9y3zma"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" "static")) (outputs '("out" "static" "doc"))
(arguments (arguments
`(#:phases (modify-phases %standard-phases `(#:phases (modify-phases %standard-phases
(add-after 'install 'move-static-libs (add-after 'install 'use-other-outputs
(lambda* (#:key outputs #:allow-other-keys) (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") (dst (string-append (assoc-ref outputs "static")
"/lib"))) "/lib")))
(mkdir-p doc)
(mkdir-p dst) (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) (for-each (lambda (ar)
(rename-file ar (string-append dst "/" (rename-file ar (string-append dst "/"
(basename ar)))) (basename ar))))
(find-files src "\\.a$")) (find-files (string-append src "/lib") "\\.a$"))
;; Remove reference to the static library from the .la ;; Remove reference to the static library from the .la
;; file such that Libtool does the right thing when both ;; file such that Libtool does the right thing when both
;; the shared and static variants are available. ;; 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=''")) (("^old_library='libxml2.a'") "old_library=''"))
#t)))))) #t))))))
(home-page "http://www.xmlsoft.org/") (home-page "http://www.xmlsoft.org/")