From 6d0c72f1d6a05e60706ef5d96a7e00196b7f4353 Mon Sep 17 00:00:00 2001 From: Alvin Date: Sat, 4 Sep 2021 08:15:27 +0800 Subject: [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> --- ports/co/portfile.cmake | 34 ++++++++++++++++++++++++++++++++++ ports/co/vcpkg.json | 33 +++++++++++++++++++++++++++++++++ versions/baseline.json | 4 ++++ versions/c-/co.json | 9 +++++++++ 4 files changed, 80 insertions(+) create mode 100644 ports/co/portfile.cmake create mode 100644 ports/co/vcpkg.json create mode 100644 versions/c-/co.json diff --git a/ports/co/portfile.cmake b/ports/co/portfile.cmake new file mode 100644 index 000000000..a4b4a08d5 --- /dev/null +++ b/ports/co/portfile.cmake @@ -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) diff --git a/ports/co/vcpkg.json b/ports/co/vcpkg.json new file mode 100644 index 000000000..70adff172 --- /dev/null +++ b/ports/co/vcpkg.json @@ -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" + ] + } + } +} diff --git a/versions/baseline.json b/versions/baseline.json index f9bc7d72e..d0b4731ae 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -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 diff --git a/versions/c-/co.json b/versions/c-/co.json new file mode 100644 index 000000000..165d9e3ff --- /dev/null +++ b/versions/c-/co.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "c9f30ca17733d2c0f4b071ca90d6500c456ac7d0", + "version-semver": "2.0.1", + "port-version": 0 + } + ] +} -- cgit v1.2.3