gnu: zlib: Use G-expression.

* gnu/packages/compression.scm (zlib)[arguments]: Convert to gexp.
This commit is contained in:
Marius Bakke 2022-06-30 13:03:18 +02:00
parent 5aeb96103f
commit a81a9ceb88
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -13,7 +13,7 @@
;;; Copyright © 20162022 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 20162022 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2016 David Craven <david@craven.ch>
;;; Copyright © 2016, 2019, 2020 Kei Kebreau <kkebreau@posteo.net> ;;; Copyright © 2016, 2019, 2020 Kei Kebreau <kkebreau@posteo.net>
;;; Copyright © 2016, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org> ;;; Copyright © 2016, 2018-2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2017 Nikita <nikita@n0.is> ;;; Copyright © 2017 Nikita <nikita@n0.is>
;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com> ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org> ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org>
@ -103,42 +103,40 @@ (define-public zlib
(version "1.2.12") (version "1.2.12")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (list (string-append "http://zlib.net/zlib-" (uri (list (string-append "http://zlib.net/zlib-"
version ".tar.gz") version ".tar.gz")
(string-append "mirror://sourceforge/libpng/zlib/" (string-append "mirror://sourceforge/libpng/zlib/"
version "/zlib-" version ".tar.gz"))) version "/zlib-" version ".tar.gz")))
(patches (search-patches "zlib-cc.patch" (patches (search-patches "zlib-cc.patch"
"zlib-correct-crc32-inputs.patch")) "zlib-correct-crc32-inputs.patch"))
(sha256 (sha256
(base32 (base32
"1n9na4fq4wagw1nzsfjr6wyly960jfa94460ncbf6p1fac44i14i")))) "1n9na4fq4wagw1nzsfjr6wyly960jfa94460ncbf6p1fac44i14i"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(outputs '("out" "static")) (outputs '("out" "static"))
(arguments (arguments
`(#:phases (list
(modify-phases %standard-phases #:phases
(replace 'configure #~(modify-phases %standard-phases
(lambda* (#:key outputs #:allow-other-keys) (replace 'configure
;; Zlib's home-made `configure' fails when passed (lambda _
;; extra flags like `--enable-fast-install', so we need to ;; Zlib's home-made `configure' fails when passed
;; invoke it with just what it understand. ;; extra flags like `--enable-fast-install', so we need to
(let ((out (assoc-ref outputs "out"))) ;; invoke it with just what it understand.
(setenv "CC" ,(cc-for-target)) (setenv "CC" #$(cc-for-target))
;; 'configure' doesn't understand '--host'. ;; 'configure' doesn't understand '--host'.
,@(if (%current-target-system) #$@(if (%current-target-system)
`((setenv "CHOST" ,(%current-target-system))) #~((setenv "CHOST" #$(%current-target-system)))
'()) #~())
(invoke "./configure" (invoke "./configure"
(string-append "--prefix=" out))))) (string-append "--prefix=" #$output))))
(add-after 'install 'move-static-library (add-after 'install 'move-static-library
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out")) (with-directory-excursion (string-append #$output "/lib")
(static (assoc-ref outputs "static"))) (install-file "libz.a" (string-append #$output:static
(with-directory-excursion (string-append out "/lib") "/lib"))
(install-file "libz.a" (string-append static "/lib")) (delete-file "libz.a")))))))
(delete-file "libz.a")
#t)))))))
(home-page "https://zlib.net/") (home-page "https://zlib.net/")
(synopsis "Compression library") (synopsis "Compression library")
(description (description