From b68967891edbf9317921e5f5158a8f2e7772bbea Mon Sep 17 00:00:00 2001 From: sigman Date: Thu, 22 Jun 2017 13:38:03 +0300 Subject: [PATCH] [SObjectizer] In-process message dispatching framework Added port of the C++ message dispatching actor model framework. https://sourceforge.net/projects/sobjectizer/ --- ports/sobjectizer/001-cmake.patch | 36 +++++++++++++++++++++++++++ ports/sobjectizer/CONTROL | 3 +++ ports/sobjectizer/portfile.cmake | 41 +++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 ports/sobjectizer/001-cmake.patch create mode 100644 ports/sobjectizer/CONTROL create mode 100644 ports/sobjectizer/portfile.cmake diff --git a/ports/sobjectizer/001-cmake.patch b/ports/sobjectizer/001-cmake.patch new file mode 100644 index 0000000000..cb4285e915 --- /dev/null +++ b/ports/sobjectizer/001-cmake.patch @@ -0,0 +1,36 @@ +diff --git a/so_5/CMakeLists.txt b/so_5/CMakeLists.txt +index bd6f1d7..0e30831 100644 +--- a/so_5/CMakeLists.txt ++++ b/so_5/CMakeLists.txt +@@ -71,12 +71,17 @@ set(SO_5_SRC exception.cpp + disp/prio_dedicated_threads/one_per_prio/pub.cpp + ) + +-add_library(${SO_5_TARGET} SHARED ${SO_5_SRC}) ++if (SO_BUILD_STATIC) ++ message(STATUS "Building static.") ++ add_library(${SO_5_TARGET} STATIC ${SO_5_SRC}) ++ target_compile_definitions(${SO_5_TARGET} ++ PUBLIC -DSO_5_STATIC_LIB ++ ) ++else() ++ message(STATUS "Building dynamic.") ++ add_library(${SO_5_TARGET} SHARED ${SO_5_SRC}) ++endif() + +-add_library(${SO_5_S_TARGET} STATIC ${SO_5_SRC}) +-target_compile_definitions(${SO_5_S_TARGET} +- PUBLIC -DSO_5_STATIC_LIB +-) + + set(SO_5_EXT_LIBS ) + if( ANDROID ) +@@ -90,7 +95,7 @@ foreach(__extLibrary ${SO_5_EXT_LIBS}) + endforeach() + + install( +- TARGETS ${SO_5_TARGET} ${SO_5_S_TARGET} ++ TARGETS ${SO_5_TARGET} + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib + RUNTIME DESTINATION bin diff --git a/ports/sobjectizer/CONTROL b/ports/sobjectizer/CONTROL new file mode 100644 index 0000000000..3ec628460e --- /dev/null +++ b/ports/sobjectizer/CONTROL @@ -0,0 +1,3 @@ +Source: sobjectizer +Version: 5.5.19 +Description: SObjectizer is a C++ in-process message dispatching framework with implementation of Actor Model, Publish-Subscribe Model and CSP-like channels. diff --git a/ports/sobjectizer/portfile.cmake b/ports/sobjectizer/portfile.cmake new file mode 100644 index 0000000000..cbc6a9e126 --- /dev/null +++ b/ports/sobjectizer/portfile.cmake @@ -0,0 +1,41 @@ +include(vcpkg_common_functions) + +set(VERSION 5.5.19) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/so-${VERSION}/dev) + +vcpkg_download_distfile(ARCHIVE + URLS "https://downloads.sourceforge.net/project/sobjectizer/sobjectizer/SObjectizer%20Core%20v.5.5/so-${VERSION}.zip" + FILENAME "so-${VERSION}.zip" + SHA512 1dd5167e3a04a169f0d192504e64b2d7f0ce82322f4388207f15de21e31bf0a75f7b84efa406f0f84bea18235861479a169358e3a1b3bad6c3f7ffe5d33c502e +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/001-cmake.patch +) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(SO_BUILD_STATIC ON) + set(SO_BUILD_SHARED OFF) +else() + set(SO_BUILD_STATIC OFF) + set(SO_BUILD_SHARED ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DSO_BUILD_STATIC=${SO_BUILD_STATIC} + -DSO_BUILD_SHARED=${SO_BUILD_SHARED} +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +# Handle copyright +file(COPY ${SOURCE_PATH}/../LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/sobjectizer) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/sobjectizer/LICENSE ${CURRENT_PACKAGES_DIR}/share/sobjectizer/copyright)