aboutsummaryrefslogtreecommitdiff
path: root/ports/telnetpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2019-11-22 09:47:40 -0800
committerGitHub <noreply@github.com>2019-11-22 09:47:40 -0800
commit45f4b820e5743b89bca3508ba2028cdd5d8bbd17 (patch)
treef874a8c4a7392309bdbb86447288597ec0a4a281 /ports/telnetpp
parent62d67d3bf8eeff1afa8009041fd08b8822676b7b (diff)
parent8831e8f25f1ff6546ee4a5291b91d599421637b3 (diff)
downloadvcpkg-45f4b820e5743b89bca3508ba2028cdd5d8bbd17.tar.gz
vcpkg-45f4b820e5743b89bca3508ba2028cdd5d8bbd17.zip
Merge branch 'master' into vcpkg_nuget
Diffstat (limited to 'ports/telnetpp')
-rw-r--r--ports/telnetpp/CONTROL11
-rw-r--r--ports/telnetpp/fix-build-error.patch152
-rw-r--r--ports/telnetpp/portfile.cmake40
3 files changed, 177 insertions, 26 deletions
diff --git a/ports/telnetpp/CONTROL b/ports/telnetpp/CONTROL
index 563a12f56..049fb9c5a 100644
--- a/ports/telnetpp/CONTROL
+++ b/ports/telnetpp/CONTROL
@@ -1,5 +1,10 @@
Source: telnetpp
-Version: 1.2.4-1
+Version: 2.0-2
Homepage: https://github.com/KazDragon/telnetpp
-Description: Telnet++ is an implementation of the Telnet Session Layer protocol using C++14
-Build-Depends: boost, gtest, zlib
+Description: Telnet++ is an implementation of the Telnet Session Layer protocol using C++14
+Build-Depends: boost-container, boost-signals2, boost-variant, gtest, gsl-lite, boost-exception
+Default-Features: zlib
+
+Feature: zlib
+Description: Zlib support
+Build-Depends: zlib \ No newline at end of file
diff --git a/ports/telnetpp/fix-build-error.patch b/ports/telnetpp/fix-build-error.patch
new file mode 100644
index 000000000..92ad5bd29
--- /dev/null
+++ b/ports/telnetpp/fix-build-error.patch
@@ -0,0 +1,152 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 09b4f9b..feb3746 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -22,9 +22,6 @@ message("Building Telnet++ with zlib: ${TELNETPP_WITH_ZLIB}")
+ message("Building Telnet++ with code coverage: ${TELNETPP_COVERAGE}")
+ message("Building Telnet++ with sanitizers: ${TELNETPP_SANITIZE}")
+
+-include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
+-conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
+-
+ # The required C++ Standard for Telnet++ is C++14.
+ set(CMAKE_CXX_STANDARD 14)
+
+@@ -154,18 +151,24 @@ add_library(telnetpp
+ ${TELNETPP_PRIVATE_INCLUDE_FILES}
+ )
+
++if (BUILD_SHARED_LIBS)
++ add_definitions(-Dtelnetpp_EXPORTS)
++else()
++ add_definitions(-DTELNETPP_STATIC_DEFINE)
++endif()
++
+ target_link_libraries(telnetpp
+ PUBLIC
+- CONAN_PKG::gsl-lite
+- CONAN_PKG::boost_container
+- CONAN_PKG::boost_signals2
+- CONAN_PKG::boost_variant
++ ${BOOST_CONTAINER_LIBRARY}
++ ${BOOST_SIGNALS2_LIBRARY}
++ ${BOOST_VARIANT_LIBRARY}
+ )
+
+ if (TELNETPP_WITH_ZLIB)
++ find_package(ZLIB REQUIRED)
+ target_link_libraries(telnetpp
+ PRIVATE
+- CONAN_PKG::zlib
++ ${ZLIB_LIBRARIES}
+ )
+ endif()
+
+@@ -180,7 +183,8 @@ target_include_directories(telnetpp
+ PUBLIC
+ $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
+ $<INSTALL_INTERFACE:include/telnetpp-${TELNETPP_VERSION}>
+- "${Boost_INCLUDE_DIRS}"
++ $<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
++ $<BUILD_INTERFACE:${GSL_INCLUDE_PATH}>
+ )
+
+ generate_export_header(telnetpp
+@@ -197,17 +201,19 @@ install(
+ telnetpp
+ EXPORT
+ telnetpp-config
++ RUNTIME DESTINATION
++ bin
+ ARCHIVE DESTINATION
+- lib/telnetpp-${TELNETPP_VERSION}
++ lib
+ LIBRARY DESTINATION
+- lib/telnetpp-${TELNETPP_VERSION}
++ lib
+ )
+
+ install(
+ DIRECTORY
+ include/
+ DESTINATION
+- include/telnetpp-${TELNETPP_VERSION}
++ include
+ )
+
+ export(
+@@ -221,7 +227,7 @@ install(
+ EXPORT
+ telnetpp-config
+ DESTINATION
+- lib/telnetpp-${TELNETPP_VERSION}
++ share/telnetpp
+ )
+
+ include(CMakePackageConfigHelpers)
+@@ -236,7 +242,7 @@ install(
+ FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/telnetpp-config-version.cmake"
+ DESTINATION
+- lib/telnetpp-${TELNETPP_VERSION}
++ share/telnetpp
+ )
+
+ if (TELNETPP_WITH_TESTS)
+@@ -299,13 +305,13 @@ if (TELNETPP_WITH_TESTS)
+ target_link_libraries(telnetpp_tester
+ PRIVATE
+ telnetpp
+- CONAN_PKG::gtest
++ GTest::GTest GTest::Main
+ )
+
+ if (TELNETPP_WITH_ZLIB)
+ target_link_libraries(telnetpp_tester
+ PRIVATE
+- CONAN_PKG::zlib
++ ${ZLIB_LIBRARIES}
+ )
+ endif()
+
+diff --git a/include/telnetpp/core.hpp b/include/telnetpp/core.hpp
+index 2362fac..48d340e 100644
+--- a/include/telnetpp/core.hpp
++++ b/include/telnetpp/core.hpp
+@@ -1,7 +1,7 @@
+ #pragma once
+
+ #include "telnetpp/detail/export.hpp"
+-#include <gsl-lite.h>
++#include <gsl-lite.hpp>
+ #include <string>
+ #include <cstdint>
+
+diff --git a/include/telnetpp/subnegotiation.hpp b/include/telnetpp/subnegotiation.hpp
+index a209b72..1f24fc9 100644
+--- a/include/telnetpp/subnegotiation.hpp
++++ b/include/telnetpp/subnegotiation.hpp
+@@ -15,7 +15,11 @@ public:
+ //* =====================================================================
+ /// \brief Constructor
+ //* =====================================================================
++#if _WIN32
++ const subnegotiation(option_type option, bytes content) noexcept
++#else
+ constexpr subnegotiation(option_type option, bytes content) noexcept
++#endif
+ : option_(std::move(option)),
+ content_(std::move(content))
+ {
+@@ -32,7 +36,11 @@ public:
+ //* =====================================================================
+ /// \brief Returns the content for this subnegotiation.
+ //* =====================================================================
++#if _WIN32
++ const bytes content() const noexcept
++#else
+ constexpr bytes content() const noexcept
++#endif
+ {
+ return content_;
+ }
diff --git a/ports/telnetpp/portfile.cmake b/ports/telnetpp/portfile.cmake
index 7af2342e1..11edf5e05 100644
--- a/ports/telnetpp/portfile.cmake
+++ b/ports/telnetpp/portfile.cmake
@@ -7,41 +7,35 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KazDragon/telnetpp
- REF v1.2.4
- SHA512 16879fd377a7d13aac497bc9989c026acc1ed5b4eb9338d151d3d827c7c4c44fab84dd06c5fe55be4efe49a98ea46e62e80bbc51c8503d6ba1bf5534fee16c84
+ REF 8dc780579293153ad2ae9ad6943815c050d4c659
+ SHA512 280a8e6c0392f5822b05968520d176d1510f00c12a2502f6039f4f1f78a558e61f825a231fb70b7de6fd21a18b24734eea3ba36a24b29f2a7e9856b1f4de5217
HEAD_REF master
+ PATCHES fix-build-error.patch
)
+set(USE_ZLIB OFF)
+if("zlib" IN_LIST FEATURES)
+ set(USE_ZLIB ON)
+endif()
+
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ DISABLE_PARALLEL_CONFIGURE
PREFER_NINJA
+ OPTIONS
+ -DGSL_INCLUDE_PATH=${CURRENT_INSTALLED_DIR}/include
+ -DTELNETPP_WITH_ZLIB=${USE_ZLIB}
+ -DTELNETPP_WITH_TESTS=OFF
)
vcpkg_install_cmake()
-# Remove duplicate header files and CMake input file
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(REMOVE ${CURRENT_PACKAGES_DIR}/include/telnetpp/version.hpp.in)
-
-# The install target in the upstream package does not install the binary output
-if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
- file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/telnetpp.dll DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
- file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/telnetpp.dll DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
-endif()
-
-# Move CMake installed configuration files and adjust for vcpkg debug location
-file(COPY ${CURRENT_PACKAGES_DIR}/lib/telnetpp/telnetpp-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/telnetpp)
-file(COPY ${CURRENT_PACKAGES_DIR}/lib/telnetpp/telnetpp-config-release.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/telnetpp)
-file(COPY ${CURRENT_PACKAGES_DIR}/debug/lib/telnetpp/telnetpp-config-debug.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/telnetpp)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/telnetpp)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/telnetpp)
-
-file(READ ${CURRENT_PACKAGES_DIR}/share/telnetpp/telnetpp-config-debug.cmake DEBUG_CONFIG)
-string(REPLACE "\${_IMPORT_PREFIX}/lib/telnetpp.lib"
- "\${_IMPORT_PREFIX}/debug/lib/telnetpp.lib" DEBUG_CONFIG ${DEBUG_CONFIG})
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/telnetpp/telnetpp-config-debug.cmake "${DEBUG_CONFIG}")
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/telnetpp)
vcpkg_copy_pdbs()
+# Remove duplicate header files and CMake input file
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE ${CURRENT_PACKAGES_DIR}/include/telnetpp/version.hpp.in)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/telnetpp RENAME copyright)