Skip to content

Commit

Permalink
(conan-io#25407) libuv: add version 1.49.0
Browse files Browse the repository at this point in the history
Co-authored-by: Ernesto de Gracia Herranz <ernestodegraciah@gmail.com>
  • Loading branch information
toge and ErniGH authored Sep 26, 2024
1 parent b319d7e commit 0553991
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes/libuv/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"1.49.0":
url: "https://github.com/libuv/libuv/archive/v1.49.0.tar.gz"
sha256: "a10656a0865e2cff7a1b523fa47d0f5a9c65be963157301f814d1cc5dbd4dc1d"
"1.48.0":
url: "https://github.com/libuv/libuv/archive/v1.48.0.tar.gz"
sha256: "8c253adb0f800926a6cbd1c6576abae0bc8eb86a4f891049b72f9e5b7dc58f33"
Expand Down Expand Up @@ -30,6 +33,10 @@ sources:
url: "https://github.com/libuv/libuv/archive/v1.41.0.zip"
sha256: "cb89a8b9f686c5ccf7ed09a9e0ece151a73ebebc17af3813159c335b02181794"
patches:
"1.49.0":
- patch_file: "patches/1.49.0/fix-cmake.patch"
patch_description: "separate shared and static library build"
patch_type: "conan"
"1.48.0":
- patch_file: "patches/1.48.0/fix-cmake.patch"
patch_description: "separate shared and static library build"
Expand Down
67 changes: 67 additions & 0 deletions recipes/libuv/all/patches/1.49.0/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28c6df2..608d0f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -471,7 +471,7 @@ if(LIBUV_BUILD_SHARED)
endif()
target_link_libraries(uv ${uv_libraries})
set_target_properties(uv PROPERTIES OUTPUT_NAME "uv")
-endif()
+else()

add_library(uv_a STATIC ${uv_sources})
target_compile_definitions(uv_a PRIVATE ${uv_defines})
@@ -491,7 +491,7 @@ set_target_properties(uv_a PROPERTIES OUTPUT_NAME "uv")
if(WIN32)
set_target_properties(uv_a PROPERTIES PREFIX "lib")
endif()
-
+endif()
if(LIBUV_BUILD_TESTS)
# Small hack: use ${uv_test_sources} now to get the runner skeleton,
# before the actual tests are added.
@@ -759,18 +759,18 @@ set(UV_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(prefix ${CMAKE_INSTALL_PREFIX})
-configure_file(libuv-static.pc.in libuv-static.pc @ONLY)
+# configure_file(libuv-static.pc.in libuv-static.pc @ONLY)

install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
install(FILES LICENSE-extra DESTINATION ${CMAKE_INSTALL_DOCDIR})
-install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-install(TARGETS uv_a EXPORT libuvConfig
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
-install(EXPORT libuvConfig
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv
- NAMESPACE libuv::)
+# install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
+# DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+# install(TARGETS uv_a EXPORT libuvConfig
+# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+# install(EXPORT libuvConfig
+# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv
+# NAMESPACE libuv::)

if(LIBUV_BUILD_SHARED)
# The version in the filename is mirroring the behaviour of autotools.
@@ -784,8 +784,16 @@ if(LIBUV_BUILD_SHARED)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+else()
+ configure_file(libuv-static.pc.in libuv-static.pc @ONLY)
+ install(FILES ${PROJECT_BINARY_DIR}/libuv-static.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ install(TARGETS uv_a EXPORT libuvConfig
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(EXPORT libuvConfig
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libuv
+ NAMESPACE libuv::)
endif()
-
if(MSVC)
set(CMAKE_DEBUG_POSTFIX d)
get_filename_component(CMAKE_C_COMPILER_DIR ${CMAKE_C_COMPILER} DIRECTORY)
2 changes: 2 additions & 0 deletions recipes/libuv/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"1.49.0":
folder: all
"1.48.0":
folder: all
"1.47.0":
Expand Down

0 comments on commit 0553991

Please sign in to comment.