pkgsrc-WIP-changes archive

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

actor-framework: simplify NetBSD patches, let systems that have cxxabi.h use __cxa_demangle



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%pkgsrc.org@localhost>
Pushed By:	nros
Date:		Wed Jan 5 21:40:00 2022 +0100
Changeset:	3b6532db8d055e80782d4f8e26d1585ea60f55d5

Modified Files:
	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-libcaf__core_src_detail_pretty__type__name.cpp

Log Message:
actor-framework: simplify NetBSD patches, let systems that have cxxabi.h use __cxa_demangle

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

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

diffstat:
 actor-framework/distinfo                           |  5 +++--
 .../patches/patch-libcaf__core_caf_config.hpp      |  3 ++-
 ...-libcaf__core_src_detail_pretty__type__name.cpp | 24 ++++++++++++++++++++++
 ...h-libcaf__core_src_detail_set__thread__name.cpp | 11 ++++------
 4 files changed, 33 insertions(+), 10 deletions(-)

diffs:
diff --git a/actor-framework/distinfo b/actor-framework/distinfo
index 99d0d9b5b0..84699f41e0 100644
--- a/actor-framework/distinfo
+++ b/actor-framework/distinfo
@@ -3,5 +3,6 @@ $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) = a46342be3f0e710b0f184cf4cbf352a6c3077909
-SHA1 (patch-libcaf__core_src_detail_set__thread__name.cpp) = eba1aeba28f9001bc1b9bf337153815dcbd57abc
+SHA1 (patch-libcaf__core_caf_config.hpp) = ea9cad613dedf78387fd7932b4df2598d0fe14f5
+SHA1 (patch-libcaf__core_src_detail_pretty__type__name.cpp) = 922423499220ba8481da6076877fb755ab49c569
+SHA1 (patch-libcaf__core_src_detail_set__thread__name.cpp) = b5a573a7c01c09b745020c048c644c2575ab1a18
diff --git a/actor-framework/patches/patch-libcaf__core_caf_config.hpp b/actor-framework/patches/patch-libcaf__core_caf_config.hpp
index 45e8a3e7bf..4183039bd1 100644
--- a/actor-framework/patches/patch-libcaf__core_caf_config.hpp
+++ b/actor-framework/patches/patch-libcaf__core_caf_config.hpp
@@ -4,12 +4,13 @@ $NetBSD$
 
 --- libcaf_core/caf/config.hpp.orig	2021-07-16 09:33:16.000000000 +0000
 +++ libcaf_core/caf/config.hpp
-@@ -191,6 +191,8 @@
+@@ -191,6 +191,9 @@
  #  endif
  #elif defined(__FreeBSD__)
  #  define CAF_BSD
 +#elif defined(__NetBSD__)
 +#  define CAF_BSD
++#  define CAF_NETBSD
  #elif defined(__OpenBSD__)
  #  define CAF_BSD
  #elif defined(__CYGWIN__)
diff --git a/actor-framework/patches/patch-libcaf__core_src_detail_pretty__type__name.cpp b/actor-framework/patches/patch-libcaf__core_src_detail_pretty__type__name.cpp
new file mode 100644
index 0000000000..a21d364f89
--- /dev/null
+++ b/actor-framework/patches/patch-libcaf__core_src_detail_pretty__type__name.cpp
@@ -0,0 +1,24 @@
+$NetBSD$
+
+* support demangling on systems that have cxxabi.h
+
+--- libcaf_core/src/detail/pretty_type_name.cpp.orig	2022-01-05 17:43:07.354119301 +0000
++++ libcaf_core/src/detail/pretty_type_name.cpp
+@@ -6,7 +6,7 @@
+ 
+ #include "caf/config.hpp"
+ 
+-#if defined(CAF_LINUX) || defined(CAF_MACOS)
++#if defined(CAF_POSIX) && __has_include(<cxxabi.h>)
+ #  include <cxxabi.h>
+ #  include <sys/types.h>
+ #  include <unistd.h>
+@@ -43,7 +43,7 @@ void prettify_type_name(std::string& cla
+ }
+ 
+ void prettify_type_name(std::string& class_name, const char* c_class_name) {
+-#if defined(CAF_LINUX) || defined(CAF_MACOS)
++#if defined(CAF_POSIX) && __has_include(<cxxabi.h>)
+   int stat = 0;
+   std::unique_ptr<char, decltype(free)*> real_class_name{nullptr, free};
+   auto tmp = abi::__cxa_demangle(c_class_name, nullptr, nullptr, &stat);
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 60139b4090..af9f4a58c1 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
@@ -16,15 +16,12 @@ $NetBSD$
  #  include <pthread_np.h>
  #endif // defined(...)
  
-@@ -33,7 +33,11 @@ void set_thread_name(const char* name) {
+@@ -32,6 +32,8 @@ 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_BSD)
-+#    if defined(__NetBSD__)
++#  elif defined(CAF_NETBSD)
 +  pthread_setname_np(pthread_self(), name , NULL); 
-+#    else
+ #  elif defined(CAF_BSD)
    pthread_set_name_np(pthread_self(), name);
-+#    endif
  #  endif // defined(...)
- #endif   // CAF_WINDOWS
- }


Home | Main Index | Thread Index | Old Index