mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
gnu: Add function libiconv-if-needed.
* gnu/packages/base.scm (libiconv-if-needed): New function.
This commit is contained in:
parent
cba36e6482
commit
4dab8c5906
1 changed files with 12 additions and 1 deletions
|
@ -46,7 +46,8 @@ (define-module (gnu packages base)
|
||||||
#:use-module (guix build-system gnu)
|
#:use-module (guix build-system gnu)
|
||||||
#:use-module (guix build-system trivial)
|
#:use-module (guix build-system trivial)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (glibc))
|
#:export (glibc
|
||||||
|
libiconv-if-needed))
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;;
|
;;;
|
||||||
|
@ -1032,6 +1033,16 @@ (define-public libiconv
|
||||||
(home-page "http://www.gnu.org/software/libiconv/")
|
(home-page "http://www.gnu.org/software/libiconv/")
|
||||||
(license lgpl3+)))
|
(license lgpl3+)))
|
||||||
|
|
||||||
|
(define* (libiconv-if-needed #:optional (target (%current-target-system)))
|
||||||
|
"Return either a libiconv package specification to include in a dependency
|
||||||
|
list for platforms that have an incomplete libc, or the empty list. If a
|
||||||
|
package needs iconv ,@(libiconv-if-needed) should be added."
|
||||||
|
;; POSIX C libraries provide iconv. Platforms with an incomplete libc
|
||||||
|
;; without iconv, such as MinGW, must return the then clause.
|
||||||
|
(if (target-mingw? target)
|
||||||
|
`(("libiconv" ,libiconv))
|
||||||
|
'()))
|
||||||
|
|
||||||
(define-public (canonical-package package)
|
(define-public (canonical-package package)
|
||||||
;; Avoid circular dependency by lazily resolving 'commencement'.
|
;; Avoid circular dependency by lazily resolving 'commencement'.
|
||||||
(let* ((iface (resolve-interface '(gnu packages commencement)))
|
(let* ((iface (resolve-interface '(gnu packages commencement)))
|
||||||
|
|
Loading…
Reference in a new issue