Import libuv: A cross-platform asynchronous I/O library.

Based on work by dcoppa@. OK abieber@, jca@. Thanks.
This commit is contained in:
edd 2017-02-14 09:37:16 +00:00
parent 6c27b18727
commit 74e7ae1d20
9 changed files with 156 additions and 0 deletions

44
devel/libuv/Makefile Normal file
View File

@ -0,0 +1,44 @@
# $OpenBSD: Makefile,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
COMMENT = multi-platform library for asynchronous I/O
VER = 1.11.0
DISTNAME = libuv-v${VER}
PKGNAME = libuv-${VER}
CATEGORIES = devel
SHARED_LIBS = uv 0.0 # 1.0
HOMEPAGE = http://libuv.org/
MASTER_SITES = http://dist.libuv.org/dist/v${VER}/
# BSD / GPL
PERMIT_PACKAGE_CDROM = Yes
WANTLIB += pthread
BUILD_DEPENDS = devel/libtool \
${MODGNU_AUTOCONF_DEPENDS} \
${MODGNU_AUTOMAKE_DEPENDS} \
textproc/py-sphinx
USE_GMAKE = Yes
CONFIGURE_STYLE = gnu
CONFIGURE_ENV = cc_cv_cflags__g=no
AUTOCONF_VERSION = 2.69
AUTOMAKE_VERSION = 1.14
pre-configure:
cd ${WRKSRC} && env AUTOCONF_VERSION=${AUTOCONF_VERSION} \
AUTOMAKE_VERSION=${AUTOMAKE_VERSION} sh autogen.sh
post-build:
cd ${WRKSRC} && ${MAKE_PROGRAM} man -C docs
post-install:
${INSTALL_MAN} ${WRKSRC}/docs/build/man/libuv.1 ${PREFIX}/man/man1/
.include <bsd.port.mk>

2
devel/libuv/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (libuv-v1.11.0.tar.gz) = D2hplNzqbLXNP1DjXV/doHIRtLNYZRbffDm9vxmsuac=
SIZE (libuv-v1.11.0.tar.gz) = 1075986

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-configure_ac,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
--- configure.ac.orig Sat Nov 26 18:32:08 2016
+++ configure.ac Sat Nov 26 18:32:41 2016
@@ -42,7 +42,6 @@ LT_INIT
# TODO(bnoordhuis) Check for -pthread vs. -pthreads
AC_CHECK_LIB([dl], [dlopen])
AC_CHECK_LIB([kstat], [kstat_lookup])
-AC_CHECK_LIB([kvm], [kvm_open])
AC_CHECK_LIB([nsl], [gethostbyname])
AC_CHECK_LIB([perfstat], [perfstat_cpu])
AC_CHECK_LIB([pthread], [pthread_mutex_init])

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-src_unix_internal_h,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
https://patch-diff.githubusercontent.com/raw/libuv/libuv/pull/1218.diff
--- src/unix/internal.h.orig Wed Feb 1 00:38:56 2017
+++ src/unix/internal.h Thu Feb 9 21:38:39 2017
@@ -162,7 +162,8 @@ struct uv__stream_queued_fds_s {
defined(__DragonFly__) || \
defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || \
- defined(__linux__)
+ defined(__linux__) || \
+ defined(__OpenBSD__)
#define uv__cloexec uv__cloexec_ioctl
#define uv__nonblock uv__nonblock_ioctl
#else

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_unix_openbsd_c,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
https://patch-diff.githubusercontent.com/raw/libuv/libuv/pull/1218.diff
--- src/unix/openbsd.c.orig Wed Feb 1 00:38:56 2017
+++ src/unix/openbsd.c Thu Feb 9 21:49:54 2017
@@ -163,7 +163,7 @@ char** uv_setup_args(int argc, char** argv) {
int uv_set_process_title(const char* title) {
uv__free(process_title);
process_title = uv__strdup(title);
- setproctitle(title);
+ setproctitle("%s", title);
return 0;
}

View File

@ -0,0 +1,25 @@
$OpenBSD: patch-test_test-fs_c,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
Workaround for a minor bug:
https://github.com/libuv/libuv/issues/1216
--- test/test-fs.c.orig Wed Feb 1 00:38:56 2017
+++ test/test-fs.c Thu Feb 9 22:06:12 2017
@@ -1621,7 +1621,7 @@ TEST_IMPL(fs_realpath) {
uv_fs_t req;
loop = uv_default_loop();
- ASSERT(0 == uv_fs_realpath(loop, &req, "no_such_file", dummy_cb));
+ ASSERT(0 == uv_fs_realpath(loop, &req, "no_such_dir/no_such_file", dummy_cb));
ASSERT(0 == uv_run(loop, UV_RUN_DEFAULT));
ASSERT(dummy_cb_count == 1);
ASSERT(req.ptr == NULL);
@@ -1637,7 +1637,7 @@ TEST_IMPL(fs_realpath) {
ASSERT(req.result == UV_ENOENT);
uv_fs_req_cleanup(&req);
- ASSERT(UV_ENOENT == uv_fs_realpath(NULL, &req, "no_such_file", NULL));
+ ASSERT(UV_ENOENT == uv_fs_realpath(NULL, &req, "no_such_dir/no_such_file", NULL));
ASSERT(req.ptr == NULL);
ASSERT(req.result == UV_ENOENT);
uv_fs_req_cleanup(&req);

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-test_test-poll_c,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
https://patch-diff.githubusercontent.com/raw/libuv/libuv/pull/1218.diff
--- test/test-poll.c.orig Wed Feb 1 00:38:56 2017
+++ test/test-poll.c Thu Feb 9 21:38:39 2017
@@ -594,7 +594,8 @@ TEST_IMPL(poll_unidirectional) {
*/
TEST_IMPL(poll_bad_fdtype) {
#if !defined(__DragonFly__) && !defined(__FreeBSD__) && !defined(__sun) && \
- !defined(_AIX) && !defined(__MVS__) && !defined(__FreeBSD_kernel__)
+ !defined(_AIX) && !defined(__MVS__) && !defined(__FreeBSD_kernel__) && \
+ !defined(__OpenBSD__)
uv_poll_t poll_handle;
int fd;

15
devel/libuv/pkg/DESCR Normal file
View File

@ -0,0 +1,15 @@
libuv is a multi-platform support library with a focus on asynchronous I/O.
Feature highlights:
+ Full-featured event loop backed by epoll, kqueue, IOCP, event ports
+ Asynchronous TCP and UDP sockets
+ Asynchronous DNS resolution
+ Asynchronous file and file system operations
+ File system events
+ ANSI escape code controlled TTY
+ IPC with socket sharing, using Unix domain sockets or named pipes (Windows)
+ Child processes
+ Thread pool
+ Signal handling
+ High resolution clock
+ Threading and synchronization primitives

12
devel/libuv/pkg/PLIST Normal file
View File

@ -0,0 +1,12 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2017/02/14 09:37:16 edd Exp $
include/uv-bsd.h
include/uv-errno.h
include/uv-threadpool.h
include/uv-unix.h
include/uv-version.h
include/uv.h
lib/libuv.a
lib/libuv.la
@lib lib/libuv.so.${LIBuv_VERSION}
lib/pkgconfig/libuv.pc
@man man/man1/libuv.1