Patchwork [10/11] gnu: readline: support mingw.

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

Comments

Jan Nieuwenhuizen - May 8, 2016, 8:42 p.m.
* gnu/packages/patches/readline-6.3-mingw.patch: New file.
* gnu-system.am (dist_patch_DATA): Add it.
* gnu/packages/readline.scm (readline): Support mingw.
---
 gnu/packages/readline.scm | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
Andy Wingo - May 9, 2016, 7:44 a.m.
On Sun 08 May 2016 22:42, Jan Nieuwenhuizen <janneke@gnu.org> writes:

> * gnu/packages/patches/readline-6.3-mingw.patch: New file.
> * gnu-system.am (dist_patch_DATA): Add it.
> * gnu/packages/readline.scm (readline): Support mingw.

LGTM

Patch

diff --git a/gnu/packages/readline.scm b/gnu/packages/readline.scm
index db469db..aae20c4 100644
--- a/gnu/packages/readline.scm
+++ b/gnu/packages/readline.scm
@@ -1,5 +1,6 @@ 
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -22,7 +23,8 @@ 
   #:use-module (gnu packages ncurses)
   #:use-module (guix packages)
   #:use-module (guix download)
-  #:use-module (guix build-system gnu))
+  #:use-module (guix build-system gnu)
+  #:use-module (guix utils))
 
 (define-public readline
   (let ((post-install-phase
@@ -59,8 +61,18 @@ 
                          ;; cross-compiling, so provide the correct answer.
                          ,@(if (%current-target-system)
                                '("bash_cv_wcwidth_broken=no")
+                               '())
+                         ;; MinGW: ncurses provides the termcap api.
+                         ,@(if (mingw-target?)
+                               '("bash_cv_termcap_lib=ncurses")
                                '()))
 
+                   #:make-flags (list ,@(if (mingw-target?)
+                                            ;; MinGW: termcap in ncurses
+                                            ;; some SIG_* #defined in _POSIX
+                                            '("TERMCAP_LIB=-lncurses"
+                                              "CPPFLAGS=-D_POSIX")
+                                            '()))
                    #:phases (alist-cons-after
                              'install 'post-install
                              ,post-install-phase