pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

actor-framework: add solaris support



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%pkgsrc.org@localhost>
Pushed By:	nros
Date:		Sat Jan 8 14:08:35 2022 +0100
Changeset:	aaba50124c9bb62fde2c80d351566e2d7b086bd5

Modified Files:
	actor-framework/Makefile
	actor-framework/distinfo
	actor-framework/patches/patch-libcaf__core_caf_config.hpp
	actor-framework/patches/patch-libcaf__core_src_detail_set__thread__name.cpp
Added Files:
	actor-framework/patches/patch-examples_message__passing_fan__out__request.cpp
	actor-framework/patches/patch-libcaf__core_CMakeLists.txt
	actor-framework/patches/patch-libcaf__core_src_detail_get__mac__addresses.cpp
	actor-framework/patches/patch-libcaf__core_src_detail_get__root__uuid.cpp
	actor-framework/patches/patch-libcaf__core_src_telemetry_importer_process.cpp
	actor-framework/patches/patch-libcaf__io_CMakeLists.txt

Log Message:
actor-framework: add solaris support

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=aaba50124c9bb62fde2c80d351566e2d7b086bd5

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 actor-framework/Makefile                           |  2 +
 actor-framework/distinfo                           | 10 +++-
 ...examples_message__passing_fan__out__request.cpp | 15 +++++
 .../patches/patch-libcaf__core_CMakeLists.txt      | 14 +++++
 .../patches/patch-libcaf__core_caf_config.hpp      | 17 +++++-
 ...libcaf__core_src_detail_get__mac__addresses.cpp | 29 ++++++++++
 ...tch-libcaf__core_src_detail_get__root__uuid.cpp | 15 +++++
 ...h-libcaf__core_src_detail_set__thread__name.cpp |  5 +-
 ...libcaf__core_src_telemetry_importer_process.cpp | 64 ++++++++++++++++++++++
 .../patches/patch-libcaf__io_CMakeLists.txt        | 15 +++++
 10 files changed, 182 insertions(+), 4 deletions(-)

diffs:
diff --git a/actor-framework/Makefile b/actor-framework/Makefile
index 27b40edcb4..4a1f709fe3 100644
--- a/actor-framework/Makefile
+++ b/actor-framework/Makefile
@@ -14,5 +14,7 @@ USE_CMAKE=	yes
 USE_TOOLS+=	gmake
 USE_LANGUAGES=	c c++
 
+#CMAKE_ARGS+=	-DCAF_ENABLE_TESTING:BOOL=OFF
+
 .include "../../security/openssl/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/actor-framework/distinfo b/actor-framework/distinfo
index 84699f41e0..4774a95895 100644
--- a/actor-framework/distinfo
+++ b/actor-framework/distinfo
@@ -3,6 +3,12 @@ $NetBSD$
 BLAKE2s (actor-framework-0.18.5.tar.gz) = 8cd0bdd72cfa5a99edc5401f162193addd7c49a13bbe0e3d93a40a9036fde9b7
 SHA512 (actor-framework-0.18.5.tar.gz) = 5b85e127cacc6df4a20c97d1c1f4d08f19a3e37812a7d8347c6ac46fcc1264a35212619030456221b70fc311b8078c0362cf8b21470518050ece5de4a5de1774
 Size (actor-framework-0.18.5.tar.gz) = 2827181 bytes
-SHA1 (patch-libcaf__core_caf_config.hpp) = ea9cad613dedf78387fd7932b4df2598d0fe14f5
+SHA1 (patch-examples_message__passing_fan__out__request.cpp) = 2039d3a58f8c4dd23ebf70772d75f88f8f265dd0
+SHA1 (patch-libcaf__core_CMakeLists.txt) = 9791d9ad4036a5eae13183e354f37f3abc98b3e9
+SHA1 (patch-libcaf__core_caf_config.hpp) = af9dc056a274539d8d27e89313f342a822c38e90
+SHA1 (patch-libcaf__core_src_detail_get__mac__addresses.cpp) = 509e8081f66cebe93866e26858357145efc46199
+SHA1 (patch-libcaf__core_src_detail_get__root__uuid.cpp) = ba158be8761dfe0dc5705de48c885e4cc9739743
 SHA1 (patch-libcaf__core_src_detail_pretty__type__name.cpp) = 922423499220ba8481da6076877fb755ab49c569
