From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Nieuwenhuizen Subject: Re: [PATCH 03/11] gnu: Add function libiconv-if-needed. Date: Sat, 14 May 2016 22:27:38 +0200 Message-ID: <87shxk9yh1.fsf@drakenvlieg.flower> References: <1462740169-15029-1-git-send-email-janneke@gnu.org> <1462740169-15029-4-git-send-email-janneke@gnu.org> <87k2j33dlx.fsf@igalia.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42058) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b1gF7-0006de-KV for guix-devel@gnu.org; Sat, 14 May 2016 16:32:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b1gF2-0007sM-EN for guix-devel@gnu.org; Sat, 14 May 2016 16:32:56 -0400 In-Reply-To: <87k2j33dlx.fsf@igalia.com> (Andy Wingo's message of "Mon, 09 May 2016 09:16:42 +0200") 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: Andy Wingo Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Andy Wingo writes: >> +(define* (libiconv-if-needed #:optional (target (%current-target-system))) >> + (if (mingw-target? target) >> + `(("libiconv" ,libiconv)) >> + '())) >> + > > Needs a docstring, please. Thanks :) How is this? (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 (mingw-target? target) `(("libiconv" ,libiconv)) '())) Greetings, Jan --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0003-gnu-Add-function-libiconv-if-needed.patch >From a1ee6d5a33a9bd32828d9c8534b50f709c27b11a Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 3 May 2016 18:49:33 +0200 Subject: [PATCH 03/11] gnu: Add function libiconv-if-needed. * 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 beb689e..35e37e0 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -44,7 +44,8 @@ #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) - #:use-module (guix build-system trivial)) + #:use-module (guix build-system trivial) + :export (libiconv-if-needed)) ;;; Commentary: ;;; @@ -964,6 +965,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 (mingw-target? target) + `(("libiconv" ,libiconv)) + '())) + (define-public (canonical-package package) ;; Avoid circular dependency by lazily resolving 'commencement'. (let* ((iface (resolve-interface '(gnu packages commencement))) -- 2.7.3 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 Jan Nieuwenhuizen | GNU LilyPond http://lilypond.org Freelance IT http://JoyofSource.com | Avatar=C2=AE http://AvatarAcademy.nl= =20=20 --=-=-=--