gnu: zlib: Move static library to separate output.

* gnu/packages/compression.scm (zlib)[outputs]: New field.
[arguments]: Add phase 'move-static-library'.
This commit is contained in:
Marius Bakke 2018-07-30 17:09:07 +02:00
parent 7b84410046
commit b90289dadc
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
1 changed files with 10 additions and 1 deletions

View File

@ -85,6 +85,7 @@
(base32 (base32
"18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3")))) "18dighcs333gsvajvvgqp8l4cx7h1x7yx9gd5xacnk80spyykrf3"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" "static"))
(arguments (arguments
`(#:phases `(#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
@ -99,7 +100,15 @@
`((setenv "CHOST" ,(%current-target-system))) `((setenv "CHOST" ,(%current-target-system)))
'()) '())
(invoke "./configure" (invoke "./configure"
(string-append "--prefix=" out)))))))) (string-append "--prefix=" out)))))
(add-after 'install 'move-static-library
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(static (assoc-ref outputs "static")))
(with-directory-excursion (string-append out "/lib")
(install-file "libz.a" (string-append static "/lib"))
(delete-file "libz.a")
#t)))))))
(home-page "https://zlib.net/") (home-page "https://zlib.net/")
(synopsis "Compression library") (synopsis "Compression library")
(description (description