From 63aa19cd4043f9b3285e92322fc0e6a7bbf5572b Mon Sep 17 00:00:00 2001 From: Lily <47812810+LilyWangL@users.noreply.github.com> Date: Sat, 21 Dec 2019 04:13:34 +0800 Subject: [PATCH] [xeus] Fix build error with Visual Studio 2019 (#9254) * [xeus] Fix build error with Visual Studio 2019 * [xeus] Handle copyright --- ports/xeus/CONTROL | 2 +- ports/xeus/Fix-TypeConversion.patch | 24 ++++++++++++++++++++++++ ports/xeus/portfile.cmake | 8 ++------ 3 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 ports/xeus/Fix-TypeConversion.patch diff --git a/ports/xeus/CONTROL b/ports/xeus/CONTROL index 931136ae4..aafd8c00b 100644 --- a/ports/xeus/CONTROL +++ b/ports/xeus/CONTROL @@ -1,4 +1,4 @@ Source: xeus -Version: 0.20.0 +Version: 0.20.0-1 Description: C++ implementation of the Jupyter kernel protocol Build-Depends: cppzmq, libuuid (linux), nlohmann-json, openssl, xtl, zeromq diff --git a/ports/xeus/Fix-TypeConversion.patch b/ports/xeus/Fix-TypeConversion.patch new file mode 100644 index 000000000..72a8c484e --- /dev/null +++ b/ports/xeus/Fix-TypeConversion.patch @@ -0,0 +1,24 @@ +diff --git a/src/xkernel_configuration.cpp b/src/xkernel_configuration.cpp +index 681b45d..b5a68eb 100644 +--- a/src/xkernel_configuration.cpp ++++ b/src/xkernel_configuration.cpp +@@ -25,8 +25,8 @@ namespace xeus + ifs >> doc; + + xconfiguration res; +- res.m_transport = doc["transport"]; +- res.m_ip = doc["ip"]; ++ res.m_transport = doc["transport"].get(); ++ res.m_ip = doc["ip"].get(); + res.m_control_port = std::to_string(doc["control_port"].get()); + res.m_shell_port = std::to_string(doc["shell_port"].get()); + res.m_stdin_port = std::to_string(doc["stdin_port"].get()); +@@ -35,7 +35,7 @@ namespace xeus + res.m_signature_scheme = doc.value("signature_scheme", ""); + if (res.m_signature_scheme != "") + { +- res.m_key = doc["key"]; ++ res.m_key = doc["key"].get(); + } + else + { diff --git a/ports/xeus/portfile.cmake b/ports/xeus/portfile.cmake index 1e77a71cd..5dd646d7f 100644 --- a/ports/xeus/portfile.cmake +++ b/ports/xeus/portfile.cmake @@ -1,11 +1,10 @@ -include(vcpkg_common_functions) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO QuantStack/xeus REF 8408f237f33514610a59d19a5ff045ee70dfa02b SHA512 41282addbe5519b6d357e802c48483834cd951604bfeb8c99d96f02d03dec2fc66ea4c091f40ec09348bb60587e8a6efef5e6eb2bb950ba720fc8ceb7a107960 HEAD_REF master + PATCHES Fix-TypeConversion.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIBS) @@ -45,10 +44,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL static) endif() # Handle copyright -configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) # Install usage file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) - -# CMake integration test -vcpkg_test_cmake(PACKAGE_NAME ${PORT})