Control: tag -1 patch

Hi!

On Wed, 2024-03-13 at 13:03:23 +0100, Lucas Nussbaum wrote:
> Source: lgeneral
> Version: 1.4.4-2
> Severity: serious
> Justification: FTBFS
> Tags: trixie sid ftbfs
> User: lu...@debian.org
> Usertags: ftbfs-20240313 ftbfs-trixie

> Relevant part (hopefully):
> > gcc -DHAVE_CONFIG_H -DDATADIR=\"/usr/share/games\" -DPREFIX=\"/usr\" -I. 
> > -I..   -I.. -Wdate-time -D_FORTIFY_SOURCE=2  -g -O2 
> > -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. 
> > -fstack-protector-strong -fstack-clash-protection -Wformat 
> > -Werror=format-security -fcf-protection -Wall -std=gnu89 -O0 -g -c -o 
> > portability.o portability.c
> > In file included from localize.h:31,
> >                  from localize.c:27:
> > ../config.h:566:12: fatal error: direct.h: No such file or directory
> >   566 | #  include <direct.h>
> >       |            ^~~~~~~~~~
> > In file included from portability.c:27:
> > ../config.h:566:12: fatal error: direct.h: No such file or directory
> >   566 | #  include <direct.h>
> >       |            ^~~~~~~~~~
> > compilation terminated.
> > compilation terminated.
> > make[3]: *** [Makefile:418: portability.o] Error 1

The attached patch should workaround this problem. From the patch
description:

  Fix missing declaration for mkdir(2)

  The header where mkdir(2) is declared is <sys/stat.h> not <unistd.h>,
  which means that with new compilers that default to set
  -Werror=implicit-function-declaration, the configure check fails and
  causes the code to try to include a <direct.h> header that does not·
  exist on the system
  .
  We currently need to only change the generated configure because
  the package disables the autoreconf sequence, due to the upstream
  build system being out-of-date and failing to autoreconf cleanly.
  To fix this properly the build system should get updated, then the
  sequence re-enabled, and the change from here applied to the
  configure.ac instead.

Thanks,
Guillem
diff -Nru lgeneral-1.4.4/debian/patches/implicit-decls.patch lgeneral-1.4.4/debian/patches/implicit-decls.patch
--- lgeneral-1.4.4/debian/patches/implicit-decls.patch	1970-01-01 01:00:00.000000000 +0100
+++ lgeneral-1.4.4/debian/patches/implicit-decls.patch	2024-05-03 20:54:06.000000000 +0200
@@ -0,0 +1,31 @@
+Description: Fix missing declaration for mkdir(2)
+ The header where mkdir(2) is declared is <sys/stat.h> not <unistd.h>,
+ which means that with new compilers that default to set
+ -Werror=implicit-function-declaration, the configure check fails and
+ causes the code to try to include a <direct.h> header that does not 
+ exist on the system
+ .
+ We currently need to only change the generated configure because the
+ package disables the autoreconf sequence, due to the upstream build system
+ being out-of-date and failing to autoreconf cleanly. To fix this properly
+ the build system should get updated, then the sequence re-enabled, and the
+ change from here applied to the configure.ac instead.
+Author: Guillem Jover <guil...@debian.org>
+Origin: vendor
+Forwarded: not-needed
+
+---
+ configure |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/configure
++++ b/configure
+@@ -5667,7 +5667,7 @@ $as_echo_n "checking if mkdir rejects pe
+ ac_mkdir_perm_broken=yes
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-#include <unistd.h>
++#include <sys/stat.h>
+ int
+ main ()
+ {
diff -Nru lgeneral-1.4.4/debian/patches/series lgeneral-1.4.4/debian/patches/series
--- lgeneral-1.4.4/debian/patches/series	2023-02-25 17:55:55.000000000 +0100
+++ lgeneral-1.4.4/debian/patches/series	2024-05-03 20:43:31.000000000 +0200
@@ -1 +1,2 @@
 fix_desktop_file_encoding.patch
+implicit-decls.patch

Reply via email to