1 { stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkg-config, ApplicationServices, CoreServices }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-K6v+00basjI32ON27ZjC5spQi/zWCcslDwQwyosq2iY=";
16 "getnameinfo_basic" "udp_send_hang_loop" # probably network-dependent
17 "tcp_connect_timeout" # tries to reach out to 8.8.8.8
18 "spawn_setuid_fails" "spawn_setgid_fails" "fs_chown" # user namespaces
19 "getaddrinfo_fail" "getaddrinfo_fail_sync"
20 "threadpool_multiple_event_loops" # times out on slow machines
21 "get_passwd" # passed on NixOS but failed on other Linuxes
22 "tcp_writealot" "udp_multicast_join" "udp_multicast_join6" # times out sometimes
23 "fs_fstat" # https://github.com/libuv/libuv/issues/2235#issuecomment-1012086927
24 ] ++ lib.optionals stdenv.isDarwin [
25 # Sometimes: timeout (no output), failed uv_listen. Someone
26 # should report these failures to libuv team. There tests should
27 # be much more robust.
28 "process_title" "emfile" "poll_duplex" "poll_unidirectional"
29 "ipc_listen_before_write" "ipc_listen_after_write" "ipc_tcp_connection"
30 "tcp_alloc_cb_fail" "tcp_ping_pong" "tcp_ref3" "tcp_ref4"
31 "tcp_bind6_error_inval" "tcp_bind6_error_addrinuse" "tcp_read_stop"
32 "tcp_unexpected_read" "tcp_write_to_half_open_connection"
33 "tcp_oob" "tcp_close_accept" "tcp_create_early_accept"
34 "tcp_create_early" "tcp_close" "tcp_bind_error_inval"
35 "tcp_bind_error_addrinuse" "tcp_shutdown_after_write"
36 "tcp_open" "tcp_write_queue_order" "tcp_try_write" "tcp_writealot"
37 "multiple_listen" "delayed_accept"
38 "shutdown_close_tcp" "shutdown_eof" "shutdown_twice" "callback_stack"
39 "tty_pty" "condvar_5" "hrtime" "udp_multicast_join"
40 # Tests that fail when sandboxing is enabled.
41 "fs_event_close_in_callback" "fs_event_watch_dir" "fs_event_error_reporting"
42 "fs_event_watch_dir_recursive" "fs_event_watch_file"
43 "fs_event_watch_file_current_dir" "fs_event_watch_file_exact_path"
44 "process_priority" "udp_create_early_bad_bind"
45 ] ++ lib.optionals stdenv.isAarch32 [
46 # I observe this test failing with some regularity on ARMv7:
47 # https://github.com/libuv/libuv/issues/1871
50 tdRegexp = lib.concatStringsSep "\\|" toDisable;
51 in lib.optionalString doCheck ''
52 sed '/${tdRegexp}/d' -i test/test-list.h
55 nativeBuildInputs = [ automake autoconf libtool pkg-config ];
56 buildInputs = lib.optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
59 LIBTOOLIZE=libtoolize ./autogen.sh
62 enableParallelBuilding = true;
66 # Some of the tests use localhost networking.
67 __darwinAllowLocalNetworking = true;
70 description = "A multi-platform support library with a focus on asynchronous I/O";
71 homepage = "https://libuv.org/";
72 changelog = "https://github.com/libuv/libuv/blob/v${version}/ChangeLog";
73 maintainers = with maintainers; [ cstrahan ];
74 platforms = platforms.all;
75 license = with licenses; [ mit isc bsd2 bsd3 cc-by-40 ];