-SHA1 (patch-libcaf__core_src_detail_set__thread__name.cpp) = b5a573a7c01c09b745020c048c644c2575ab1a18
+SHA1 (patch-libcaf__core_src_detail_set__thread__name.cpp) = fb3cfefb1eccbf77ccf65173f1cfeb1e71b2e875
+SHA1 (patch-libcaf__core_src_telemetry_importer_process.cpp) = 729b9574cba607f9c05558150a780701ea75e7ba
+SHA1 (patch-libcaf__io_CMakeLists.txt) = 327649d0fef862e75a5367d38e1baf769923c9f0
diff --git a/actor-framework/patches/patch-examples_message__passing_fan__out__request.cpp b/actor-framework/patches/patch-examples_message__passing_fan__out__request.cpp
new file mode 100644
index 0000000000..bf57c77ca2
--- /dev/null
+++ b/actor-framework/patches/patch-examples_message__passing_fan__out__request.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* illumos can't choose std::pow overload, be explicit 
+
+--- examples/message_passing/fan_out_request.cpp.orig	2021-07-16 09:33:16.000000000 +0000
++++ examples/message_passing/fan_out_request.cpp
+@@ -137,7 +137,7 @@ void caf_main(actor_system& sys) {
+   //      4    16    64   256  1024  4096
+   for (int row = 0; row < rows; ++row)
+     for (int column = 0; column < columns; ++column)
+-      f(put_atom_v, row, column, (int) pow(row + 2, column + 1));
++      f(put_atom_v, row, column, (int) pow((float)(row + 2), column + 1));
+   // Print out matrix.
+   for (int row = 0; row < rows; ++row) {
+     for (int column = 0; column < columns; ++column)
diff --git a/actor-framework/patches/patch-libcaf__core_CMakeLists.txt b/actor-framework/patches/patch-libcaf__core_CMakeLists.txt
new file mode 100644
index 0000000000..dc59e1162d
--- /dev/null
+++ b/actor-framework/patches/patch-libcaf__core_CMakeLists.txt
@@ -0,0 +1,14 @@
+$NetBSD$
+
+* libsocket needed on SunOS(illumos) due to use of socket function
+
+--- libcaf_core/CMakeLists.txt.orig	2021-07-16 09:33:16.000000000 +0000
++++ libcaf_core/CMakeLists.txt
+@@ -52,6 +52,7 @@ caf_add_component(
+       ${LIBCAF_CORE_OPTIONAL_DEPENDENCIES}
+     PRIVATE
+       CAF::internal
++      $<$<PLATFORM_ID:SunOS>:socket>
+   ENUM_CONSISTENCY_CHECKS
+     exit_reason
+     intrusive.inbox_result
diff --git a/actor-framework/patches/patch-libcaf__core_caf_config.hpp b/actor-framework/patches/patch-libcaf__core_caf_config.hpp
index 4183039bd1..9e2bac4c1b 100644
--- a/actor-framework/patches/patch-libcaf__core_caf_config.hpp
+++ b/actor-framework/patches/patch-libcaf__core_caf_config.hpp
@@ -1,10 +1,11 @@
 $NetBSD$
 
 * add NetBSD support
+* add Solaris support
 
 --- libcaf_core/caf/config.hpp.orig	2021-07-16 09:33:16.000000000 +0000
 +++ libcaf_core/caf/config.hpp
-@@ -191,6 +191,9 @@
+@@ -191,17 +191,22 @@
  #  endif
  #elif defined(__FreeBSD__)
  #  define CAF_BSD
@@ -14,3 +15,17 @@ $NetBSD$
  #elif defined(__OpenBSD__)
  #  define CAF_BSD
  #elif defined(__CYGWIN__)
+ #  define CAF_CYGWIN
+ #elif defined(WIN32) || defined(_WIN32)
+ #  define CAF_WINDOWS
++#elif defined(__sun) || defined(__sun__) || defined(__illumos__)
++#  define CAF_SOLARIS
+ #else
+ #  error Platform and/or compiler not supported
+ #endif
+ #if defined(CAF_MACOS) || defined(CAF_LINUX) || defined(CAF_BSD)               \
+-  || defined(CAF_CYGWIN)
++  || defined(CAF_CYGWIN) || defined(CAF_SOLARIS)
+ #  define CAF_POSIX
+ #endif
+ 
diff --git a/actor-framework/patches/patch-libcaf__core_src_detail_get__mac__addresses.cpp b/actor-framework/patches/patch-libcaf__core_src_detail_get__mac__addresses.cpp
new file mode 100644
index 0000000000..d9d9cf2582
--- /dev/null
+++ b/actor-framework/patches/patch-libcaf__core_src_detail_get__mac__addresses.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+* add Solaris build , add defines and includes to fix solaris build
+
+--- libcaf_core/src/detail/get_mac_addresses.cpp.orig	2021-07-16 09:33:16.000000000 +0000
++++ libcaf_core/src/detail/get_mac_addresses.cpp
+@@ -83,7 +83,7 @@ std::vector<iface_info> get_mac_addresse
+ } // namespace detail
+ } // namespace caf
+ 
+-#elif defined(CAF_LINUX) || defined(CAF_ANDROID) || defined(CAF_CYGWIN)
++#elif defined(CAF_LINUX) || defined(CAF_ANDROID) || defined(CAF_CYGWIN) || defined(CAF_SOLARIS)
+ 
+ #  include <algorithm>
+ #  include <cctype>
+@@ -101,6 +101,13 @@ std::vector<iface_info> get_mac_addresse
+ #  include <unistd.h>
+ #  include <vector>
+ 
++#  if defined(CAF_SOLARIS)
++#    include <sys/sockio.h>
++#    if !defined(ifr_hwaddr)
++#      define ifr_hwaddr ifr_addr
++#    endif
++#  endif
++
+ namespace caf::detail {
+ 
+ std::vector<iface_info> get_mac_addresses() {
diff --git a/actor-framework/patches/patch-libcaf__core_src_detail_get__root__uuid.cpp b/actor-framework/patches/patch-libcaf__core_src_detail_get__root__uuid.cpp
new file mode 100644
index 0000000000..1b8fc4407e
--- /dev/null
+++ b/actor-framework/patches/patch-libcaf__core_src_detail_get__root__uuid.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Add Solaris support
+
+--- libcaf_core/src/detail/get_root_uuid.cpp.orig	2021-07-16 09:33:16.000000000 +0000
++++ libcaf_core/src/detail/get_root_uuid.cpp
+@@ -192,7 +192,7 @@ std::string get_root_uuid() {
+ } // namespace detail
+ } // namespace caf
+ 
+-#elif defined(CAF_IOS) || defined(CAF_ANDROID)
++#elif defined(CAF_IOS) || defined(CAF_ANDROID) || defined(CAF_SOLARIS)
+ 
+ // return a randomly-generated UUID on mobile devices
+ 
diff --git a/actor-framework/patches/patch-libcaf__core_src_detail_set__thread__name.cpp b/actor-framework/patches/patch-libcaf__core_src_detail_set__thread__name.cpp
index af9f4a58c1..a17614d9d9 100644
--- a/actor-framework/patches/patch-libcaf__core_src_detail_set__thread__name.cpp
+++ b/actor-framework/patches/patch-libcaf__core_src_detail_set__thread__name.cpp
@@ -4,6 +4,7 @@ $NetBSD$
   so that pthread_np.h is only included on platforms that have it
 
 * add NetBSD support
+* add Solaris support
 
 --- libcaf_core/src/detail/set_thread_name.cpp.orig	2021-07-16 09:33:16.000000000 +0000
 +++ libcaf_core/src/detail/set_thread_name.cpp
@@ -16,12 +17,14 @@ $NetBSD$
  #  include <pthread_np.h>
  #endif // defined(...)
  
-@@ -32,6 +32,8 @@ void set_thread_name(const char* name) {
+@@ -32,6 +32,10 @@ void set_thread_name(const char* name) {
    pthread_setname_np(name);
  #  elif defined(CAF_LINUX)
    prctl(PR_SET_NAME, name, 0, 0, 0);
 +#  elif defined(CAF_NETBSD)
 +  pthread_setname_np(pthread_self(), name , NULL); 
++#  elif defined(CAF_SOLARIS)
++  pthread_setname_np(pthread_self(), name); 
  #  elif defined(CAF_BSD)
    pthread_set_name_np(pthread_self(), name);
  #  endif // defined(...)
diff --git a/actor-framework/patches/patch-libcaf__core_src_telemetry_importer_process.cpp b/actor-framework/patches/patch-libcaf__core_src_telemetry_importer_process.cpp
new file mode 100644
index 0000000000..797ce5e85e
--- /dev/null
+++ b/actor-framework/patches/patch-libcaf__core_src_telemetry_importer_process.cpp
@@ -0,0 +1,64 @@
+$NetBSD$
+
+* Add Solaris support
+
+--- libcaf_core/src/telemetry/importer/process.cpp.orig	2021-07-16 09:33:16.000000000 +0000
++++ libcaf_core/src/telemetry/importer/process.cpp
+@@ -10,7 +10,7 @@
+ 
+ // -- detect supported platforms -----------------------------------------------
+ 
+-#if defined(CAF_MACOS) || defined(CAF_LINUX)
++#if defined(CAF_MACOS) || defined(CAF_LINUX) || defined(CAF_SOLARIS)
+ #  define CAF_HAS_PROCESS_METRICS
+ #endif
+ 
+@@ -212,6 +212,48 @@ sys_stats read_sys_stats() {
+ 
+ #endif // CAF_LINUX
+ 
++#if defined(CAF_SOLARIS)
++
++#  include <procfs.h>
++#  include <stdio.h>
++#  include <unistd.h>
++
++namespace {
++
++sys_stats read_sys_stats() {
++  sys_stats result{0, 0, 0};
++  char procfs_path[32];
++
++  snprintf(procfs_path, sizeof(procfs_path), "/proc/%d/psinfo", getpid());
++
++  if (auto f = fopen(procfs_path, "r")) {
++    psinfo_t ppsi;
++
++    auto rd = fread(&ppsi, sizeof(ppsi), 1, f);
++    fclose(f);
++    if (rd != 1) {
++       CAF_LOG_ERROR("failed to read content of " + procfs_path);
++       return result;
++    }
++
++    result.rss = static_cast<int64_t>(ppsi.pr_rssize) * 1024;
++    result.vms = static_cast<int64_t>(ppsi.pr_size) * 1024;
++    result.cpu_time = ppsi.pr_time.tv_sec;
++    if (ppsi.pr_time.tv_nsec > 500000000) {
++      result.cpu_time += 1;
++    }
++  }
++  else {
++    CAF_LOG_ERROR("failed to open file " + procfs_path);
++  }
++
++  return result;
++}
++
++} // namespace 
++
++#endif // CAF_SOLARIS
++
+ namespace caf::telemetry::importer {
+ 
+ process::process(metric_registry& reg) {
diff --git a/actor-framework/patches/patch-libcaf__io_CMakeLists.txt b/actor-framework/patches/patch-libcaf__io_CMakeLists.txt
new file mode 100644
index 0000000000..3cc0eced46
--- /dev/null
+++ b/actor-framework/patches/patch-libcaf__io_CMakeLists.txt
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* socket and nsl needed for networking on Solaris
+
+--- libcaf_io/CMakeLists.txt.orig	2021-07-16 09:33:16.000000000 +0000
++++ libcaf_io/CMakeLists.txt
+@@ -10,6 +10,8 @@ caf_add_component(
+     PUBLIC
+       CAF::core
+       $<$<CXX_COMPILER_ID:MSVC>:ws2_32>
++      $<$<PLATFORM_ID:SunOS>:socket>
++      $<$<PLATFORM_ID:SunOS>:nsl>
+     PRIVATE
+       CAF::internal
+   ENUM_CONSISTENCY_CHECKS


Home | Main Index | Thread Index | Old Index