Subject: [PATCH 1/2] gnu: Add guile3.0-ncurses.

From: Martin Becze <[email-masked]>
Date: Thu, 30 Apr 2020 11:37:48 -0500

* gnu/packages/guile-xyz.scm (guile3.0-ncurses): new variable.
---
 gnu/packages/guile-xyz.scm | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 6ec1c4c2fc..37511e9bca 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -23,7 +23,7 @@
 ;;; Copyright © 2019 swedebugia <[email-masked]>
 ;;; Copyright © 2019, 2020 Amar Singh <[email-masked]>
 ;;; Copyright © 2019 Timothy Sample <[email-masked]>
-;;; Copyright © 2019 Martin Becze <[email-masked]>
+;;; Copyright © 2019, 2020 Martin Becze <[email-masked]>
 ;;; Copyright © 2020 Evan Straw <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1858,6 +1858,33 @@ many readers as needed).")
 library.")
     (license license:lgpl3+)))
 
+(define-public guile3.0-ncurses
+  (package
+    (inherit guile-ncurses)
+    (name "guile3.0-ncurses")
+    (version "3.0")
+    (inputs `(("ncurses" ,ncurses)
+              ("guile" ,guile-3.0)))
+    (arguments
+     '(#:configure-flags (list "--with-ncursesw"  ; unicode support
+                               "--with-gnu-filesystem-hierarchy")
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'fix-libguile-ncurses-file-name
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "make" "install"
+                     "-c" "src/ncurses"
+                     "-j" (number->string
+                           (parallel-job-count)))
+             (let* ((out   (assoc-ref outputs "out"))
+                    (dir   "src/ncurses")
+                    (files (find-files dir ".scm")))
+               (substitute* files
+                 (("\"libguile-ncurses\"")
+                  (format #f "\"~a/lib/guile/3.0/libguile-ncurses\""
+                          out)))
+               #t))))))))
+
 (define-public guile-ncurses/gpm
   (package
     (inherit guile-ncurses)
-- 
2.26.2