$NetBSD$

Neovim is only compatible with Lua API/ABI 5.1 so we need this exact version

--- CMakeLists.txt.orig	2020-01-01 04:03:20.000000000 +0000
+++ CMakeLists.txt
@@ -380,7 +380,7 @@ endif()
 option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF)
 
 if(PREFER_LUA)
-  find_package(Lua 5.1 REQUIRED)
+  find_package(Lua 5.1 EXACT REQUIRED)
   set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR})
   set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES})
   # Passive (not REQUIRED): if LUAJIT_FOUND is not set, nvim-test is skipped.
@@ -513,6 +513,9 @@ message(STATUS "Using Lua interpreter: $
 # Setup busted.
 find_program(BUSTED_PRG NAMES busted busted.bat)
 find_program(BUSTED_LUA_PRG busted-lua)
+if (NOT BUSTED_LUA_PRG AND BUSTED_PRG)
+  set(BUSTED_LUA_PRG "${BUSTED_PRG}")
+endif()
 if(NOT BUSTED_OUTPUT_TYPE)
   set(BUSTED_OUTPUT_TYPE "nvim")
 endif()
