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

[libuv] update to 1.44.1 and use official CMakeLists #24745

Merged
merged 43 commits into from
Jul 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0349f5c
[libuv] update to <1.44.1>
JonLiu1993 May 17, 2022
fadca38
update version
JonLiu1993 May 17, 2022
50ddf4b
fix ci error
JonLiu1993 May 18, 2022
943545a
update version
JonLiu1993 May 18, 2022
c85ebd4
fix-ci-error
JonLiu1993 May 18, 2022
eb7e6be
[libuv] update to <1.44.1>
JonLiu1993 May 18, 2022
e08f6ff
update version
JonLiu1993 May 18, 2022
095183b
add patch
JonLiu1993 May 18, 2022
5c2f36e
update version
JonLiu1993 May 18, 2022
985fcd5
add option
JonLiu1993 Jun 2, 2022
53fc9a0
update version
JonLiu1993 Jun 2, 2022
b79fd52
delete patch
JonLiu1993 Jun 2, 2022
55817df
update evrsion
JonLiu1993 Jun 2, 2022
6a19323
fix ci error
JonLiu1993 Jun 2, 2022
08deaab
update version
JonLiu1993 Jun 2, 2022
2fd5e00
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
JonLiu1993 Jun 27, 2022
c1c020f
delete patch
JonLiu1993 Jun 27, 2022
6a6dfbd
update evrsion
JonLiu1993 Jun 27, 2022
fc50c5a
Use official CMakeLists.txt
Jun 27, 2022
8a04c19
Fix build type
Jun 27, 2022
a1c15c5
Re-fix, fix pkgconfig
Jun 27, 2022
18b3306
Fix usocket build
Jun 28, 2022
be8810c
Fix uvw build
Jun 28, 2022
1110978
Fix wpilib build
Jun 28, 2022
cb960f9
Fix cmake build
Jun 28, 2022
ae3b9e8
Fix tensorpipe build
Jun 28, 2022
b893e2a
Fix qpid-proton build
Jun 28, 2022
177720d
modern portfile
JonLiu1993 Jun 28, 2022
9db56a4
update version
JonLiu1993 Jun 28, 2022
348b3de
Add licese
JonLiu1993 Jun 28, 2022
1ded7ce
update version
JonLiu1993 Jun 28, 2022
f3df9a4
Update ports/usockets/CMakeLists.txt
JackBoosY Jun 28, 2022
abd4a53
update version
JonLiu1993 Jun 28, 2022
ea8497c
Add usage
Jul 6, 2022
76c202f
Apply suggestion
Jul 6, 2022
c25a997
version
Jul 6, 2022
21f0d66
Disable to build examples
Jul 6, 2022
9f1d906
version
Jul 6, 2022
3836985
typo
Jul 6, 2022
aaadada
version
Jul 6, 2022
f5366cf
Fix find_package
Jul 6, 2022
bb1728c
version
Jul 6, 2022
7d8b2d0
Update version
JonLiu1993 Jul 7, 2022
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
83 changes: 0 additions & 83 deletions ports/libuv/CMakeLists.txt

This file was deleted.

