summaryrefslogtreecommitdiffstats
path: root/www/nghttp2/Makefile
blob: b19a9e59666e5d33d740c449288488ba8d8b07f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Created by: Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>
# $FreeBSD$

PORTNAME=	nghttp2
PORTVERSION=	1.18.0
DISTVERSIONPREFIX=	v
PORTREVISION=	1
CATEGORIES=	www net

MAINTAINER=	sunpoet@FreeBSD.org
COMMENT=	HTTP/2.0 C Library

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/COPYING

BUILD_DEPENDS=	libnghttp2>=${PORTVERSION}:www/libnghttp2
LIB_DEPENDS=	libnghttp2.so:www/libnghttp2

OPTIONS_DEFINE=	APP ASIO DOCS EXAMPLES HPACK SPDY
OPTIONS_DEFAULT=APP HPACK SPDY
OPTIONS_SUB=	yes
APP_DESC=	Build h2load, nghttp, nghttpd and nghttpx
SPDY_DESC=	Enable SPDY in h2load and nghttpx
SPDY_IMPLIES=	APP

CONFIGURE_ARGS=	--disable-python-bindings
CONFIGURE_ENV=	OPENSSL_CFLAGS="-I${OPENSSLINC}" \
		OPENSSL_LIBS="-L${OPENSSLLIB} -lcrypto -lssl" \
		ZLIB_CFLAGS="-I${INCLUDEDIR}" \
		ZLIB_LIBS="-L${LIBDIR} -lz"
GNU_CONFIGURE=	yes
INSTALL_TARGET=	install-strip
USE_CXXSTD=	c++11
USE_LDCONFIG=	yes
USE_RC_SUBR=	nghttpx
USES=		autoreconf compiler:c++11-lib gmake libtool localbase pathfix pkgconfig ssl

PORTDATA=	fetch-ocsp-response
PORTDOCS=	*
PORTEXAMPLES=	*

USE_GITHUB=	yes

APP_BUILD_DEPENDS=	c-ares>=1.7.5:dns/c-ares \
			libev>=4.11:devel/libev
APP_CONFIGURE_ENABLE=	app
APP_CONFIGURE_OFF=	--without-libxml2
APP_LIB_DEPENDS=	libcares.so:dns/c-ares \
			libev.so:devel/libev
APP_USE=		GNOME=libxml2
APP_USES=		gnome
ASIO_BUILD_DEPENDS=	boost-libs>=1.54.0:devel/boost-libs
ASIO_CONFIGURE_OFF=	--with-boost=no
ASIO_CONFIGURE_ON=	--enable-asio-lib --with-boost-asio --with-boost-system --with-boost-thread
ASIO_LIB_DEPENDS=	libboost_thread.so:devel/boost-libs
EXAMPLES_CONFIGURE_ENABLE=	examples
EXAMPLES_BUILD_DEPENDS=	libevent2>=2.0.8:devel/libevent2
EXAMPLES_LIB_DEPENDS=	libevent_openssl.so:devel/libevent2
HPACK_BUILD_DEPENDS=	jansson>=2.5:devel/jansson
HPACK_CONFIGURE_ENABLE=	hpack-tools
HPACK_LIB_DEPENDS=	libjansson.so:devel/jansson
SPDY_BUILD_DEPENDS=	spdylay>=1.3.2:www/spdylay
SPDY_CONFIGURE_WITH=	spdylay
SPDY_LIB_DEPENDS=	libspdylay.so:www/spdylay

.include <bsd.port.pre.mk>

.if ${OPSYS} == FreeBSD
CONFIGURE_ARGS+=--with-jemalloc
.endif

post-patch:
	@${REINPLACE_CMD} -e '/^SUBDIRS = / s| lib||' ${WRKSRC}/Makefile.am
	@${REINPLACE_CMD} -e 's|$$[({]top_builddir[})]/lib/libnghttp2.la|-lnghttp2|' ${WRKSRC}/*/Makefile.am

# lib/libnghttp2.* are not available until configure phase
post-configure:
	@${MKDIR} ${WRKSRC}/lib/.libs/
	@${CP} ${LOCALBASE}/lib/libnghttp2.so* ${WRKSRC}/lib/.libs/
	@cd ${WRKSRC}/lib/.libs/ && ${AR} x ${LOCALBASE}/lib/libnghttp2.a
# Disable thread_local support for hosts without __cxa_thread_atexit()
# See PR/192320 for details
.if (${OSVERSION} < 1003506) || ((${OSVERSION} >= 1100000) && (${OSVERSION} < 1100122)) || (${OSVERSION} == 1100500)
	@${REINPLACE_CMD} -e '/HAVE_THREAD_LOCAL/d' ${WRKSRC}/config.h
.endif

post-install:
	${MKDIR} ${STAGEDIR}${PREFIX}/etc/nghttpx/
	${INSTALL_DATA} ${FILESDIR}/nghttpx.conf.sample ${STAGEDIR}${PREFIX}/etc/nghttpx/nghttpx.conf.sample

post-install-EXAMPLES-on:
	${MKDIR} ${STAGEDIR}${EXAMPLESDIR}/
	${INSTALL_DATA} ${WRKSRC}/examples/*.c* ${STAGEDIR}${EXAMPLESDIR}/
	cd ${WRKSRC}/examples/ && ${INSTALL_PROGRAM} client deflate libevent-client libevent-server ${STAGEDIR}${EXAMPLESDIR}/

.include <bsd.port.post.mk>
OpenPOWER on IntegriCloud