From 2c4da1ff5e5deadd2bfe6d720e301e42cf1379a8 Mon Sep 17 00:00:00 2001 From: deepend Date: Wed, 18 Feb 2026 12:46:59 -0700 Subject: [PATCH] Reworked the prior change to preserve cross-OS default behavior by restoring with-lua default to luajit (instead of auto), so downstream builds that rely on historical defaults are not surprised. Kept Lua fallback probing logic, but now it applies to both with-lua=auto and the default with-lua=luajit: Meson tries luajit, then lua-5.4, lua5.4, lua-5.3, lua5.3, and lua; if none are present it warns and disables the Lua plugin instead of hard-failing configure. Updated the Lua plugin dependency selection so plugins/lua/meson.build consumes the pre-resolved fallback dependency for both auto and luajit paths, while keeping explicit custom pkg-config names unchanged. --- plugins/meson.build | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/plugins/meson.build b/plugins/meson.build index e45e4c6c..b87aaa99 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -22,7 +22,31 @@ if get_option('with-fishlim') subdir('fishlim') endif -if get_option('with-lua') != 'false' +lua_option = get_option('with-lua') +if lua_option == 'auto' or lua_option == 'luajit' + lua_auto_dep = dependency('luajit', required: false) + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua-5.4', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua5.4', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua-5.3', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua5.3', required: false) + endif + if not lua_auto_dep.found() + lua_auto_dep = dependency('lua', required: false) + endif + + if lua_auto_dep.found() + subdir('lua') + else + warning('LuaJIT/Lua development files not found, disabling Lua plugin') + endif +elif lua_option != 'false' subdir('lua') endif