1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

net/libsrtp2: Update to 2.6.0 and switch to meson

This commit is contained in:
Tijl Coosemans 2024-02-25 19:20:22 +01:00
parent 572f236169
commit 552266cdfd
7 changed files with 132 additions and 56 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= libsrtp
DISTVERSIONPREFIX= v
DISTVERSION= 2.5.0
DISTVERSION= 2.6.0
CATEGORIES= net
PKGNAMESUFFIX= 2
@ -11,25 +11,14 @@ WWW= https://github.com/cisco/libsrtp
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= cpe meson pkgconfig ssl
CPE_VENDOR= cisco
USE_GITHUB= yes
GH_ACCOUNT= cisco
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --enable-openssl \
crypto_CFLAGS="-I${OPENSSLINC}" \
crypto_LIBS="${OPENSSLLIB}/libcrypto.so"
USES= cpe gmake pkgconfig ssl
CPE_VENDOR= cisco
USE_LDCONFIG= yes
ALL_TARGET= all shared_library
TEST_TARGET= runtest
TEST_ENV= LD_LIBRARY_PATH=${WRKSRC}
post-patch:
@${REINPLACE_CMD} '/supported_cflags=.*-fPIC/d' ${WRKSRC}/configure
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/libsrtp2.so.1
MESON_ARGS= -Dcrypto-library=openssl \
-Dcrypto-library-kdf=disabled \
-Ddoc=disabled
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
TIMESTAMP = 1675429915
SHA256 (cisco-libsrtp-v2.5.0_GH0.tar.gz) = 8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09
SIZE (cisco-libsrtp-v2.5.0_GH0.tar.gz) = 638704
TIMESTAMP = 1708868825
SHA256 (cisco-libsrtp-v2.6.0_GH0.tar.gz) = bf641aa654861be10570bfc137d1441283822418e9757dc71ebb69a6cf84ea6b
SIZE (cisco-libsrtp-v2.6.0_GH0.tar.gz) = 640699

View File

@ -1,35 +0,0 @@
--- Makefile.in.orig 2018-05-15 19:33:24 UTC
+++ Makefile.in
@@ -82,12 +82,11 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libsrtp2.pc
SHAREDLIBVERSION = 1
-ifneq (,$(or $(findstring linux,@host@), $(findstring gnu,@host@)))
SHAREDLIB_DIR = $(libdir)
SHAREDLIB_LDFLAGS = -shared -Wl,-soname,$@
SHAREDLIBSUFFIXNOVER = so
SHAREDLIBSUFFIX = $(SHAREDLIBSUFFIXNOVER).$(SHAREDLIBVERSION)
-else ifneq (,$(or $(findstring cygwin,@host@), $(findstring mingw,@host@)))
+ifneq (,$(or $(findstring cygwin,@host@), $(findstring mingw,@host@)))
SHAREDLIB_DIR = $(bindir)
SHAREDLIB_LDFLAGS = -shared -Wl,--out-implib,libsrtp2.dll.a
SHAREDLIBVERSION =
@@ -106,6 +105,9 @@ endif
%.o: %.c
$(COMPILE) -c $< -o $@
+%.So: %.c
+ $(COMPILE) -DPIC -fPIC -c $< -o $@
+
%$(EXE): %.c
$(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
@@ -137,7 +139,7 @@ libsrtp2.a: $(srtpobj) $(cryptobj) $(gdoi)
$(AR) cr libsrtp2.a $^
$(RANLIB) libsrtp2.a
-libsrtp2.$(SHAREDLIBSUFFIX): $(srtpobj) $(cryptobj) $(gdoi)
+libsrtp2.$(SHAREDLIBSUFFIX): $(srtpobj:.o=.So) $(cryptobj:.o=.So) $(gdoi:.o=.So)
$(CC) -shared -o $@ $(SHAREDLIB_LDFLAGS) \
$^ $(LDFLAGS) $(LIBS)
if [ -n "$(SHAREDLIBVERSION)" ]; then \

View File

@ -0,0 +1,11 @@
--- test/meson.build.orig 2024-02-24 08:29:39 UTC
+++ test/meson.build
@@ -64,7 +64,7 @@ endif
endif
# rtp_decoder
-pcap_dep = dependency('libpcap', required: get_option('pcap-tests'))
+pcap_dep = cc.find_library('pcap', required: get_option('pcap-tests'))
if pcap_dep.found()
executable('rtp_decoder',

View File

@ -0,0 +1,38 @@
--- test/rtpw_test.sh.orig 2024-02-24 08:29:39 UTC
+++ test/rtpw_test.sh
@@ -87,7 +87,7 @@ sleep 1
sleep 1
# verify that the background job is running
-ps -e | grep -q $receiver_pid
+ps x | grep -q $receiver_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -104,7 +104,7 @@ echo $0 ": sender PID = $sender_pid"
echo $0 ": sender PID = $sender_pid"
# verify that the background job is running
-ps -e | grep -q $sender_pid
+ps x | grep -q $sender_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -136,7 +136,7 @@ sleep 1
sleep 1
# verify that the background job is running
-ps -e | grep -q $receiver_pid
+ps x | grep -q $receiver_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -153,7 +153,7 @@ echo $0 ": sender PID = $sender_pid"
echo $0 ": sender PID = $sender_pid"
# verify that the background job is running
-ps -e | grep -q $sender_pid
+ps x | grep -q $sender_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then

View File

@ -0,0 +1,74 @@
--- test/rtpw_test_gcm.sh.orig 2024-02-24 08:29:39 UTC
+++ test/rtpw_test_gcm.sh
@@ -84,7 +84,7 @@ sleep 1
sleep 1
# verify that the background job is running
-ps -e | grep -q $receiver_pid
+ps x | grep -q $receiver_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -101,7 +101,7 @@ echo $0 ": sender PID = $sender_pid"
echo $0 ": sender PID = $sender_pid"
# verify that the background job is running
-ps -e | grep -q $sender_pid
+ps x | grep -q $sender_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -129,7 +129,7 @@ sleep 1
sleep 1
# verify that the background job is running
-ps -e | grep -q $receiver_pid
+ps x | grep -q $receiver_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -146,7 +146,7 @@ echo $0 ": sender PID = $sender_pid"
echo $0 ": sender PID = $sender_pid"
# verify that the background job is running
-ps -e | grep -q $sender_pid
+ps x | grep -q $sender_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -175,7 +175,7 @@ sleep 1
sleep 1
# verify that the background job is running
-ps -e | grep -q $receiver_pid
+ps x | grep -q $receiver_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -192,7 +192,7 @@ echo $0 ": sender PID = $sender_pid"
echo $0 ": sender PID = $sender_pid"
# verify that the background job is running
-ps -e | grep -q $sender_pid
+ps x | grep -q $sender_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -220,7 +220,7 @@ sleep 1
sleep 1
# verify that the background job is running
-ps -e | grep -q $receiver_pid
+ps x | grep -q $receiver_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then
@@ -237,7 +237,7 @@ echo $0 ": sender PID = $sender_pid"
echo $0 ": sender PID = $sender_pid"
# verify that the background job is running
-ps -e | grep -q $sender_pid
+ps x | grep -q $sender_pid
retval=$?
echo $retval
if [ $retval != 0 ]; then

View File

@ -2,7 +2,6 @@ include/srtp2/auth.h
include/srtp2/cipher.h
include/srtp2/crypto_types.h
include/srtp2/srtp.h
lib/libsrtp2.a
lib/libsrtp2.so
lib/libsrtp2.so.1
libdata/pkgconfig/libsrtp2.pc