From dfc7fa2775ad6928a7b8d02a0eb96a9a406a3827 Mon Sep 17 00:00:00 2001 From: miyanyan <1138989048@qq.com> Date: Fri, 27 Dec 2024 22:10:24 +0800 Subject: [PATCH 1/6] [ucoro] add new port --- ports/ucoro/cmake-install.patch | 39 +++++++++++++++++++++++++++++++++ ports/ucoro/portfile.cmake | 26 ++++++++++++++++++++++ ports/ucoro/vcpkg.json | 16 ++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 ports/ucoro/cmake-install.patch create mode 100644 ports/ucoro/portfile.cmake create mode 100644 ports/ucoro/vcpkg.json diff --git a/ports/ucoro/cmake-install.patch b/ports/ucoro/cmake-install.patch new file mode 100644 index 00000000000000..3ca81f6a6511f2 --- /dev/null +++ b/ports/ucoro/cmake-install.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 663044e..6d8e460 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,8 +15,31 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + add_compile_options(-foptimize-sibling-calls) + endif() + ++include(GNUInstallDirs) ++ + add_library(ucoro INTERFACE) +-target_include_directories(ucoro INTERFACE include) ++target_include_directories(ucoro INTERFACE $ ++ $) ++ ++option(UCORO_BUILD_TESTING "Build the tests" ON) ++if (UCORO_BUILD_TESTING) ++ enable_testing() ++ add_subdirectory(tests) ++endif() ++ ++install( ++ TARGETS ucoro ++ EXPORT ucoroTargets ++ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ++) ++install( ++ DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ucoro ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++# generate config.cmake ++install( ++ EXPORT ucoroTargets ++ FILE ucoro-config.cmake ++ DESTINATION "share/ucoro" ++) + +-enable_testing() +-add_subdirectory(tests) diff --git a/ports/ucoro/portfile.cmake b/ports/ucoro/portfile.cmake new file mode 100644 index 00000000000000..d5b888317a4c0e --- /dev/null +++ b/ports/ucoro/portfile.cmake @@ -0,0 +1,26 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO avplayer/ucoro + REF "v${VERSION}" + SHA512 c3436b436ef1ebb3d47a65db9603842293bdb6451bc6fb738a63d61a63b52901e223f46625d956303566dc52dfb38ffb2c6ce20016c18b444f9cb3e2e701e613 + HEAD_REF main + PATCHES + cmake-install.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DUCORO_BUILD_TESTING=OFF +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup() +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" +) + +file(INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/ucoro/vcpkg.json b/ports/ucoro/vcpkg.json new file mode 100644 index 00000000000000..51b3d86e415ac5 --- /dev/null +++ b/ports/ucoro/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "ucoro", + "version": "1.0", + "description": "It is a minimized C++20 coroutine library.", + "homepage": "https://github.com/avplayer/ucoro", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} From c6c9fcdefa90993c1ce7821575fa92e5ae65f8ba Mon Sep 17 00:00:00 2001 From: miyanyan <1138989048@qq.com> Date: Fri, 27 Dec 2024 22:12:26 +0800 Subject: [PATCH 2/6] update versions --- versions/baseline.json | 4 ++++ versions/u-/ucoro.json | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 versions/u-/ucoro.json diff --git a/versions/baseline.json b/versions/baseline.json index fd13fea6c4b5a1..6abf2f4e344f72 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -9204,6 +9204,10 @@ "baseline": "0.0.8", "port-version": 0 }, + "ucoro": { + "baseline": "1.0", + "port-version": 0 + }, "udt": { "baseline": "4.11", "port-version": 0 diff --git a/versions/u-/ucoro.json b/versions/u-/ucoro.json new file mode 100644 index 00000000000000..d3850a0e1b8fad --- /dev/null +++ b/versions/u-/ucoro.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "b725fd749de02e00920707b6c8dabe1a3e491852", + "version": "1.0", + "port-version": 0 + } + ] +} From 9c3ca4f47a70ab700c6b7511036905c108d8eec9 Mon Sep 17 00:00:00 2001 From: miyanyan <1138989048@qq.com> Date: Sat, 28 Dec 2024 12:26:14 +0800 Subject: [PATCH 3/6] remove empty debug folder --- ports/ucoro/portfile.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/ucoro/portfile.cmake b/ports/ucoro/portfile.cmake index d5b888317a4c0e..e74391f8bc3c00 100644 --- a/ports/ucoro/portfile.cmake +++ b/ports/ucoro/portfile.cmake @@ -19,8 +19,7 @@ vcpkg_cmake_config_fixup() vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/debug" ) file(INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) From 986bd19133b928aa5bee0a534883836ee23b6e18 Mon Sep 17 00:00:00 2001 From: miyanyan <1138989048@qq.com> Date: Sat, 28 Dec 2024 12:26:27 +0800 Subject: [PATCH 4/6] update versions --- versions/u-/ucoro.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/u-/ucoro.json b/versions/u-/ucoro.json index d3850a0e1b8fad..46640a2e75ac68 100644 --- a/versions/u-/ucoro.json +++ b/versions/u-/ucoro.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "b725fd749de02e00920707b6c8dabe1a3e491852", + "git-tree": "d461a5bc5382ef0d0b4cd776a861c416099ca2e9", "version": "1.0", "port-version": 0 } From a02bb4a12b61bf30215258935d6a66fb91a0d5bf Mon Sep 17 00:00:00 2001 From: miyanyan <1138989048@qq.com> Date: Sat, 28 Dec 2024 16:25:26 +0800 Subject: [PATCH 5/6] fix --- ports/ucoro/cmake-install.patch | 10 +++++----- ports/ucoro/portfile.cmake | 6 ++---- ports/ucoro/vcpkg.json | 1 + 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ports/ucoro/cmake-install.patch b/ports/ucoro/cmake-install.patch index 3ca81f6a6511f2..64804e94877b5c 100644 --- a/ports/ucoro/cmake-install.patch +++ b/ports/ucoro/cmake-install.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 663044e..6d8e460 100644 +index 663044e..9121cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,31 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") @@ -18,7 +18,9 @@ index 663044e..6d8e460 100644 + enable_testing() + add_subdirectory(tests) +endif() -+ + +-enable_testing() +-add_subdirectory(tests) +install( + TARGETS ucoro + EXPORT ucoroTargets @@ -32,8 +34,6 @@ index 663044e..6d8e460 100644 +install( + EXPORT ucoroTargets + FILE ucoro-config.cmake ++ NAMESPACE ucoro:: + DESTINATION "share/ucoro" +) - --enable_testing() --add_subdirectory(tests) diff --git a/ports/ucoro/portfile.cmake b/ports/ucoro/portfile.cmake index e74391f8bc3c00..468ea7c9023874 100644 --- a/ports/ucoro/portfile.cmake +++ b/ports/ucoro/portfile.cmake @@ -1,3 +1,5 @@ +set(VCPKG_BUILD_TYPE release) # header-only + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO avplayer/ucoro @@ -18,8 +20,4 @@ vcpkg_cmake_install() vcpkg_cmake_config_fixup() vcpkg_fixup_pkgconfig() -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug" -) - file(INSTALL "${SOURCE_PATH}/LICENSE_1_0.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/ucoro/vcpkg.json b/ports/ucoro/vcpkg.json index 51b3d86e415ac5..6f1428d8550324 100644 --- a/ports/ucoro/vcpkg.json +++ b/ports/ucoro/vcpkg.json @@ -3,6 +3,7 @@ "version": "1.0", "description": "It is a minimized C++20 coroutine library.", "homepage": "https://github.com/avplayer/ucoro", + "license": "BSL-1.0", "dependencies": [ { "name": "vcpkg-cmake", From c213625c531504d4ede611544a154dcf766f451f Mon Sep 17 00:00:00 2001 From: miyanyan <1138989048@qq.com> Date: Sat, 28 Dec 2024 16:25:59 +0800 Subject: [PATCH 6/6] update versions --- versions/u-/ucoro.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/u-/ucoro.json b/versions/u-/ucoro.json index 46640a2e75ac68..e30e979379c8bc 100644 --- a/versions/u-/ucoro.json +++ b/versions/u-/ucoro.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "d461a5bc5382ef0d0b4cd776a861c416099ca2e9", + "git-tree": "29380e4860b67d864c58e5c7b26c763dd90b634b", "version": "1.0", "port-version": 0 }