Processed: Re: Bug#868599: ocaml-curses FTBFS with recent ncurses

2017-07-17 Thread Debian Bug Tracking System
Processing control commands:

> tags -1 + patch
Bug #868599 [src:ocaml-curses] ocaml-curses FTBFS with recent ncurses
Added tag(s) patch.

-- 
868599: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=868599
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#868599: ocaml-curses FTBFS with recent ncurses

2017-07-17 Thread Sven Joachim
Control: tags -1 + patch

On 2017-07-17 02:17 +0300, Adrian Bunk wrote:

> Source: ocaml-curses
> Version: 1.0.3-2
> Severity: serious
> Tags: buster sid
>
> https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ocaml-curses.html
>
> ...
> checking for sys/ioctl.h... yes
> checking windows.h usability... no
> checking windows.h presence... no
> checking for windows.h... no
> checking for working ncurses library... found in -lncursesw
> checking for term.h... configure: error: not found
> debian/rules:21: recipe for target 'build-stamp' failed
> make: *** [build-stamp] Error 1
>
>
>
> config.log says:
>
> ...
> configure:3644: checking for term.h
> configure:3657: gcc -c -g -O2   conftest.c >&5
> conftest.c: In function 'main':
> conftest.c:26:10: error: storage size of '__dummy' isn't known
>  TERMINAL __dummy
>   ^~~

This has been caused by the following change in ncurses:

,
| 20170318
|   + change TERMINAL structure in term.h to make it opaque.  Some
| applications misuse its members, e.g., directly modifying it
| rather than using def_prog_mode().
`

Changing the test in configure.ac to use TERMTYPE rather than TERMINAL
fixes the problem, see the attached debdiff.  It is very noisy because
the patch run_autoconf.diff had to be refreshed by rerunning autoreconf.
It would be better to regenerate `configure' at build time, e.g. with
dh_autoreconf.

Cheers,
   Sven

diff -Nru ocaml-curses-1.0.3/debian/changelog ocaml-curses-1.0.3/debian/changelog
--- ocaml-curses-1.0.3/debian/changelog	2012-01-05 02:44:06.0 +0100
+++ ocaml-curses-1.0.3/debian/changelog	2017-07-17 09:55:43.0 +0200
@@ -1,3 +1,11 @@
+ocaml-curses (1.0.3-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use TERMTYPE rather than TERMINAL in configure check, the latter is
+opaque in recent ncurses versions (Closes: #868599).
+
+ -- Sven Joachim   Mon, 17 Jul 2017 09:55:43 +0200
+
 ocaml-curses (1.0.3-2) unstable; urgency=low
 
   * Team upload.
diff -Nru ocaml-curses-1.0.3/debian/patches/configure.ac.diff ocaml-curses-1.0.3/debian/patches/configure.ac.diff
--- ocaml-curses-1.0.3/debian/patches/configure.ac.diff	1970-01-01 01:00:00.0 +0100
+++ ocaml-curses-1.0.3/debian/patches/configure.ac.diff	2017-07-17 09:55:43.0 +0200
@@ -0,0 +1,33 @@
+Description: Use TERMTYPE rather than TERMINAL in configure script
+ The TERMINAL structure has been made opaque in ncurses since the
+ 20170318 patchlevel, this made the test fail.
+Author: Sven Joachim 
+Bug-Debian: https://bugs.debian.org/868599
+
+---
+ configure.ac |6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/configure.ac
 b/configure.ac
+@@ -91,17 +91,17 @@ fi
+ 
+ AC_MSG_CHECKING(for term.h)
+ AC_TRY_COMPILE(
+-   [#include ], [TERMINAL __dummy],
++   [#include ], [TERMTYPE __dummy],
+[TERM_H_STRING=""
+ AC_DEFINE(CURSES_TERM_H, , [Defined to ncurses term.h file])],
+[
+ AC_TRY_COMPILE(
+-   [#include ], [TERMINAL __dummy],
++   [#include ], [TERMTYPE __dummy],
+[TERM_H_STRING=""
+ AC_DEFINE(CURSES_TERM_H, , [Defined to ncurses term.h file])],
+[
+ AC_TRY_COMPILE(
+-   [#include ], [TERMINAL __dummy],
++   [#include ], [TERMTYPE __dummy],
+[TERM_H_STRING=""
+ AC_DEFINE(CURSES_TERM_H, , [Defined to ncurses term.h file])],
+ ) ]) ])
diff -Nru ocaml-curses-1.0.3/debian/patches/run_autoconf.diff ocaml-curses-1.0.3/debian/patches/run_autoconf.diff
--- ocaml-curses-1.0.3/debian/patches/run_autoconf.diff	2012-01-05 02:33:32.0 +0100
+++ ocaml-curses-1.0.3/debian/patches/run_autoconf.diff	2017-07-17 09:43:15.0 +0200
@@ -1,9 +1,13 @@
 Author: Sylvain Le Gall 
 Description: run autoconf
 
-diff -urNad ocaml-curses~/config.h.in ocaml-curses/config.h.in
 ocaml-curses~/config.h.in	1970-01-01 00:00:00.0 +
-+++ ocaml-curses/config.h.in	2009-12-16 23:40:18.253476530 +
+---
+ config.h.in |   79 
+ configure   | 5109 
+ 2 files changed, 5188 insertions(+)
+
+--- /dev/null
 b/config.h.in
 @@ -0,0 +1,79 @@
 +/* config.h.in.  Generated from configure.ac by autoheader.  */
 +
@@ -84,18 +88,15 @@
 +
 +/* Define to 1 if you have the ANSI C header files. */
 +#undef STDC_HEADERS
-diff -urNad ocaml-curses~/configure ocaml-curses/configure
 ocaml-curses~/configure	1970-01-01 00:00:00.0 +
-+++ ocaml-curses/configure	2009-12-16 23:40:11.773540312 +
-@@ -0,0 +1,5056 @@
+--- /dev/null
 b/configure
+@@ -0,0 +1,5109 @@
 +#! /bin/sh
 +# Guess values for system-dependent variables and create Makefiles.
-+# Generated by GNU Autoconf 2.65.
++# Generated by GNU Autoconf 2.69.
 +#
 +#
-+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-+# Inc.
++# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
 +#
 +#
 +# This configure script is free 

Bug#868599: ocaml-curses FTBFS with recent ncurses

2017-07-16 Thread Adrian Bunk
Source: ocaml-curses
Version: 1.0.3-2
Severity: serious
Tags: buster sid

https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ocaml-curses.html

...
checking for sys/ioctl.h... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking for working ncurses library... found in -lncursesw
checking for term.h... configure: error: not found
debian/rules:21: recipe for target 'build-stamp' failed
make: *** [build-stamp] Error 1



config.log says:

...
configure:3644: checking for term.h
configure:3657: gcc -c -g -O2   conftest.c >&5
conftest.c: In function 'main':
conftest.c:26:10: error: storage size of '__dummy' isn't known
 TERMINAL __dummy
  ^~~
configure:3657: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_TERMIOS_H 1
| #define HAVE_SYS_IOCTL_H 1
| #define CURSES_HEADER 
| /* end confdefs.h.  */
| #include 
| int
| main ()
| {
| TERMINAL __dummy
|   ;
|   return 0;
| }
...