From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: [PATCH 04/12] gnu: Add function libiconv-if-needed. Date: Thu, 18 Aug 2016 08:08:43 +0200 Message-ID: <20160818060851.2853-5-janneke@gnu.org> References: <20160818060851.2853-1-janneke@gnu.org> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baGVy-0008Tf-QI for guix-devel@gnu.org; Thu, 18 Aug 2016 02:09:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baGVx-0008Pb-Mi for guix-devel@gnu.org; Thu, 18 Aug 2016 02:09:18 -0400 In-Reply-To: <20160818060851.2853-1-janneke@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * gnu/packages/base.scm (libiconv-if-needed): New function. --- gnu/packages/base.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index a476837..fe11a87 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -46,7 +46,8 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (ice-9 match) - #:export (glibc)) + #:export (glibc + libiconv-if-needed)) ;;; Commentary: ;;; @@ -997,6 +998,16 @@ program. It supports a wide variety of different encodings.") (home-page "http://www.gnu.org/software/libiconv/") (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) ;; Avoid circular dependency by lazily resolving 'commencement'. (let* ((iface (resolve-interface '(gnu packages commencement))) -- 2.9.2