diff --git a/mac/gramps.modules b/mac/gramps.modules
index a9d152a79..01ca740f5 100644
--- a/mac/gramps.modules
+++ b/mac/gramps.modules
@@ -147,6 +147,7 @@ https://files.pythonhosted.org/packages/
repo="oracle"
hash="sha256:12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef" >
+
@@ -163,6 +164,7 @@ https://files.pythonhosted.org/packages/
repo="oracle"
hash="sha256:12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef">
+
diff --git a/mac/patches/berkeleydb-4.8-mutex.patch b/mac/patches/berkeleydb-4.8-mutex.patch
new file mode 100644
index 000000000..bb31dd23f
--- /dev/null
+++ b/mac/patches/berkeleydb-4.8-mutex.patch
@@ -0,0 +1,115 @@
+--- a/dist/configure 2022-12-26 13:46:24.000000000 -0800
++++ b/dist/configure 2022-12-27 11:35:26.000000000 -0800
+@@ -18756,6 +18756,7 @@
+ /* end confdefs.h. */
+
+ #include
++#include
+ int
+ main ()
+ {
+@@ -18792,7 +18793,8 @@
+ /* end confdefs.h. */
+
+ #include
+-main() {
++#include
++int main() {
+ pthread_cond_t cond;
+ pthread_mutex_t mutex;
+ pthread_condattr_t condattr;
+@@ -18828,6 +18830,7 @@
+ /* end confdefs.h. */
+
+ #include
++#include
+ int
+ main ()
+ {
+@@ -18864,7 +18867,7 @@
+ /* end confdefs.h. */
+
+ #include
+-main() {
++int main() {
+ pthread_cond_t cond;
+ pthread_mutex_t mutex;
+ pthread_condattr_t condattr;
+@@ -18899,6 +18902,7 @@
+ /* end confdefs.h. */
+
+ #include
++#include
+ int
+ main ()
+ {
+@@ -18933,7 +18937,8 @@
+ /* end confdefs.h. */
+
+ #include
+-main() {
++#include
++int main() {
+ pthread_cond_t cond;
+ pthread_mutex_t mutex;
+ pthread_condattr_t condattr;
+@@ -18967,6 +18972,7 @@
+ /* end confdefs.h. */
+
+ #include
++#include
+ int
+ main ()
+ {
+@@ -19001,7 +19007,8 @@
+ /* end confdefs.h. */
+
+ #include
+-main() {
++#include
++int main() {
+ pthread_cond_t cond;
+ pthread_mutex_t mutex;
+ pthread_condattr_t condattr;
+@@ -19038,6 +19045,7 @@
+ /* end confdefs.h. */
+
+ #include
++#include
+ int
+ main ()
+ {
+@@ -19069,6 +19077,7 @@
+
+ #include
+ #include
++#include
+ int
+ main ()
+ {
+@@ -19099,6 +19108,7 @@
+
+ #include
+ #include
++#include
+ int
+ main ()
+ {
+@@ -20743,7 +20753,7 @@
+ /* end confdefs.h. */
+
+ #include
+-main() {
++int main() {
+ struct timespec t;
+ return (clock_gettime(CLOCK_MONOTONIC, &t) != 0);
+ }
+@@ -21634,7 +21644,7 @@
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+- main() {
++ int main() {
+ $db_cv_seq_type l;
+ unsigned $db_cv_seq_type u;
+ char buf[100];