From 1e16abdf7fb98181aafd1dee5b4e2d9f20b3b786 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sun, 12 Feb 2017 16:02:08 +0100 Subject: [PATCH] Replace patch from openSUSE by the Debian one to not only build kyotocabinet with GCC >= 6 but also with GCC >= 7 (#1307706 #c15) --- kyotocabinet-1.2.76-gcc6.patch | 20 ++++++++++++++++++-- kyotocabinet.spec | 10 ++++++++-- sources | 2 +- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/kyotocabinet-1.2.76-gcc6.patch b/kyotocabinet-1.2.76-gcc6.patch index 0463b26..d565cff 100644 --- a/kyotocabinet-1.2.76-gcc6.patch +++ b/kyotocabinet-1.2.76-gcc6.patch @@ -1,4 +1,5 @@ -Patch from openSUSE to work around build failures with GCC >= 6 like: +Patch from Andreas Stührk to work around build +failures with GCC >= 6 like: In file included from kcdbext.cc:16:0: kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)': @@ -11,10 +12,25 @@ kcdbext.h:1281:14: error: cannot convert 'bool' to 'char*' in return return false; ^~~~~ +Note that using '\0' rather nullptr (like the patch from openSUSE is +doing) just leads to new build failures with GCC >= 7 like: + +In file included from kcdbext.cc:16:0: +kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)': +kcdbext.h:1281:14: error: invalid conversion from 'char' to 'char*' [-fpermissive] + return '\0'; + ^~~~ +In file included from kclangc.cc:17:0: +kcdbext.h: In member function 'char* kyotocabinet::IndexDB::get(const char*, size_t, size_t*)': +kcdbext.h:1281:14: error: invalid conversion from 'char' to 'char*' [-fpermissive] + return '\0'; + ^~~~ + See also: - https://bugzilla.redhat.com/show_bug.cgi?id=1307706 - https://build.opensuse.org/package/view_file/devel:libraries:c_c++/kyotocabinet/gcc6-fix-errors.patch?expand=1 + - https://bugs.debian.org/811627 --- kyotocabinet-1.2.76/kcdbext.h 2016-05-25 11:32:53.591866016 +0200 +++ kyotocabinet-1.2.76/kcdbext.h 2012-05-24 18:27:59.000000000 +0200 @@ -23,7 +39,7 @@ See also: set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); *sp = 0; - return false; -+ return '\0'; ++ return nullptr; } if (!cache_) return db_.get(kbuf, ksiz, sp); size_t dvsiz = 0; diff --git a/kyotocabinet.spec b/kyotocabinet.spec index 6540635..60575c8 100644 --- a/kyotocabinet.spec +++ b/kyotocabinet.spec @@ -1,7 +1,7 @@ Summary: A straightforward implementation of DBM Name: kyotocabinet Version: 1.2.76 -Release: 12%{?dist} +Release: 13%{?dist} License: GPLv3 Group: Applications/Databases URL: http://fallabs.com/%{name}/ @@ -135,7 +135,9 @@ rm -rf $RPM_BUILD_ROOT %files libs %defattr(-,root,root,-) -%doc ChangeLog COPYING FOSSEXCEPTION LINKEXCEPTION +%{!?_licensedir:%global license %%doc} +%license COPYING FOSSEXCEPTION LINKEXCEPTION +%doc ChangeLog %{_libdir}/libkyotocabinet.so.* %files devel @@ -170,6 +172,10 @@ rm -rf $RPM_BUILD_ROOT %doc COPYING doc/api/* kyotocabinet.idl %changelog +* Sun Feb 12 2017 Robert Scheck 1.2.76-13 +- Replace patch from openSUSE by the Debian one to not only build + kyotocabinet with GCC >= 6 but also with GCC >= 7 (#1307706 #c15) + * Fri Feb 10 2017 Fedora Release Engineering - 1.2.76-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild diff --git a/sources b/sources index a6d2054..115d7ca 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b925d369d7ed4a37cf0013409046738c kyotocabinet-1.2.76.tar.gz +SHA512 (kyotocabinet-1.2.76.tar.gz) = 278db7b327eb4c21bf0137d9aa14fb67d74d5ce7ed1cb29fc9120d157a60de165ec0cf842903eb7952e8f998045ae585b958977fa973ba0e0773381de71d9f6a