From ee2d2a100103e0f3613c60655dcf15be7d5157b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=95=9C=ED=83=9C=ED=98=84?= Date: Wed, 11 Sep 2024 09:42:43 +0900 Subject: [PATCH] [netcpp] Update to 0.5.0 (#40870) --- ports/netcpp/pkgconfig.patch | 33 ------------------ ports/netcpp/portfile.cmake | 65 ++++++++++++++++++------------------ ports/netcpp/usage | 8 ++--- ports/netcpp/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/n-/netcpp.json | 5 +++ 6 files changed, 44 insertions(+), 71 deletions(-) delete mode 100644 ports/netcpp/pkgconfig.patch diff --git a/ports/netcpp/pkgconfig.patch b/ports/netcpp/pkgconfig.patch deleted file mode 100644 index 0df3cf0cd8..0000000000 --- a/ports/netcpp/pkgconfig.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ffb6c54..e5656c6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -8,6 +8,8 @@ include(GNUInstallDirs) - if (MSVC) - set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG") - else() -+ find_package(PkgConfig REQUIRED) -+ pkg_check_modules(URING REQUIRED liburing) - add_compile_definitions(_LIBCPP_ENABLE_EXPERIMENTAL) - endif(MSVC) - add_compile_definitions(NETCPP_BUILD) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 9c54dca..f67ed18 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -4,6 +4,13 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) - add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES}) - add_library(${EXPORT_NAMESPACE}${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - --target_include_directories(netcpp PUBLIC -+target_include_directories(${PROJECT_NAME} PUBLIC - $ - $) -+ -+if (MSVC) -+ target_link_libraries(${PROJECT_NAME} PRIVATE ws2_32) -+else () -+ target_include_directories(${PROJECT_NAME} PRIVATE ${URING_INCLUDE_DIRS}) -+ target_link_libraries(${PROJECT_NAME} PRIVATE ${URING_LINK_LIBRARIES}) -+endif () -\ No newline at end of file diff --git a/ports/netcpp/portfile.cmake b/ports/netcpp/portfile.cmake index 5b3389ea27..088d95d33a 100644 --- a/ports/netcpp/portfile.cmake +++ b/ports/netcpp/portfile.cmake @@ -1,32 +1,33 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO index1207/netcpp - REF "v${VERSION}" - SHA512 18b322ec599dc2ece84d31bf723e8d1c8bf107e93a39a58dee27e7e59de7e0387c72a638d5a59eda43706f39a054b3325e3f40f093edf8d673061c526d30b06b - HEAD_REF release - PATCHES - pkgconfig.patch -) - -if (VCPKG_TARGET_IS_LINUX) - vcpkg_find_acquire_program(PKGCONFIG) -endif () - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DINCLUDE_TEST=OFF - "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" - MAYBE_UNUSED_VARIABLES - PKG_CONFIG_EXECUTABLE -) -vcpkg_fixup_pkgconfig() -vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/netcpp PACKAGE_NAME netcpp) - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO index1207/netcpp + REF "v${VERSION}" + SHA512 5f0c7a9ad414b868c23cde4c16a605c2029631935b252b3faa4e485ec1efa3dbfe64fd0b068db8e018481b6ac83f819facc1db371470be42c6919fcf69005e17 + HEAD_REF release +) + +set(options -DNETCPP_TEST=OFF) + +vcpkg_find_acquire_program(PKGCONFIG) +list(APPEND options "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}") + +if ("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "dynamic") + list(APPEND options -DNETCPP_BUILD_SHARED=ON) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + MAYBE_UNUSED_VARIABLES + PKG_CONFIG_EXECUTABLE +) + +vcpkg_cmake_install() +vcpkg_fixup_pkgconfig() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/netcpp PACKAGE_NAME netcpp) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY) diff --git a/ports/netcpp/usage b/ports/netcpp/usage index 2a4e5273cd..b199e5b6e6 100644 --- a/ports/netcpp/usage +++ b/ports/netcpp/usage @@ -1,4 +1,4 @@ -netcpp provides CMake targets: - - find_package(netcpp CONFIG REQUIRED) - target_link_libraries(main PRIVATE netcpp::netcpp) +netcpp provides CMake targets: + + find_package(netcpp CONFIG REQUIRED) + target_link_libraries(main PRIVATE netcpp::netcpp) diff --git a/ports/netcpp/vcpkg.json b/ports/netcpp/vcpkg.json index 97e488917a..4d5bfc322b 100644 --- a/ports/netcpp/vcpkg.json +++ b/ports/netcpp/vcpkg.json @@ -1,6 +1,6 @@ { "name": "netcpp", - "version": "0.4.1", + "version": "0.5.0", "description": "A simple asynchronous network library", "homepage": "https://github.com/index1207/netcpp", "license": "MIT", diff --git a/versions/baseline.json b/versions/baseline.json index 5123d34b39..e06562d80c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6241,7 +6241,7 @@ "port-version": 5 }, "netcpp": { - "baseline": "0.4.1", + "baseline": "0.5.0", "port-version": 0 }, "netgen": { diff --git a/versions/n-/netcpp.json b/versions/n-/netcpp.json index 0e3c7ae2c9..0042f6cbd4 100644 --- a/versions/n-/netcpp.json +++ b/versions/n-/netcpp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a6b9de73a8c7899d0e814723cebae0e0d49209a6", + "version": "0.5.0", + "port-version": 0 + }, { "git-tree": "31b03887dbbc3cd3e44aebfd261ff1bda934c9a3", "version": "0.4.1",