From 988ed3a17b1a5ba659c4f3758b5a262859b0e4e1 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sun, 14 Aug 2016 21:03:39 +0200 Subject: [PATCH] Added patch from openSUSE to build with GCC >= 6 (#1307706) --- kyotocabinet-1.2.76-gcc6.patch | 29 +++++++++++++++++++++++++++++ kyotocabinet.spec | 7 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 kyotocabinet-1.2.76-gcc6.patch diff --git a/kyotocabinet-1.2.76-gcc6.patch b/kyotocabinet-1.2.76-gcc6.patch new file mode 100644 index 0000000..0463b26 --- /dev/null +++ b/kyotocabinet-1.2.76-gcc6.patch @@ -0,0 +1,29 @@ +Patch from openSUSE 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*)': +kcdbext.h:1281:14: error: cannot convert 'bool' to 'char*' in return + return false; + ^~~~~ +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: cannot convert 'bool' to 'char*' in return + return false; + ^~~~~ + +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 + +--- 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 +@@ -1278,7 +1278,7 @@ + if (omode_ == 0) { + set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened"); + *sp = 0; +- return false; ++ return '\0'; + } + if (!cache_) return db_.get(kbuf, ksiz, sp); + size_t dvsiz = 0; diff --git a/kyotocabinet.spec b/kyotocabinet.spec index acc9014..47b1ec5 100644 --- a/kyotocabinet.spec +++ b/kyotocabinet.spec @@ -1,7 +1,7 @@ Summary: A straightforward implementation of DBM Name: kyotocabinet Version: 1.2.76 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv3 Group: Applications/Databases URL: http://fallabs.com/%{name}/ @@ -9,6 +9,7 @@ Source: http://fallabs.com/%{name}/pkg/%{name}-%{version}.tar.gz Patch0: kyotocabinet-1.2.76-cflags.patch Patch1: kyotocabinet-1.2.76-8-byte-atomics.patch Patch2: kyotocabinet-1.2.76-tr1_hashtable.patch +Patch3: kyotocabinet-1.2.76-gcc6.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} BuildRequires: zlib-devel, lzo-devel, xz-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -62,6 +63,7 @@ applications that use Kyoto Cabinet. %if 0%{?rhel} == 5 %patch2 -p1 -b .tr1_hashtable %endif +%patch3 -p1 -b .gcc6 %build %configure --disable-opt --enable-lzo --enable-lzma @@ -168,6 +170,9 @@ rm -rf $RPM_BUILD_ROOT %doc COPYING doc/api/* kyotocabinet.idl %changelog +* Sun Aug 14 2016 Robert Scheck 1.2.76-11 +- Added patch from openSUSE to build with GCC >= 6 (#1307706) + * Thu Feb 04 2016 Fedora Release Engineering - 1.2.76-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild