Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[new port] ZLMediaKit #33024

Merged
merged 30 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions ports/zlmediakit/fix-dependency.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/3rdpart/CMakeLists.txt b/3rdpart/CMakeLists.txt
index c90129d..06bde42 100644
--- a/3rdpart/CMakeLists.txt
+++ b/3rdpart/CMakeLists.txt
@@ -24,6 +24,7 @@
##############################################################################

# jsoncpp
+if (0)
file(GLOB JSONCPP_SRC_LIST
${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp/include/json/*.h
${CMAKE_CURRENT_SOURCE_DIR}/jsoncpp/src/lib_json/*.cpp
@@ -38,7 +39,8 @@ target_include_directories(jsoncpp
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/jsoncpp/include")

-update_cached_list(MK_LINK_LIBRARIES jsoncpp)
+endif()
+update_cached_list(MK_LINK_LIBRARIES JsonCpp::JsonCpp)

##############################################################################

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb85679..c9390bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -434,6 +434,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
# for assert.h
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3rdpart)

+find_package(jsoncpp CONFIG REQUIRED)
add_subdirectory(3rdpart)

add_subdirectory(src)
74 changes: 74 additions & 0 deletions ports/zlmediakit/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ZLMediaKit/ZLMediaKit
REF 383da1e09ea78c24f380ffce8b7695ceec315c24
SHA512 f5ac5bf1e3629c67a9487fe082baaabeeb06532eac9777dcc02c362dc0632d5e2594400f6b9a6dd5cbdace614db5fb39f2cab3d86ce0ea066f0d2e09c56c300d
HEAD_REF master
PATCHES fix-dependency.patch
)

vcpkg_from_github(
OUT_SOURCE_PATH TOOL_KIT_SOURCE_PATH
REPO ZLMediaKit/ZLToolKit
REF d2016522a0e4b1d8df51a78b7415fe148f7245ca
SHA512 350730903fb24ce8e22710adea7af67dc1f74d157ae17b9f2e5fabd1c5aced8f45de0abce985130f5013871a3e31f9eaf78b161f734c16a9966da5b876a90e1b
HEAD_REF master
)

file(REMOVE_RECURSE "${SOURCE_PATH}/3rdpart/ZLToolKit")
file(COPY "${TOOL_KIT_SOURCE_PATH}/" DESTINATION "${SOURCE_PATH}/3rdpart/ZLToolKit")

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" static ZLMEDIAKIT_BUILD_STATIC)
string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" static ZLMEDIAKIT_CRT_STATIC)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
openssl ENABLE_OPENSSL
x264 ENABLE_X264
#mysql ENABLE_MYSQL
INVERTED_FEATURES
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DENABLE_API=ON
-DENABLE_API_STATIC_LIB=${ZLMEDIAKIT_BUILD_STATIC}
-DENABLE_MSVC_MT=${ZLMEDIAKIT_CRT_STATIC}
-DENABLE_ASAN=OFF
-DENABLE_CXX_API=OFF
-DENABLE_JEMALLOC_STATIC=OFF
-DENABLE_FAAC=OFF
-DENABLE_FFMPEG=OFF
-DENABLE_MYSQL=OFF
-DENABLE_PLAYER=ON
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
-DENABLE_SERVER=ON
-DENABLE_SERVER_LIB=OFF
-DENABLE_SRT=ON
-DENABLE_SCTP=ON
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
-DENABLE_WEBRTC=OFF
-DENABLE_WEPOLL=ON
# needs dependency libmov
-DENABLE_MP4=OFF
-DENABLE_HLS_FMP4=OFF
# needs dependency libmpeg
-DENABLE_RTPPROXY=OFF
-DENABLE_HLS=OFF

-DDISABLE_REPORT=OFF
-DUSE_SOLUTION_FOLDERS=ON
-DENABLE_TESTS=OFF
${FEATURE_OPTIONS}
OPTIONS_RELEASE
-DENABLE_MEM_DEBUG=OFF
OPTIONS_DEBUG
-DENABLE_MEM_DEBUG=ON
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()

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

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
32 changes: 32 additions & 0 deletions ports/zlmediakit/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "zlmediakit",
"version-date": "2023-08-05",
"description": "A high-performance carrier-grade streaming media service framework based on C++11.",
"homepage": "https://github.com/ZLMediaKit/ZLMediaKit",
"license": "MIT",
"dependencies": [
"jsoncpp",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"openssl": {
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
"description": "Enable OpenSSL",
"dependencies": [
"openssl"
]
},
"x264": {
"description": "Enable x264",
"dependencies": [
"x264"
JackBoosY marked this conversation as resolved.
Show resolved Hide resolved
]
}
}
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -9032,6 +9032,10 @@
"baseline": "2.0.7",
"port-version": 0
},
"zlmediakit": {
"baseline": "2023-08-05",
"port-version": 0
},
"zookeeper": {
"baseline": "3.5.6",
"port-version": 1
Expand Down
9 changes: 9 additions & 0 deletions versions/z-/zlmediakit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "cd74d9bd03b40a90d29a5397d6b0ab0ce2741eb6",
"version-date": "2023-08-05",
"port-version": 0
}
]
}