This hack is unneeded and breaks the build on some systems.
Just remove it, then the build works robustly.

--- CMakeLists.txt	2023-09-25 16:47:42.000000000 +0800
+++ CMakeLists.txt	2024-05-02 04:27:25.000000000 +0800
@@ -209,18 +209,8 @@
 if(NOT DBOPEN_IN_LIBC)
     target_link_libraries(nvi PRIVATE db1)
 endif()
-if (APPLE)
-    # Avoid using an incompatible db.h installed to /usr/local (since this is
-    # part of the default search path on macOS)
-    set(DB_H_GUESS "${CMAKE_OSX_SYSROOT}/usr/include/db.h")
-    if (NOT EXISTS ${DB_H_GUESS})
-        message(FATAL_ERROR "Could not find db.h at the expected path (${DB_H_GUESS}).")
-    endif()
-    add_definitions("-DDB_H_ABS_PATH=<${DB_H_GUESS}>")
-else()
-    find_path(DB_INCLUDE_DIR db.h PATH_SUFFIXES db1)
-    target_include_directories(nvi PRIVATE ${DB_INCLUDE_DIR})
-endif()
+find_path(DB_INCLUDE_DIR db.h PATH_SUFFIXES db1)
+target_include_directories(nvi PRIVATE ${DB_INCLUDE_DIR})
 
 check_include_files(libutil.h HAVE_LIBUTIL_H)
 check_include_files(ncurses.h HAVE_NCURSES_H)

--- common/common.h	2023-09-25 16:47:42.000000000 +0800
+++ common/common.h	2024-05-02 06:04:46.000000000 +0800
@@ -11,11 +11,7 @@
 #define TCSASOFT 0
 #endif
 
-#ifdef DB_H_ABS_PATH
-#include DB_H_ABS_PATH
-#else
 #include <db.h>
-#endif
 #include <regex.h>		/* May refer to the bundled regex. */
 
 /*
