diff mbox

[v2] gnu: Add perl-curses

Message ID 87k2fcev8k.fsf@we.make.ritual.n0.is
State New
Headers show

Commit Message

non such Aug. 19, 2016, 1:36 p.m. UTC
Okay, when I build this without "FORMS" it succeeds. Works for me.

Comments

Efraim Flashner Sept. 6, 2016, 5:36 p.m. UTC | #1
On Fri, Aug 19, 2016 at 01:36:27PM +0000, ng0 wrote:
> Okay, when I build this without "FORMS" it succeeds. Works for me.
> 

> From a72020974650298e89b82abda8e07f722f7cf32c Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@we.make.ritual.n0.is>
> Date: Fri, 19 Aug 2016 13:13:42 +0000
> Subject: [PATCH 1/2] gnu: Add perl-curses.
> 
> * gnu/packages/perl.scm (perl-curses): New variable.
> ---
>  gnu/packages/perl.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
> index aef92f4..170eacd 100644
> --- a/gnu/packages/perl.scm
> +++ b/gnu/packages/perl.scm
> @@ -30,6 +30,7 @@
>  (define-module (gnu packages perl)
>    #:use-module (guix licenses)
>    #:use-module (gnu packages)
> +  #:use-module (gnu packages ncurses)
>    #:use-module (guix packages)
>    #:use-module (guix download)
>    #:use-module (guix build-system gnu)
> @@ -1138,6 +1139,57 @@ contained in Appendix A of FIPS Publication 181, \"Standard for Automated
>  Password Generator\".")
>      (license (package-license perl))))
>  
> +(define-public perl-curses
> +  (package
> +    (name "perl-curses")
> +    (version "1.36")
> +    (source (origin
> +              (method url-fetch)
> +              (uri (string-append "mirror://cpan/authors/id/G/GI/GIRAFFED/"
> +                                  "Curses-" version ".tar.gz"))
> +              (sha256
> +               (base32
> +                "0r6xd9wr0c25rr28zixhqipak575zqsfb7r7f2693i9il1dpj554"))))
> +    (build-system perl-build-system)
> +    (inputs
> +     `(("ncurses" ,ncurses)))
> +    (arguments
> +     `(#:make-maker-flags (list "PANELS" "MENUS") ; FORMS seems faulty.
> +       #:phases
> +       (modify-phases %standard-phases
> +         (add-before 'configure 'set-curses-ldflags
> +           (lambda* (#:key inputs #:allow-other-keys)

you'd do well with a (let ... here for all of your (assoc-ref inputs "ncurses").

> +             (setenv "CURSES_LIBTYPE" "ncurses")
> +             (setenv "CURSES_CFLAGS"
> +                     (string-append "-I" (assoc-ref inputs "ncurses")
> +                                    "/include"))
> +             (setenv "CURSES_PANEL_CFLAGS"
> +                     (string-append "-I" (assoc-ref inputs "ncurses")
> +                                    "/include"))
> +             (setenv "CURSES_MENU_CFLAGS"
> +                     (string-append "-I" (assoc-ref inputs "ncurses")
> +                                    "/include"))
> +             (setenv "CURSES_FORM_CFLAGS"
> +                     (string-append "-I" (assoc-ref inputs "ncurses")
> +                                    "/include"))
> +             (setenv "CURSES_LDFLAGS"
> +                     (string-append "-L" (assoc-ref inputs "ncurses")
> +                                    "/lib -lncurses"))
> +             (setenv "CURSES_PANEL_LDFLAGS"
> +                     (string-append "-L" (assoc-ref inputs "ncurses")
> +                                    "/lib -lpanel"))
> +             (setenv "CURSES_MENU_LDFLAGS"
> +                     (string-append "-L" (assoc-ref inputs "ncurses")
> +                                    "/lib -lmenu"))
> +             (setenv "CURSES_FORM_LDFLAGS"
> +                     (string-append "-L" (assoc-ref inputs "ncurses")
> +                                    "/lib -lform")))))))
> +    (home-page "http://search.cpan.org/dist/Curses")
> +    (synopsis "Terminal screen handling and optimization")
> +    (description
> +     "@code{Curses} is the interface between Perl and the curses library of your system.")
> +    (license (package-license perl))))
> +
>  (define-public perl-czplib
>    (package
>      (name "perl-czplib")
> -- 
> 2.9.3
> 

I think this would go better in ncurses.scm than in perl. Can you send
an updated patch? Thanks.
diff mbox

Patch

From a72020974650298e89b82abda8e07f722f7cf32c Mon Sep 17 00:00:00 2001
From: ng0 <ng0@we.make.ritual.n0.is>
Date: Fri, 19 Aug 2016 13:13:42 +0000
Subject: [PATCH 1/2] gnu: Add perl-curses.

* gnu/packages/perl.scm (perl-curses): New variable.
---
 gnu/packages/perl.scm | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index aef92f4..170eacd 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -30,6 +30,7 @@ 
 (define-module (gnu packages perl)
   #:use-module (guix licenses)
   #:use-module (gnu packages)
+  #:use-module (gnu packages ncurses)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
@@ -1138,6 +1139,57 @@  contained in Appendix A of FIPS Publication 181, \"Standard for Automated
 Password Generator\".")
     (license (package-license perl))))
 
+(define-public perl-curses
+  (package
+    (name "perl-curses")
+    (version "1.36")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://cpan/authors/id/G/GI/GIRAFFED/"
+                                  "Curses-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0r6xd9wr0c25rr28zixhqipak575zqsfb7r7f2693i9il1dpj554"))))
+    (build-system perl-build-system)
+    (inputs
+     `(("ncurses" ,ncurses)))
+    (arguments
+     `(#:make-maker-flags (list "PANELS" "MENUS") ; FORMS seems faulty.
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'set-curses-ldflags
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CURSES_LIBTYPE" "ncurses")
+             (setenv "CURSES_CFLAGS"
+                     (string-append "-I" (assoc-ref inputs "ncurses")
+                                    "/include"))
+             (setenv "CURSES_PANEL_CFLAGS"
+                     (string-append "-I" (assoc-ref inputs "ncurses")
+                                    "/include"))
+             (setenv "CURSES_MENU_CFLAGS"
+                     (string-append "-I" (assoc-ref inputs "ncurses")
+                                    "/include"))
+             (setenv "CURSES_FORM_CFLAGS"
+                     (string-append "-I" (assoc-ref inputs "ncurses")
+                                    "/include"))
+             (setenv "CURSES_LDFLAGS"
+                     (string-append "-L" (assoc-ref inputs "ncurses")
+                                    "/lib -lncurses"))
+             (setenv "CURSES_PANEL_LDFLAGS"
+                     (string-append "-L" (assoc-ref inputs "ncurses")
+                                    "/lib -lpanel"))
+             (setenv "CURSES_MENU_LDFLAGS"
+                     (string-append "-L" (assoc-ref inputs "ncurses")
+                                    "/lib -lmenu"))
+             (setenv "CURSES_FORM_LDFLAGS"
+                     (string-append "-L" (assoc-ref inputs "ncurses")
+                                    "/lib -lform")))))))
+    (home-page "http://search.cpan.org/dist/Curses")
+    (synopsis "Terminal screen handling and optimization")
+    (description
+     "@code{Curses} is the interface between Perl and the curses library of your system.")
+    (license (package-license perl))))
+
 (define-public perl-czplib
   (package
     (name "perl-czplib")
-- 
2.9.3