From 8979c5049d74f5bd0513689762daf24395fa4b4d Mon Sep 17 00:00:00 2001 From: MonicaLiu <110024546+MonicaLiu0311@users.noreply.github.com> Date: Fri, 1 Nov 2024 05:51:49 +0000 Subject: [PATCH] [enet] Update to 1.3.18 (#41880) Co-authored-by: Monica --- ports/enet/CMakeLists.txt | 106 ------------------------------------ ports/enet/fix-export.patch | 31 +++++++++++ ports/enet/portfile.cmake | 9 ++- ports/enet/vcpkg.json | 3 +- versions/baseline.json | 4 +- versions/e-/enet.json | 5 ++ 6 files changed, 43 insertions(+), 115 deletions(-) delete mode 100644 ports/enet/CMakeLists.txt create mode 100644 ports/enet/fix-export.patch diff --git a/ports/enet/CMakeLists.txt b/ports/enet/CMakeLists.txt deleted file mode 100644 index d17150b3da..0000000000 --- a/ports/enet/CMakeLists.txt +++ /dev/null @@ -1,106 +0,0 @@ -cmake_minimum_required(VERSION 3.0.2) - -project(enet) - -# The "configure" step. -include(CheckFunctionExists) -include(CheckStructHasMember) -include(CheckTypeSize) -check_function_exists("fcntl" HAS_FCNTL) -check_function_exists("poll" HAS_POLL) -check_function_exists("getaddrinfo" HAS_GETADDRINFO) -check_function_exists("getnameinfo" HAS_GETNAMEINFO) -check_function_exists("gethostbyname_r" HAS_GETHOSTBYNAME_R) -check_function_exists("gethostbyaddr_r" HAS_GETHOSTBYADDR_R) -check_function_exists("inet_pton" HAS_INET_PTON) -check_function_exists("inet_ntop" HAS_INET_NTOP) -check_struct_has_member("struct msghdr" "msg_flags" "sys/types.h;sys/socket.h" HAS_MSGHDR_FLAGS) -set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h") -check_type_size("socklen_t" HAS_SOCKLEN_T BUILTIN_TYPES_ONLY) -unset(CMAKE_EXTRA_INCLUDE_FILES) -if(MSVC) - add_definitions(-W3) -else() - add_definitions(-Wno-error) -endif() - -if(HAS_FCNTL) - add_definitions(-DHAS_FCNTL=1) -endif() -if(HAS_POLL) - add_definitions(-DHAS_POLL=1) -endif() -if(HAS_GETNAMEINFO) - add_definitions(-DHAS_GETNAMEINFO=1) -endif() -if(HAS_GETADDRINFO) - add_definitions(-DHAS_GETADDRINFO=1) -endif() -if(HAS_GETHOSTBYNAME_R) - add_definitions(-DHAS_GETHOSTBYNAME_R=1) -endif() -if(HAS_GETHOSTBYADDR_R) - add_definitions(-DHAS_GETHOSTBYADDR_R=1) -endif() -if(HAS_INET_PTON) - add_definitions(-DHAS_INET_PTON=1) -endif() -if(HAS_INET_NTOP) - add_definitions(-DHAS_INET_NTOP=1) -endif() -if(HAS_MSGHDR_FLAGS) - add_definitions(-DHAS_MSGHDR_FLAGS=1) -endif() -if(HAS_SOCKLEN_T) - add_definitions(-DHAS_SOCKLEN_T=1) -endif() - -add_library(enet - callbacks.c - compress.c - host.c - list.c - packet.c - peer.c - protocol.c - unix.c - win32.c - ) - -add_library(enet::enet ALIAS enet) - -target_include_directories(enet PUBLIC - $ - $ -) - -if (BUILD_SHARED_LIBS) - target_compile_definitions(enet - PUBLIC ENET_DLL - PRIVATE ENET_BUILDING_LIB - ) -endif() - - -if (WIN32) - target_link_libraries(enet winmm ws2_32) -endif() - -set(ENET_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/enet) - -configure_file ("${CMAKE_SOURCE_DIR}/libenet.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libenet.pc" @ONLY) -install (FILES "${CMAKE_CURRENT_BINARY_DIR}/libenet.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig") - -install(TARGETS enet EXPORT unofficial-enet-config - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) - -INSTALL(EXPORT unofficial-enet-config - NAMESPACE unofficial::enet:: - FILE unofficial-enet-config.cmake - DESTINATION share/unofficial-enet -) - -install(DIRECTORY include/ - DESTINATION include) \ No newline at end of file diff --git a/ports/enet/fix-export.patch b/ports/enet/fix-export.patch new file mode 100644 index 0000000000..89fec84b72 --- /dev/null +++ b/ports/enet/fix-export.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c6459b6..63aef98 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -89,14 +89,25 @@ add_library(enet STATIC + ${SOURCE_FILES} + ) + ++target_include_directories(enet PUBLIC ++ $ ++ $ ++) ++ + if (MINGW) + target_link_libraries(enet winmm ws2_32) + endif() + + install(TARGETS enet ++ EXPORT unofficial-enet-config + RUNTIME DESTINATION bin +- ARCHIVE DESTINATION lib/static ++ ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) + ++INSTALL(EXPORT unofficial-enet-config ++ NAMESPACE unofficial::enet:: ++ DESTINATION share/unofficial-enet ++) ++ + install(DIRECTORY include/ + DESTINATION include) diff --git a/ports/enet/portfile.cmake b/ports/enet/portfile.cmake index ad4d17374c..399fe1251a 100644 --- a/ports/enet/portfile.cmake +++ b/ports/enet/portfile.cmake @@ -1,12 +1,11 @@ vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH REPO "lsalzman/enet" - REF e0e7045b7e056b454b5093cb34df49dc4cee0bee # v1.3.17 + REF "v${VERSION}" HEAD_REF master - SHA512 006a78edcc2059d8cee47a163d308dd02120a54f9c203401b83eb6cb4ab3e56cf09988d3c35b436a1e9f74c01296995ae6fdd46f6d354fe8261cf19cdde3df5d + SHA512 a0d2fa8c957704dd49e00a726284ac5ca034b50b00d2b20a94fa1bbfbb80841467834bfdc84aa0ed0d6aab894608fd6c86c3b94eee46343f0e6d9c22e391dbf9 + PATCHES fix-export.patch ) -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") - vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" # OPTIONS -DUSE_THIS_IN_ALL_BUILDS=1 -DUSE_THIS_TOO=2 @@ -21,4 +20,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_copy_pdbs() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/enet/vcpkg.json b/ports/enet/vcpkg.json index 00dedec906..c85c7f19aa 100644 --- a/ports/enet/vcpkg.json +++ b/ports/enet/vcpkg.json @@ -1,7 +1,6 @@ { "name": "enet", - "version": "1.3.17", - "port-version": 2, + "version": "1.3.18", "description": "Reliable UDP networking library", "homepage": "https://github.com/lsalzman/enet", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index dc7b9dfbe7..e0b99672d4 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2557,8 +2557,8 @@ "port-version": 4 }, "enet": { - "baseline": "1.3.17", - "port-version": 2 + "baseline": "1.3.18", + "port-version": 0 }, "enkits": { "baseline": "1.11", diff --git a/versions/e-/enet.json b/versions/e-/enet.json index 895ebb97da..96b612a689 100644 --- a/versions/e-/enet.json +++ b/versions/e-/enet.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "20760176898c0663e1a8c3245ec12c324a444525", + "version": "1.3.18", + "port-version": 0 + }, { "git-tree": "17a08430b1e76eae1ff5ea036084bee2d9a09775", "version": "1.3.17",