diff options
Diffstat (limited to 'vcpkg/ports/outcome')
| -rw-r--r-- | vcpkg/ports/outcome/files-do-not-exist.patch | 37 | ||||
| -rw-r--r-- | vcpkg/ports/outcome/fix-status-code-path.patch | 23 | ||||
| -rw-r--r-- | vcpkg/ports/outcome/portfile.cmake | 68 | ||||
| -rw-r--r-- | vcpkg/ports/outcome/usage | 4 | ||||
| -rw-r--r-- | vcpkg/ports/outcome/vcpkg.json | 61 |
5 files changed, 193 insertions, 0 deletions
diff --git a/vcpkg/ports/outcome/files-do-not-exist.patch b/vcpkg/ports/outcome/files-do-not-exist.patch new file mode 100644 index 0000000..53affeb --- /dev/null +++ b/vcpkg/ports/outcome/files-do-not-exist.patch @@ -0,0 +1,37 @@ +diff --git a/cmake/headers.cmake b/cmake/headers.cmake +index 734e7d0..5d0f646 100644 +--- a/cmake/headers.cmake ++++ b/cmake/headers.cmake +@@ -25,32 +25,6 @@ set(outcome_HEADERS + "include/outcome/detail/version.hpp" + "include/outcome/experimental/coroutine_support.hpp" + "include/outcome/experimental/result.h" +- "include/outcome/experimental/status-code/include/status-code/boost_error_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/com_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/config.hpp" +- "include/outcome/experimental/status-code/include/status-code/detail/nt_code_to_generic_code.ipp" +- "include/outcome/experimental/status-code/include/status-code/detail/nt_code_to_win32_code.ipp" +- "include/outcome/experimental/status-code/include/status-code/detail/win32_code_to_generic_code.ipp" +- "include/outcome/experimental/status-code/include/status-code/error.hpp" +- "include/outcome/experimental/status-code/include/status-code/errored_status_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/generic_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/getaddrinfo_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/http_status_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/iostream_support.hpp" +- "include/outcome/experimental/status-code/include/status-code/nested_status_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/nt_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/posix_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/quick_status_code_from_enum.hpp" +- "include/outcome/experimental/status-code/include/status-code/result.hpp" +- "include/outcome/experimental/status-code/include/status-code/status_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/status_code_domain.hpp" +- "include/outcome/experimental/status-code/include/status-code/status_error.hpp" +- "include/outcome/experimental/status-code/include/status-code/std_error_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/system_code.hpp" +- "include/outcome/experimental/status-code/include/status-code/system_code_from_exception.hpp" +- "include/outcome/experimental/status-code/include/status-code/system_error2.hpp" +- "include/outcome/experimental/status-code/include/status-code/win32_code.hpp" +- "include/outcome/experimental/status-code/single-header/system_error2.hpp" + "include/outcome/experimental/status_outcome.hpp" + "include/outcome/experimental/status_result.hpp" + "include/outcome/iostream_support.hpp" diff --git a/vcpkg/ports/outcome/fix-status-code-path.patch b/vcpkg/ports/outcome/fix-status-code-path.patch new file mode 100644 index 0000000..755966d --- /dev/null +++ b/vcpkg/ports/outcome/fix-status-code-path.patch @@ -0,0 +1,23 @@ +diff --git a/include/outcome/experimental/result.h b/include/outcome/experimental/result.h +index b912a55..1370e9e 100644 +--- a/include/outcome/experimental/result.h ++++ b/include/outcome/experimental/result.h +@@ -278,14 +278,14 @@ extern "C" + } + + #include "../config.hpp" +-#include "status-code/include/status-code/config.hpp" +-#include "status-code/include/status-code/system_code.hpp" ++#include <status-code/config.hpp> ++#include <status-code/system_code.hpp> + #include "status_result.hpp" + + +-#include "status-code/include/status-code/posix_code.hpp" ++#include <status-code/posix_code.hpp> + #ifdef _WIN32 +-#include "status-code/include/status-code/win32_code.hpp" ++#include <status-code/win32_code.hpp> + #endif + + #include <algorithm> diff --git a/vcpkg/ports/outcome/portfile.cmake b/vcpkg/ports/outcome/portfile.cmake new file mode 100644 index 0000000..ca7ab2b --- /dev/null +++ b/vcpkg/ports/outcome/portfile.cmake @@ -0,0 +1,68 @@ +# Outcome is composed of other third party libraries: +# Outcome +# <= status-code +# <= quickcpplib +# <= byte-lite +# <= gsl-lite +# <= Optional +# +# byte-lite and gsl-lite are in vcpkg, but may not be versions +# known to be compatible with Outcome. It has occurred in the +# past that newer versions were severely broken with Outcome. +# +# One can fetch an 'all sources' tarball from +# https://github.com/ned14/outcome/releases which contains +# the exact copy of those third party libraries known to +# have passed Outcome's CI process. + +vcpkg_download_distfile(MISSING_HEADER_FIX + URLS https://github.com/ned14/outcome/commit/d4d38266a0c889be00069600bdbc339456f8f5bd.patch?full_index=1 + FILENAME outcome-missing-swap-d4d38266a0c889be00069600bdbc339456f8f5bd.patch + SHA512 bcc6c050001776b998ff8146b7937ab86811288a0e611b911fad5031b654b0839c41a57196f70ec314c322124e1cb6473a7c5e91472e18b5bb6d35780eaf65f8 +) + +if ("polyfill-cxx20" IN_LIST FEATURES) + message(WARNING [=[ + Outcome depends on QuickCppLib which uses the vcpkg versions of gsl-lite and byte-lite, rather than the versions tested by QuickCppLib's and Outcome's CI. It is not guaranteed to work with other versions, with failures experienced in the past up-to-and-including runtime crashes. See the warning message from QuickCppLib for how you can pin the versions of those dependencies in your manifest file to those with which QuickCppLib was tested. Do not report issues to upstream without first pinning the versions as QuickCppLib was tested against. + ]=]) +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO ned14/outcome + REF v${VERSION} + SHA512 faa92dbee1f5c74389bc181721e12cd87ad616bdcd2e5845b19233f63cd366270eb806b88ac057ea9a3147e3df49210b7219e9b98a0a0299f00c98eaf2ab8903 + HEAD_REF develop + PATCHES + fix-status-code-path.patch + "${MISSING_HEADER_FIX}" + files-do-not-exist.patch +) + +# Because outcome's deployed files are header-only, the debug build is not necessary +set(VCPKG_BUILD_TYPE release) + +# Use Outcome's own build process, skipping examples and tests. +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -Doutcome_IS_DEPENDENCY=ON + "-DCMAKE_PREFIX_PATH=${CURRENT_INSTALLED_DIR}" + -DOUTCOME_BUNDLE_EMBEDDED_STATUS_CODE=OFF + -DOUTCOME_ENABLE_DEPENDENCY_SMOKE_TEST=ON # Leave this always on to test everything compiles + -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON + -DCXX_CONCEPTS_FLAGS= +) + +if("run-tests" IN_LIST FEATURES) + vcpkg_cmake_build(TARGET test) +endif() + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/outcome) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") + +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/Licence.txt") diff --git a/vcpkg/ports/outcome/usage b/vcpkg/ports/outcome/usage new file mode 100644 index 0000000..6bf0040 --- /dev/null +++ b/vcpkg/ports/outcome/usage @@ -0,0 +1,4 @@ +The package outcome provides CMake targets:
+
+ find_package(outcome CONFIG REQUIRED)
+ target_link_libraries(main PUBLIC outcome::hl)
diff --git a/vcpkg/ports/outcome/vcpkg.json b/vcpkg/ports/outcome/vcpkg.json new file mode 100644 index 0000000..20a7c5b --- /dev/null +++ b/vcpkg/ports/outcome/vcpkg.json @@ -0,0 +1,61 @@ +{ + "name": "outcome", + "version": "2.2.12", + "port-version": 2, + "maintainers": [ + "Niall Douglas <s_github@nedprod.com>", + "Henrik Gaßmann <henrik@gassmann.onl>" + ], + "description": "Provides very lightweight outcome<T> and result<T> (non-Boost edition)", + "homepage": "https://github.com/ned14/outcome", + "license": "Apache-2.0 OR BSL-1.0", + "supports": "!uwp", + "dependencies": [ + "ned14-internal-quickcpplib", + "status-code", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "polyfill-cxx17": { + "description": "Polyfill C++17 entities", + "dependencies": [ + { + "name": "ned14-internal-quickcpplib", + "default-features": false, + "features": [ + "polyfill-cxx17" + ] + }, + { + "name": "outcome", + "default-features": false, + "features": [ + "polyfill-cxx20" + ] + } + ] + }, + "polyfill-cxx20": { + "description": "Polyfill C++20 entities", + "dependencies": [ + { + "name": "ned14-internal-quickcpplib", + "default-features": false, + "features": [ + "polyfill-cxx20" + ] + } + ] + }, + "run-tests": { + "description": "Build and run the dependency validation tests" + } + } +} |