aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/arcus
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/arcus')
-rw-r--r--vcpkg/ports/arcus/0001-fix-protobuf-deprecated.patch26
-rw-r--r--vcpkg/ports/arcus/0002-protobuf-version.patch37
-rw-r--r--vcpkg/ports/arcus/portfile.cmake30
-rw-r--r--vcpkg/ports/arcus/vcpkg.json19
4 files changed, 112 insertions, 0 deletions
diff --git a/vcpkg/ports/arcus/0001-fix-protobuf-deprecated.patch b/vcpkg/ports/arcus/0001-fix-protobuf-deprecated.patch
new file mode 100644
index 0000000..81980a4
--- /dev/null
+++ b/vcpkg/ports/arcus/0001-fix-protobuf-deprecated.patch
@@ -0,0 +1,26 @@
+diff --git a/src/MessageTypeStore.cpp b/src/MessageTypeStore.cpp
+index 382a138..5f09122 100644
+--- a/src/MessageTypeStore.cpp
++++ b/src/MessageTypeStore.cpp
+@@ -52,7 +52,7 @@ class ErrorCollector : public google::protobuf::compiler::MultiFileErrorCollecto
+ public:
+ ErrorCollector() : _error_count(0) { }
+
+- void AddError(const std::string& filename, int line, int column, const std::string& message) override
++ void RecordError(absl::string_view filename, int line, int column, absl::string_view message) override
+ {
+ _stream << "[" << filename << " (" << line << "," << column << ")] " << message << std::endl;
+ _error_count++;
+diff --git a/src/Socket_p.h b/src/Socket_p.h
+index 9c3c084..9ccabda 100644
+--- a/src/Socket_p.h
++++ b/src/Socket_p.h
+@@ -548,7 +548,7 @@ namespace Arcus
+
+ google::protobuf::io::ArrayInputStream array(wire_message->data, wire_message->size);
+ google::protobuf::io::CodedInputStream stream(&array);
+- stream.SetTotalBytesLimit(message_size_maximum, message_size_warning);
++ stream.SetTotalBytesLimit(message_size_maximum);
+ if(!message->ParseFromCodedStream(&stream))
+ {
+ error(ErrorCode::ParseFailedError, "Failed to parse message:" + std::string(wire_message->data));
diff --git a/vcpkg/ports/arcus/0002-protobuf-version.patch b/vcpkg/ports/arcus/0002-protobuf-version.patch
new file mode 100644
index 0000000..1dea393
--- /dev/null
+++ b/vcpkg/ports/arcus/0002-protobuf-version.patch
@@ -0,0 +1,37 @@
+diff --git a/ArcusConfig.cmake.in b/ArcusConfig.cmake.in
+index 3208a69..fb4a968 100644
+--- a/ArcusConfig.cmake.in
++++ b/ArcusConfig.cmake.in
+@@ -4,7 +4,7 @@
+ # However, if ProtobufConfig is used instead, there is a CMake option that controls
+ # this, which defaults to OFF. We need to force this option to ON instead.
+ set(protobuf_MODULE_COMPATIBLE ON CACHE "" INTERNAL FORCE)
+-find_package(Protobuf 3.0.0 REQUIRED)
++find_package(Protobuf REQUIRED)
+
+ get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+ include(${SELF_DIR}/Arcus-targets.cmake)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1d736ba..66d6c13 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -17,7 +17,7 @@ endif()
+ # However, if ProtobufConfig is used instead, there is a CMake option that controls
+ # this, which defaults to OFF. We need to force this option to ON instead.
+ set(protobuf_MODULE_COMPATIBLE ON CACHE INTERNAL "" FORCE)
+-find_package(Protobuf 3.0.0 REQUIRED)
++find_package(Protobuf REQUIRED)
+
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON) #Required if a patch to libArcus needs to be made via templates.
+
+@@ -103,9 +103,8 @@ endif()
+ target_include_directories(Arcus PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
+- ${PROTOBUF_INCLUDE_DIR}
+ )
+-target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES})
++target_link_libraries(Arcus PUBLIC protobuf::libprotobuf)
+
+ if(WIN32)
+ add_definitions(-D_WIN32_WINNT=0x0600) # Declare we require Vista or higher, this allows us to use IPv6 functions.
diff --git a/vcpkg/ports/arcus/portfile.cmake b/vcpkg/ports/arcus/portfile.cmake
new file mode 100644
index 0000000..da0dcc4
--- /dev/null
+++ b/vcpkg/ports/arcus/portfile.cmake
@@ -0,0 +1,30 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO Ultimaker/libArcus
+ REF ${VERSION}
+ SHA512 452c541360d74a8f58ab1b20df59efd36756812a9ecd09804ba16877956fb240d367bd968271a9c010496598ef0b459f62aa287553d4ba3fdb4cd2742c25553f
+ HEAD_REF main
+ PATCHES
+ 0001-fix-protobuf-deprecated.patch
+ 0002-protobuf-version.patch
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_PYTHON=OFF
+ -DBUILD_EXAMPLES=OFF
+ -DBUILD_STATIC=${ENABLE_STATIC}
+)
+
+vcpkg_cmake_install()
+
+vcpkg_copy_pdbs()
+
+vcpkg_cmake_config_fixup(PACKAGE_NAME Arcus CONFIG_PATH lib/cmake/Arcus)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/arcus/vcpkg.json b/vcpkg/ports/arcus/vcpkg.json
new file mode 100644
index 0000000..61a48d4
--- /dev/null
+++ b/vcpkg/ports/arcus/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "arcus",
+ "version-semver": "4.10.0",
+ "port-version": 4,
+ "description": "This library contains C++ bindings for creating a socket in a thread and using this socket to send and receive messages based on the Protocol Buffers library.",
+ "homepage": "https://github.com/Ultimaker/libArcus",
+ "supports": "!uwp",
+ "dependencies": [
+ "protobuf",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}