pkgsrc-Changes archive

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

CVS commit: pkgsrc/databases/galera



Module Name:    pkgsrc
Committed By:   wiz
Date:           Fri Jan 13 16:08:03 UTC 2023

Added Files:
        pkgsrc/databases/galera: DESCR Makefile PLIST buildlink3.mk distinfo
        pkgsrc/databases/galera/patches:
            patch-asio_asio_detail_impl_kqueue__reactor.ipp
            patch-cmake_crc32c.cmake patch-galerautils_SConscript
            patch-galerautils_src_gu__arch.h
            patch-galerautils_src_gu__asio__socket__util.hpp
            patch-galerautils_src_gu__crc32c__arm64.c
            patch-galerautils_src_gu__errno.h
            patch-galerautils_src_gu__fdesc.cpp
            patch-galerautils_src_gu__limits.c
            patch-galerautils_src_gu__resolver.cpp
            patch-galerautils_src_gu__system.h
            patch-galerautils_src_gu__thread.cpp patch-gcs_src_gcs__spread.cpp

Log Message:
databases/galera: import galera-26.4.13

This is Galera replication - Codership's implementation of the write set
replication (wsrep) interface.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/galera/DESCR \
    pkgsrc/databases/galera/Makefile pkgsrc/databases/galera/PLIST \
    pkgsrc/databases/galera/buildlink3.mk pkgsrc/databases/galera/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/databases/galera/patches/patch-asio_asio_detail_impl_kqueue__reactor.ipp \
    pkgsrc/databases/galera/patches/patch-cmake_crc32c.cmake \
    pkgsrc/databases/galera/patches/patch-galerautils_SConscript \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__arch.h \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__errno.h \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__fdesc.cpp \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__limits.c \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__resolver.cpp \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__system.h \
    pkgsrc/databases/galera/patches/patch-galerautils_src_gu__thread.cpp \
    pkgsrc/databases/galera/patches/patch-gcs_src_gcs__spread.cpp

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

Added files:

Index: pkgsrc/databases/galera/DESCR
diff -u /dev/null pkgsrc/databases/galera/DESCR:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/DESCR       Fri Jan 13 16:08:03 2023
@@ -0,0 +1,2 @@
+This is Galera replication - Codership's implementation of the write set
+replication (wsrep) interface.
Index: pkgsrc/databases/galera/Makefile
diff -u /dev/null pkgsrc/databases/galera/Makefile:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/Makefile    Fri Jan 13 16:08:03 2023
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+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
+# GPL with openssl exception to allow linking against openssl
+LICENSE=       gnu-gpl-v2 AND boost-license
+
+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"
Index: pkgsrc/databases/galera/PLIST
diff -u /dev/null pkgsrc/databases/galera/PLIST:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/PLIST       Fri Jan 13 16:08:03 2023
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1 2023/01/13 16:08:03 wiz Exp $
+bin/garbd
+lib/libgalera_smm.so
Index: pkgsrc/databases/galera/buildlink3.mk
diff -u /dev/null pkgsrc/databases/galera/buildlink3.mk:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/buildlink3.mk       Fri Jan 13 16:08:03 2023
@@ -0,0 +1,14 @@
+# $NetBSD: buildlink3.mk,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+BUILDLINK_TREE+=       galera
+
+.if !defined(GALERA_BUILDLINK3_MK)
+GALERA_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.galera+= galera>=26.4.13
+BUILDLINK_PKGSRCDIR.galera?=   ../../databases/galera
+
+.include "../../security/openssl/buildlink3.mk"
+.endif # GALERA_BUILDLINK3_MK
+
+BUILDLINK_TREE+=       -galera
Index: pkgsrc/databases/galera/distinfo
diff -u /dev/null pkgsrc/databases/galera/distinfo:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/distinfo    Fri Jan 13 16:08:03 2023
@@ -0,0 +1,21 @@
+$NetBSD: distinfo,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+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-asio_asio_detail_impl_kqueue__reactor.ipp) = 9b34f0c1307b9b1566284e1d196be97f0c2e887f
+SHA1 (patch-cmake_crc32c.cmake) = 777bc7bd309963390dd2619728988bbcf4903992
+SHA1 (patch-galerautils_SConscript) = 9658410ee04446b9c8ad5e310a209e3a15c3aa32
+SHA1 (patch-galerautils_src_gu__arch.h) = 51eb5a415af0ae52ec0012a100d62992da6d7539
+SHA1 (patch-galerautils_src_gu__asio__socket__util.hpp) = 894fe5ce32d9ecf802da2da618f71cdbf2dc06dd
+SHA1 (patch-galerautils_src_gu__crc32c__arm64.c) = 31e1671b9d91e74f23620b0370088f5c8da0e11f
+SHA1 (patch-galerautils_src_gu__errno.h) = 5b366c5f78a3262be80ebda5520ccb4b3cf7e22f
+SHA1 (patch-galerautils_src_gu__fdesc.cpp) = 4d41100c18914a39ec2140239a1f5144536deb43
+SHA1 (patch-galerautils_src_gu__limits.c) = 4d226505ab0796f51e6645c8545878614c4ae804
+SHA1 (patch-galerautils_src_gu__resolver.cpp) = 3462c2dc6db76d782d972bbec365c2ce80417638
+SHA1 (patch-galerautils_src_gu__system.h) = 9ce3fccebf2621e449fb24b73632f8aae4d1f937
+SHA1 (patch-galerautils_src_gu__thread.cpp) = 4e9108ca1b553d13f47fe197e5d202cea21fc122
+SHA1 (patch-gcs_src_gcs__spread.cpp) = a808b7eaa8395fa664cae394b5ff67ba0c756587

