lol

ocamlPackages.luv: backport patch; fix clang build

clang build fails with an incompatible pointer type error. Backport a
patch from 0.5.14 which fixes this. Can not just update to 0.5.14 as it
contains breaking changes and breaks most of luv's consumers.

https://github.com/aantron/luv/commit/ad7f953fccb8732fe4eb9018556e8d4f82abf8f2

+93
+6
pkgs/development/ocaml-modules/luv/default.nix
··· 15 15 sha256 = "sha256-dp9qCIYqSdROIAQ+Jw73F3vMe7hnkDe8BgZWImNMVsA="; 16 16 }; 17 17 18 + patches = [ 19 + # backport of patch to fix incompatible pointer type. remove next update 20 + # https://github.com/aantron/luv/commit/ad7f953fccb8732fe4eb9018556e8d4f82abf8f2 21 + ./incompatible-pointer-type-fix.diff 22 + ]; 23 + 18 24 postConfigure = '' 19 25 for f in src/c/vendor/configure/{ltmain.sh,configure}; do 20 26 substituteInPlace "$f" --replace /usr/bin/file file
+87
pkgs/development/ocaml-modules/luv/incompatible-pointer-type-fix.diff
··· 1 + addapted from https://github.com/aantron/luv/commit/ad7f953fccb8732fe4eb9018556e8d4f82abf8f2 2 + diff --git a/src/c/helpers.c b/src/c/helpers.c 3 + index 7fcd8b6..bc1b926 100755 4 + --- a/src/c/helpers.c 5 + +++ b/src/c/helpers.c 6 + @@ -175,7 +175,8 @@ static void luv_getaddrinfo_trampoline( 7 + } 8 + 9 + static void luv_getnameinfo_trampoline( 10 + - uv_getnameinfo_t *c_request, int status, char *hostname, char *service) 11 + + uv_getnameinfo_t *c_request, int status, const char *hostname, 12 + + const char *service) 13 + { 14 + caml_acquire_runtime_system(); 15 + value callback; 16 + @@ -407,7 +408,7 @@ uv_getaddrinfo_cb luv_get_getaddrinfo_trampoline() 17 + return luv_getaddrinfo_trampoline; 18 + } 19 + 20 + -luv_getnameinfo_cb luv_get_getnameinfo_trampoline() 21 + +uv_getnameinfo_cb luv_get_getnameinfo_trampoline() 22 + { 23 + return luv_getnameinfo_trampoline; 24 + } 25 + @@ -613,15 +614,6 @@ int luv_fs_poll_start( 26 + return uv_fs_poll_start(handle, (uv_fs_poll_cb)poll_cb, path, interval); 27 + } 28 + 29 + -int luv_getnameinfo( 30 + - uv_loop_t *loop, uv_getnameinfo_t *req, luv_getnameinfo_cb getnameinfo_cb, 31 + - const struct sockaddr *addr, int flags) 32 + -{ 33 + - return 34 + - uv_getnameinfo( 35 + - loop, req, (uv_getnameinfo_cb)getnameinfo_cb, addr, flags); 36 + -} 37 + - 38 + int luv_read_start( 39 + uv_stream_t *stream, uv_alloc_cb alloc_cb, luv_read_cb read_cb) 40 + { 41 + diff --git a/src/c/helpers.h b/src/c/helpers.h 42 + index f73e32f..2cc1200 100755 43 + --- a/src/c/helpers.h 44 + +++ b/src/c/helpers.h 45 + @@ -55,9 +55,6 @@ typedef void (*luv_fs_event_cb)( 46 + typedef void (*luv_fs_poll_cb)( 47 + uv_fs_poll_t *handle, int status, uv_stat_t *prev, uv_stat_t *curr); 48 + 49 + -typedef void (*luv_getnameinfo_cb)( 50 + - uv_getnameinfo_t *req, int status, char *hostname, char *service); 51 + - 52 + typedef void (*luv_read_cb)(uv_stream_t *stream, ssize_t nread, uv_buf_t *buf); 53 + 54 + typedef void (*luv_udp_recv_cb)( 55 + @@ -78,7 +75,7 @@ uv_fs_cb luv_null_fs_callback_pointer(); 56 + luv_fs_event_cb luv_get_fs_event_trampoline(); 57 + luv_fs_poll_cb luv_get_fs_poll_trampoline(); 58 + uv_getaddrinfo_cb luv_get_getaddrinfo_trampoline(); 59 + -luv_getnameinfo_cb luv_get_getnameinfo_trampoline(); 60 + +uv_getnameinfo_cb luv_get_getnameinfo_trampoline(); 61 + uv_idle_cb luv_get_idle_trampoline(); 62 + luv_once_cb luv_get_once_trampoline(); 63 + uv_poll_cb luv_get_poll_trampoline(); 64 + @@ -173,10 +170,6 @@ int luv_fs_poll_start( 65 + uv_fs_poll_t *handle, luv_fs_poll_cb poll_cb, const char *path, 66 + unsigned int interval); 67 + 68 + -int luv_getnameinfo( 69 + - uv_loop_t *loop, uv_getnameinfo_t *req, luv_getnameinfo_cb getnameinfo_cb, 70 + - const struct sockaddr *addr, int flags); 71 + - 72 + int luv_read_start( 73 + uv_stream_t *stream, uv_alloc_cb alloc_cb, luv_read_cb read_cb); 74 + 75 + diff --git a/src/c/luv_c_function_descriptions.ml b/src/c/luv_c_function_descriptions.ml 76 + index 684a46b..7ac1421 100755 77 + --- a/src/c/luv_c_function_descriptions.ml 78 + +++ b/src/c/luv_c_function_descriptions.ml 79 + @@ -1336,7 +1336,7 @@ struct 80 + (void @-> returning trampoline) 81 + 82 + let getnameinfo = 83 + - foreign "luv_getnameinfo" 84 + + foreign "uv_getnameinfo" 85 + (ptr Loop.t @-> 86 + ptr t @-> 87 + trampoline @->