2021-07-20 05:20:00 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkg-config, ApplicationServices, CoreServices }:
|
2014-07-09 01:08:45 +01:00
|
|
|
|
2016-04-25 15:04:22 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2022-03-13 04:20:00 +00:00
|
|
|
version = "1.44.1";
|
2019-02-12 09:52:33 +00:00
|
|
|
pname = "libuv";
|
2014-07-09 01:08:45 +01:00
|
|
|
|
2016-04-25 15:04:22 +01:00
|
|
|
src = fetchFromGitHub {
|
2019-02-12 09:52:33 +00:00
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2014-07-09 01:08:45 +01:00
|
|
|
rev = "v${version}";
|
2022-03-13 04:20:00 +00:00
|
|
|
sha256 = "sha256-12uveSEavRxQW4xVrB4Rkkj+eHZ71Qy8dRG+95ldz50=";
|
2014-07-09 01:08:45 +01:00
|
|
|
};
|
|
|
|
|
2016-12-22 10:30:03 +00:00
|
|
|
postPatch = let
|
|
|
|
toDisable = [
|
2017-05-30 18:24:32 +01:00
|
|
|
"getnameinfo_basic" "udp_send_hang_loop" # probably network-dependent
|
2021-01-31 14:50:00 +00:00
|
|
|
"tcp_connect_timeout" # tries to reach out to 8.8.8.8
|
2016-12-22 10:30:03 +00:00
|
|
|
"spawn_setuid_fails" "spawn_setgid_fails" "fs_chown" # user namespaces
|
2017-01-07 02:09:49 +00:00
|
|
|
"getaddrinfo_fail" "getaddrinfo_fail_sync"
|
2017-07-14 20:52:36 +01:00
|
|
|
"threadpool_multiple_event_loops" # times out on slow machines
|
2019-04-18 19:26:57 +01:00
|
|
|
"get_passwd" # passed on NixOS but failed on other Linuxes
|
2020-08-09 14:57:41 +01:00
|
|
|
"tcp_writealot" "udp_multicast_join" "udp_multicast_join6" # times out sometimes
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2019-04-15 18:56:05 +01:00
|
|
|
# Sometimes: timeout (no output), failed uv_listen. Someone
|
|
|
|
# should report these failures to libuv team. There tests should
|
|
|
|
# be much more robust.
|
2018-07-04 20:05:54 +01:00
|
|
|
"process_title" "emfile" "poll_duplex" "poll_unidirectional"
|
|
|
|
"ipc_listen_before_write" "ipc_listen_after_write" "ipc_tcp_connection"
|
|
|
|
"tcp_alloc_cb_fail" "tcp_ping_pong" "tcp_ref3" "tcp_ref4"
|
|
|
|
"tcp_bind6_error_inval" "tcp_bind6_error_addrinuse" "tcp_read_stop"
|
|
|
|
"tcp_unexpected_read" "tcp_write_to_half_open_connection"
|
|
|
|
"tcp_oob" "tcp_close_accept" "tcp_create_early_accept"
|
|
|
|
"tcp_create_early" "tcp_close" "tcp_bind_error_inval"
|
|
|
|
"tcp_bind_error_addrinuse" "tcp_shutdown_after_write"
|
|
|
|
"tcp_open" "tcp_write_queue_order" "tcp_try_write" "tcp_writealot"
|
|
|
|
"multiple_listen" "delayed_accept"
|
|
|
|
"shutdown_close_tcp" "shutdown_eof" "shutdown_twice" "callback_stack"
|
2020-07-25 14:22:39 +01:00
|
|
|
"tty_pty" "condvar_5" "hrtime" "udp_multicast_join"
|
2019-04-15 18:56:05 +01:00
|
|
|
# Tests that fail when sandboxing is enabled.
|
2020-02-06 18:14:09 +00:00
|
|
|
"fs_event_close_in_callback" "fs_event_watch_dir" "fs_event_error_reporting"
|
2019-04-15 18:56:05 +01:00
|
|
|
"fs_event_watch_dir_recursive" "fs_event_watch_file"
|
|
|
|
"fs_event_watch_file_current_dir" "fs_event_watch_file_exact_path"
|
|
|
|
"process_priority" "udp_create_early_bad_bind"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch32 [
|
2019-04-15 18:56:05 +01:00
|
|
|
# I observe this test failing with some regularity on ARMv7:
|
|
|
|
# https://github.com/libuv/libuv/issues/1871
|
|
|
|
"shutdown_close_pipe"
|
|
|
|
];
|
2016-12-22 10:30:03 +00:00
|
|
|
tdRegexp = lib.concatStringsSep "\\|" toDisable;
|
|
|
|
in lib.optionalString doCheck ''
|
|
|
|
sed '/${tdRegexp}/d' -i test/test-list.h
|
|
|
|
'';
|
2016-11-29 17:40:30 +00:00
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ automake autoconf libtool pkg-config ];
|
2021-01-21 17:00:13 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
|
2014-07-09 01:08:45 +01:00
|
|
|
|
2016-04-25 15:04:22 +01:00
|
|
|
preConfigure = ''
|
|
|
|
LIBTOOLIZE=libtoolize ./autogen.sh
|
|
|
|
'';
|
2014-07-09 01:08:45 +01:00
|
|
|
|
2016-11-29 17:40:30 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-07-04 20:05:54 +01:00
|
|
|
doCheck = true;
|
2016-11-29 17:40:30 +00:00
|
|
|
|
2019-04-15 18:56:05 +01:00
|
|
|
# Some of the tests use localhost networking.
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2016-04-25 15:04:22 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A multi-platform support library with a focus on asynchronous I/O";
|
2020-09-08 05:20:00 +01:00
|
|
|
homepage = "https://libuv.org/";
|
|
|
|
changelog = "https://github.com/libuv/libuv/blob/v${version}/ChangeLog";
|
2016-04-25 15:04:22 +01:00
|
|
|
maintainers = with maintainers; [ cstrahan ];
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
2018-10-23 18:37:33 +01:00
|
|
|
license = with licenses; [ mit isc bsd2 bsd3 cc-by-40 ];
|
2014-07-09 01:08:45 +01:00
|
|
|
};
|
|
|
|
|
2016-04-25 15:04:22 +01:00
|
|
|
}
|