Control: tags 984158 + patch Control: tags 984158 + pending Dear maintainer,
I've prepared an NMU for grfcodec (versioned as 6.0.6-5.1) and uploaded it to DELAYED/15. Please feel free to tell me if I should cancel it, or to use the changes for a maintainer upload instead. cu Adrian
diff -Nru grfcodec-6.0.6/debian/changelog grfcodec-6.0.6/debian/changelog --- grfcodec-6.0.6/debian/changelog 2020-08-12 15:39:33.000000000 +0300 +++ grfcodec-6.0.6/debian/changelog 2021-11-23 19:42:54.000000000 +0200 @@ -1,3 +1,10 @@ +grfcodec (6.0.6-5.1) unstable; urgency=medium + + * Non-maintainer upload. + * Backport upstream fixes for FTBFS with gcc 11. (Closes: #984158) + + -- Adrian Bunk <b...@debian.org> Tue, 23 Nov 2021 19:42:54 +0200 + grfcodec (6.0.6-5) unstable; urgency=medium * [99dfb79] Fix FTBFS with gcc-10 (Closes: 957307) diff -Nru grfcodec-6.0.6/debian/patches/0001-Fix-name-conflict-with-std-data-c-17.patch grfcodec-6.0.6/debian/patches/0001-Fix-name-conflict-with-std-data-c-17.patch --- grfcodec-6.0.6/debian/patches/0001-Fix-name-conflict-with-std-data-c-17.patch 1970-01-01 02:00:00.000000000 +0200 +++ grfcodec-6.0.6/debian/patches/0001-Fix-name-conflict-with-std-data-c-17.patch 2021-11-23 19:42:17.000000000 +0200 @@ -0,0 +1,95 @@ +From 18ab320d97e2312f18f8fc69f9c610f86dd2ca05 Mon Sep 17 00:00:00 2001 +From: glx <g...@openttd.org> +Date: Fri, 29 Nov 2019 01:12:45 +0100 +Subject: Fix: name conflict with std::data (c++17) + +--- + src/data.cpp | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/src/data.cpp b/src/data.cpp +index e319c40..0781240 100644 +--- a/src/data.cpp ++++ b/src/data.cpp +@@ -1046,7 +1046,7 @@ struct dat{ + #undef DATA + #undef DATA_FILE + #undef END_DATA +-#define DATA() static const dat data[]={ ++#define DATA() static const dat datafiles[]={ + #define DATA_FILE(name)\ + {(char*)_dat##name,"/.nforenum/" #name ".dat",sizeof(_dat##name)-1},\ + +@@ -1126,11 +1126,11 @@ FILE*tryopen(const char*name,const char*mode,bool allownull=false){ + } + + FILE*_myfopen(files file, bool write){ +- FILE*pFile=tryopen(data[file].name,"rb",true); ++ FILE*pFile=tryopen(datafiles[file].name,"rb",true); + if(pFile){ +- if(fgetc(pFile)==data[file].data[0]&&fgetc(pFile)>=data[file].data[1]){ ++ if(fgetc(pFile)==datafiles[file].data[0]&&fgetc(pFile)>=datafiles[file].data[1]){ + if(file>datfeat && (uint)fgetc(pFile)<MaxFeature()){ +- IssueMessage(0,DATAFILE_MISMATCH,data[file].name+NFORENUM_DIR_LEN); ++ IssueMessage(0,DATAFILE_MISMATCH,datafiles[file].name+NFORENUM_DIR_LEN); + assert(false); + exit(EDATA); + } +@@ -1140,9 +1140,9 @@ FILE*_myfopen(files file, bool write){ + } + #if WITH_FMEMOPEN + if (!write) { +- pFile = fmemopen(const_cast<char *>(data[file].data), data[file].len, "rb"); ++ pFile = fmemopen(const_cast<char *>(datafiles[file].data), datafiles[file].len, "rb"); + if (pFile == NULL) { +- IssueMessage(0, DATAFILE_ERROR, OPEN, data[file].name + 1, ERRNO, errno); ++ IssueMessage(0, DATAFILE_ERROR, OPEN, datafiles[file].name + 1, ERRNO, errno); + perror(NULL); + assert(false); + exit(EDATA); +@@ -1150,19 +1150,19 @@ FILE*_myfopen(files file, bool write){ + } else + #endif /* WITH_FMEMOPEN */ + { +- pFile = tryopen(data[file].name,"wb"); +- if (fwrite(data[file].data, 1, data[file].len, pFile) != data[file].len) { +- IssueMessage(0, DATAFILE_ERROR, WRITE, data[file].name + 1, -1); ++ pFile = tryopen(datafiles[file].name,"wb"); ++ if (fwrite(datafiles[file].data, 1, datafiles[file].len, pFile) != datafiles[file].len) { ++ IssueMessage(0, DATAFILE_ERROR, WRITE, datafiles[file].name + 1, -1); + assert(false); + exit(EDATA); + } + fclose(pFile); +- pFile = tryopen(data[file].name,"rb"); ++ pFile = tryopen(datafiles[file].name,"rb"); + } + fgetc(pFile); + fgetc(pFile); + if(file>datfeat && (uint)fgetc(pFile)<MaxFeature()){ +- IssueMessage(0,DATAFILE_MISMATCH,data[file].name+NFORENUM_DIR_LEN); ++ IssueMessage(0,DATAFILE_MISMATCH,datafiles[file].name+NFORENUM_DIR_LEN); + assert(false); + exit(EDATA); + } +@@ -1171,7 +1171,7 @@ FILE*_myfopen(files file, bool write){ + + int _CheckEOF(int dat,files file,const char*src,int line){ + if(dat==EOF){ +- IssueMessage(0,DATAFILE_ERROR,LOAD,data[file].name+NFORENUM_DIR_LEN,FILELINE,src,line); ++ IssueMessage(0,DATAFILE_ERROR,LOAD,datafiles[file].name+NFORENUM_DIR_LEN,FILELINE,src,line); + assert(false); + exit(EDATA); + } +@@ -1185,7 +1185,7 @@ int _GetCheckWord(FILE*pFile,files file,const char*src,int line){ + + void _myfread(FILE*pFile,uchar*target,uint count,files file,const char*src,int line){ + if(fread(target,1,count,pFile)!=count){ +- IssueMessage(0,DATAFILE_ERROR,LOAD,data[file].name+NFORENUM_DIR_LEN,FILELINE,src,line); ++ IssueMessage(0,DATAFILE_ERROR,LOAD,datafiles[file].name+NFORENUM_DIR_LEN,FILELINE,src,line); + assert(false); + exit(EDATA); + } +-- +2.20.1 + diff -Nru grfcodec-6.0.6/debian/patches/cxx11.patch grfcodec-6.0.6/debian/patches/cxx11.patch --- grfcodec-6.0.6/debian/patches/cxx11.patch 1970-01-01 02:00:00.000000000 +0200 +++ grfcodec-6.0.6/debian/patches/cxx11.patch 2021-11-23 19:41:46.000000000 +0200 @@ -0,0 +1,16 @@ +Description: Force C++ 11 +Author: Adrian Bunk <b...@debian.org> +Bug-Debian: https://bugs.debian.org/984158 +Forwarded: https://github.com/OpenTTD/grfcodec/commit/8ed61cfc3a1c97b221027b0a511e018768bac69d + +--- grfcodec-6.0.6.orig/Makefile ++++ grfcodec-6.0.6/Makefile +@@ -96,7 +96,7 @@ FLAGS += -DWITH_PNG $(shell $(LIBPNG_CON + endif + endif + +-MY_CXXFLAGS ?= $(FLAGS) $(CXXFLAGS) ++MY_CXXFLAGS ?= $(FLAGS) $(CXXFLAGS) -std=gnu++11 + + # ======================================================================= + # setup verbose/non-verbose make process diff -Nru grfcodec-6.0.6/debian/patches/series grfcodec-6.0.6/debian/patches/series --- grfcodec-6.0.6/debian/patches/series 2020-08-12 15:39:33.000000000 +0300 +++ grfcodec-6.0.6/debian/patches/series 2021-11-23 19:42:49.000000000 +0200 @@ -1,3 +1,5 @@ # Series of quilt patches endian_check_cpp_abort_on_ftbfs.patch gcc_10_ftbfs.patch +cxx11.patch +0001-Fix-name-conflict-with-std-data-c-17.patch