nixpkgs-suyu/pkgs/development/libraries/libuv/default.nix

68 lines
2.4 KiB
Nix
Raw Normal View History

2018-07-05 18:18:02 +02:00
{ stdenv, lib, fetchpatch, fetchFromGitHub, autoconf, automake, libtool, pkgconfig }:
2016-04-25 16:04:22 +02:00
stdenv.mkDerivation rec {
version = "1.21.0";
2016-04-25 16:04:22 +02:00
name = "libuv-${version}";
2016-04-25 16:04:22 +02:00
src = fetchFromGitHub {
owner = "libuv";
repo = "libuv";
rev = "v${version}";
sha256 = "1jjg34ppnlrnb634q9mla7whl7rm9xmjgnzckrznqcycwzir074b";
};
2018-07-05 18:18:02 +02:00
patches = [
(fetchpatch {
url = "https://github.com/libuv/libuv/commit/1a5d4f08238dd532c3718e210078de1186a5920d.patch";
2018-07-05 18:18:02 +02:00
sha256 = "1s2692h4dvqnzwwicrkpj0zph1i2bhv39w31z5vh7ssgvykaradj";
})
];
postPatch = let
toDisable = [
"getnameinfo_basic" "udp_send_hang_loop" # probably network-dependent
"spawn_setuid_fails" "spawn_setgid_fails" "fs_chown" # user namespaces
"getaddrinfo_fail" "getaddrinfo_fail_sync"
"threadpool_multiple_event_loops" # times out on slow machines
]
# Sometimes: timeout (no output), failed uv_listen. Someone
# should report these failures to libuv team. There tests should
# be much more robust.
++ stdenv.lib.optionals stdenv.isDarwin [
"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"
2018-07-29 06:14:57 +02:00
"tty_pty"
];
tdRegexp = lib.concatStringsSep "\\|" toDisable;
in lib.optionalString doCheck ''
sed '/${tdRegexp}/d' -i test/test-list.h
'';
nativeBuildInputs = [ automake autoconf libtool pkgconfig ];
2016-04-25 16:04:22 +02:00
preConfigure = ''
LIBTOOLIZE=libtoolize ./autogen.sh
'';
enableParallelBuilding = true;
doCheck = true;
2016-04-25 16:04:22 +02:00
meta = with lib; {
description = "A multi-platform support library with a focus on asynchronous I/O";
homepage = https://github.com/libuv/libuv;
maintainers = with maintainers; [ cstrahan ];
platforms = with platforms; linux ++ darwin;
};
2016-04-25 16:04:22 +02:00
}