Patchwork [03/11] gnu: Add function libiconv-if-needed.

login
register
mail settings
Submitter Jan Nieuwenhuizen
Date May 8, 2016, 8:42 p.m.
Message ID <1462740169-15029-4-git-send-email-janneke@gnu.org>
Download mbox | patch
Permalink /patch/12150/
State New
Headers show

Comments

Jan Nieuwenhuizen - May 8, 2016, 8:42 p.m.
* gnu/packages/base.scm (libiconv-if-needed): New function.
---
 gnu/packages/base.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
Andy Wingo - May 9, 2016, 7:16 a.m.
On Sun 08 May 2016 22:42, Jan Nieuwenhuizen <janneke@gnu.org> writes:

> * gnu/packages/base.scm (libiconv-if-needed): New function.
> ---
>  gnu/packages/base.scm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
> index beb689e..51d70b1 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,11 @@ 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)))
> +  (if (mingw-target? target)
> +      `(("libiconv" ,libiconv))
> +      '()))
> +

Needs a docstring, please.  Thanks :)

>  (define-public (canonical-package package)
>    ;; Avoid circular dependency by lazily resolving 'commencement'.
>    (let* ((iface (resolve-interface '(gnu packages commencement)))

Patch

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index beb689e..51d70b1 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,11 @@  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)))
+  (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)))