From 70372975261f2fc89aa9bbf92fe975a7663ef59f Mon Sep 17 00:00:00 2001 From: Bruno Date: Tue, 6 Aug 2024 18:11:38 -0300 Subject: [PATCH] meson: Prevent broken lua plug-ins See: https://gitlab.gnome.org/GNOME/gimp/-/issues/11876 For 3.0 we will support only Lua 5.1, since we need to figure out how much of the Lua 5.1 API is compatible with newer versions (Lua minor versions aren't like Python minor versions, there is API breakage so plug-ins would be completely unreliable, this commit prevent this). Also, change some files to not force luajit since it isn't mandatory. --- INSTALL.in | 2 +- extensions/goat-exercises/goat-exercise-lua.lua | 2 +- meson.build | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/INSTALL.in b/INSTALL.in index ab8976afd9..c7698e512d 100644 --- a/INSTALL.in +++ b/INSTALL.in @@ -291,7 +291,7 @@ help in that regard: "gegl:matting-levin" GEGL operation for alternative matting engine Python @PYTHON3_REQUIRED_VERSION@ and PyGObject for Python 3 plug-ins GJS for Javascript plug-ins - LuaJIT and LGI for Lua plug-ins + Lua 5.1 (or LuaJIT) and LGI for Lua plug-ins dot for "Show Image Graph" (unstable branches) xdg-desktop-portal implemented for your desktop for various D-Bus API (screenshot, color-picking…) diff --git a/extensions/goat-exercises/goat-exercise-lua.lua b/extensions/goat-exercises/goat-exercise-lua.lua index 3c1b229d95..da96d1f025 100755 --- a/extensions/goat-exercises/goat-exercise-lua.lua +++ b/extensions/goat-exercises/goat-exercise-lua.lua @@ -1,4 +1,4 @@ -#!/usr/bin/env luajit +#!/usr/bin/env lua -- GIMP - The GNU Image Manipulation Program -- Copyright (C) 1995 Spencer Kimball and Peter Mattis diff --git a/meson.build b/meson.build index 8ea17e7d4c..59eab1b5b0 100644 --- a/meson.build +++ b/meson.build @@ -1117,12 +1117,12 @@ endif ## Lua have_lua = false -# At time of writing, lua-lgi works with Lua 5.1, 5.2, 5.3, 5.4 and LuaJIT2. On -# most platforms, we use luajit. +# At time of writing, lua-lgi works with Lua 5.1, 5.2, 5.3 and LuaJIT2, but we +# support only Lua 5.1 API. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/11876 if get_option('lua').allowed() have_lua_lgi = false - foreach lua_bin : [ 'luajit', 'lua5.1', 'lua5.2', 'lua5.3', 'lua5.4', 'lua' ] + foreach lua_bin : [ 'luajit', 'lua5.1', 'lua' ] lua = find_program(lua_bin, required: false) if lua.found() and meson.can_run_host_binaries()