Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[promise-cpp] Add new port #20340

Merged
merged 10 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ports/promise-cpp/fix-ifdef.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/include/promise-cpp/promise.hpp b/include/promise-cpp/promise.hpp
--- a/include/promise-cpp/promise.hpp
+++ b/include/promise-cpp/promise.hpp
@@ -2,7 +2,7 @@
#ifndef INC_PROMISE_HPP_
#define INC_PROMISE_HPP_

-#ifdef PROMISE_HEADER_ONLY
+#ifdef PROMISE_HEADONLY
#define PROMISE_API inline
#elif defined PROMISE_BUILD_SHARED

15 changes: 15 additions & 0 deletions ports/promise-cpp/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xhawk18/promise-cpp
REF 2.1.2
SHA512 490571e6d6742e05ae6a2549af4e242a1d7084edc583fbbb183798bdddb25d08a7f68becfa94f55b877cba7e2e8e8515964f892881591b5bb394b4b33e6593f7
HEAD_REF master
PATCHES fix-ifdef.patch
)

file(GLOB PROMISE_HEADERS "${SOURCE_PATH}/include/*.hpp")
file(INSTALL "${SOURCE_PATH}/include/promise-cpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include")

file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
9 changes: 9 additions & 0 deletions ports/promise-cpp/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The package promise-cpp is header only and can be used from CMake via:

find_path(PROMISE_CPP_INCLUDE_DIRS "promise-cpp/promise.hpp")
target_include_directories(main PRIVATE ${PROMISE_CPP_INCLUDE_DIRS})

Make sure to define the pre-processor macro PROMISE_HEADONLY before including "promise-cpp/promise.hpp":

#define PROMISE_HEADONLY
#include "promise-cpp/promise.hpp"
12 changes: 12 additions & 0 deletions ports/promise-cpp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "promise-cpp",
"version": "2.1.2",
"description": "C++ promise/A+ library in Javascript style.",
"homepage": "https://github.com/xhawk18/promise-cpp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -5236,6 +5236,10 @@
"baseline": "0.13.0",
"port-version": 0
},
"promise-cpp": {
"baseline": "2.1.2",
"port-version": 0
},
"protobuf": {
"baseline": "3.18.0",
"port-version": 0
Expand Down
9 changes: 9 additions & 0 deletions versions/p-/promise-cpp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "ebacf13f64f6bab1413ec0e45d16259c8cf78279",
"version": "2.1.2",
"port-version": 0
}
]
}