72 changes: 72 additions & 0 deletions ports/libuv/fix-build-type.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac52412..15d5cb2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -381,7 +381,7 @@ endif()
if(APPLE OR CMAKE_SYSTEM_NAME MATCHES "DragonFly|FreeBSD|Linux|NetBSD|OpenBSD")
list(APPEND uv_test_libraries util)
endif()
-
+if (BUILD_SHARED_LIBS)
add_library(uv SHARED ${uv_sources})
target_compile_definitions(uv
INTERFACE
@@ -401,7 +401,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
set_target_properties(uv PROPERTIES LINKER_LANGUAGE CXX)
endif()
target_link_libraries(uv ${uv_libraries})
-
+else()
add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
target_compile_options(uv_a PRIVATE ${uv_cflags})
@@ -416,7 +416,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "OS390")
set_target_properties(uv_a PROPERTIES LINKER_LANGUAGE CXX)
endif()
target_link_libraries(uv_a ${uv_libraries})
-
+endif()
if(LIBUV_BUILD_TESTS)
# Small hack: use ${uv_test_sources} now to get the runner skeleton,
# before the actual tests are added.
@@ -659,26 +659,39 @@ string(REPLACE ";" " " LIBS "${LIBS}")
file(STRINGS configure.ac configure_ac REGEX ^AC_INIT)
string(REGEX MATCH "([0-9]+)[.][0-9]+[.][0-9]+" PACKAGE_VERSION "${configure_ac}")
set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
+if (BUILD_SHARED_LIBS)
# The version in the filename is mirroring the behaviour of autotools.
set_target_properties(uv PROPERTIES
VERSION ${UV_VERSION_MAJOR}.0.0
SOVERSION ${UV_VERSION_MAJOR})
+endif()
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
+if (BUILD_SHARED_LIBS)
configure_file(libuv.pc.in libuv.pc @ONLY)
+else()
configure_file(libuv-static.pc.in libuv-static.pc @ONLY)
+endif()

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
-install(FILES ${PROJECT_BINARY_DIR}/libuv.pc ${PROJECT_BINARY_DIR}/libuv-static.pc
+if (BUILD_SHARED_LIBS)
+install(FILES ${PROJECT_BINARY_DIR}/libuv.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+else()
+install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+endif()
+if (BUILD_SHARED_LIBS)
install(TARGETS uv EXPORT libuvConfig
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+else()
install(TARGETS uv_a EXPORT libuvConfig
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
install(EXPORT libuvConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv)

if(MSVC)
34 changes: 15 additions & 19 deletions ports/libuv/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libuv/libuv
REF v1.43.0
SHA512 66ee11f8f6fc1313c432858572789cf67acd6364b29a06c73323ab20626e2d6e3d3dcea748cf5d9d4368b40ad7fe0d5fd35e9369c22e531db523703f005248d3
REF e8b7eb6908a847ffbe6ab2eec7428e43a0aa53a2 #v1.44.1
SHA512 c8918fe3cdfcfec7c7da4af8286b5fd28805f41a40a283a22ff578631835539d9f52b46310f1ac0a464a570f9664d6793bb6c63541f01a4f379b3ad2f7c56aea
HEAD_REF v1.x
PATCHES fix-build-type.patch
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS_DEBUG
-DUV_SKIP_HEADERS=ON
OPTIONS
-DLIBUV_BUILD_TESTS=OFF
-DQEMU=OFF
-DASAN=OFF
-DTSAN=OFF
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-libuv CONFIG_PATH share/unofficial-libuv)
vcpkg_copy_pdbs()

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

configure_file(
"${CMAKE_CURRENT_LIST_DIR}/unofficial-libuv-config.in.cmake"
"${CURRENT_PACKAGES_DIR}/share/unofficial-libuv/unofficial-libuv-config.cmake"
@ONLY
)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libuv)
vcpkg_fixup_pkgconfig()

file(READ "${CURRENT_PACKAGES_DIR}/include/uv.h" UV_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
string(REPLACE "defined(USING_UV_SHARED)" "1" UV_H "${UV_H}")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/uv.h" "defined(USING_UV_SHARED)" "1")
else()
string(REPLACE "defined(USING_UV_SHARED)" "0" UV_H "${UV_H}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/uv.h" "defined(USING_UV_SHARED)" "0")
endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/include/uv.h" "${UV_H}")

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

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

7 changes: 0 additions & 7 deletions ports/libuv/unofficial-libuv-config.in.cmake

This file was deleted.

4 changes: 4 additions & 0 deletions ports/libuv/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
libuv provides CMake targets:

find_package(libuv CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:uv_a>,uv_a,uv>)
16 changes: 0 additions & 16 deletions ports/libuv/vcpkg-cmake-wrapper.cmake

This file was deleted.

3 changes: 2 additions & 1 deletion ports/libuv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "libuv",
"version-semver": "1.43.0",
"version-semver": "1.44.1",
"description": "libuv is a multi-platform support library with a focus on asynchronous I/O.",
"homepage": "https://github.com/libuv/libuv",
"license": "BSD-3-Clause",
"dependencies": [
{
"name": "vcpkg-cmake",
Expand Down
Loading