pkgsrc-WIP-changes archive

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

actor-framework: more netbsd fixes



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%pkgsrc.org@localhost>
Pushed By:	nros
Date:		Mon Jan 10 21:36:01 2022 +0100
Changeset:	bc09d660dd40c19a7b32a0906d1662d16349be3f

Modified Files:
	actor-framework/distinfo
	actor-framework/patches/patch-libcaf__core_caf_config.hpp
	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_detail_set__thread__name.cpp

Log Message:
actor-framework: more netbsd fixes

Don't set CAF_BSD on NetBSD.
Use NetBSDs uuid api to generate uuids.

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

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

diffstat:
 actor-framework/distinfo                           |  8 +--
 .../patches/patch-libcaf__core_caf_config.hpp      |  5 +-
 ...libcaf__core_src_detail_get__mac__addresses.cpp |  9 +++
 ...tch-libcaf__core_src_detail_get__root__uuid.cpp | 72 +++++++++++++++++++++-
 ...h-libcaf__core_src_detail_set__thread__name.cpp | 19 ++----
 5 files changed, 90 insertions(+), 23 deletions(-)

diffs:
diff --git a/actor-framework/distinfo b/actor-framework/distinfo
index 8d09a25ce8..38cd20794e 100644
--- a/actor-framework/distinfo
+++ b/actor-framework/distinfo
@@ -5,11 +5,11 @@ SHA512 (actor-framework-0.18.5.tar.gz) = 5b85e127cacc6df4a20c97d1c1f4d08f19a3e37
 Size (actor-framework-0.18.5.tar.gz) = 2827181 bytes
 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_caf_config.hpp) = 31247b3883c0c2f4d60018606949e0d0fff691c4
+SHA1 (patch-libcaf__core_src_detail_get__mac__addresses.cpp) = 01331c31e5ccecdfa9b4cc3b6a1940f06d59e9f9
+SHA1 (patch-libcaf__core_src_detail_get__root__uuid.cpp) = ec4c0a53dbbda680b6d7a7fcd0ad9f7c58a2016d
 SHA1 (patch-libcaf__core_src_detail_pretty__type__name.cpp) = 922423499220ba8481da6076877fb755ab49c569
-SHA1 (patch-libcaf__core_src_detail_set__thread__name.cpp) = fb3cfefb1eccbf77ccf65173f1cfeb1e71b2e875
+SHA1 (patch-libcaf__core_src_detail_set__thread__name.cpp) = 400dfc5f138ca6a9676bafd6e0e77eeaafa79dd2
 SHA1 (patch-libcaf__core_src_telemetry_importer_process.cpp) = 1c805a05d3154b4e637e0a10bece33797e4d5cae
 SHA1 (patch-libcaf__core_test_scheduled__actor.cpp) = c16b336c67173b4d8c562b624fadf4443ae27005
 SHA1 (patch-libcaf__io_CMakeLists.txt) = 327649d0fef862e75a5367d38e1baf769923c9f0
diff --git a/actor-framework/patches/patch-libcaf__core_caf_config.hpp b/actor-framework/patches/patch-libcaf__core_caf_config.hpp
index 9e2bac4c1b..a5cf568195 100644
--- a/actor-framework/patches/patch-libcaf__core_caf_config.hpp
+++ b/actor-framework/patches/patch-libcaf__core_caf_config.hpp
@@ -5,12 +5,11 @@ $NetBSD$
 
 --- libcaf_core/caf/config.hpp.orig	2021-07-16 09:33:16.000000000 +0000
 +++ libcaf_core/caf/config.hpp
-@@ -191,17 +191,22 @@
+@@ -191,17 +191,21 @@
  #  endif
  #elif defined(__FreeBSD__)
  #  define CAF_BSD
 +#elif defined(__NetBSD__)
-+#  define CAF_BSD
 +#  define CAF_NETBSD
  #elif defined(__OpenBSD__)
  #  define CAF_BSD
@@ -25,7 +24,7 @@ $NetBSD$
  #endif
  #if defined(CAF_MACOS) || defined(CAF_LINUX) || defined(CAF_BSD)               \
 -  || defined(CAF_CYGWIN)
