From 554a918c3cc605717a0c8f867d82ecd149a049d3 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Mon, 13 Feb 2023 19:49:01 +1000 Subject: [PATCH] libsrtp2: add recipe --- net-libs/libsrtp/libsrtp2-2.5.0.recipe | 76 +++++++++++++++++++ .../libsrtp/patches/libsrtp-2.5.0.patchset | 36 +++++++++ 2 files changed, 112 insertions(+) create mode 100644 net-libs/libsrtp/libsrtp2-2.5.0.recipe create mode 100644 net-libs/libsrtp/patches/libsrtp-2.5.0.patchset diff --git a/net-libs/libsrtp/libsrtp2-2.5.0.recipe b/net-libs/libsrtp/libsrtp2-2.5.0.recipe new file mode 100644 index 000000000..f0fa7425b --- /dev/null +++ b/net-libs/libsrtp/libsrtp2-2.5.0.recipe @@ -0,0 +1,76 @@ +SUMMARY="Secure RTP (SRTP) Reference Implementation" +DESCRIPTION="This package provides an implementation of the Secure Real-time \ +Transport Protocol (SRTP), the Universal Security Transform (UST), and \ +a supporting cryptographic kernel." +HOMEPAGE="https://github.com/cisco/libsrtp/" +COPYRIGHT="2001-2023 Cisco Systems, Inc." +LICENSE="BSD (3-clause)" +REVISION="1" +SOURCE_URI="$HOMEPAGE/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="8a43ef8e9ae2b665292591af62aa1a4ae41e468b6d98d8258f91478735da4e09" +SOURCE_DIR="libsrtp-$portVersion" +PATCHES="libsrtp-$portVersion.patchset" + +ARCHITECTURES="all ?x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + libsrtp2$secondaryArchSuffix = $portVersion + lib:libsrtp2$secondaryArchSuffix = 1 + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + " + +PROVIDES_devel=" + libsrtp2${secondaryArchSuffix}_devel = $portVersion + devel:libsrtp2$secondaryArchSuffix = 1 + " +REQUIRES_devel=" + libsrtp2$secondaryArchSuffix == $portVersion base + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcrypto$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:libtoolize$secondaryArchSuffix + cmd:meson + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + export LDFLAGS="-lnetwork" + + meson \ + --buildtype=release \ + --prefix=$prefix \ + --libdir=$libDir \ + --libexecdir=$binDir \ + --datadir=$dataDir \ + --includedir=$includeDir \ + -Dcrypto-library=openssl \ + _build + + ninja -C _build +} + +INSTALL() +{ + ninja -C _build install + + # prepare development lib links + prepareInstalledDevelLib libsrtp2 + fixPkgconfig + + # devel package + packageEntries devel \ + $developDir +} diff --git a/net-libs/libsrtp/patches/libsrtp-2.5.0.patchset b/net-libs/libsrtp/patches/libsrtp-2.5.0.patchset new file mode 100644 index 000000000..ce3f2b442 --- /dev/null +++ b/net-libs/libsrtp/patches/libsrtp-2.5.0.patchset @@ -0,0 +1,36 @@ +From 0080247d1348a3e25b3f8e6d6580a8711ecbb3b9 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 12 Feb 2023 13:26:04 +1000 +Subject: Haiku fix + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3d9e4a9..cc40f17 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -273,6 +273,9 @@ if(WIN32) + target_link_libraries(srtp2 ws2_32) + target_compile_definitions(srtp2 PUBLIC _CRT_SECURE_NO_WARNINGS) + endif() ++if(HAIKU) ++ target_link_libraries(srtp2 network) ++endif() + + install(TARGETS srtp2 DESTINATION lib + EXPORT libSRTPTargets +diff --git a/test/cutest.h b/test/cutest.h +index 94e1087..9a10fac 100644 +--- a/test/cutest.h ++++ b/test/cutest.h +@@ -91,7 +91,7 @@ + #include + #include + +-#if defined(unix) || defined(__unix__) || defined(__unix) || defined(__APPLE__) ++#if defined(unix) || defined(__unix__) || defined(__unix) || defined(__APPLE__) || defined(__HAIKU__) + #define CUTEST_UNIX__ 1 + #include + #include +-- +2.37.3 +