source-highlight: fix build with clang 16

Fetch upstream patch to add C++17 compatibility (the default in clang
16) and standardize fetchpatch URLs and hashes.

+12 -4
+12 -4
pkgs/tools/text/source-highlight/default.nix
··· 14 14 patches = [ 15 15 # gcc-11 compat upstream patch 16 16 (fetchpatch { 17 - url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4"; 18 - sha256 = "1wnj0jmkmrwjww7qk9dvfxh8h06jdn7mi8v2fvwh95b6x87z5l47"; 17 + url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=904949c9026cb772dc93fbe0947a252ef47127f4"; 18 + hash = "sha256-h9DyD+pmlQT5dmKjWI9t0gCIYHe7pYkP55LnOqsE0vI="; 19 19 excludes = [ "ChangeLog" ]; 20 20 }) 21 21 22 22 # Upstream fix for clang-13 and gcc-12 test support 23 23 (fetchpatch { 24 24 name = "gcc-12.patch"; 25 - url = "http://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9"; 26 - sha256 = "1v33zd2766k7cdgmajw2lffw9wd7v4f8z01f40z53f6bp608nr62"; 25 + url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=ab9fe5cb9b85c5afab94f2a7f4b6d7d473c14ee9"; 26 + hash = "sha256-wmSLgLnLuFE+IC6AjxzZp/HEnaOCS1VfY2cac0T7Y+w="; 27 + }) 28 + ] ++ lib.optionals stdenv.cc.isClang [ 29 + # Adds compatibility with C++17 by removing the `register` storage class specifier. 30 + (fetchpatch { 31 + name = "remove-register-keyword"; 32 + url = "https://git.savannah.gnu.org/cgit/src-highlite.git/patch/?id=416b39758dba2c74515584514a959ad1b0ad50d1"; 33 + hash = "sha256-R5A7IGHhU82EqceMCsuNBanhRz4dFVqiaH8637dr7jw="; 34 + includes = [ "lib/*" ]; 27 35 }) 28 36 ]; 29 37