-+  || defined(CAF_CYGWIN) || defined(CAF_SOLARIS)
++  || defined(CAF_CYGWIN) || defined(CAF_SOLARIS) || defined(CAF_NETBSD)
  #  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
index d9d9cf2582..4fe9d3ae15 100644
--- 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
@@ -4,6 +4,15 @@ $NetBSD$
 
 --- 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
+@@ -7,7 +7,7 @@
+ #include "caf/config.hpp"
+ #include "caf/detail/scope_guard.hpp"
+ 
+-#if defined(CAF_MACOS) || defined(CAF_BSD) || defined(CAF_IOS)
++#if defined(CAF_MACOS) || defined(CAF_BSD) || defined(CAF_IOS) || defined(CAF_NETBSD)
+ 
+ #  include <arpa/inet.h>
+ #  include <cerrno>
 @@ -83,7 +83,7 @@ std::vector<iface_info> get_mac_addresse
  } // namespace detail
  } // namespace caf
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
index 1b8fc4407e..59df054e4f 100644
--- 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
@@ -4,12 +4,80 @@ $NetBSD$
 
 --- 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() {
+@@ -3,6 +3,7 @@
+ // https://github.com/actor-framework/actor-framework/blob/master/LICENSE.
+ 
+ #include "caf/detail/get_root_uuid.hpp"
++#include "caf/logger.hpp"
+ #include "caf/config.hpp"
+ 
+ #ifndef CAF_MACOS // not needed on Mac OS X
+@@ -45,7 +46,7 @@ std::string get_root_uuid() {
+ } // namespace detail
+ } // namespace caf
+ 
+-#elif defined(CAF_LINUX) || defined(CAF_BSD) || defined(CAF_CYGWIN)
++#elif defined(CAF_LINUX) || defined(CAF_CYGWIN)
+ 
+ #  include <algorithm>
+ #  include <fstream>
+@@ -125,6 +126,50 @@ std::string get_root_uuid() {
+ 
+ } // namespace caf::detail
+ 
++#elif defined(CAF_NETBSD)
++
++#  include <uuid.h>
++
++#  include <cstdlib>
++#  include <string>
++
++namespace caf {
++namespace detail {
++
++namespace {
++  uuid_t s_uuid;
++  bool s_uuid_need_init = true;
++}
++
++std::string get_root_uuid()
++{
++  std::string uuid;
++  char *uuid_str;
++  uint32_t status;
++  if(s_uuid_need_init) {
++    uuid_create(&s_uuid, &status);
++    if(status != uuid_s_ok) {
++      CAF_LOG_ERROR("failed to get uuid from uuid_create in get_root_uuid");
++      return uuid;
++    }
++    s_uuid_need_init = false;
++  }
++
++  uuid_to_string(&s_uuid, &uuid_str, &status);
++  if(status != uuid_s_ok) {
++    CAF_LOG_ERROR("failed to create uuid string using uuid_to_string in get_root_uuid");
++    return uuid;
++  }
++  uuid.assign(uuid_str);
++  free(uuid_str);
++
++  return uuid;
++}
++
++
++} // detail
++} // caf
++
+ #elif defined(CAF_WINDOWS)
+ 
+ #  include <algorithm>
+@@ -192,7 +237,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)
++#elif defined(CAF_IOS) || defined(CAF_ANDROID) || defined(CAF_SOLARIS) || defined(CAF_BSD)
  
  // 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 a17614d9d9..82d3fd5703 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
@@ -8,23 +8,14 @@ $NetBSD$
 
 --- 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
-@@ -12,7 +12,7 @@
- 
- #if defined(CAF_LINUX)
- #  include <sys/prctl.h>
--#elif defined(CAF_BSD)
-+#elif __has_include(<pthread_np.h>)
- #  include <pthread_np.h>
- #endif // defined(...)
- 
-@@ -32,6 +32,10 @@ void set_thread_name(const char* name) {
-   pthread_setname_np(name);
- #  elif defined(CAF_LINUX)
+@@ -34,6 +34,10 @@ void set_thread_name(const char* name) {
    prctl(PR_SET_NAME, name, 0, 0, 0);
+ #  elif defined(CAF_BSD)
+   pthread_set_name_np(pthread_self(), name);
 +#  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(...)
+ #endif   // CAF_WINDOWS
+ }


Home | Main Index | Thread Index | Old Index