See <https://trac.macports.org/ticket/59992>.

--- include/unctrl.h.in.orig	2020-02-03 10:34:34
+++ include/unctrl.h.in	2024-04-29 15:16:48
@@ -42,6 +42,14 @@
 
 /* $Id: unctrl.h.in,v 1.12 2020/02/02 23:34:34 tom Exp $ */
 
+/* Work around issues with Apple's module map */
+#ifndef __building_module
+#define __building_module(x) 0
+#endif
+#if __building_module(Darwin)
+#include_next <unctrl.h>
+#else
+
 #ifndef NCURSES_UNCTRL_H_incl
 #define NCURSES_UNCTRL_H_incl	1
 
@@ -66,3 +74,5 @@ NCURSES_EXPORT(NCURSES_CONST char *) NCURSES_SP_NAME(u
 #endif
 
 #endif /* NCURSES_UNCTRL_H_incl */
+
+#endif /* __building_module(Darwin) */
--- include/ncurses_dll.h.in.orig	2023-05-07 06:12:43
+++ include/ncurses_dll.h.in	2024-04-29 15:18:28
@@ -28,6 +28,14 @@
  ****************************************************************************/
 /* $Id: ncurses_dll.h.in,v 1.18 2023/05/06 20:12:43 tom Exp $ */
 
+/* Work around issues with Apple's module map */
+#ifndef __building_module
+#define __building_module(x) 0
+#endif
+#if __building_module(Darwin)
+#include_next <ncurses_dll.h>
+#else
+
 #ifndef NCURSES_DLL_H_incl
 #define NCURSES_DLL_H_incl 1
 
@@ -101,3 +109,5 @@
 #endif
 
 #endif /* NCURSES_DLL_H_incl */
+
+#endif /* __building_module(Darwin) */
--- include/curses.h.in.orig	2024-01-19 22:50:07
+++ include/curses.h.in	2024-04-29 15:19:26
@@ -34,6 +34,14 @@
  ****************************************************************************/
 
 /* $Id: curses.h.in,v 1.282 2024/01/19 11:50:07 tom Exp $ */
+
+/* Work around issues with Apple's module map */
+#ifndef __building_module
+#define __building_module(x) 0
+#endif
+#if __building_module(Darwin)
+#include_next <ncurses.h>
+#else
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
--- include/curses.tail.orig	2023-08-06 05:43:46
+++ include/curses.tail	2024-04-29 15:20:21
@@ -195,3 +195,5 @@ extern GCC_NORETURN NCURSES_EXPORT(void) exit_curses (
 #endif
 
 #endif /* __NCURSES_H */
+
+#endif /* __building_module(Darwin) */
