git: 6bbcfea9bcb4 - main - net-im/jitsi-srtp-native: New port: Native libraties to speed up jitsi-srtp

From: Jose Alonso Cardenas Marquez <acm_at_FreeBSD.org>
Date: Sat, 18 Jun 2022 06:59:42 UTC
The branch main has been updated by acm:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6bbcfea9bcb415be236e2670ad99c4cef5eb6ff9

commit 6bbcfea9bcb415be236e2670ad99c4cef5eb6ff9
Author:     Michael Gmelin <grembo@FreeBSD.org>
AuthorDate: 2022-06-18 06:57:16 +0000
Commit:     Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
CommitDate: 2022-06-18 06:57:16 +0000

    net-im/jitsi-srtp-native: New port: Native libraties to speed up jitsi-srtp
    
    Native libraries required to speed-up Jitsi SRTP.
    
    WWW: https://github.com/jitsi/jitsi-srtp/tree/master/src/main/native
    PR:             264243
---
 net-im/Makefile                    |  1 +
 net-im/jitsi-meet-full/Makefile    |  2 ++
 net-im/jitsi-srtp-native/Makefile  | 53 ++++++++++++++++++++++++++++++++++++++
 net-im/jitsi-srtp-native/distinfo  |  3 +++
 net-im/jitsi-srtp-native/pkg-descr |  3 +++
 5 files changed, 62 insertions(+)

diff --git a/net-im/Makefile b/net-im/Makefile
index dd2aa46f24c2..55a1cf6205bb 100644
--- a/net-im/Makefile
+++ b/net-im/Makefile
@@ -35,6 +35,7 @@
     SUBDIR += jicofo
     SUBDIR += jitsi-meet-full
     SUBDIR += jitsi-prosody-plugins
+    SUBDIR += jitsi-srtp-native
     SUBDIR += jitsi-videobridge
     SUBDIR += kaccounts-integration
     SUBDIR += kaccounts-providers
diff --git a/net-im/jitsi-meet-full/Makefile b/net-im/jitsi-meet-full/Makefile
index 8eea34dee895..528f4b69d3ed 100644
--- a/net-im/jitsi-meet-full/Makefile
+++ b/net-im/jitsi-meet-full/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	jitsi-meet-full
 PORTVERSION=	2.0.7287
+PORTREVISION=	1
 CATEGORIES=	net-im
 
 MAINTAINER=	acm@FreeBSD.org
@@ -10,6 +11,7 @@ USES=		metaport
 RUN_DEPENDS+=	jicofo>=1.0.877:net-im/jicofo \
 		jitsi-meet>=1.0.6155:www/jitsi-meet \
 		jitsi-prosody-plugins>=2.0.7287:net-im/jitsi-prosody-plugins \
+		jitsi-srtp-native>=1.1.7:net-im/jitsi-srtp-native \
 		jitsi-videobridge>=2.1.681:net-im/jitsi-videobridge \
 		nginx>0:www/nginx
 
diff --git a/net-im/jitsi-srtp-native/Makefile b/net-im/jitsi-srtp-native/Makefile
new file mode 100644
index 000000000000..9bc6d6c40687
--- /dev/null
+++ b/net-im/jitsi-srtp-native/Makefile
@@ -0,0 +1,53 @@
+PORTNAME=	jitsi
+DISTVERSION=	1.1-7
+DISTVERSIONSUFFIX=	-gd8d1435
+CATEGORIES=	net-im java
+PKGNAMESUFFIX=	-srtp-native
+
+MAINTAINER=	acm@FreeBSD.org
+COMMENT=	Native libraties to speed up jitsi-srtp
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+ONLY_FOR_ARCHS=	amd64 i386 powerpc64 powerpc64le
+
+BUILD_DEPENDS=	jitsi-videobridge>=2.1.681:net-im/jitsi-videobridge
+
+USES=		ssl
+USE_GITHUB=	yes
+USE_LDCONFIG=	yes
+GH_PROJECT=	${PORTNAME}-srtp
+USE_JAVA=	yes
+JAVA_VERSION=	11
+
+PLIST_FILES=	lib/libjitsisrtp_1.1.so
+
+do-build:
+	${MKDIR} ${WRKSRC}/target/native/javah
+	${FIND} ${WRKSRC}/src/main/java/org/jitsi/srtp/crypto -name "*.java" \
+		-exec ${JAVAC} \
+			-classpath ${JAVAJARDIR}/jitsi-videobridge.jar \
+			-h ${WRKSRC}/src/main/native \
+			$$(${BASENAME} {} .java) \;
+	cd ${WRKSRC}/src/main/native && ${FIND} . -name "*.c" \
+		-exec ${CC} ${CFLAGS} -Djitsisrtp_1_1_EXPORTS \
+			-I${JAVA_HOME}/include \
+			-I${JAVA_HOME}/include/freebsd \
+			-I. \
+			-I${OPENSSLINC} \
+			-fPIC \
+			-o $$(${BASENAME} {} .c).o \
+			-c {} \;
+	cd ${WRKSRC}/src/main/native && \
+		${CC} ${CFLAGS} -fPIC -shared \
+			-Wl,-soname,libjitsisrtp_1.1.so \
+			-o libjitsisrtp_1.1.so *.o \
+			-L${OPENSSLLIB} -lcrypto \
+			-Wl,-rpath,${JAVA_HOME}/lib/server
+
+do-install:
+	${INSTALL_LIB} ${WRKSRC}/src/main/native/libjitsisrtp_1.1.so \
+		${STAGEDIR}${PREFIX}/lib/
+
+.include <bsd.port.mk>
diff --git a/net-im/jitsi-srtp-native/distinfo b/net-im/jitsi-srtp-native/distinfo
new file mode 100644
index 000000000000..40815a9d253e
--- /dev/null
+++ b/net-im/jitsi-srtp-native/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1653499003
+SHA256 (jitsi-jitsi-srtp-1.1-7-gd8d1435_GH0.tar.gz) = 706ea56d9edc9c197cd1255721f66ac277324752735a6ff2c47b8f809bd391c4
+SIZE (jitsi-jitsi-srtp-1.1-7-gd8d1435_GH0.tar.gz) = 55896
diff --git a/net-im/jitsi-srtp-native/pkg-descr b/net-im/jitsi-srtp-native/pkg-descr
new file mode 100644
index 000000000000..00b6e5288f03
--- /dev/null
+++ b/net-im/jitsi-srtp-native/pkg-descr
@@ -0,0 +1,3 @@
+Native libraries required to speed-up Jitsi SRTP.
+
+WWW: https://github.com/jitsi/jitsi-srtp/tree/master/src/main/native