[co] Add new port (#19535)

* add package co

* add version

* fix support

* fix version

* Update ports/co/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/co/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/co/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/co/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/co/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/co/vcpkg.json

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* using features instead of dependency

* update version schema

* fix portfile

* fix hash

* add comments & cleanup

* fix hash

* update portfile

* up hash

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
This commit is contained in:
Alvin 2021-09-04 08:15:27 +08:00 committed by GitHub
parent 3fa88493ab
commit 6d0c72f1d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 0 deletions

34
ports/co/portfile.cmake Normal file
View File

@ -0,0 +1,34 @@
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
vcpkg_fail_port_install(ON_ARCH "arm" ON_TAREGT "uwp")
endif()
# It's not safe to use dynamic library, as we hooked some system APIs in CO.
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO idealvin/co
REF 82b9f75dcd114c69d2b9c2c5a13ce2c3b95ba99f #v2.0.1
SHA512 ec33c5b920adf8b5e5500ed7c9768bd595ba2b568b604f26f953ddb5d04e411e8a2ea05b213595a44cafbadf90c1e1661208855301b2b47295ccc6e20f36e8d8
HEAD_REF master
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
libcurl WITH_LIBCURL
openssl WITH_OPENSSL
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
)
vcpkg_cmake_install()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

33
ports/co/vcpkg.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "co",
"version-semver": "2.0.1",
"description": "A go-style coroutine library in C++11 and more",
"homepage": "https://github.com/idealvin/co",
"supports": "!uwp & !(arm & windows)",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
],
"features": {
"libcurl": {
"description": "libcurl with OpenSSL support",
"dependencies": [
{
"name": "curl",
"default-features": false,
"features": [
"openssl"
]
}
]
},
"openssl": {
"description": "SSL support (OpenSSL)",
"dependencies": [
"openssl"
]
}
}
}

View File

@ -1352,6 +1352,10 @@
"baseline": "1.1.7",
"port-version": 1
},
"co": {
"baseline": "2.0.1",
"port-version": 0
},
"coin": {
"baseline": "4.0.0",
"port-version": 2

9
versions/c-/co.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "c9f30ca17733d2c0f4b071ca90d6500c456ac7d0",
"version-semver": "2.0.1",
"port-version": 0
}
]
}