-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[capnproto] Add Capnproto package #5617
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
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
ports/capnproto/0001-fix-capnpc-extension-handling-on-Windows.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| From 6e142f270524d78689a119737660050561cf853e Mon Sep 17 00:00:00 2001 | ||
| From: Thomas Arcila <thomas.arcila@gmail.com> | ||
| Date: Sat, 9 Mar 2019 19:00:24 -0500 | ||
| Subject: [PATCH] fix capnpc extension handling on Windows | ||
|
|
||
| --- | ||
| c++/src/capnp/CMakeLists.txt | 2 +- | ||
| c++/src/capnp/compiler/capnp.c++ | 2 +- | ||
| 2 files changed, 2 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/c++/src/capnp/CMakeLists.txt b/c++/src/capnp/CMakeLists.txt | ||
| index 11cbf5af..20b99ed3 100644 | ||
| --- a/c++/src/capnp/CMakeLists.txt | ||
| +++ b/c++/src/capnp/CMakeLists.txt | ||
| @@ -182,7 +182,7 @@ if(NOT CAPNP_LITE) | ||
| install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS}) | ||
|
|
||
| # Symlink capnpc -> capnp | ||
| - install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc\")") | ||
| + install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp${CMAKE_EXECUTABLE_SUFFIX} \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc${CMAKE_EXECUTABLE_SUFFIX}\")") | ||
| endif() # NOT CAPNP_LITE | ||
|
|
||
| # Tests ======================================================================== | ||
| diff --git a/c++/src/capnp/compiler/capnp.c++ b/c++/src/capnp/compiler/capnp.c++ | ||
| index 8e8c459b..d252fb12 100644 | ||
| --- a/c++/src/capnp/compiler/capnp.c++ | ||
| +++ b/c++/src/capnp/compiler/capnp.c++ | ||
| @@ -78,7 +78,7 @@ public: | ||
| : context(context), disk(kj::newDiskFilesystem()), loader(*this) {} | ||
|
|
||
| kj::MainFunc getMain() { | ||
| - if (context.getProgramName().endsWith("capnpc")) { | ||
| + if (context.getProgramName().endsWith("capnpc") || context.getProgramName().endsWith("capnpc.exe")) { | ||
| kj::MainBuilder builder(context, VERSION_STRING, | ||
| "Compiles Cap'n Proto schema files and generates corresponding source code in one or " | ||
| "more languages."); | ||
| -- | ||
| 2.19.1 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Source: capnproto | ||
| Version: 0.7.0 | ||
| Description: Data interchange format and capability-based RPC system https://capnproto.org/ | ||
| Build-Depends: zlib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL WindowsStore) | ||
| message(FATAL_ERROR "Error: UWP build is not supported.") | ||
| endif() | ||
|
|
||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
| message("Building DLLs not supported. Building static instead.") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif() | ||
|
|
||
| include(vcpkg_common_functions) | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO capnproto/capnproto | ||
| REF v0.7.0 | ||
| SHA512 a3ea278ded6a866759c0517d16b99bd38ffea1c163ce63a3604b752d8bdaafbc38a600de94afe12db35e7f7f06e29cc94c911dc2e0ecec6fe1185452df2a2bd3 | ||
| HEAD_REF master | ||
| ) | ||
|
|
||
| vcpkg_apply_patches( | ||
| SOURCE_PATH ${SOURCE_PATH} | ||
| PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-capnpc-extension-handling-on-Windows.patch" | ||
| ) | ||
|
|
||
| vcpkg_configure_cmake(SOURCE_PATH ${SOURCE_PATH}) | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/CapnProto") | ||
|
|
||
| file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools") | ||
| file(RENAME "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/tools/CapnProto") | ||
| vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/capnproto) | ||
|
|
||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) | ||
| file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
|
|
||
| # Handle copyright | ||
| file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/capnproto) | ||
| file(RENAME ${CURRENT_PACKAGES_DIR}/share/capnproto/LICENSE ${CURRENT_PACKAGES_DIR}/share/capnproto/copyright) | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be moved into the PATCHES argument to vcpkg_from_github
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