summaryrefslogtreecommitdiffstats
path: root/system/kyotocabinet
diff options
context:
space:
mode:
Diffstat (limited to 'system/kyotocabinet')
-rw-r--r--system/kyotocabinet/kyotocabinet-1.2.76-gcc6.patch45
-rw-r--r--system/kyotocabinet/kyotocabinet.SlackBuild5
2 files changed, 49 insertions, 1 deletions
diff --git a/system/kyotocabinet/kyotocabinet-1.2.76-gcc6.patch b/system/kyotocabinet/kyotocabinet-1.2.76-gcc6.patch
new file mode 100644
index 0000000000..d565cff0f3
--- /dev/null
+++ b/system/kyotocabinet/kyotocabinet-1.2.76-gcc6.patch
@@ -0,0 +1,45 @@
+Patch from Andreas Stührk <andy@hammerhartes.de> 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;
+ ^~~~~
+
+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
+@@ -1278,7 +1278,7 @@
+ if (omode_ == 0) {
+ set_error(_KCCODELINE_, BasicDB::Error::INVALID, "not opened");
+ *sp = 0;
+- return false;
++ return nullptr;
+ }
+ if (!cache_) return db_.get(kbuf, ksiz, sp);
+ size_t dvsiz = 0;
diff --git a/system/kyotocabinet/kyotocabinet.SlackBuild b/system/kyotocabinet/kyotocabinet.SlackBuild
index 6cb8823a5a..5efbfdb944 100644
--- a/system/kyotocabinet/kyotocabinet.SlackBuild
+++ b/system/kyotocabinet/kyotocabinet.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
# Slackware build script for kyotocabinet
-# Copyright 2013 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy
+# Copyright 2013-2017 Matteo Bernardini <ponce@slackbuilds.org>, Pisa, Italy
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -69,6 +69,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Patch for gcc >= 6.x - thanks to opensuse
+patch -p1 < $CWD/kyotocabinet-1.2.76-gcc6.patch
+
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \