Skip Menu |

This queue is for tickets about the Term-Terminfo CPAN distribution.

Report information
The Basics
Id: 78155
Status: resolved
Priority: 0/
Queue: Term-Terminfo

People
Owner: Nobody in particular
Requestors: czacek [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.08



Subject: Build fix for Term::Terminfo on cygwin
Date: Mon, 2 Jul 2012 15:37:41 -0500
To: bug-Term-Terminfo [...] rt.cpan.org
From: Casey Zacek <czacek [...] gmail.com>
Hi, Cygwin 1.7 with Perl v5.14.2 I haven't actually tried to use Term::Terminfo yet (soon), but I did build it. I had to change Build.PL so it would find term.h (use find_include_dirs_for instead of assert_compile_run, and add the /usr/include/terminfo dir), and then again so this step would actually compile (linking with libncurses is required in order to reference cur_term, at least on this platform/version): --- cut --- diff -urN Term-Terminfo-0.07/Build.PL Term-Terminfo-0.07-UVrAfg/Build.PL --- Term-Terminfo-0.07/Build.PL 2011-09-28 16:15:23.000000000 -0500 +++ Term-Terminfo-0.07-UVrAfg/Build.PL 2012-07-02 15:30:37.358221100 -0500 @@ -16,13 +16,16 @@ $cc->push_extra_linker_flags ( split ' ', ExtUtils::PkgConfig->libs( "unibilium" ) ); } else { - $cc->assert_compile_run( + $cc->find_include_dirs_for( diag => "no term.h", + dirs => [[qw(/usr/include/ncurses)]], source => <<'EOF' ); #include <stdio.h> #include <term.h> int main(int argc, char *argv[]) { - TERMINAL *term = cur_term; + char tmp[64]; + TERMINAL term; + sprintf(tmp, "term._termname ptr = %p\n", term._termname); return 0; } EOF --- cut --- -- Casey Zacek czacek@gmail.com
On Mon Jul 02 16:37:52 2012, czacek@gmail.com wrote: Show quoted text
> Hi, > > Cygwin 1.7 with Perl v5.14.2 > > I haven't actually tried to use Term::Terminfo yet (soon), but I did build > it. I had to change Build.PL so it would find term.h (use > find_include_dirs_for instead of assert_compile_run, and add the > /usr/include/terminfo dir), and then again so this step would actually > compile (linking with libncurses is required in order to reference > cur_term, at least on this platform/version):
Ah yes. Applied patch with two alterations: Show quoted text
> --- Term-Terminfo-0.07/Build.PL 2011-09-28 16:15:23.000000000 -0500 > +++ Term-Terminfo-0.07-UVrAfg/Build.PL 2012-07-02 15:30:37.358221100 -0500 > @@ -16,13 +16,16 @@ > $cc->push_extra_linker_flags ( split ' ', ExtUtils::PkgConfig->libs( > "unibilium" ) ); > } > else { > - $cc->assert_compile_run( > + $cc->find_include_dirs_for( > diag => "no term.h", > + dirs => [[qw(/usr/include/ncurses)]],
Best to start with dirs => [ [], [qw(/usr/include/ncurses)] ] so it starts with the empty case first, as that's likely to work on most systems. Show quoted text
> source => <<'EOF' ); > #include <stdio.h> > #include <term.h> > int main(int argc, char *argv[]) { > - TERMINAL *term = cur_term; > + char tmp[64]; > + TERMINAL term; > + sprintf(tmp, "term._termname ptr = %p\n", term._termname);
That sprintf isn't really necessary. I've replaced with a far simpler char *name = term._termname; which will still fail to compile if the struct lacks such a member. These are applied in 0.08, which I have just this second uploaded to CPAN. Thanks, -- Paul Evans
Subject: Re: [rt.cpan.org #78155] Build fix for Term::Terminfo on cygwin
Date: Tue, 3 Jul 2012 10:06:25 -0500
To: bug-Term-Terminfo [...] rt.cpan.org
From: Casey Zacek <czacek [...] gmail.com>
Sounds good. The module does what I needed it to do. Thanks! -cz On Tue, Jul 3, 2012 at 7:48 AM, Paul Evans via RT < bug-Term-Terminfo@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=78155 > > > On Mon Jul 02 16:37:52 2012, czacek@gmail.com wrote:
> > Hi, > > > > Cygwin 1.7 with Perl v5.14.2 > > > > I haven't actually tried to use Term::Terminfo yet (soon), but I did
> build
> > it. I had to change Build.PL so it would find term.h (use > > find_include_dirs_for instead of assert_compile_run, and add the > > /usr/include/terminfo dir), and then again so this step would actually > > compile (linking with libncurses is required in order to reference > > cur_term, at least on this platform/version):
> > Ah yes. Applied patch with two alterations: >
> > --- Term-Terminfo-0.07/Build.PL 2011-09-28 16:15:23.000000000 -0500 > > +++ Term-Terminfo-0.07-UVrAfg/Build.PL 2012-07-02 15:30:37.358221100
> -0500
> > @@ -16,13 +16,16 @@ > > $cc->push_extra_linker_flags ( split ' ', ExtUtils::PkgConfig->libs( > > "unibilium" ) ); > > } > > else { > > - $cc->assert_compile_run( > > + $cc->find_include_dirs_for( > > diag => "no term.h", > > + dirs => [[qw(/usr/include/ncurses)]],
> > Best to start with > > dirs => [ [], [qw(/usr/include/ncurses)] ] > > so it starts with the empty case first, as that's likely to work on most > systems. >
> > source => <<'EOF' ); > > #include <stdio.h> > > #include <term.h> > > int main(int argc, char *argv[]) { > > - TERMINAL *term = cur_term; > > + char tmp[64]; > > + TERMINAL term; > > + sprintf(tmp, "term._termname ptr = %p\n", term._termname);
> > That sprintf isn't really necessary. I've replaced with a far simpler > > char *name = term._termname; > > which will still fail to compile if the struct lacks such a member. > > > These are applied in 0.08, which I have just this second uploaded to CPAN. > > > Thanks, > > -- > > Paul Evans >
Now fixed. -- Paul Evans