Index: pkgsrc/databases/galera/patches/patch-asio_asio_detail_impl_kqueue__reactor.ipp
diff -u /dev/null pkgsrc/databases/galera/patches/patch-asio_asio_detail_impl_kqueue__reactor.ipp:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-asio_asio_detail_impl_kqueue__reactor.ipp     Fri Jan 13 16:08:03 2023
@@ -0,0 +1,18 @@
+$NetBSD: patch-asio_asio_detail_impl_kqueue__reactor.ipp,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+Fix build on NetBSD>=10.
+https://github.com/codership/galera/pull/632
+
+--- asio/asio/detail/impl/kqueue_reactor.ipp.orig      2022-11-02 06:09:14.000000000 +0000
++++ asio/asio/detail/impl/kqueue_reactor.ipp
+@@ -28,6 +28,10 @@
+ #include "asio/detail/push_options.hpp"
+ 
+ #if defined(__NetBSD__)
++#include <sys/param.h>
++#endif
++
++#if defined(__NetBSD__) && __NetBSD_Version__ < 1000000000
+ # define ASIO_KQUEUE_EV_SET(ev, ident, filt, flags, fflags, data, udata) \
+     EV_SET(ev, ident, filt, flags, fflags, data, \
+       reinterpret_cast<intptr_t>(static_cast<void*>(udata)))
Index: pkgsrc/databases/galera/patches/patch-cmake_crc32c.cmake
diff -u /dev/null pkgsrc/databases/galera/patches/patch-cmake_crc32c.cmake:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-cmake_crc32c.cmake    Fri Jan 13 16:08:03 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-cmake_crc32c.cmake,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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
Index: pkgsrc/databases/galera/patches/patch-galerautils_SConscript
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_SConscript:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_SConscript        Fri Jan 13 16:08:03 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-galerautils_SConscript,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__arch.h
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__arch.h:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__arch.h    Fri Jan 13 16:08:03 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-galerautils_src_gu__arch.h,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__asio__socket__util.hpp    Fri Jan 13 16:08:03 2023
@@ -0,0 +1,25 @@
+$NetBSD: patch-galerautils_src_gu__asio__socket__util.hpp,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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;
+ }
+ 
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__crc32c__arm64.c   Fri Jan 13 16:08:03 2023
@@ -0,0 +1,25 @@
+$NetBSD: patch-galerautils_src_gu__crc32c__arm64.c,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__errno.h
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__errno.h:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__errno.h   Fri Jan 13 16:08:03 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-galerautils_src_gu__errno.h,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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 */
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__fdesc.cpp
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__fdesc.cpp:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__fdesc.cpp Fri Jan 13 16:08:03 2023
@@ -0,0 +1,26 @@
+$NetBSD: patch-galerautils_src_gu__fdesc.cpp,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD man page suggests ftruncate() before posix_fallocate().
+Also recognize NetBSD's errno if unsupported.
+https://github.com/codership/galera/pull/632
+
+--- galerautils/src/gu_fdesc.cpp.orig  2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_fdesc.cpp
+@@ -235,13 +235,16 @@ namespace gu
+ #if defined(__APPLE__)
+         if (-1 == fcntl (fd_, F_SETSIZE, size_) && -1 == ftruncate (fd_, size_))
+         {
++#elif defined(__NetBSD__)
++        if (-1 == ftruncate (fd_, size_) || 0 != posix_fallocate (fd_, start, diff))
++        {
+ #else
+         int const ret = posix_fallocate (fd_, start, diff);
+         if (0 != ret)
+         {
+             errno = ret;
+ #endif
+-            if ((EINVAL == errno || ENOSYS == errno) && start >= 0 && diff > 0)
++            if ((EINVAL == errno || ENOSYS == errno || EOPNOTSUPP == errno) && start >= 0 && diff > 0)
+             {
+                 // FS does not support the operation, try physical write
+                 write_file (start);
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__limits.c
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__limits.c:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__limits.c  Fri Jan 13 16:08:03 2023
@@ -0,0 +1,43 @@
+$NetBSD: patch-galerautils_src_gu__limits.c,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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()                          \
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__resolver.cpp
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__resolver.cpp:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__resolver.cpp      Fri Jan 13 16:08:03 2023
@@ -0,0 +1,43 @@
+$NetBSD: patch-galerautils_src_gu__resolver.cpp,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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"
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__system.h
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__system.h:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__system.h  Fri Jan 13 16:08:03 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-galerautils_src_gu__system.h,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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
Index: pkgsrc/databases/galera/patches/patch-galerautils_src_gu__thread.cpp
diff -u /dev/null pkgsrc/databases/galera/patches/patch-galerautils_src_gu__thread.cpp:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-galerautils_src_gu__thread.cpp        Fri Jan 13 16:08:03 2023
@@ -0,0 +1,21 @@
+$NetBSD: patch-galerautils_src_gu__thread.cpp,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- galerautils/src/gu_thread.cpp.orig 2022-11-02 06:09:14.000000000 +0000
++++ galerautils/src/gu_thread.cpp
+@@ -89,6 +89,13 @@ void gu::thread_set_schedparam(pthread_t
+ #else
+     struct sched_param spstr = { sp.prio() };
+ #endif
++#if defined(__NetBSD__)
++    if (sp.policy() == SCHED_OTHER)
++    {
++        /* NetBSD does not allow setting priorities for SCHED_OTHER */
++        return;
++    }
++#endif
+     int err;
+     if ((err = pthread_setschedparam(thd, sp.policy(), &spstr)) != 0)
+     {
Index: pkgsrc/databases/galera/patches/patch-gcs_src_gcs__spread.cpp
diff -u /dev/null pkgsrc/databases/galera/patches/patch-gcs_src_gcs__spread.cpp:1.1
--- /dev/null   Fri Jan 13 16:08:03 2023
+++ pkgsrc/databases/galera/patches/patch-gcs_src_gcs__spread.cpp       Fri Jan 13 16:08:03 2023
@@ -0,0 +1,16 @@
+$NetBSD: patch-gcs_src_gcs__spread.cpp,v 1.1 2023/01/13 16:08:03 wiz Exp $
+
+NetBSD support.
+https://github.com/codership/galera/pull/632
+
+--- 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