aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libsrt
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/libsrt
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/libsrt')
-rw-r--r--vcpkg/ports/libsrt/fix-static.patch26
-rw-r--r--vcpkg/ports/libsrt/fix-tool.patch30
-rw-r--r--vcpkg/ports/libsrt/pkgconfig.diff16
-rw-r--r--vcpkg/ports/libsrt/portfile.cmake57
-rw-r--r--vcpkg/ports/libsrt/vcpkg.json27
5 files changed, 156 insertions, 0 deletions
diff --git a/vcpkg/ports/libsrt/fix-static.patch b/vcpkg/ports/libsrt/fix-static.patch
new file mode 100644
index 0000000..6080c91
--- /dev/null
+++ b/vcpkg/ports/libsrt/fix-static.patch
@@ -0,0 +1,26 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3f08b6a..88e636b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1026,20 +1026,7 @@ endif()
+
+ if (srt_libspec_static)
+ add_library(${TARGET_srt}_static STATIC ${OBJECT_LIB_SUPPORT} ${VIRTUAL_srt})
+-
+- # For Windows, leave the name to be "srt_static.lib".
+- # Windows generates two different library files:
+- # - a usual static library for static linkage
+- # - a shared library exposer, which allows pre-resolution and later dynamic
+- # linkage when running the executable
+- # Both having unfortunately the same names created by MSVC compiler.
+- # It's not the case of Cygwin/MINGW - they are named there libsrt.a and libsrt.dll.a
+- if (MICROSOFT)
+- # Keep _static suffix. By unknown reason, the name must still be set explicitly.
+- set_property(TARGET ${TARGET_srt}_static PROPERTY OUTPUT_NAME ${TARGET_srt}_static)
+- else()
+- set_property(TARGET ${TARGET_srt}_static PROPERTY OUTPUT_NAME ${TARGET_srt})
+- endif()
++ set_property(TARGET ${TARGET_srt}_static PROPERTY OUTPUT_NAME ${TARGET_srt})
+
+ list (APPEND INSTALL_TARGETS ${TARGET_srt}_static)
+ if (ENABLE_ENCRYPTION)
diff --git a/vcpkg/ports/libsrt/fix-tool.patch b/vcpkg/ports/libsrt/fix-tool.patch
new file mode 100644
index 0000000..b3b6079
--- /dev/null
+++ b/vcpkg/ports/libsrt/fix-tool.patch
@@ -0,0 +1,30 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 7ed11ef..794028a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1384,11 +1384,13 @@ if (ENABLE_APPS)
+
+ # Applications
+
+- srt_add_application(srt-live-transmit ${VIRTUAL_srtsupport})
++ srt_add_application(srt-live-transmit ${VIRTUAL_srtsupport} ${VIRTUAL_srt})
++ target_link_libraries(srt-live-transmit ${SSL_LIBRARIES})
+ if (DEFINED EXTRA_stransmit)
+ set_target_properties(srt-live-transmit PROPERTIES COMPILE_FLAGS "${EXTRA_stransmit}")
+ endif()
+- srt_add_application(srt-file-transmit ${VIRTUAL_srtsupport})
++ srt_add_application(srt-file-transmit ${VIRTUAL_srtsupport} ${VIRTUAL_srt})
++ target_link_libraries(srt-file-transmit ${SSL_LIBRARIES})
+
+ if (MINGW)
+ # FIXME: with MINGW, it fails to build apps that require C++11
+@@ -1397,7 +1399,8 @@ if (ENABLE_APPS)
+ else()
+ # srt-multiplex temporarily blocked
+ #srt_add_application(srt-multiplex ${VIRTUAL_srtsupport})
+- srt_add_application(srt-tunnel ${VIRTUAL_srtsupport})
++ srt_add_application(srt-tunnel ${VIRTUAL_srtsupport} ${VIRTUAL_srt})
++ target_link_libraries(srt-tunnel ${SSL_LIBRARIES})
+ endif()
+
+ if (ENABLE_TESTING)
diff --git a/vcpkg/ports/libsrt/pkgconfig.diff b/vcpkg/ports/libsrt/pkgconfig.diff
new file mode 100644
index 0000000..5235e84
--- /dev/null
+++ b/vcpkg/ports/libsrt/pkgconfig.diff
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1492306..69287ec 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1182,7 +1182,11 @@ endif()
+ # if your build requires it, you'd probably remove -lstdc++ from the list
+ # obtained by `pkg-config --libs`.
+ if(ENABLE_CXX_DEPS)
++ cmake_policy(SET CMP0057 NEW)
+ foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})
++ if(LIB IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES)
++ continue()
++ endif()
+ if((IS_ABSOLUTE ${LIB} AND EXISTS ${LIB}) OR (${LIB} MATCHES "^-l"))
+ set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB})
+ else()
diff --git a/vcpkg/ports/libsrt/portfile.cmake b/vcpkg/ports/libsrt/portfile.cmake
new file mode 100644
index 0000000..f188271
--- /dev/null
+++ b/vcpkg/ports/libsrt/portfile.cmake
@@ -0,0 +1,57 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Haivision/srt
+ REF "v${VERSION}"
+ SHA512 ec4e5923531a8a7fd7778c739cb52208d24a91c569f31f3995d6e0695dffd83492e5eca2530b2e112ca37f1fd4520061d89ef42d1ded95e2516a9acda009bcaf
+ HEAD_REF master
+ PATCHES
+ fix-static.patch
+ pkgconfig.diff
+ fix-tool.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KEYSTONE_BUILD_STATIC)
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" KEYSTONE_BUILD_SHARED)
+
+vcpkg_check_features(
+ OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ tool ENABLE_APPS
+ bonding ENABLE_BONDING
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${FEATURE_OPTIONS}
+ -DENABLE_CXX11=ON
+ -DENABLE_STATIC=${KEYSTONE_BUILD_STATIC}
+ -DENABLE_SHARED=${KEYSTONE_BUILD_SHARED}
+ -DENABLE_UNITTESTS=OFF
+ -DUSE_OPENSSL_PC=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
+
+if(ENABLE_APPS)
+ if(NOT VCPKG_TARGET_IS_MINGW)
+ vcpkg_copy_tools(TOOL_NAMES srt-tunnel AUTO_CLEAN)
+ endif()
+ vcpkg_copy_tools(TOOL_NAMES srt-file-transmit srt-live-transmit AUTO_CLEAN)
+ vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/bin/srt-ffplay" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/srt-ffplay")
+endif()
+if(KEYSTONE_BUILD_STATIC OR NOT VCPKG_TARGET_IS_WINDOWS)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+else()
+ file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/srt-ffplay" "${CURRENT_PACKAGES_DIR}/debug/bin/srt-ffplay")
+endif()
+
+if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/srt/srt.h" "#ifdef SRT_DYNAMIC" "#if 1")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/libsrt/vcpkg.json b/vcpkg/ports/libsrt/vcpkg.json
new file mode 100644
index 0000000..626fc2d
--- /dev/null
+++ b/vcpkg/ports/libsrt/vcpkg.json
@@ -0,0 +1,27 @@
+{
+ "name": "libsrt",
+ "version": "1.5.4",
+ "description": "Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet.",
+ "homepage": "https://github.com/Haivision/srt",
+ "license": "MPL-2.0",
+ "supports": "!uwp & !xbox",
+ "dependencies": [
+ "openssl",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ],
+ "features": {
+ "bonding": {
+ "description": "Enables the Connection Bonding feature"
+ },
+ "tool": {
+ "description": "Builds libsrt executable"
+ }
+ }
+}