Skip to content

Commit

Permalink
[libcoro] New Port (microsoft#30623)
Browse files Browse the repository at this point in the history
* Add libcoro 0.7

* Update CI baseline

* Add "supports": "!windows"

* Update CI baseline

* Remove unneeded vcpkg-cmake-config dependency

* Update CI baseline

* Disable x64-linux and x64-osx in ci.baseline.txt

* Apply code review suggestions

* Update CI baseline

* Add patch to disable git config

* Update CI baseline

* Fix patch

* Update CI baseline

* Allow shared library builds

* Update CI baseline

* Update libcoro to version 0.8

* Update CI baseline

* Update CI baseline

* Fix line endings

* Update CI baseline

* Fix hash

* Update CI baseline

* Update version database

* Force rerun of CI pipeline

* Update to libcoro 0.9

* Update CI baseline

* Replace manual dependency check with manifest-based one

* Remove v0.8 version

* Update CI baseline

---------

Co-authored-by: chausner <[email protected]>
Co-authored-by: Billy Robert O'Neal III <[email protected]>
  • Loading branch information
3 people authored Oct 2, 2023
1 parent c6d6efe commit 38dd6b1
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ports/libcoro/0001-allow-shared-lib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -92,4 +92,4 @@
endif()

-add_library(${PROJECT_NAME} STATIC ${LIBCORO_SOURCE_FILES})
+add_library(${PROJECT_NAME} ${LIBCORO_SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX PREFIX "")
18 changes: 18 additions & 0 deletions ports/libcoro/0002-disable-git-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,9 +7,9 @@

# Set the githooks directory to auto format and update the readme.
-message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks")
-execute_process(
- COMMAND git config --local core.hooksPath .githooks
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-)
+#message("${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR} -> git config --local core.hooksPath .githooks")
+#execute_process(
+# COMMAND git config --local core.hooksPath .githooks
+# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+#)

option(LIBCORO_EXTERNAL_DEPENDENCIES "Use Cmake find_package to resolve dependencies instead of embedded libraries, Default=OFF." OFF)
34 changes: 34 additions & 0 deletions ports/libcoro/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jbaldwin/libcoro
REF "v${VERSION}"
SHA512 9554fcaf721188e2475933fb8fe6b35f879479af9acb8b011545d66e588a98811f69100a4392e62c3c8bf05e8177760778c44ed4357d40d0a6349833a93fb8e8
HEAD_REF master
PATCHES
0001-allow-shared-lib.patch
0002-disable-git-config.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
networking LIBCORO_FEATURE_NETWORKING
ssl LIBCORO_FEATURE_SSL
threading LIBCORO_FEATURE_THREADING
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DLIBCORO_EXTERNAL_DEPENDENCIES=ON
-DLIBCORO_BUILD_TESTS=OFF
-DLIBCORO_BUILD_EXAMPLES=OFF
)

vcpkg_cmake_install()

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

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

vcpkg_fixup_pkgconfig()
44 changes: 44 additions & 0 deletions ports/libcoro/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "libcoro",
"version": "0.9",
"description": "C++20 coroutine library",
"homepage": "https://github.com/jbaldwin/libcoro",
"license": "Apache-2.0",
"supports": "!windows",
"dependencies": [
"tl-expected",
{
"name": "vcpkg-cmake",
"host": true
}
],
"default-features": [
"networking",
"ssl",
"threading"
],
"features": {
"networking": {
"description": "Include networking features.",
"dependencies": [
"c-ares"
]
},
"ssl": {
"description": "Include SSL features.",
"dependencies": [
{
"name": "libcoro",
"default-features": false,
"features": [
"networking"
]
},
"openssl"
]
},
"threading": {
"description": "Include multithreading features."
}
}
}
4 changes: 4 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ libcanberra:arm-neon-android=fail
libcanberra:arm64-android=fail
libcanberra:x64-android=fail
libcerf:x64-windows-static-md=fail
libcoro:arm-neon-android=fail
libcoro:arm64-android=fail
libcoro:x64-android=fail
libcoro:x64-osx=fail
libcpplocate:arm-neon-android=fail
libcpplocate:arm64-android=fail
libcpplocate:x64-android=fail
Expand Down
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4016,6 +4016,10 @@
"baseline": "2.2.0",
"port-version": 0
},
"libcoro": {
"baseline": "0.9",
"port-version": 0
},
"libcorrect": {
"baseline": "2018-10-11",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libcoro.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "36f9c61aa64e8be9670199b9efad6cec4e83b805",
"version": "0.9",
"port-version": 0
}
]
}

0 comments on commit 38dd6b1

Please sign in to comment.