From b53a14ae3efd035a16dd45f0049e1bcfd2fa0c67 Mon Sep 17 00:00:00 2001 From: Greg Lewis Date: Tue, 24 Sep 2019 01:49:46 +0000 Subject: Build the native transport library * Build the native KQueue transport library * Add that library to the installed netty.jar * Bump PORTREVISION This was only tested on amd64, but should work on all architectures with Java support --- java/netty/Makefile | 42 ++++++++++++++++++++++++++++++++++++++++-- java/netty/files/Makefile.in | 8 ++++++++ 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 java/netty/files/Makefile.in diff --git a/java/netty/Makefile b/java/netty/Makefile index d5a3b36e9240..2b7c96277260 100644 --- a/java/netty/Makefile +++ b/java/netty/Makefile @@ -4,6 +4,7 @@ PORTNAME= netty PORTVERSION= 4.1.41 DISTVERSIONSUFFIX= .Final +PORTREVISION= 1 CATEGORIES= java devel MASTER_SITES= http://dl.bintray.com/netty/downloads/ @@ -18,7 +19,6 @@ USE_JAVA= yes CPE_VENDOR= netty_project JAVA_VERSION= 8+ -NO_BUILD= yes NO_ARCH= yes WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}.Final @@ -36,6 +36,44 @@ PORTDOCS= * OPTIONS_DEFINE= DOCS +.include + +.if ${ARCH} == "aarch64" +NETTY_ARCH= aarch_64 +.elif ${ARCH} == "amd64" +NETTY_ARCH= x86_64 +.elif ${ARCH} == "arm6" +NETTY_ARCH= arm_32 +.elif ${ARCH} == "arm7" +NETTY_ARCH= arm_32 +.elif ${ARCH} == "i386" +NETTY_ARCH= x86_32 +.elif ${ARCH} == "powerpc" +NETTY_ARCH= ppc_32 +.elif ${ARCH} == "powerpc64" +NETTY_ARCH= ppc_64 +.elif ${ARCH} == "sparc64" +NETTY_ARCH= sparc_64 +.else +# Default to ${ARCH} +NETTY_ARCH= ${ARCH} +.endif + +post-extract: + (cd ${WRKSRC} && \ + ${JAR} xf jar/netty-transport-native-kqueue-${PORTVERSION}.Final-sources.jar) + (cd ${WRKSRC} && \ + ${JAR} xf jar/netty-transport-native-unix-common-${PORTVERSION}.Final-sources.jar) + @${SED} -e 's!%%NETTY_ARCH%%!${NETTY_ARCH}!g' \ + -e 's!%%JAVA_HOME%%!${JAVA_HOME}!g' \ + ${FILESDIR}/Makefile.in > ${WRKSRC}/Makefile + +pre-install: + @${MKDIR} ${WRKSRC}/jar/all-in-one/META-INF/native + @${MV} ${WRKSRC}/libnetty_transport_native_kqueue*.so \ + ${WRKSRC}/jar/all-in-one/META-INF/native/ + @(cd ${WRKSRC}/jar/all-in-one && ${JAR} uvf ${PORTNAME}-all-${PORTVERSION}.Final.jar META-INF/native/libnetty_transport_native_kqueue*.so) + do-install: @${MKDIR} ${STAGEDIR}${JAVAJARDIR} ${INSTALL_DATA} ${WRKSRC}/jar/all-in-one/${PORTNAME}-all-${PORTVERSION}.Final.jar ${STAGEDIR}${JAVAJARDIR}/${PORTNAME}-${PORTVERSION}.jar @@ -47,4 +85,4 @@ do-install: ${INSTALL_MAN} ${WRKSRC}/${FILE} ${STAGEDIR}${DOCSDIR} .endfor -.include +.include diff --git a/java/netty/files/Makefile.in b/java/netty/files/Makefile.in new file mode 100644 index 000000000000..87f86840eb13 --- /dev/null +++ b/java/netty/files/Makefile.in @@ -0,0 +1,8 @@ +# $FreeBSD$ + +SHLIB_NAME= libnetty_transport_native_kqueue_%%NETTY_ARCH%%.so +SRCS!= ls *.c +INCS!= ls *.h +CFLAGS+= -I%%JAVA_HOME%%/include -I%%JAVA_HOME%%/include/freebsd + +.include -- cgit v1.2.3