mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
libuv: update recipe, rework patchset, fix Haiku linker flags. (#837)
This commit is contained in:
76
dev-libs/libuv/libuv-1.10.0.recipe
Normal file
76
dev-libs/libuv/libuv-1.10.0.recipe
Normal file
@@ -0,0 +1,76 @@
|
||||
SUMMARY="A new platform layer for Node"
|
||||
DESCRIPTION="libuv is a multi-platform support library with a focus on \
|
||||
asynchronous I/O. It was primarily developed for use by Node.js, but it's also \
|
||||
used by Luvit, Julia, pyuv, and others."
|
||||
HOMEPAGE="http://libuv.org/"
|
||||
COPYRIGHT="2009-2016 Ryan Dahl and others"
|
||||
LICENSE="MIT"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/libuv/libuv/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="50f4ed57d65af4ab634e2cbdd90c49213020e15b4d77d3631feb633cbba9239f"
|
||||
PATCHES="libuv-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
|
||||
PROVIDES="
|
||||
libuv$secondaryArchSuffix = $portVersion
|
||||
lib:libuv$secondaryArchSuffix = 1.0.0 compat >= 1
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libuv${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libuv$secondaryArchSuffix = 1.0.0 compat >= 1
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libuv$secondaryArchSuffix == $portVersion
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:autoconf
|
||||
cmd:automake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:libtoolize$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
export LDFLAGS="-lroot -lnetwork -lbsd"
|
||||
export CFLAGS="-D_BSD_SOURCE"
|
||||
|
||||
./autogen.sh
|
||||
|
||||
runConfigure ./configure
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $includeDir
|
||||
mkdir -p $libDir
|
||||
|
||||
make install
|
||||
|
||||
rm -f $libDir/*.la
|
||||
|
||||
prepareInstalledDevelLib libuv
|
||||
|
||||
fixPkgconfig
|
||||
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
make check || true # Test suite doesn't pass
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
SUMMARY="A new platform layer for Node"
|
||||
DESCRIPTION="
|
||||
libuv is a multi-platform support library with a focus on asynchronous I/O. \
|
||||
It was primarily developed for use by Node.js, but it's also used by Luvit, \
|
||||
Julia, pyuv, and others."
|
||||
HOMEPAGE="http://github.com/libuv/libuv"
|
||||
COPYRIGHT="2009-2015 Ryan Dahl and others"
|
||||
LICENSE="MIT"
|
||||
REVISION="2"
|
||||
SOURCE_URI="git://github.com/hamishm/libuv#d48e9ae4bd504aadc25e26f06e83e9c2c86921ac"
|
||||
SOURCE_DIR="libuv-v1.2.0"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 ?x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
libuv$secondaryArchSuffix = $portVersion
|
||||
lib:libuv$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PROVIDES_devel="
|
||||
libuv${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libuv$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES_devel="
|
||||
libuv$secondaryArchSuffix == $portVersion
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:autoconf
|
||||
cmd:python
|
||||
cmd:automake
|
||||
cmd:libtoolize$secondaryArchSuffix
|
||||
cmd:gyp
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
rm -rf out
|
||||
./gyp_uv.py -f make -Dcomponent=shared_library -Duv_library=shared_library
|
||||
make -C out BUILDTYPE=Release
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
mkdir -p $includeDir
|
||||
cp -rf include/* $includeDir/
|
||||
|
||||
mkdir -p $libDir
|
||||
cp -rf out/Release/lib.target/libuv.so $libDir/
|
||||
|
||||
prepareInstalledDevelLibs libuv
|
||||
|
||||
packageEntries devel $developDir
|
||||
}
|
||||
|
||||
TEST()
|
||||
{
|
||||
true
|
||||
#./out/Debug/run-tests
|
||||
# Test suite doesn't pass
|
||||
}
|
||||
141
dev-libs/libuv/patches/libuv-1.10.0.patchset
Normal file
141
dev-libs/libuv/patches/libuv-1.10.0.patchset
Normal file
@@ -0,0 +1,141 @@
|
||||
From 9dfdbc6a361c50b363ab544781eb88a59d9ad817 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Sat, 29 Oct 2016 18:18:22 +0200
|
||||
Subject: [PATCH] Haiku supporting code
|
||||
|
||||
---
|
||||
configure.ac | 7 +++++++
|
||||
include/uv-unix.h | 4 ++++
|
||||
src/unix/core.c | 25 ++++++++++++++++++++++++-
|
||||
3 files changed, 35 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 5abd8a1..ca4c6ec 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -41,14 +41,17 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
LT_INIT
|
||||
# TODO(bnoordhuis) Check for -pthread vs. -pthreads
|
||||
AC_CHECK_LIB([dl], [dlopen])
|
||||
+AC_CHECK_LIB([root], [dlopen])
|
||||
AC_CHECK_LIB([kstat], [kstat_lookup])
|
||||
AC_CHECK_LIB([kvm], [kvm_open])
|
||||
AC_CHECK_LIB([nsl], [gethostbyname])
|
||||
+AC_CHECK_LIB([network], [gethostbyname])
|
||||
AC_CHECK_LIB([perfstat], [perfstat_cpu])
|
||||
AC_CHECK_LIB([pthread], [pthread_mutex_init])
|
||||
AC_CHECK_LIB([rt], [clock_gettime])
|
||||
AC_CHECK_LIB([sendfile], [sendfile])
|
||||
AC_CHECK_LIB([socket], [socket])
|
||||
+AC_CHECK_LIB([network], [socket])
|
||||
AC_SYS_LARGEFILE
|
||||
AM_CONDITIONAL([AIX], [AS_CASE([$host_os],[aix*], [true], [false])])
|
||||
AM_CONDITIONAL([ANDROID], [AS_CASE([$host_os],[linux-android*],[true], [false])])
|
||||
@@ -61,9 +64,13 @@ AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])
|
||||
AM_CONDITIONAL([OS390], [AS_CASE([$host_os],[openedition*], [true], [false])])
|
||||
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
|
||||
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
|
||||
+AM_CONDITIONAL([HAIKU], [AS_CASE([$host_os],[haiku*], [true], [false])])
|
||||
AS_CASE([$host_os],[mingw*], [
|
||||
LIBS="$LIBS -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv -luser32"
|
||||
])
|
||||
+AS_CASE([$host_os],[haiku*], [
|
||||
+ LIBS="$LIBS -lroot -lnetwork -lbsd"
|
||||
+])
|
||||
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
|
||||
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
|
||||
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
|
||||
diff --git a/include/uv-unix.h b/include/uv-unix.h
|
||||
index bca2714..cae33fe 100644
|
||||
--- a/include/uv-unix.h
|
||||
+++ b/include/uv-unix.h
|
||||
@@ -58,6 +58,10 @@
|
||||
# include "uv-bsd.h"
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+# include "pthread-barrier.h"
|
||||
+#endif
|
||||
+
|
||||
#ifndef PTHREAD_BARRIER_SERIAL_THREAD
|
||||
# include "pthread-barrier.h"
|
||||
#endif
|
||||
diff --git a/src/unix/core.c b/src/unix/core.c
|
||||
index a2c07e6..7f7848a 100644
|
||||
--- a/src/unix/core.c
|
||||
+++ b/src/unix/core.c
|
||||
@@ -55,6 +55,12 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#include <sys/times.h>
|
||||
+#define FIONCLEX 0x5450
|
||||
+#define FIOCLEX 0x5451
|
||||
+#endif
|
||||
+
|
||||
#if defined(__DragonFly__) || \
|
||||
defined(__FreeBSD__) || \
|
||||
defined(__FreeBSD_kernel__)
|
||||
@@ -921,7 +927,7 @@ int uv_getrusage(uv_rusage_t* rusage) {
|
||||
rusage->ru_stime.tv_sec = usage.ru_stime.tv_sec;
|
||||
rusage->ru_stime.tv_usec = usage.ru_stime.tv_usec;
|
||||
|
||||
-#if !defined(__MVS__)
|
||||
+#if !defined(__MVS__) && !defined(__HAIKU__)
|
||||
rusage->ru_maxrss = usage.ru_maxrss;
|
||||
rusage->ru_ixrss = usage.ru_ixrss;
|
||||
rusage->ru_idrss = usage.ru_idrss;
|
||||
@@ -938,6 +944,23 @@ int uv_getrusage(uv_rusage_t* rusage) {
|
||||
rusage->ru_nivcsw = usage.ru_nivcsw;
|
||||
#endif
|
||||
|
||||
+#if defined(__HAIKU__)
|
||||
+ rusage->ru_maxrss = 0;
|
||||
+ rusage->ru_ixrss = 0;
|
||||
+ rusage->ru_idrss = 0;
|
||||
+ rusage->ru_isrss = 0;
|
||||
+ rusage->ru_minflt = 0;
|
||||
+ rusage->ru_majflt = 0;
|
||||
+ rusage->ru_nswap = 0;
|
||||
+ rusage->ru_inblock = 0;
|
||||
+ rusage->ru_oublock = 0;
|
||||
+ rusage->ru_msgsnd = 0;
|
||||
+ rusage->ru_msgrcv = 0;
|
||||
+ rusage->ru_nsignals = 0;
|
||||
+ rusage->ru_nvcsw = 0;
|
||||
+ rusage->ru_nivcsw = 0;
|
||||
+#endif
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.10.0
|
||||
|
||||
From a3834352441da2845c4219af67ea2b610f765a50 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Sat, 29 Oct 2016 18:43:04 +0200
|
||||
Subject: [PATCH] Test fix
|
||||
|
||||
---
|
||||
test/test-fs.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/test/test-fs.c b/test/test-fs.c
|
||||
index 06718f2..b28ad03 100644
|
||||
--- a/test/test-fs.c
|
||||
+++ b/test/test-fs.c
|
||||
@@ -29,7 +29,8 @@
|
||||
|
||||
/* FIXME we shouldn't need to branch in this file */
|
||||
#if defined(__unix__) || defined(__POSIX__) || \
|
||||
- defined(__APPLE__) || defined(_AIX) || defined(__MVS__)
|
||||
+ defined(__APPLE__) || defined(_AIX) || defined(__MVS__) || \
|
||||
+ defined(__HAIKU__)
|
||||
#include <unistd.h> /* unlink, rmdir, etc. */
|
||||
#else
|
||||
# include <direct.h>
|
||||
--
|
||||
2.10.0
|
||||
|
||||
Reference in New Issue
Block a user