summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2016-04-11 00:11:11 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2016-04-12 15:43:20 (GMT)
commit65f5e062bec8a03fc152b7cd4419daaccfa68bd4 (patch)
tree30ef759893181a2821d4f9a9801776c76039076d
parent4160e8ab88ad9580645695b6b2dd2aa2e7558f16 (diff)
downloadmxe-65f5e062bec8a03fc152b7cd4419daaccfa68bd4.zip
mxe-65f5e062bec8a03fc152b7cd4419daaccfa68bd4.tar.gz
mxe-65f5e062bec8a03fc152b7cd4419daaccfa68bd4.tar.bz2
add libuv
-rw-r--r--index.html4
-rw-r--r--src/libuv-1-fixes.patch27
-rw-r--r--src/libuv-test.c15
-rw-r--r--src/libuv.mk28
4 files changed, 74 insertions, 0 deletions
diff --git a/index.html b/index.html
index d0b7627..2f5ad68 100644
--- a/index.html
+++ b/index.html
@@ -1910,6 +1910,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="website"><a href="http://libusb.org/">LibUsb-1.0</a></td>
</tr>
<tr>
+ <td class="package">libuv</td>
+ <td class="website"><a href="http://libuv.org/">libuv</a></td>
+ </tr>
+ <tr>
<td class="package">libvpx</td>
<td class="website"><a href="http://code.google.com/p/webm/">vpx</a></td>
</tr>
diff --git a/src/libuv-1-fixes.patch b/src/libuv-1-fixes.patch
new file mode 100644
index 0000000..bc34a02
--- /dev/null
+++ b/src/libuv-1-fixes.patch
@@ -0,0 +1,27 @@
+This file is part of MXE.
+See index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Boris Nagaev <bnagaev@gmail.com>
+Date: Mon, 11 Apr 2016 02:02:54 +0200
+Subject: [PATCH] set Libs in pc-file
+
+They are already defined in Makefile.am, but are not passed
+(only -lpthread is passed).
+
+According to http://stackoverflow.com/a/30960268 passing LIBS from
+Makefile.am to libuv.pc is impossible, as it is not fully-expanded.
+
+diff --git a/libuv.pc.in b/libuv.pc.in
+index 1111111..2222222 100644
+--- a/libuv.pc.in
++++ b/libuv.pc.in
+@@ -7,5 +7,5 @@ Name: @PACKAGE_NAME@
+ Version: @PACKAGE_VERSION@
+ Description: multi-platform support library with a focus on asynchronous I/O.
+
+-Libs: -L${libdir} -luv @LIBS@
++Libs: -L${libdir} -luv -lpthread -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv
+ Cflags: -I${includedir}
diff --git a/src/libuv-test.c b/src/libuv-test.c
new file mode 100644
index 0000000..a31bf88
--- /dev/null
+++ b/src/libuv-test.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <uv.h>
+
+int main() {
+ uv_loop_t *loop = malloc(sizeof(uv_loop_t));
+ uv_loop_init(loop);
+
+ printf("Now quitting.\n");
+ uv_run(loop, UV_RUN_DEFAULT);
+
+ uv_loop_close(loop);
+ free(loop);
+ return 0;
+}
diff --git a/src/libuv.mk b/src/libuv.mk
new file mode 100644
index 0000000..5dd70a2
--- /dev/null
+++ b/src/libuv.mk
@@ -0,0 +1,28 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := libuv
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 1.8.0
+$(PKG)_CHECKSUM := 6511f734da4fe082dacf85967606d600b7bce557bb9b2f0d2539193535323125
+$(PKG)_SUBDIR := $(PKG)-v$($(PKG)_VERSION)
+$(PKG)_FILE := $(PKG)-v$($(PKG)_VERSION).tar.gz
+$(PKG)_URL := http://dist.libuv.org/dist/v$($(PKG)_VERSION)/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc
+
+define $(PKG)_UPDATE
+ $(call MXE_GET_GITHUB_TAGS, libuv/libuv, v)
+endef
+
+define $(PKG)_BUILD
+ cd '$(1)' && sh autogen.sh
+ cd '$(1)' && ./configure \
+ $(MXE_CONFIGURE_OPTS)
+ $(MAKE) -C '$(1)' -j '$(JOBS)'
+ $(MAKE) -C '$(1)' -j 1 install
+
+ '$(TARGET)-gcc' \
+ -W -Wall -Werror -pedantic \
+ '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-$(PKG).exe' \
+ `'$(TARGET)-pkg-config' $(PKG) --libs`
+endef