h2o: add package
authorJames Taylor <james@jtaylor.id.au>
Mon, 9 Dec 2019 01:49:19 +0000 (12:49 +1100)
committerJames Taylor <james@jtaylor.id.au>
Tue, 10 Dec 2019 10:32:52 +0000 (21:32 +1100)
H2O is a new generation HTTP server that provides quicker response to users
  with less CPU utilization when compared to older generation of web servers.
  Designed from ground-up, the server takes full advantage of HTTP/2 features
  including prioritized content serving and server push, promising outstanding
  experience to the visitors of your web site.

Signed-off-by: James Taylor <james@jtaylor.id.au>
libs/h2o/Makefile [new file with mode: 0644]
libs/h2o/patches/100-socket_disable_npn.patch [new file with mode: 0644]
libs/h2o/patches/200-libh2o-evloop_wslay-link.patch [new file with mode: 0644]
libs/h2o/patches/300-picotls-chacha-detect.patch [new file with mode: 0644]

diff --git a/libs/h2o/Makefile b/libs/h2o/Makefile
new file mode 100644 (file)
index 0000000..688f6ef
--- /dev/null
@@ -0,0 +1,54 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=h2o
+PKG_VERSION:=2.2.6
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=https://codeload.github.com/h2o/h2o/tar.gz/v${PKG_VERSION}?
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_HASH:=f8cbc1b530d85ff098f6efc2c3fdbc5e29baffb30614caac59d5c710f7bda201
+
+PKG_MAINTAINER:=James Taylor <james@jtaylor.id.au
+PKG_LICENSE:=MIT
+PKG_LICENSE_FILES:=LICENSE
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+PKG_BUILD_DEPENDS:=ruby/host
+PKG_BUILD_PARALLEL:=1
+
+CMAKE_OPTIONS:= \
+       -DBUILD_SHARED_LIBS=ON \
+       -DWITH_MRUBY=OFF
+
+CMAKE_INSTALL:=1
+
+define Package/libh2o-evloop
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=H2O Library compiled with its own event loop
+  URL:=https://h2o.examp1e.net/
+  DEPENDS:=+libwslay +libopenssl +zlib +libyaml +ruby
+endef
+
+define Package/libh2o
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=H2O Library compiled with libuv
+  URL:=https://h2o.examp1e.net/
+  DEPENDS:=+libuv +libwslay +libopenssl +zlib +libyaml +ruby
+endef
+
+define Package/libh2o-evloop/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libh2o-evloop.so* $(1)/usr/lib/
+endef
+
+define Package/libh2o/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/libh2o.so* $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libh2o-evloop))
+$(eval $(call BuildPackage,libh2o))
diff --git a/libs/h2o/patches/100-socket_disable_npn.patch b/libs/h2o/patches/100-socket_disable_npn.patch
new file mode 100644 (file)
index 0000000..00425e8
--- /dev/null
@@ -0,0 +1,22 @@
+--- a/include/h2o/socket.h
++++ b/include/h2o/socket.h
+@@ -29,6 +29,7 @@
+ #include <stdint.h>
+ #include <sys/socket.h>
+ #include <openssl/ssl.h>
++#include <openssl/opensslconf.h>
+ #include "h2o/cache.h"
+ #include "h2o/memory.h"
+ #include "h2o/openssl_backport.h"
+@@ -45,7 +44,11 @@
+ #if OPENSSL_VERSION_NUMBER >= 0x10002000L
+ #define H2O_USE_ALPN 1
++#ifndef OPENSSL_NO_NEXTPROTONEG
+ #define H2O_USE_NPN 1
++#else
++#define H2O_USE_NPN 0
++#endif
+ #elif OPENSSL_VERSION_NUMBER >= 0x10001000L
+ #define H2O_USE_ALPN 0
+ #define H2O_USE_NPN 1
diff --git a/libs/h2o/patches/200-libh2o-evloop_wslay-link.patch b/libs/h2o/patches/200-libh2o-evloop_wslay-link.patch
new file mode 100644 (file)
index 0000000..8f7dfcd
--- /dev/null
@@ -0,0 +1,9 @@
+--- a/libh2o-evloop.pc.in
++++ b/libh2o-evloop.pc.in
+@@ -7,5 +7,5 @@
+ Description: An optimized HTTP/1.x & HTTP/2 library
+ URL: https://h2o.examp1e.net/
+ Version: @LIBRARY_VERSION_MAJOR@.@LIBRARY_VERSION_MINOR@.@LIBRARY_VERSION_PATCH@
+-Libs: -L${libdir} -lh2o-evloop
++Libs: -L${libdir} -lh2o-evloop -lwslay
+ Cflags: -I${includedir}
diff --git a/libs/h2o/patches/300-picotls-chacha-detect.patch b/libs/h2o/patches/300-picotls-chacha-detect.patch
new file mode 100644 (file)
index 0000000..5fc7932
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/deps/picotls/include/picotls/openssl.h
++++ b/deps/picotls/include/picotls/openssl.h
+@@ -26,11 +26,14 @@
+ #include <openssl/evp.h>
+ #include <openssl/hmac.h>
+ #include <openssl/x509.h>
++#include <openssl/opensslconf.h>
+ #include "../picotls.h"
+ #if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
++#if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
+ #define PTLS_OPENSSL_HAVE_CHACHA20_POLY1305
+ #endif
++#endif
+ extern ptls_key_exchange_algorithm_t ptls_openssl_secp256r1;
+ extern ptls_key_exchange_algorithm_t *ptls_openssl_key_exchanges[];