From 63c735d5a9ab695d1f2a4528e1d25e2c8ea495b9 Mon Sep 17 00:00:00 2001 From: Dmitry Arkhipov Date: Wed, 1 Nov 2023 12:22:59 +0300 Subject: [PATCH] Added vcpkg port --- README.md | 12 +++ vcpkg/ports/boost-scope/1.83_compat.patch | 103 ++++++++++++++++++++++ vcpkg/ports/boost-scope/portfile.cmake | 23 +++++ vcpkg/ports/boost-scope/vcpkg.json | 25 ++++++ 4 files changed, 163 insertions(+) create mode 100644 vcpkg/ports/boost-scope/1.83_compat.patch create mode 100644 vcpkg/ports/boost-scope/portfile.cmake create mode 100644 vcpkg/ports/boost-scope/vcpkg.json diff --git a/README.md b/README.md index d411960..5e0a782 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,18 @@ This library is currently proposed for review and potential inclusion into [Boos * **include** - Interface headers of Boost.Scope * **test** - Boost.Scope unit tests +### Installation + +#### vcpkg + +```` +git clone https://github.com/Lastique/scope +vcpkg install boost-scope --overlay-ports=scope/vcpkg/ports/boost-scope +```` + +This will install Scope and all the required Boost packages if they were not +already installed. + ### More information * Read the [documentation](https://lastique.github.io/scope/libs/scope/doc/html/index.html). diff --git a/vcpkg/ports/boost-scope/1.83_compat.patch b/vcpkg/ports/boost-scope/1.83_compat.patch new file mode 100644 index 0000000..b08b4e8 --- /dev/null +++ b/vcpkg/ports/boost-scope/1.83_compat.patch @@ -0,0 +1,103 @@ +diff --git a/include/boost/scope/unique_resource.hpp b/include/boost/scope/unique_resource.hpp +index 08f4fc6..c97e3b1 100644 +--- a/include/boost/scope/unique_resource.hpp ++++ b/include/boost/scope/unique_resource.hpp +@@ -16,7 +16,7 @@ + + #include + #include +-#include ++#include + #include + #include + #include +@@ -615,8 +615,8 @@ private: + + void swap_impl(unique_resource_data& that, std::true_type, std::true_type) noexcept + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + + const bool allocated = m_allocated; + m_allocated = that.m_allocated; +@@ -625,14 +625,14 @@ private: + + void swap_impl(unique_resource_data& that, std::true_type, std::false_type) + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); + try + { +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + } + catch (...) + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); + throw; + } + +@@ -643,14 +643,14 @@ private: + + void swap_impl(unique_resource_data& that, std::false_type, std::false_type) + { +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + try + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); + } + catch (...) + { +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + throw; + } + +@@ -896,34 +896,34 @@ private: + + void swap_impl(unique_resource_data& that, std::true_type, std::true_type) noexcept + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + } + + void swap_impl(unique_resource_data& that, std::true_type, std::false_type) + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); + try + { +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + } + catch (...) + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); + throw; + } + } + + void swap_impl(unique_resource_data& that, std::false_type, std::false_type) + { +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + try + { +- boost::core::invoke_swap(get_internal_resource(), that.get_internal_resource()); ++ boost::swap(get_internal_resource(), that.get_internal_resource()); + } + catch (...) + { +- boost::core::invoke_swap(get_internal_deleter(), that.get_internal_deleter()); ++ boost::swap(get_internal_deleter(), that.get_internal_deleter()); + throw; + } + } diff --git a/vcpkg/ports/boost-scope/portfile.cmake b/vcpkg/ports/boost-scope/portfile.cmake new file mode 100644 index 0000000..93f336b --- /dev/null +++ b/vcpkg/ports/boost-scope/portfile.cmake @@ -0,0 +1,23 @@ +# Copyright 2023 Dmitry Arkhipov (grisumbras@yandex.ru) +# +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# https://www.boost.org/LICENSE_1_0.txt) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Lastique/scope + REF 6c14f5ccbdc0cb8dfad082f6f3bd5f0d3cdb8cf1 + SHA512 a4f647cb134a91e24a8f159646bb0912866a03047386579184298f6e5dad0b8c2a6df452390bb21954b313c80ddf2cd1d91ec5cdeb8ec4789a1f3f137f21ed5e + HEAD_REF develop + PATCHES 1.83_compat.patch +) + +file( + INSTALL "${SOURCE_PATH}/LICENSE" + DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" + RENAME copyright) +file( + INSTALL "${SOURCE_PATH}/include/" + DESTINATION "${CURRENT_PACKAGES_DIR}/include" + PATTERN "${SOURCE_PATH}/include/*") diff --git a/vcpkg/ports/boost-scope/vcpkg.json b/vcpkg/ports/boost-scope/vcpkg.json new file mode 100644 index 0000000..1450481 --- /dev/null +++ b/vcpkg/ports/boost-scope/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "boost-scope", + "version": "1.84.0", + "description": "Scope guards from Fundamentals TS 3", + "homepage": "https://github.com/Lastique/scope", + "dependencies": [ + { + "name": "boost-build", + "host": true, + "version>=": "1.83.0" + }, + { + "name": "boost-config", + "version>=": "1.83.0" + }, + { + "name": "boost-core", + "version>=": "1.83.0" + }, + { + "name": "boost-type-traits", + "version>=": "1.83.0" + } + ] +}