Merge pull request #265344 from reckenrode/clang16-fixes-batch3

mecab-nodic,mecab,python3Package.uamqp,source-highlight: fix build with clang 16
This commit is contained in:
Weijia Wang 2023-11-05 01:57:54 +01:00 committed by GitHub
commit b6ba8de16f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 4 deletions

View File

@ -0,0 +1,13 @@
diff --git a/src/message_receiver.pyx b/src/message_receiver.pyx
index b99647c..479cc9c 100644
--- a/src/message_receiver.pyx
+++ b/src/message_receiver.pyx
@@ -120,7 +120,7 @@ cdef class cMessageReceiver(StructBase):
#### Callbacks (context is a MessageReceiver instance)
-cdef void on_message_receiver_state_changed(void* context, c_message_receiver.MESSAGE_RECEIVER_STATE_TAG new_state, c_message_receiver.MESSAGE_RECEIVER_STATE_TAG previous_state):
+cdef void on_message_receiver_state_changed(const void* context, c_message_receiver.MESSAGE_RECEIVER_STATE_TAG new_state, c_message_receiver.MESSAGE_RECEIVER_STATE_TAG previous_state):
if context != NULL:
context_pyobj = <PyObject*>context
if context_pyobj.ob_refcnt == 0: # context is being garbage collected, skip the callback

View File

@ -27,6 +27,9 @@ buildPythonPackage rec {
patches = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
./darwin-azure-c-shared-utility-corefoundation.patch
] ++ [
# Fix incompatible function pointer conversion error with clang 16.
./clang-fix-incompatible-function-pointer-conversion.patch
];
postPatch = lib.optionalString (stdenv.isDarwin && !stdenv.isx86_64) ''

View File

@ -15,5 +15,9 @@ finalAttrs: {
"--with-charset=utf8"
];
# mecab uses several features that have been removed in C++17.
# Force the language mode to C++14, so that it can compile with clang 16.
makeFlags = [ "CXXFLAGS=-std=c++14" ];
doCheck = true;
}

View File

@ -14,16 +14,24 @@ stdenv.mkDerivation rec {
patches = [
# gcc-11 compat upstream patch
(fetchpatch {
url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4";
sha256 = "1wnj0jmkmrwjww7qk9dvfxh8h06jdn7mi8v2fvwh95b6x87z5l47";
url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4";
hash = "sha256-h9DyD+pmlQT5dmKjWI9t0gCIYHe7pYkP55LnOqsE0vI=";
excludes = [ "ChangeLog" ];
})
# Upstream fix for clang-13 and gcc-12 test support
(fetchpatch {
name = "gcc-12.patch";
url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9";
sha256 = "1v33zd2766k7cdgmajw2lffw9wd7v4f8z01f40z53f6bp608nr62";
url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9";
hash = "sha256-wmSLgLnLuFE+IC6AjxzZp/HEnaOCS1VfY2cac0T7Y+w=";
})
] ++ lib.optionals stdenv.cc.isClang [
# Adds compatibility with C++17 by removing the `register` storage class specifier.
(fetchpatch {
name = "remove-register-keyword";
url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=416b39758dba2c74515584514a959ad1b0ad50d1";
hash = "sha256-R5A7IGHhU82EqceMCsuNBanhRz4dFVqiaH8637dr7jw=";
includes = [ "lib/*" ];
})
];