diff --git a/pkgs/development/python-modules/uamqp/clang-fix-incompatible-function-pointer-conversion.patch b/pkgs/development/python-modules/uamqp/clang-fix-incompatible-function-pointer-conversion.patch new file mode 100644 index 000000000000..ed177797da0c --- /dev/null +++ b/pkgs/development/python-modules/uamqp/clang-fix-incompatible-function-pointer-conversion.patch @@ -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 = context + if context_pyobj.ob_refcnt == 0: # context is being garbage collected, skip the callback diff --git a/pkgs/development/python-modules/uamqp/default.nix b/pkgs/development/python-modules/uamqp/default.nix index 207ad3d43727..c306068f7fdb 100644 --- a/pkgs/development/python-modules/uamqp/default.nix +++ b/pkgs/development/python-modules/uamqp/default.nix @@ -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) '' diff --git a/pkgs/tools/text/mecab/base.nix b/pkgs/tools/text/mecab/base.nix index 572ec28c0750..ea572104238c 100644 --- a/pkgs/tools/text/mecab/base.nix +++ b/pkgs/tools/text/mecab/base.nix @@ -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; } diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index c8a775e64459..d20b3692f31c 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -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/*" ]; }) ];