aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/cppmicroservices
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/cppmicroservices')
-rw-r--r--vcpkg/ports/cppmicroservices/devendor_boost_absl.patch172
-rw-r--r--vcpkg/ports/cppmicroservices/fix_strnicmp.patch13
-rw-r--r--vcpkg/ports/cppmicroservices/portfile.cmake45
-rw-r--r--vcpkg/ports/cppmicroservices/remove-ut-macro.patch16
-rw-r--r--vcpkg/ports/cppmicroservices/vcpkg.json21
-rw-r--r--vcpkg/ports/cppmicroservices/werror.patch13
6 files changed, 280 insertions, 0 deletions
diff --git a/vcpkg/ports/cppmicroservices/devendor_boost_absl.patch b/vcpkg/ports/cppmicroservices/devendor_boost_absl.patch
new file mode 100644
index 0000000..8087f69
--- /dev/null
+++ b/vcpkg/ports/cppmicroservices/devendor_boost_absl.patch
@@ -0,0 +1,172 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 87cfb37..d7fbd20 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -693,7 +693,7 @@ endif()
+ # Compile libraries here if you do not want -Werror or /WX on
+ #-----------------------------------------------------------------------------
+ set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
+-add_subdirectory(third_party/boost/nowide)
++find_package(Boost COMPONENTS nowide CONFIG REQUIRED)
+ set(BUILD_SHARED_LIBS ${_us_build_shared} CACHE BOOL "Build shared libraries" FORCE)
+ #-----------------------------------------------------------------------------
+
+diff --git a/cmake/usBundleConfig.cmake.in b/cmake/usBundleConfig.cmake.in
+index c9cf743..f0ab1ca 100644
+--- a/cmake/usBundleConfig.cmake.in
++++ b/cmake/usBundleConfig.cmake.in
+@@ -3,6 +3,10 @@
+ set(US_@PROJECT_NAME@_LIBRARIES @PROJECT_TARGET@)
+ set(US_@PROJECT_NAME@_RUNTIME_LIBRARY_DIRS "@PACKAGE_CONFIG_RUNTIME_LIBRARY_DIR@")
+
++include(CMakeFindDependencyMacro)
++find_dependency(Boost COMPONENTS asio nowide CONFIG)
++find_dependency(absl CONFIG)
++
+ if(NOT TARGET @PROJECT_TARGET@)
+ include("${CMAKE_CURRENT_LIST_DIR}/us@PROJECT_NAME@Targets.cmake")
+ endif()
+diff --git a/compendium/CMakeLists.txt b/compendium/CMakeLists.txt
+index a571331..d26ac7e 100644
+--- a/compendium/CMakeLists.txt
++++ b/compendium/CMakeLists.txt
+@@ -1,3 +1,4 @@
++find_package(Boost COMPONENTS asio CONFIG REQUIRED)
+ if(US_BUILD_TESTING)
+ add_subdirectory(test_bundles)
+ endif()
+diff --git a/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp b/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp
+index 50f02e6..fdfa45d 100644
+--- a/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp
++++ b/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp
+@@ -22,10 +22,10 @@
+
+ #include "CMAsyncWorkService.hpp"
+
+-#include "boost/asio/async_result.hpp"
+-#include "boost/asio/packaged_task.hpp"
+-#include "boost/asio/post.hpp"
+-#include "boost/asio/thread_pool.hpp"
++#include <boost/asio/async_result.hpp>
++#include <boost/asio/packaged_task.hpp>
++#include <boost/asio/post.hpp>
++#include <boost/asio/thread_pool.hpp>
+
+ namespace cppmicroservices
+ {
+diff --git a/compendium/ConfigurationAdmin/src/CMakeLists.txt b/compendium/ConfigurationAdmin/src/CMakeLists.txt
+index a079c20..2657610 100644
+--- a/compendium/ConfigurationAdmin/src/CMakeLists.txt
++++ b/compendium/ConfigurationAdmin/src/CMakeLists.txt
+@@ -28,7 +28,7 @@ set(_private_headers
+ )
+
+ add_library(ConfigurationAdminObjs OBJECT ${_srcs} ${_private_headers})
+-
++target_link_libraries(ConfigurationAdminObjs PULBIC Boost::asio)
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ get_property(_compile_flags TARGET ConfigurationAdminObjs PROPERTY COMPILE_FLAGS)
+ set_property(TARGET ConfigurationAdminObjs PROPERTY COMPILE_FLAGS "${_compile_flags} -fPIC")
+diff --git a/compendium/DeclarativeServices/CMakeLists.txt b/compendium/DeclarativeServices/CMakeLists.txt
+index 2920189..810b00b 100755
+--- a/compendium/DeclarativeServices/CMakeLists.txt
++++ b/compendium/DeclarativeServices/CMakeLists.txt
+@@ -37,14 +37,14 @@ endif()
+ add_compile_definitions(BOOST_DATE_TIME_NO_LIB)
+ add_compile_definitions(BOOST_REGEX_NO_LIB)
+
+-
++find_package(Boost COMPONENTS asio CONFIG REQUIRED)
+ usMacroCreateBundle(DeclarativeServices
+ VERSION "1.5.13"
+ DEPENDS Framework
+ TARGET DeclarativeServices
+ SYMBOLIC_NAME declarative_services
+ EMBED_RESOURCE_METHOD LINK
+- LINK_LIBRARIES ${_link_libraries} usServiceComponent usAsyncWorkService
++ LINK_LIBRARIES ${_link_libraries} usServiceComponent usAsyncWorkService Boost::asio
+ PRIVATE_HEADERS ${_ds_private_headers}
+ SOURCES $<TARGET_OBJECTS:DeclarativeServicesObjs> src/SCRActivator.cpp
+ BINARY_RESOURCES manifest.json
+diff --git a/compendium/DeclarativeServices/src/CMakeLists.txt b/compendium/DeclarativeServices/src/CMakeLists.txt
+index 726d402..4e075d5 100644
+--- a/compendium/DeclarativeServices/src/CMakeLists.txt
++++ b/compendium/DeclarativeServices/src/CMakeLists.txt
+@@ -80,9 +80,9 @@ set(_private_headers
+ metadata/ServiceMetadata.hpp
+ metadata/Util.hpp
+ )
+-
++find_package(Boost COMPONENTS asio CONFIG REQUIRED)
+ add_library(DeclarativeServicesObjs OBJECT ${_srcs} ${_private_headers})
+-
++target_link_libraries(DeclarativeServicesObjs PUBLIC Boost::asio)
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ get_property(_compile_flags TARGET DeclarativeServicesObjs PROPERTY COMPILE_FLAGS)
+ set_property(TARGET DeclarativeServicesObjs PROPERTY COMPILE_FLAGS "${_compile_flags} -fPIC")
+diff --git a/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp b/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp
+index ffc93e9..1b9af7b 100644
+--- a/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp
++++ b/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp
+@@ -22,10 +22,10 @@
+
+ #include "SCRAsyncWorkService.hpp"
+
+-#include "boost/asio/async_result.hpp"
+-#include "boost/asio/packaged_task.hpp"
+-#include "boost/asio/post.hpp"
+-#include "boost/asio/thread_pool.hpp"
++#include <boost/asio/async_result.hpp>
++#include <boost/asio/packaged_task.hpp>
++#include <boost/asio/post.hpp>
++#include <boost/asio/thread_pool.hpp>
+
+ namespace cppmicroservices
+ {
+diff --git a/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp b/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp
+index c4483a9..84d4217 100644
+--- a/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp
++++ b/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp
+@@ -30,7 +30,7 @@
+ #include "ReferenceManager.hpp"
+ #include "ReferenceManagerImpl.hpp"
+ #include "RegistrationManager.hpp"
+-#include "boost/asio/post.hpp"
++#include <boost/asio/post.hpp>
+ #include "cppmicroservices/servicecomponent/ComponentConstants.hpp"
+ #include "states/CCUnsatisfiedReferenceState.hpp"
+ #include "states/ComponentConfigurationState.hpp"
+diff --git a/tools/rc/CMakeLists.txt b/tools/rc/CMakeLists.txt
+index c4a36f8..8844292 100755
+--- a/tools/rc/CMakeLists.txt
++++ b/tools/rc/CMakeLists.txt
+@@ -20,8 +20,8 @@ if(WIN32)
+ target_link_libraries(${US_RCC_EXECUTABLE_TARGET} Shlwapi)
+ endif()
+
+-target_link_libraries(${US_RCC_EXECUTABLE_TARGET} nowide::nowide)
+-target_include_directories(${US_RCC_EXECUTABLE_TARGET} PRIVATE ${CppMicroServices_SOURCE_DIR}/third_party/boost/nowide/include)
++find_package(Boost COMPONENTS nowide CONFIG REQUIRED)
++target_link_libraries(${US_RCC_EXECUTABLE_TARGET} Boost::nowide)
+
+ set_property(TARGET ${US_RCC_EXECUTABLE_TARGET} APPEND PROPERTY
+ COMPILE_DEFINITIONS "MINIZ_NO_ARCHIVE_READING_API;MINIZ_NO_ZLIB_COMPATIBLE_NAMES")
+diff --git a/tools/rc/ResourceCompiler.cpp b/tools/rc/ResourceCompiler.cpp
+index a5b81d3..4e92db4 100755
+--- a/tools/rc/ResourceCompiler.cpp
++++ b/tools/rc/ResourceCompiler.cpp
+@@ -37,9 +37,12 @@
+ #include <utility>
+ #include <vector>
+
+-#include <nowide/args.hpp>
+-#include <nowide/fstream.hpp>
++#include <boost/nowide/args.hpp>
++#include <boost/nowide/fstream.hpp>
+
++namespace nowide {
++ using namespace boost::nowide;
++}
+ #include "optionparser.h"
+ #include "json/json.h"
+
diff --git a/vcpkg/ports/cppmicroservices/fix_strnicmp.patch b/vcpkg/ports/cppmicroservices/fix_strnicmp.patch
new file mode 100644
index 0000000..1a9245f
--- /dev/null
+++ b/vcpkg/ports/cppmicroservices/fix_strnicmp.patch
@@ -0,0 +1,13 @@
+diff --git a/framework/src/util/PropsCheck.h b/framework/src/util/PropsCheck.h
+index 26acd33..930a328 100644
+--- a/framework/src/util/PropsCheck.h
++++ b/framework/src/util/PropsCheck.h
+@@ -47,7 +47,7 @@
+
+ #ifdef US_PLATFORM_WINDOWS
+ # include <string.h>
+-# define ci_compare strnicmp
++# define ci_compare _strnicmp
+ #else
+ # include <strings.h>
+ # define ci_compare strncasecmp
diff --git a/vcpkg/ports/cppmicroservices/portfile.cmake b/vcpkg/ports/cppmicroservices/portfile.cmake
new file mode 100644
index 0000000..414ea8d
--- /dev/null
+++ b/vcpkg/ports/cppmicroservices/portfile.cmake
@@ -0,0 +1,45 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO CppMicroServices/CppMicroservices
+ REF "v${VERSION}"
+ SHA512 6378f929bebd2d77d260791c0518dc0fcda43a19ade2475d5e20698c594c178ed1f9123d65017fc25c34c95437d25d5eca889224c6650a1c37584842ddc6dbab
+ HEAD_REF development
+ PATCHES
+ werror.patch
+ fix_strnicmp.patch
+ devendor_boost_absl.patch
+ remove-ut-macro.patch
+)
+
+# TODO: De-vendor everything
+file(REMOVE_RECURSE
+ "${SOURCE_PATH}/third_party/absl"
+ "${SOURCE_PATH}/third_party/boost"
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DTOOLS_INSTALL_DIR:STRING=tools/cppmicroservices
+ -DAUXILIARY_INSTALL_DIR:STRING=share/cppmicroservices
+ -DUS_USE_SYSTEM_GTEST=TRUE
+ -DUS_BUILD_TESTING=FALSE
+ -DUS_USE_SYSTEM_BOOST=TRUE
+)
+
+vcpkg_cmake_install(ADD_BIN_TO_PATH)
+
+vcpkg_cmake_config_fixup()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+
+# CppMicroServices uses a custom resource compiler to compile resources
+# the zipped resources are then appended to the target which cause the linker to crash
+# when compiling a static library
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+endif()
diff --git a/vcpkg/ports/cppmicroservices/remove-ut-macro.patch b/vcpkg/ports/cppmicroservices/remove-ut-macro.patch
new file mode 100644
index 0000000..689ce3d
--- /dev/null
+++ b/vcpkg/ports/cppmicroservices/remove-ut-macro.patch
@@ -0,0 +1,16 @@
+diff --git a/framework/include/FrameworkConfig.h.in b/framework/include/FrameworkConfig.h.in
+index 024a0ec..9eba2f8 100644
+--- a/framework/include/FrameworkConfig.h.in
++++ b/framework/include/FrameworkConfig.h.in
+@@ -18,11 +18,4 @@
+ #define US_FRAMEWORK_VERSION @Framework_VERSION@
+ #define US_FRAMEWORK_VERSION_STR "@Framework_VERSION@"
+
+-
+-///-------------------------------------------------------------------
+-// Macros used by the unit tests
+-//-------------------------------------------------------------------
+-
+-#define US_FRAMEWORK_SOURCE_DIR "@PROJECT_SOURCE_DIR@"
+-
+ #endif // CPPMICROSERVICES_FRAMEWORKCONFIG_H
diff --git a/vcpkg/ports/cppmicroservices/vcpkg.json b/vcpkg/ports/cppmicroservices/vcpkg.json
new file mode 100644
index 0000000..027a9d3
--- /dev/null
+++ b/vcpkg/ports/cppmicroservices/vcpkg.json
@@ -0,0 +1,21 @@
+{
+ "name": "cppmicroservices",
+ "version": "3.8.6",
+ "description": "An OSGi-like C++ dynamic module system and service registry",
+ "homepage": "https://github.com/CppMicroServices/CppMicroServices",
+ "license": "Apache-2.0",
+ "dependencies": [
+ "abseil",
+ "boost-asio",
+ "boost-nowide",
+ "gtest",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}
diff --git a/vcpkg/ports/cppmicroservices/werror.patch b/vcpkg/ports/cppmicroservices/werror.patch
new file mode 100644
index 0000000..83343a1
--- /dev/null
+++ b/vcpkg/ports/cppmicroservices/werror.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 267b82e..87cfb37 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -552,7 +552,7 @@ else()
+ usFunctionCheckCompilerFlags(-fstack-protector-all US_CXX_FLAGS)
+ endif()
+
+- foreach(_cxxflag -Werror -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align
++ foreach(_cxxflag -Wall -Wextra -Wpointer-arith -Winvalid-pch -Wcast-align
+ -Wwrite-strings -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast
+ -Wstrict-null-sentinel -Wsign-promo -fdiagnostics-show-option )
+ usFunctionCheckCompilerFlags(${_cxxflag} US_CXX_FLAGS)