pkgsrc-WIP-changes archive

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

galera: add incomplete package



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%gatalith.at@localhost>
Pushed By:	wiz
Date:		Wed Jan 11 20:51:47 2023 +0100
Changeset:	45b1d6a8371ffb38627569c653eda387c505b924

Modified Files:
	Makefile
Added Files:
	galera/DESCR
	galera/Makefile
	galera/PLIST
	galera/TODO
	galera/distinfo
	galera/patches/patch-cmake_crc32c.cmake
	galera/patches/patch-galerautils_SConscript
	galera/patches/patch-galerautils_src_gu__arch.h
	galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp
	galera/patches/patch-galerautils_src_gu__crc32c__arm64.c
	galera/patches/patch-galerautils_src_gu__errno.h
	galera/patches/patch-galerautils_src_gu__limits.c
	galera/patches/patch-galerautils_src_gu__resolver.cpp
	galera/patches/patch-galerautils_src_gu__system.h
	galera/patches/patch-gcs_src_gcs__spread.cpp

Log Message:
galera: add incomplete package

Fails due to a C++ problem:

In file included from /usr/include/wchar.h:61,
                 from /usr/include/g++/cwchar:44,
                 from /usr/include/g++/bits/postypes.h:40,
                 from /usr/include/g++/bits/char_traits.h:40,
                 from /usr/include/g++/string:40,
                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_string_utils.hpp:6,
                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_config.hpp:13,
                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_asio.hpp:13,
                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_asio_stream_engine.hpp:17,
                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_asio_stream_engine.cpp:7:
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In constructor 'asio::detail::kqueue_reactor::kqueue_reactor(asio::execution_context&)':
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:53:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
   53 |   ASIO_KQUEUE_EV_SET(&events[0], interrupter_.read_descriptor(),
      |   ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In member function 'virtual void asio::detail::kqueue_reactor::notify_fork(asio::execution_context::fork_event)':
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:101:5: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  101 |     ASIO_KQUEUE_EV_SET(&events[0], interrupter_.read_descriptor(),
      |     ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:117:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  117 |         ASIO_KQUEUE_EV_SET(&events[0], state->descriptor_,
      |         ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:119:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  119 |         ASIO_KQUEUE_EV_SET(&events[1], state->descriptor_,
      |         ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In member function 'int asio::detail::kqueue_reactor::register_internal_descriptor(int, asio::detail::socket_type, asio::detail::kqueue_reactor::descriptor_state*&, asio::detail::reactor_op*)':
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:173:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  173 |   ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ,
      |   ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In member function 'void asio::detail::kqueue_reactor::start_op(int, asio::detail::socket_type, asio::detail::kqueue_reactor::descriptor_state*&, asio::detail::reactor_op*, bool, bool)':
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:226:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  226 |         ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ,
      |         ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:228:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  228 |         ASIO_KQUEUE_EV_SET(&events[1], descriptor, EVFILT_WRITE,
      |         ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:249:7: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  249 |       ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ,
      |       ^~~~~~~~~~~~~~~~~~
/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:251:7: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
  251 |       ASIO_KQUEUE_EV_SET(&events[1], descriptor, EVFILT_WRITE,
      |       ^~~~~~~~~~~~~~~~~~

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

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

diffstat:
 Makefile                                           |  3 +-
 galera/DESCR                                       |  2 ++
 galera/Makefile                                    | 32 +++++++++++++++++
 galera/PLIST                                       |  4 +++
 galera/TODO                                        | 41 +++++++++++++++++++++
 galera/distinfo                                    | 18 ++++++++++
 galera/patches/patch-cmake_crc32c.cmake            | 15 ++++++++
 galera/patches/patch-galerautils_SConscript        | 15 ++++++++
 galera/patches/patch-galerautils_src_gu__arch.h    | 15 ++++++++
 ...atch-galerautils_src_gu__asio__socket__util.hpp | 24 +++++++++++++
 .../patch-galerautils_src_gu__crc32c__arm64.c      | 24 +++++++++++++
 galera/patches/patch-galerautils_src_gu__errno.h   | 15 ++++++++
 galera/patches/patch-galerautils_src_gu__limits.c  | 42 ++++++++++++++++++++++
 .../patches/patch-galerautils_src_gu__resolver.cpp | 42 ++++++++++++++++++++++
 galera/patches/patch-galerautils_src_gu__system.h  | 15 ++++++++
 galera/patches/patch-gcs_src_gcs__spread.cpp       | 15 ++++++++
 16 files changed, 321 insertions(+), 1 deletion(-)

diffs:
diff --git a/Makefile b/Makefile
index 5fa4d51006..a65a6f3cc0 100644
--- a/Makefile
+++ b/Makefile
@@ -279,9 +279,9 @@ SUBDIR+=	bigdft
 SUBDIR+=	bijiben
 SUBDIR+=	bindgraph
 SUBDIR+=	binutils-gold-git
+SUBDIR+=	bio-mocha
 SUBDIR+=	biolibc
 SUBDIR+=	biolibc-tools
-SUBDIR+=	bio-mocha
 SUBDIR+=	bioruby
 SUBDIR+=	bip
 SUBDIR+=	bitkeeper
@@ -976,6 +976,7 @@ SUBDIR+=	g21k-binutils
 SUBDIR+=	gDesklets
 SUBDIR+=	gDesklets-rssgrab
 SUBDIR+=	gDesklets-starterbar
+SUBDIR+=	galera
 SUBDIR+=	galib
 SUBDIR+=	galoisfieldarth
 SUBDIR+=	gambas3
diff --git a/galera/DESCR b/galera/DESCR
new file mode 100644
index 0000000000..be78f55ad5
--- /dev/null
+++ b/galera/DESCR
@@ -0,0 +1,2 @@
+This is Galera replication - Codership's implementation of the write set
+replication (wsrep) interface.
diff --git a/galera/Makefile b/galera/Makefile
new file mode 100644
index 0000000000..00e8e28281
--- /dev/null
+++ b/galera/Makefile
@@ -0,0 +1,32 @@
+# $NetBSD$
+
+DISTNAME=	galera-26.4.13
+CATEGORIES=	databases
+MASTER_SITES=	${MASTER_SITE_GITHUB:=codership/}
+GITHUB_TAG=	release_${PKGVERSION_NOREV}
+DISTFILES=	${DEFAULT_DISTFILES} 694d6ca47f5eec7873be99b7d6babccf633d1231.tar.gz
+SITES.694d6ca47f5eec7873be99b7d6babccf633d1231.tar.gz=	https://github.com/codership/wsrep-API/archive/
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/codership/galera/
+COMMENT=	Synchronous multi-master replication library
+#LICENSE=	gnu-gpl-v2 AND something
+
+WRKSRC=		${WRKDIR}/galera-release_26.4.13
+USE_CMAKE=	yes
+USE_LANGUAGES=	c c++
+
+CHECK_PORTABILITY_SKIP+=	scripts/mysql/centos/mysqld_safe
+CHECK_PORTABILITY_SKIP+=	scripts/mysql/debian/mysqld_safe-5.5
+
+BUILDLINK_TRANSFORM+=	opt:-ldl:${BUILDLINK_LDADD.dl:Q}
+
+post-extract:
+	cd ${WRKDIR}/wsrep-* && ${MV} * ${WRKSRC}/wsrep/src/
+
+.include "../../devel/boost-headers/buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../security/openssl/buildlink3.mk"
+.include "../../devel/check/buildlink3.mk"
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/galera/PLIST b/galera/PLIST
new file mode 100644
index 0000000000..92ba51a2d7
--- /dev/null
+++ b/galera/PLIST
@@ -0,0 +1,4 @@
+@comment $NetBSD$
+@comment TODO: to fill this file with the file listing:
+@comment TODO: 1. run "/usr/bin/make package"
+@comment TODO: 2. run "/usr/bin/make print-PLIST"
diff --git a/galera/TODO b/galera/TODO
new file mode 100644
index 0000000000..77193ca63d
--- /dev/null
+++ b/galera/TODO
@@ -0,0 +1,41 @@
+In file included from /usr/include/wchar.h:61,
+                 from /usr/include/g++/cwchar:44,
+                 from /usr/include/g++/bits/postypes.h:40,
+                 from /usr/include/g++/bits/char_traits.h:40,
+                 from /usr/include/g++/string:40,
+                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_string_utils.hpp:6,
+                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_config.hpp:13,
+                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_asio.hpp:13,
+                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_asio_stream_engine.hpp:17,
+                 from /scratch/wip/galera/work/galera-release_26.4.13/galerautils/src/gu_asio_stream_engine.cpp:7:
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In constructor 'asio::detail::kqueue_reactor::kqueue_reactor(asio::execution_context&)':
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:53:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+   53 |   ASIO_KQUEUE_EV_SET(&events[0], interrupter_.read_descriptor(),
+      |   ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In member function 'virtual void asio::detail::kqueue_reactor::notify_fork(asio::execution_context::fork_event)':
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:101:5: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  101 |     ASIO_KQUEUE_EV_SET(&events[0], interrupter_.read_descriptor(),
+      |     ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:117:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  117 |         ASIO_KQUEUE_EV_SET(&events[0], state->descriptor_,
+      |         ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:119:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  119 |         ASIO_KQUEUE_EV_SET(&events[1], state->descriptor_,
+      |         ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In member function 'int asio::detail::kqueue_reactor::register_internal_descriptor(int, asio::detail::socket_type, asio::detail::kqueue_reactor::descriptor_state*&, asio::detail::reactor_op*)':
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:173:3: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  173 |   ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ,
+      |   ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp: In member function 'void asio::detail::kqueue_reactor::start_op(int, asio::detail::socket_type, asio::detail::kqueue_reactor::descriptor_state*&, asio::detail::reactor_op*, bool, bool)':
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:226:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  226 |         ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ,
+      |         ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:228:9: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  228 |         ASIO_KQUEUE_EV_SET(&events[1], descriptor, EVFILT_WRITE,
+      |         ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:249:7: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  249 |       ASIO_KQUEUE_EV_SET(&events[0], descriptor, EVFILT_READ,
+      |       ^~~~~~~~~~~~~~~~~~
+/scratch/wip/galera/work/galera-release_26.4.13/asio/asio/detail/impl/kqueue_reactor.ipp:251:7: error: invalid 'static_cast' from type 'intptr_t' {aka 'long int'} to type 'void*'
+  251 |       ASIO_KQUEUE_EV_SET(&events[1], descriptor, EVFILT_WRITE,
+      |       ^~~~~~~~~~~~~~~~~~
diff --git a/galera/distinfo b/galera/distinfo
new file mode 100644
index 0000000000..7bcf3adb38
--- /dev/null
+++ b/galera/distinfo
@@ -0,0 +1,18 @@
+$NetBSD$
+
+BLAKE2s (694d6ca47f5eec7873be99b7d6babccf633d1231.tar.gz) = 75e68accfc8848a2d43987a2dd8f4598e2ce0a73a224e3cc71c0475d72571956
+SHA512 (694d6ca47f5eec7873be99b7d6babccf633d1231.tar.gz) = 4bf11c9ea43263cddebfebe115ea4118a1d5573f30f160a7fc7db9ae7faa4d1f11c5f0988ce4d4878d49431635b9e1b0c9ec3bfe0f8cda7c3b6d1d6c7265a391
+Size (694d6ca47f5eec7873be99b7d6babccf633d1231.tar.gz) = 91929 bytes
+BLAKE2s (galera-26.4.13.tar.gz) = 54717494b2abda58deffeb91a73aff1948ec5d9a155438208c6d58cdcf61446c
+SHA512 (galera-26.4.13.tar.gz) = 34bd8eecf45efe8237256672eb164060ef4f8b9548b0da4392d6c45507f215d85272bf9fe883ec365ae8541051edc4c1a8b9f2d4bd9158100264bd824cc6cc61
+Size (galera-26.4.13.tar.gz) = 3587759 bytes
+SHA1 (patch-cmake_crc32c.cmake) = f81ca80457b529cd72999c25c21cfa54def28a84
+SHA1 (patch-galerautils_SConscript) = 8c53d2d110bba19dda5c1dbda872492aa5010701
+SHA1 (patch-galerautils_src_gu__arch.h) = 317bac921afb5cf8134e2a93dbd6984d4018e750
+SHA1 (patch-galerautils_src_gu__asio__socket__util.hpp) = bdbd2481f45f1ca9063944288e3933e56e863839
+SHA1 (patch-galerautils_src_gu__crc32c__arm64.c) = 8ed40c8e4c5824f762b8bfc64e65f2ea1827cd71
+SHA1 (patch-galerautils_src_gu__errno.h) = cb5ac99b3a77a865fe1c40b3553284ce795db003
+SHA1 (patch-galerautils_src_gu__limits.c) = 9d7a7315f17670fff836dfafd641196c2cdf51cc
+SHA1 (patch-galerautils_src_gu__resolver.cpp) = a057a5802d38cbf716a1a1a493ea5ae7e41eba09
+SHA1 (patch-galerautils_src_gu__system.h) = 9d0062df2878af8277a6fe2de072d5fefc297e4f
+SHA1 (patch-gcs_src_gcs__spread.cpp) = ab3088ca2d5b12592bc51bc8c6221666f6319449
diff --git a/galera/patches/patch-cmake_crc32c.cmake b/galera/patches/patch-cmake_crc32c.cmake
new file mode 100644
index 0000000000..ed8dca4e90
--- /dev/null
+++ b/galera/patches/patch-cmake_crc32c.cmake
@@ -0,0 +1,15 @@
+$NetBSD$
+
+NetBSD support.
+
+--- cmake/crc32c.cmake.orig	2022-11-02 06:09:14.000000000 +0000
++++ cmake/crc32c.cmake
+@@ -42,7 +42,7 @@ int main()
+ {
+ #if defined(__linux__)
+     (void)getauxval(AT_HWCAP);
+-#elif defined(__FreeBSD__)
++#elif defined(__FreeBSD__) || defined(__NetBSD__)
+     unsigned long info;
+     (void)elf_aux_info(AT_HWCAP, &info, sizeof(info));
+ #else
diff --git a/galera/patches/patch-galerautils_SConscript b/galera/patches/patch-galerautils_SConscript
new file mode 100644
index 0000000000..6737085045
--- /dev/null
+++ b/galera/patches/patch-galerautils_SConscript
@@ -0,0 +1,15 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/SConscript.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/SConscript
+@@ -56,7 +56,7 @@ if not crc32c_no_hardware:
+                             {
+                             #if defined(__linux__)
+                                 (void)getauxval(AT_HWCAP);
+-                            #elif defined(__FreeBSD__)
++                            #elif defined(__FreeBSD__) || defined(__NetBSD__)
+                                 unsigned long info;
+                                 (void)elf_aux_info(AT_HWCAP, &info, sizeof(info));
+                             #else
diff --git a/galera/patches/patch-galerautils_src_gu__arch.h b/galera/patches/patch-galerautils_src_gu__arch.h
new file mode 100644
index 0000000000..d56009e2cf
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__arch.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_arch.h.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_arch.h
+@@ -41,7 +41,7 @@
+ # error "Byte order not defined"
+ #endif
+ 
+-#if defined(__sun__)
++#if defined(__sun__) || defined(__NetBSD__)
+ # if defined (_LP64)
+ #  define GU_WORDSIZE 64
+ # else
diff --git a/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp b/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp
new file mode 100644
index 0000000000..b971c12188
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp
@@ -0,0 +1,24 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_asio_socket_util.hpp.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_asio_socket_util.hpp
+@@ -148,7 +148,7 @@ static struct tcp_info get_tcp_info(Sock
+ {
+     struct tcp_info tcpi;
+     memset(&tcpi, 0, sizeof(tcpi));
+-#if defined(__linux__) || defined(__FreeBSD__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #if defined(__linux__)
+     static int const level(SOL_TCP);
+ #else /* FreeBSD */
+@@ -162,7 +162,7 @@ static struct tcp_info get_tcp_info(Sock
+         gu_throw_error(err) << "Failed to read TCP info from socket: "
+                             << strerror(err);
+     }
+-#endif /* __linux__ || __FreeBSD__ */
++#endif /* __linux__ || __FreeBSD__ || __NetBSD__ */
+     return tcpi;
+ }
+ 
diff --git a/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c b/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c
new file mode 100644
index 0000000000..dcb42833aa
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c
@@ -0,0 +1,24 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_crc32c_arm64.c.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_crc32c_arm64.c
+@@ -70,7 +70,7 @@ gu_crc32c_arm64(gu_crc32c_t state, const
+ 
+ #include <sys/auxv.h>
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ /* Imitate getauxval() interface */
+ static unsigned long int
+ getauxval(unsigned long int const type)
+@@ -79,7 +79,7 @@ getauxval(unsigned long int const type)
+     if (0 != elf_aux_info(type, &ret, sizeof(ret))) ret = 0;
+     return ret;
+ }
+-#endif /* FreeBSD */
++#endif /* FreeBSD || NetBSD */
+ 
+ #if defined(HWCAP_CRC32)
+ #    define GU_AT_HWCAP    AT_HWCAP
diff --git a/galera/patches/patch-galerautils_src_gu__errno.h b/galera/patches/patch-galerautils_src_gu__errno.h
new file mode 100644
index 0000000000..acaa74a06a
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__errno.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_errno.h.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_errno.h
+@@ -7,7 +7,7 @@
+ 
+ #include <errno.h>
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ #  define GU_ELAST ELAST
+ #else
+ /* must be high enough to not collide with system errnos but lower than 256 */
diff --git a/galera/patches/patch-galerautils_src_gu__limits.c b/galera/patches/patch-galerautils_src_gu__limits.c
new file mode 100644
index 0000000000..0ab6bf1deb
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__limits.c
@@ -0,0 +1,42 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_limits.c.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_limits.c
+@@ -94,13 +94,33 @@ static inline size_t page_size()    { re
+ static inline size_t phys_pages()   { return sysconf(_SC_PHYS_PAGES);   }
+ static inline size_t avphys_pages() { return freebsd_avphys_pages();    }
+ 
+-#else /* !__APPLE__ && !__FreeBSD__ */
++#elif defined(__NetBSD__)
++#include <sys/param.h>
++#include <sys/sysctl.h>
++#include <sys/vmmeter.h>
++
++static long netbsd_avphys_pages (void)
++{
++    struct vmtotal total;
++    static const int vmmeter_mib[] = { CTL_VM, VM_METER };
++    size_t size = sizeof(total);
++    if (sysctl(vmmeter_mib, 2, &total, &size, NULL, 0) == -1) {
++        gu_error("Can't get vmtotals");
++	return 0;
++    }
++    return (long)total.t_free;
++}
++
++static inline size_t page_size()    { return sysconf(_SC_PAGESIZE);     }
++static inline size_t phys_pages()   { return sysconf(_SC_PHYS_PAGES);   }
++static inline size_t avphys_pages() { return netbsd_avphys_pages();    }
++#else /* !__APPLE__ && !__FreeBSD__ && !__NetBSD__ */
+ 
+ static inline size_t page_size()    { return sysconf(_SC_PAGESIZE);     }
+ static inline size_t phys_pages()   { return sysconf(_SC_PHYS_PAGES);   }
+ static inline size_t avphys_pages() { return sysconf(_SC_AVPHYS_PAGES); }
+ 
+-#endif /* !__APPLE__ && !__FreeBSD__ */
++#endif /* !__APPLE__ && !__FreeBSD__ && !__NetBSD__ */
+ 
+ #define GU_DEFINE_FUNCTION(func)                \
+     size_t gu_##func()                          \
diff --git a/galera/patches/patch-galerautils_src_gu__resolver.cpp b/galera/patches/patch-galerautils_src_gu__resolver.cpp
new file mode 100644
index 0000000000..0b0d135cb0
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__resolver.cpp
@@ -0,0 +1,42 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_resolver.cpp.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_resolver.cpp
+@@ -17,7 +17,7 @@
+ #include <map>
+ #include <stdexcept>
+ 
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ # include <ifaddrs.h>
+ # define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+ # define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+@@ -79,7 +79,7 @@ private:
+             family,
+             socktype,
+             protocol,
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ 	    0, // FreeBSD gives ENOMEM error with non-zero value
+ #else
+             sizeof(struct sockaddr),
+@@ -208,7 +208,7 @@ static unsigned int get_ifindex_by_addr(
+ 
+     unsigned int idx(-1);
+     int err(0);
+-#if defined(__APPLE__) || defined(__FreeBSD__)
++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+     struct ifaddrs *if_addrs = NULL;
+     struct ifaddrs *if_addr = NULL;
+ 
+@@ -272,7 +272,7 @@ out:
+                 }
+ #if defined(__linux__) || defined(__GNU__)
+                 idx = ifrp->ifr_ifindex;
+-#elif defined(__sun__) || defined(__FreeBSD_kernel__)
++#elif defined(__sun__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
+                 idx = ifrp->ifr_index;
+ #else
+ # error "Unsupported ifreq structure"
diff --git a/galera/patches/patch-galerautils_src_gu__system.h b/galera/patches/patch-galerautils_src_gu__system.h
new file mode 100644
index 0000000000..b374b77da6
--- /dev/null
+++ b/galera/patches/patch-galerautils_src_gu__system.h
@@ -0,0 +1,15 @@
+$NetBSD$
+
+NetBSD support.
+
+--- galerautils/src/gu_system.h.orig	2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_system.h
+@@ -23,7 +23,7 @@ extern "C" {
+ 
+ #if defined(__sun__)
+ # define GU_SYS_PROGRAM_NAME getexecname ()
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
++#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+ # define GU_SYS_PROGRAM_NAME getprogname ()
+ #elif defined(__linux__)
+ # define GU_SYS_PROGRAM_NAME program_invocation_name
diff --git a/galera/patches/patch-gcs_src_gcs__spread.cpp b/galera/patches/patch-gcs_src_gcs__spread.cpp
new file mode 100644
index 0000000000..9397e0b17c
--- /dev/null
+++ b/galera/patches/patch-gcs_src_gcs__spread.cpp
@@ -0,0 +1,15 @@
+$NetBSD$
+
+NetBSD support.
+
+--- gcs/src/gcs_spread.cpp.orig	2022-11-02 06:09:14.000000000 +0000
++++ gcs/src/gcs_spread.cpp
+@@ -654,7 +654,7 @@ GCS_BACKEND_CREATE_FN(gcs_spread_create)
+ 	if (spread_priv_name (spread->priv_name,
+ #if defined(__sun__)
+                               getexecname (),
+-#elif defined(__APPLE__) || defined(__FreeBSD__)
++#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__)
+                               getprogname (),
+ #elif defined(__linux__)
+                               program_invocation_short_name,


Home | Main Index | Thread Index | Old Index