push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
{
lib,
buildDunePackage,
ocaml,
fetchurl,
ctypes,
result,
alcotest,
file,
}:
buildDunePackage rec {
pname = "luv";
version = "0.5.12";
minimalOCamlVersion = "4.03";
src = fetchurl {
url = "https://github.com/aantron/luv/releases/download/${version}/luv-${version}.tar.gz";
sha256 = "sha256-dp9qCIYqSdROIAQ+Jw73F3vMe7hnkDe8BgZWImNMVsA=";
};
patches = [
# backport of patch to fix incompatible pointer type. remove next update
# https://github.com/aantron/luv/commit/ad7f953fccb8732fe4eb9018556e8d4f82abf8f2
./incompatible-pointer-type-fix.diff
];
postConfigure = ''
for f in src/c/vendor/configure/{ltmain.sh,configure}; do
substituteInPlace "$f" --replace /usr/bin/file file
done
'';
nativeBuildInputs = [ file ];
propagatedBuildInputs = [
ctypes
result
];
checkInputs = [ alcotest ];
# Alcotest depends on fmt that needs 4.08 or newer
doCheck = lib.versionAtLeast ocaml.version "4.08";
meta = with lib; {
homepage = "https://github.com/aantron/luv";
description = "Binding to libuv: cross-platform asynchronous I/O";
# MIT-licensed, extra licenses apply partially to libuv vendor
license = with licenses; [
mit
bsd2
bsd3
cc-by-sa-40
];
maintainers = with maintainers; [
locallycompact
sternenseemann
];
};
}

View File

@@ -0,0 +1,87 @@
addapted from https://github.com/aantron/luv/commit/ad7f953fccb8732fe4eb9018556e8d4f82abf8f2
diff --git a/src/c/helpers.c b/src/c/helpers.c
index 7fcd8b6..bc1b926 100755
--- a/src/c/helpers.c
+++ b/src/c/helpers.c
@@ -175,7 +175,8 @@ static void luv_getaddrinfo_trampoline(
}
static void luv_getnameinfo_trampoline(
- uv_getnameinfo_t *c_request, int status, char *hostname, char *service)
+ uv_getnameinfo_t *c_request, int status, const char *hostname,
+ const char *service)
{
caml_acquire_runtime_system();
value callback;
@@ -407,7 +408,7 @@ uv_getaddrinfo_cb luv_get_getaddrinfo_trampoline()
return luv_getaddrinfo_trampoline;
}
-luv_getnameinfo_cb luv_get_getnameinfo_trampoline()
+uv_getnameinfo_cb luv_get_getnameinfo_trampoline()
{
return luv_getnameinfo_trampoline;
}
@@ -613,15 +614,6 @@ int luv_fs_poll_start(
return uv_fs_poll_start(handle, (uv_fs_poll_cb)poll_cb, path, interval);
}
-int luv_getnameinfo(
- uv_loop_t *loop, uv_getnameinfo_t *req, luv_getnameinfo_cb getnameinfo_cb,
- const struct sockaddr *addr, int flags)
-{
- return
- uv_getnameinfo(
- loop, req, (uv_getnameinfo_cb)getnameinfo_cb, addr, flags);
-}
-
int luv_read_start(
uv_stream_t *stream, uv_alloc_cb alloc_cb, luv_read_cb read_cb)
{
diff --git a/src/c/helpers.h b/src/c/helpers.h
index f73e32f..2cc1200 100755
--- a/src/c/helpers.h
+++ b/src/c/helpers.h
@@ -55,9 +55,6 @@ typedef void (*luv_fs_event_cb)(
typedef void (*luv_fs_poll_cb)(
uv_fs_poll_t *handle, int status, uv_stat_t *prev, uv_stat_t *curr);
-typedef void (*luv_getnameinfo_cb)(
- uv_getnameinfo_t *req, int status, char *hostname, char *service);
-
typedef void (*luv_read_cb)(uv_stream_t *stream, ssize_t nread, uv_buf_t *buf);
typedef void (*luv_udp_recv_cb)(
@@ -78,7 +75,7 @@ uv_fs_cb luv_null_fs_callback_pointer();
luv_fs_event_cb luv_get_fs_event_trampoline();
luv_fs_poll_cb luv_get_fs_poll_trampoline();
uv_getaddrinfo_cb luv_get_getaddrinfo_trampoline();
-luv_getnameinfo_cb luv_get_getnameinfo_trampoline();
+uv_getnameinfo_cb luv_get_getnameinfo_trampoline();
uv_idle_cb luv_get_idle_trampoline();
luv_once_cb luv_get_once_trampoline();
uv_poll_cb luv_get_poll_trampoline();
@@ -173,10 +170,6 @@ int luv_fs_poll_start(
uv_fs_poll_t *handle, luv_fs_poll_cb poll_cb, const char *path,
unsigned int interval);
-int luv_getnameinfo(
- uv_loop_t *loop, uv_getnameinfo_t *req, luv_getnameinfo_cb getnameinfo_cb,
- const struct sockaddr *addr, int flags);
-
int luv_read_start(
uv_stream_t *stream, uv_alloc_cb alloc_cb, luv_read_cb read_cb);
diff --git a/src/c/luv_c_function_descriptions.ml b/src/c/luv_c_function_descriptions.ml
index 684a46b..7ac1421 100755
--- a/src/c/luv_c_function_descriptions.ml
+++ b/src/c/luv_c_function_descriptions.ml
@@ -1336,7 +1336,7 @@ struct
(void @-> returning trampoline)
let getnameinfo =
- foreign "luv_getnameinfo"
+ foreign "uv_getnameinfo"
(ptr Loop.t @->
ptr t @->
trampoline @->