aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLazyHamster <ariman@inbox.ru>2017-10-05 15:56:49 +0300
committerLazyHamster <ariman@inbox.ru>2017-10-05 15:56:49 +0300
commit887466dfc1ff8ed20d3b9268f76da987f7d53635 (patch)
treeafdad04519bc7611919992a06c81ce625c376257
parentd8507cd159f8de6ae174cae9894c926f75fe50d7 (diff)
downloadvcpkg-887466dfc1ff8ed20d3b9268f76da987f7d53635.tar.gz
vcpkg-887466dfc1ff8ed20d3b9268f76da987f7d53635.zip
Added port for librtmp 2.3
-rw-r--r--ports/librtmp/CMakeLists.txt57
-rw-r--r--ports/librtmp/CONTROL4
-rw-r--r--ports/librtmp/fix_strncasecmp.patch16
-rw-r--r--ports/librtmp/hide_netstackdump.patch22
-rw-r--r--ports/librtmp/librtmp.def105
-rw-r--r--ports/librtmp/portfile.cmake36
6 files changed, 240 insertions, 0 deletions
diff --git a/ports/librtmp/CMakeLists.txt b/ports/librtmp/CMakeLists.txt
new file mode 100644
index 000000000..c12ddc0ef
--- /dev/null
+++ b/ports/librtmp/CMakeLists.txt
@@ -0,0 +1,57 @@
+cmake_minimum_required(VERSION 3.8)
+
+project(librtmp C)
+
+find_package(zlib REQUIRED)
+find_package(openssl REQUIRED)
+
+include_directories(${ZLIB_INCLUDE_DIRS})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+
+set(CMAKE_DEBUG_POSTFIX "d")
+
+if(MSVC)
+ add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
+ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
+ add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS)
+endif()
+
+add_definitions(-DLIBRTMP_ONLY)
+
+# List the header files
+set(HEADERS librtmp/amf.h
+ librtmp/bytes.h
+ librtmp/dh.h
+ librtmp/dhgroups.h
+ librtmp/handshake.h
+ librtmp/http.h
+ librtmp/log.h
+ librtmp/rtmp.h
+ librtmp/rtmp_sys.h
+)
+
+# List the source files
+set(SRCS librtmp/amf.c
+ librtmp/hashswf.c
+ librtmp/log.c
+ librtmp/parseurl.c
+ librtmp/rtmp.c
+ librtmp/librtmp.def
+)
+
+if(MSVC)
+ set(SRCS_MSVC "librtmp/librtmp.def")
+endif()
+
+add_library(librtmp ${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)
+
+install(TARGETS librtmp
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+
+install(FILES librtmp/rtmp.h librtmp/amf.h DESTINATION include/librtmp) \ No newline at end of file
diff --git a/ports/librtmp/CONTROL b/ports/librtmp/CONTROL
new file mode 100644
index 000000000..d26541d91
--- /dev/null
+++ b/ports/librtmp/CONTROL
@@ -0,0 +1,4 @@
+Source: librtmp
+Version: 2.3
+Build-Depends: zlib, openssl
+Description: RTMPDump Real-Time Messaging Protocol API
diff --git a/ports/librtmp/fix_strncasecmp.patch b/ports/librtmp/fix_strncasecmp.patch
new file mode 100644
index 000000000..c1cadc4ac
--- /dev/null
+++ b/ports/librtmp/fix_strncasecmp.patch
@@ -0,0 +1,16 @@
+diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h
+index 0874cbe..b43d587 100644
+--- a/librtmp/rtmp_sys.h
++++ b/librtmp/rtmp_sys.h
+@@ -37,6 +37,11 @@
+ #include <ws2tcpip.h>
+ #endif
+
++#ifdef _MSC_VER
++#define strncasecmp _strnicmp
++#define strcasecmp _stricmp
++#endif
++
+ #define GetSockError() WSAGetLastError()
+ #define SetSockError(e) WSASetLastError(e)
+ #define setsockopt(a,b,c,d,e) (setsockopt)(a,b,c,(const char *)d,(int)e)
diff --git a/ports/librtmp/hide_netstackdump.patch b/ports/librtmp/hide_netstackdump.patch
new file mode 100644
index 000000000..e2a5e4207
--- /dev/null
+++ b/ports/librtmp/hide_netstackdump.patch
@@ -0,0 +1,22 @@
+diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c
+index f152648..0bf3f7d 100644
+--- a/librtmp/rtmp.c
++++ b/librtmp/rtmp.c
+@@ -1316,7 +1316,7 @@ ReadN(RTMP *r, char *buffer, int n)
+ SendBytesReceived(r);
+ }
+ /*RTMP_Log(RTMP_LOGDEBUG, "%s: %d bytes\n", __FUNCTION__, nBytes); */
+-#ifdef _DEBUG
++#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
+ fwrite(ptr, 1, nBytes, netstackdump_read);
+ #endif
+
+@@ -3527,7 +3527,7 @@ RTMPSockBuf_Send(RTMPSockBuf *sb, const char *buf, int len)
+ {
+ int rc;
+
+-#ifdef _DEBUG
++#if defined(_DEBUG) && !defined(LIBRTMP_ONLY)
+ fwrite(buf, 1, len, netstackdump);
+ #endif
+
diff --git a/ports/librtmp/librtmp.def b/ports/librtmp/librtmp.def
new file mode 100644
index 000000000..d9f8b9136
--- /dev/null
+++ b/ports/librtmp/librtmp.def
@@ -0,0 +1,105 @@
+EXPORTS
+ AMF_AddProp
+ AMF_CountProp
+ AMF_Decode
+ AMF_DecodeArray
+ AMF_DecodeBoolean
+ AMF_DecodeInt16
+ AMF_DecodeInt24
+ AMF_DecodeInt32
+ AMF_DecodeLongString
+ AMF_DecodeNumber
+ AMF_DecodeString
+ AMF_Dump
+ AMF_Encode
+ AMF_EncodeBoolean
+ AMF_EncodeInt16
+ AMF_EncodeInt24
+ AMF_EncodeInt32
+ AMF_EncodeNamedBoolean
+ AMF_EncodeNamedNumber
+ AMF_EncodeNamedString
+ AMF_EncodeNumber
+ AMF_EncodeString
+ AMF_GetProp
+ AMF_Reset
+
+ AMF3_Decode
+ AMF3CD_AddProp
+ AMF3CD_GetProp
+ AMF3Prop_Decode
+ AMF3ReadInteger
+ AMF3ReadString
+
+ AMFProp_Decode
+ AMFProp_Dump
+ AMFProp_Encode
+ AMFProp_GetBoolean
+ AMFProp_GetName
+ AMFProp_GetNumber
+ AMFProp_GetObject
+ AMFProp_GetString
+ AMFProp_GetType
+ AMFProp_IsValid
+ AMFProp_Reset
+ AMFProp_SetName
+
+ RTMP_Alloc
+ RTMP_ClientPacket
+ RTMP_Close
+ RTMP_Connect
+ RTMP_Connect0
+ RTMP_Connect1
+ RTMP_ConnectStream
+ RTMP_ctrlC
+ RTMP_debuglevel
+ RTMP_DefaultFlashVer
+ RTMP_DeleteStream
+ RTMP_DropRequest
+ RTMP_EnableWrite
+ RTMP_FindFirstMatchingProperty
+ RTMP_FindPrefixProperty
+ RTMP_Free
+ RTMP_GetDuration
+ RTMP_GetNextMediaPacket
+ RTMP_GetTime
+ RTMP_HashSWF
+ RTMP_Init
+ RTMP_IsConnected
+ RTMP_IsTimedout
+ RTMP_LibVersion
+ RTMP_Log
+ RTMP_LogGetLevel
+ RTMP_LogHex
+ RTMP_LogHexString
+ RTMP_LogPrintf
+ RTMP_LogSetCallback
+ RTMP_LogSetLevel
+ RTMP_LogSetOutput
+ RTMP_LogStatus
+ RTMP_ParsePlaypath
+ RTMP_ParseURL
+ RTMP_Pause
+ RTMP_Read
+ RTMP_ReadPacket
+ RTMP_ReconnectStream
+ RTMP_SendChunk
+ RTMP_SendClientBW
+ RTMP_SendCreateStream
+ RTMP_SendCtrl
+ RTMP_SendPacket
+ RTMP_SendPause
+ RTMP_SendSeek
+ RTMP_SendServerBW
+ RTMP_Serve
+ RTMP_SetBufferMS
+ RTMP_SetOpt
+ RTMP_SetupStream
+ RTMP_SetupURL
+ RTMP_Socket
+ RTMP_TLS_ctx
+ RTMP_TLS_Init
+ RTMP_ToggleStream
+ RTMP_UpdateBufferMS
+ RTMP_UserInterrupt
+ RTMP_Write
diff --git a/ports/librtmp/portfile.cmake b/ports/librtmp/portfile.cmake
new file mode 100644
index 000000000..18423f152
--- /dev/null
+++ b/ports/librtmp/portfile.cmake
@@ -0,0 +1,36 @@
+include(vcpkg_common_functions)
+
+set(RTMPDUMP_VERSION 2.3)
+set(RTMPDUMP_FILENAME rtmpdump-${RTMPDUMP_VERSION}.tgz)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rtmpdump-${RTMPDUMP_VERSION})
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://rtmpdump.mplayerhq.hu/download/${RTMPDUMP_FILENAME}"
+ FILENAME "${RTMPDUMP_FILENAME}"
+ SHA512 d8240ba372a704231286b81bbf75716d8b76874840538c4e1527f7f8b6ca66eeaba6b03167fe6fab06bf80f20f07d89ecb84cc428b3196234174a43f3328ec2a
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/librtmp.def DESTINATION ${SOURCE_PATH}/librtmp)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ ${CMAKE_CURRENT_LIST_DIR}/fix_strncasecmp.patch
+ ${CMAKE_CURRENT_LIST_DIR}/hide_netstackdump.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+)
+
+vcpkg_install_cmake()
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+
+# License and man
+file(INSTALL ${SOURCE_PATH}/librtmp/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/librtmp RENAME copyright)
+file(INSTALL ${SOURCE_PATH}/librtmp/librtmp.3.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/librtmp)
+
+vcpkg_copy_pdbs()