diff options
| author | Alexander Saprykin <xelfium@gmail.com> | 2018-05-26 13:27:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-26 13:27:14 +0200 |
| commit | 4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5 (patch) | |
| tree | d95c9490352eb73f078d34a33bc4bb44ac9fa48b /ports/librtmp | |
| parent | fb689bd13dd6ba563a885d71fff1dd2b32a615db (diff) | |
| parent | 2ac7527b40b1dbeb7856b9f763362c1e139e2ca9 (diff) | |
| download | vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.tar.gz vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.zip | |
Merge pull request #1 from Microsoft/master
Update vcpkg from upstream
Diffstat (limited to 'ports/librtmp')
| -rw-r--r-- | ports/librtmp/CMakeLists.txt | 56 | ||||
| -rw-r--r-- | ports/librtmp/CONTROL | 4 | ||||
| -rw-r--r-- | ports/librtmp/fix_strncasecmp.patch | 20 | ||||
| -rw-r--r-- | ports/librtmp/hide_netstackdump.patch | 58 | ||||
| -rw-r--r-- | ports/librtmp/librtmp.def | 109 | ||||
| -rw-r--r-- | ports/librtmp/portfile.cmake | 37 |
6 files changed, 284 insertions, 0 deletions
diff --git a/ports/librtmp/CMakeLists.txt b/ports/librtmp/CMakeLists.txt new file mode 100644 index 000000000..9751f3d73 --- /dev/null +++ b/ports/librtmp/CMakeLists.txt @@ -0,0 +1,56 @@ +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 +) + +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(DIRECTORY ${PROJECT_SOURCE_DIR}/librtmp DESTINATION include FILES_MATCHING PATTERN "*.h") diff --git a/ports/librtmp/CONTROL b/ports/librtmp/CONTROL new file mode 100644 index 000000000..957f5ee16 --- /dev/null +++ b/ports/librtmp/CONTROL @@ -0,0 +1,4 @@ +Source: librtmp +Version: 2.4-1 +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..3e0c7ea96 --- /dev/null +++ b/ports/librtmp/fix_strncasecmp.patch @@ -0,0 +1,20 @@ +diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h +index 6a3f215..1b5ac2a 100644 +--- a/librtmp/rtmp_sys.h ++++ b/librtmp/rtmp_sys.h +@@ -28,11 +28,13 @@ + #include <ws2tcpip.h> + + #ifdef _MSC_VER /* MSVC */ ++#if _MSC_VER < 1900 + #define snprintf _snprintf +-#define strcasecmp stricmp +-#define strncasecmp strnicmp + #define vsnprintf _vsnprintf + #endif ++#define strcasecmp _stricmp ++#define strncasecmp _strnicmp ++#endif + + #define GetSockError() WSAGetLastError() + #define SetSockError(e) WSASetLastError(e) diff --git a/ports/librtmp/hide_netstackdump.patch b/ports/librtmp/hide_netstackdump.patch new file mode 100644 index 000000000..2ae44e46b --- /dev/null +++ b/ports/librtmp/hide_netstackdump.patch @@ -0,0 +1,58 @@ +diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c +index 5ef3ae9..7c6a010 100644 +--- a/librtmp/rtmp.c ++++ b/librtmp/rtmp.c +@@ -129,7 +129,7 @@ static int clk_tck; + uint32_t + RTMP_GetTime() + { +-#ifdef _DEBUG ++#if defined(_DEBUG) && !defined(LIBRTMP_ONLY) + return 0; + #elif defined(_WIN32) + return timeGetTime(); +@@ -1256,7 +1256,7 @@ RTMP_ClientPacket(RTMP *r, RTMPPacket *packet) + return bHasMediaPacket; + } + +-#ifdef _DEBUG ++#if defined(_DEBUG) && !defined(LIBRTMP_ONLY) + extern FILE *netstackdump; + extern FILE *netstackdump_read; + #endif +@@ -1333,7 +1333,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 + +@@ -3064,7 +3064,7 @@ HandShake(RTMP *r, int FP9HandShake) + + memset(&clientsig[4], 0, 4); + +-#ifdef _DEBUG ++#if defined(_DEBUG) && !defined(LIBRTMP_ONLY) + for (i = 8; i < RTMP_SIG_SIZE; i++) + clientsig[i] = 0xff; + #else +@@ -3136,7 +3136,7 @@ SHandShake(RTMP *r) + memcpy(serversig, &uptime, 4); + + memset(&serversig[4], 0, 4); +-#ifdef _DEBUG ++#if defined(_DEBUG) && !defined(LIBRTMP_ONLY) + for (i = 8; i < RTMP_SIG_SIZE; i++) + serversig[i] = 0xff; + #else +@@ -3553,7 +3553,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..837e6a355 --- /dev/null +++ b/ports/librtmp/librtmp.def @@ -0,0 +1,109 @@ +EXPORTS + AMF3_Decode + AMF3CD_AddProp + AMF3CD_GetProp + AMF3Prop_Decode + AMF3ReadInteger + AMF3ReadString + + 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 + + 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_debuglevel + 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_Init + RTMP_ToggleStream + RTMP_UpdateBufferMS + RTMP_UserInterrupt + RTMP_Write + RTMPPacket_Alloc + RTMPPacket_Dump + RTMPPacket_Free + RTMPPacket_Reset + RTMPSockBuf_Close + RTMPSockBuf_Fill + RTMPSockBuf_Send diff --git a/ports/librtmp/portfile.cmake b/ports/librtmp/portfile.cmake new file mode 100644 index 000000000..25e41bbf7 --- /dev/null +++ b/ports/librtmp/portfile.cmake @@ -0,0 +1,37 @@ +include(vcpkg_common_functions) + +set(RTMPDUMP_VERSION 2.4) +set(RTMPDUMP_FILENAME rtmpdump-${RTMPDUMP_VERSION}.tar.gz) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/rtmpdump) + +vcpkg_download_distfile(ARCHIVE + URLS "http://rtmpdump.mplayerhq.hu/download/${RTMPDUMP_FILENAME}" + FILENAME "${RTMPDUMP_FILENAME}" + SHA512 a6253af95492739366dce620a2a6cc6f4f18d7f12f9ef2c747240259066ca135beeb02091d0f3dd8380c0c294a30d3f702ad3fad1dee1db4e70473078fb81609 +) +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} + PREFER_NINJA +) + +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() |
