[Haskell-cafe] error with nanocurses-1.5.2

José Romildo Malaquias j.romildo at gmail.com
Sun Jul 10 16:43:39 CEST 2011


On Sat, Jul 09, 2011 at 01:59:12PM -0300, José Romildo Malaquias wrote:
> Hello.
> 
> When trying to install nanocurses-1.5.2 on my Fedora Linux system, I am
> getting the following error:
> 
> $ cabal install nanocurses
> Resolving dependencies...
> Configuring nanocurses-1.5.2...
> Preprocessing library nanocurses-1.5.2...
> In file included from Curses.hsc:42:0:
> cbits/utils.h:7:20: fatal error: config.h: No such file or directory
> compilation terminated.
> compiling dist/build/UI/Nanocurses/Curses_hsc_make.c failed (exit code 1)
> command was: /usr/bin/gcc -c dist/build/UI/Nanocurses/Curses_hsc_make.c
> -o dist/build/UI/Nanocurses/Curses_hsc_make.o -fno-stack-protector
> -fno-stack-protector -D__GLASGOW_HASKELL__=700 -Dlinux_BUILD_OS
> -Dlinux_HOST_OS -Dx86_64_BUILD_ARCH -Dx86_64_HOST_ARCH -Icbits
> -I/usr/lib64/ghc-7.0.2/unix-2.4.2.0/include
> -I/usr/lib64/ghc-7.0.2/bytestring-0.9.1.10/include
> -I/usr/lib64/ghc-7.0.2/base-4.3.1.0/include
> -I/usr/lib64/ghc-7.0.2/include -I/usr/lib64/ghc-7.0.2/include/
> cabal: Error: some packages failed to install:
> nanocurses-1.5.2 failed during the building phase. The exception was:
> ExitFailure 1
> 
> It would be nice to have this buf fixed.

The attached patch fixes the compilation issues. Basically it changes
the build type from simple to configure in the cabal file, and it
renames the function getline in cbits/utils.{h,c} to mygetline.

If appropriate, please release a new version with the fixes.

Romildo
-------------- next part --------------
diff -ur nanocurses-1.5.2.orig/cbits/utils.c nanocurses-1.5.2/cbits/utils.c
--- nanocurses-1.5.2.orig/cbits/utils.c	2008-05-18 18:09:23.000000000 -0300
+++ nanocurses-1.5.2/cbits/utils.c	2011-07-10 11:23:02.082418889 -0300
@@ -38,7 +38,7 @@
 }
 
 /* sometimes we write to the wrong spot after a refresh */
-int getline(char *buf, FILE *hdl) { 
+int mygetline(char *buf, FILE *hdl) { 
     char *p;
     int c;
 
@@ -52,7 +52,7 @@
 
         while (c != '\n') 
             c = getc(hdl);
-        return getline(buf,hdl);        /* read another line */
+        return mygetline(buf,hdl);        /* read another line */
 
     /* normal packet */
     } else {
@@ -60,7 +60,7 @@
 
         p = fgets(buf+1, BUFLEN-1, hdl);  /* read rest of line */
         if (p == NULL) {
-        //  perror("getline failed\n");
+        //  perror("mygetline failed\n");
             return (-1);
         }
         buf[0] = c;         /* drop the '@' */
diff -ur nanocurses-1.5.2.orig/cbits/utils.h nanocurses-1.5.2/cbits/utils.h
--- nanocurses-1.5.2.orig/cbits/utils.h	2008-05-18 18:09:23.000000000 -0300
+++ nanocurses-1.5.2/cbits/utils.h	2011-07-10 11:22:18.180418821 -0300
@@ -12,5 +12,5 @@
 
 /* packed string IO */
 FILE *openfd(int fd);
-int getline(char *buf, FILE *hdl);
+int mygetline(char *buf, FILE *hdl);
 void forcenext(void);
diff -ur nanocurses-1.5.2.orig/nanocurses.cabal nanocurses-1.5.2/nanocurses.cabal
--- nanocurses-1.5.2.orig/nanocurses.cabal	2008-05-18 18:09:23.000000000 -0300
+++ nanocurses-1.5.2/nanocurses.cabal	2011-07-10 11:21:43.256418788 -0300
@@ -21,7 +21,7 @@
                      (It does not differ significantly from Hmp3's Curses binding, as the Curses.hsc
                      in Nanocurses is essentially extracted from Hmp3.)
 
-build-type:         Simple
+build-type:         Configure
 build-depends:      base>3, unix, bytestring
 tested-with:        GHC==6.8.2
 


More information about the Haskell-Cafe mailing list