Skip to content

Commit

Permalink
[librtmp] 2024-03-01
Browse files Browse the repository at this point in the history
  • Loading branch information
paperchalice committed Jan 13, 2025
1 parent 80d54ff commit 002b0ab
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 212 deletions.
25 changes: 19 additions & 6 deletions ports/librtmp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.10)

project(librtmp C)

Expand Down Expand Up @@ -43,13 +43,26 @@ if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4996")
endif()

add_library(librtmp ${SRCS} ${HEADERS} ${SRCS_MSVC})
add_library(rtmp ${SRCS} ${HEADERS} ${SRCS_MSVC})

target_include_directories(librtmp PRIVATE ./librtmp)
target_link_libraries(librtmp PRIVATE ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES})
target_link_libraries(librtmp PRIVATE Ws2_32.lib Winmm.lib)
target_include_directories(rtmp PRIVATE ./librtmp)
target_link_libraries(rtmp PRIVATE ${ZLIB_LIBRARIES} ${OPENSSL_LIBRARIES})
if(MSVC OR MINGW)
target_link_libraries(rtmp PRIVATE Ws2_32.lib Winmm.lib)
endif()

set(libdir [[${prefix}/lib]])
set(VERSION 2.6) # from ChangeLog
set(CRYPTO_REQ "libssl,libcrypto")
if(MSVC OR MINGW)
set(PRIVATE_LIBS "-lWS2_32 -lWinMM")
endif()
configure_file(librtmp/librtmp.pc.in librtmp.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/librtmp.pc
DESTINATION lib/pkgconfig
)

install(TARGETS librtmp
install(TARGETS rtmp
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
Expand Down
136 changes: 0 additions & 136 deletions ports/librtmp/dh.patch

This file was deleted.

35 changes: 0 additions & 35 deletions ports/librtmp/handshake.patch

This file was deleted.

28 changes: 0 additions & 28 deletions ports/librtmp/hashswf.patch

This file was deleted.

15 changes: 15 additions & 0 deletions ports/librtmp/pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/librtmp/librtmp.pc.in b/librtmp/librtmp.pc.in
--- a/librtmp/librtmp.pc.in
+++ b/librtmp/librtmp.pc.in
@@ -5,9 +5,9 @@

Name: librtmp
Description: RTMP implementation
Version: @VERSION@
-Requires: @CRYPTO_REQ@
+Requires: zlib,@CRYPTO_REQ@
URL: http://rtmpdump.mplayerhq.hu
-Libs: -L${libdir} -lrtmp -lz @PUBLIC_LIBS@
+Libs: -L${libdir} -lrtmp @PUBLIC_LIBS@
Libs.private: @PRIVATE_LIBS@
Cflags: -I${incdir}
10 changes: 5 additions & 5 deletions ports/librtmp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO mirror/rtmpdump
REF c5f04a58fc2aeea6296ca7c44ee4734c18401aa3
SHA512 d97ac38672898a96412baa5f03d1e64d512ccefe15ead0a055ca039dc6057e2e620e046c28f4d7468e132b0b5a9eb9bd171250c1afa14da53760a0d7aae3c9e9
REF 6f6bb1353fc84f4cc37138baa99f586750028a01
SHA512 e6c108576fdd3430d81e2f72b343864eee5d6be396c9378a2ae2bfc871e9464e20d7bd057a47ef2449a301d933b29265e7ffd3383631b24fc035f5483337bbce
PATCHES
dh.patch #Openssl 1.1.1 patch
handshake.patch #Openssl 1.1.1 patch
hashswf.patch #Openssl 1.1.1 patch
fix_strncasecmp.patch
hide_netstackdump.patch
pkgconfig.patch
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
Expand All @@ -19,11 +17,13 @@ vcpkg_cmake_configure(
)

vcpkg_cmake_install()
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")

# License and man
file(INSTALL "${SOURCE_PATH}/librtmp/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/librtmp/librtmp.3.html" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_copy_pdbs()
5 changes: 5 additions & 0 deletions ports/librtmp/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
librtmp can be imported via CMake FindPkgConfig module:

find_package(PkgConfig REQUIRED)
pkg_check_modules(librtmp REQUIRED IMPORTED_TARGET librtmp)
target_link_libraries(main PkgConfig::librtmp)
3 changes: 1 addition & 2 deletions ports/librtmp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "librtmp",
"version-date": "2019-11-11",
"port-version": 4,
"version-date": "2024-03-01",
"description": "RTMPDump Real-Time Messaging Protocol API",
"homepage": "https://rtmpdump.mplayerhq.hu",
"dependencies": [
Expand Down

0 comments on commit 002b0ab

Please sign in to comment.