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

DoneSubmitted by Martin Becze.
Details
2 participants
  • Mathieu Othacehe
  • Martin Becze
Owner
unassigned
Severity
normal
M
M
Martin Becze wrote on 30 Apr 2020 18:37
(address . guix-patches@gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
f2be7628d5cce892974bb100eb07ce272f546048.1588264594.git.mjbecze@riseup.net
* gnu/packages/guile-xyz.scm (guile3.0-ncurses): new variable.
---
gnu/packages/guile-xyz.scm | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)

Toggle diff (49 lines)
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 <swedebugia@riseup.net>
 ;;; Copyright © 2019, 2020 Amar Singh <nly@disroot.org>
 ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
-;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2020 Evan Straw <evan.straw99@gmail.com>
 ;;;
 ;;; 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
M
M
Martin Becze wrote on 30 Apr 2020 19:00
[PATCH 2/2] gnu: Add guile3.0-ncurses-with-gpm.
(address . 40984@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
294762badeedccfd3f6b6de3cb6b3693811c0f08.1588265903.git.mjbecze@riseup.net
* gnu/packages/guile-xyz.scm (guile3.0-ncurses/gpm): New variable.
---
gnu/packages/guile-xyz.scm | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 37511e9bca..82a5362637 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -1892,6 +1892,13 @@ library.")
     (inputs `(("ncurses" ,ncurses/gpm)
               ("guile" ,guile-2.2)))))
 
+(define-public guile3.0-ncurses/gpm
+  (package
+    (inherit guile3.0-ncurses)
+    (name "guile3.0-ncurses-with-gpm")
+    (inputs `(("ncurses" ,ncurses/gpm)
+              ("guile" ,guile-3.0)))))
+
 (define-public guile-lib
   (package
     (name "guile-lib")
-- 
2.26.2
M
M
Mathieu Othacehe wrote on 1 May 2020 12:47
Re: [bug#40984] [PATCH 1/2] gnu: Add guile3.0-ncurses.
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 40984@debbugs.gnu.org)
87d07o3paj.fsf@gmail.com
Hello Martin,

Thanks for this patch.

Toggle quote (6 lines)
> + (substitute* files
> + (("\"libguile-ncurses\"")
> + (format #f "\"~a/lib/guile/3.0/libguile-ncurses\""
> + out)))
> + #t))))))))

I think you could modify guile-ncurses to use "effective-version"
instead of hardcoded "2.2". This way, guile3.0-ncurses would just
inherit from guile-ncurses this way:

Toggle snippet (9 lines)
(define-public guile3.0-ncurses
(package
(inherit guile-ncurses)
(name "guile3.0-ncurses")
(version "3.0")
(inputs `(("ncurses" ,ncurses)
("guile" ,guile-3.0)))))

WDYT?

Thanks,

Mathieu
M
M
Martin Becze wrote on 1 May 2020 20:16
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . 40984@debbugs.gnu.org)
9fe04c4c-52ad-2279-95bb-00b5fcab0221@riseup.net
Ok I think figured it out! Attached is the updated patch. I had to use
(target-guile-effective-version) instead of effective-version.

On 5/1/20 5:47 AM, Mathieu Othacehe wrote:
Toggle quote (31 lines)
>
> Hello Martin,
>
> Thanks for this patch.
>
>> + (substitute* files
>> + (("\"libguile-ncurses\"")
>> + (format #f "\"~a/lib/guile/3.0/libguile-ncurses\""
>> + out)))
>> + #t))))))))
>
> I think you could modify guile-ncurses to use "effective-version"
> instead of hardcoded "2.2". This way, guile3.0-ncurses would just
> inherit from guile-ncurses this way:
>
> --8<---------------cut here---------------start------------->8---
> (define-public guile3.0-ncurses
> (package
> (inherit guile-ncurses)
> (name "guile3.0-ncurses")
> (version "3.0")
> (inputs `(("ncurses" ,ncurses)
> ("guile" ,guile-3.0)))))
> --8<---------------cut here---------------end--------------->8---
>
> WDYT?
>
> Thanks,
>
> Mathieu
>
From 002ec2f173b0782a4c9995c768e12a083e11ae3f Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@riseup.net>
Date: Thu, 30 Apr 2020 11:21:38 -0500
Subject: [PATCH 1/2] gnu: Add guile3.0-ncurses.

* gnu/packages/guile-xyz.scm (guile3.0-ncurses):
Uses (target-guile-effective-version) instead of hardcoding the version
number in the libary path.
(guile3.0-ncurses): new variable.
---
gnu/packages/guile-xyz.scm | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)

Toggle diff (56 lines)
diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 6ec1c4c2fc..de76f3b6d0 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -23,7 +23,7 @@
 ;;; Copyright © 2019 swedebugia <swedebugia@riseup.net>
 ;;; Copyright © 2019, 2020 Amar Singh <nly@disroot.org>
 ;;; Copyright © 2019 Timothy Sample <samplet@ngyro.com>
-;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2020 Evan Straw <evan.straw99@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -1833,7 +1833,13 @@ many readers as needed).")
               ("guile" ,guile-2.2)))
     (native-inputs `(("pkg-config" ,pkg-config)))
     (arguments
-     '(#:configure-flags (list "--with-ncursesw"  ; Unicode support
+     `(#:modules ((guix build gnu-build-system)
+                  ((guix build guile-build-system)
+                   #:select (target-guile-effective-version))
+                  (guix build utils))
+       #:imported-modules ((guix build guile-build-system)
+                           ,@%gnu-build-system-modules)
+       #:configure-flags (list "--with-ncursesw" ; Unicode support
                                "--with-gnu-filesystem-hierarchy")
        #:phases
        (modify-phases %standard-phases
@@ -1848,8 +1854,8 @@ many readers as needed).")
                     (files (find-files dir ".scm")))
                (substitute* files
                  (("\"libguile-ncurses\"")
-                  (format #f "\"~a/lib/guile/2.2/libguile-ncurses\""
-                          out)))
+                  (format #f "\"~a/lib/guile/~a/libguile-ncurses\""
+                          out (target-guile-effective-version))))
                #t))))))
     (home-page "https://www.gnu.org/software/guile-ncurses/")
     (synopsis "Guile bindings to ncurses")
@@ -1858,6 +1864,14 @@ 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)))))
+
 (define-public guile-ncurses/gpm
   (package
     (inherit guile-ncurses)
-- 
2.26.2
M
M
Mathieu Othacehe wrote on 2 May 2020 12:32
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 40984-done@debbugs.gnu.org)
87tv0yzkxn.fsf@gmail.com
Hello Martin,

Toggle quote (3 lines)
> Ok I think figured it out! Attached is the updated patch. I had to use
> (target-guile-effective-version) instead of effective-version.

Nice! I pushed those patches to master.

Thanks,

Mathieu
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 40984@debbugs.gnu.org