diff --git a/extensions/lua.interp.in b/extensions/lua.interp.in index 183a754aaf..0a6c22bb19 100644 --- a/extensions/lua.interp.in +++ b/extensions/lua.interp.in @@ -1,5 +1,5 @@ -lua=@LUA_PATH@luajit.exe -luajit=@LUA_PATH@luajit.exe -/usr/bin/luajit=@LUA_PATH@luajit.exe -/usr/bin/lua=@LUA_PATH@luajit.exe -:Lua:E::lua::luajit: +lua=@LUA_PATH@ +luajit=@LUA_PATH@ +/usr/bin/luajit=@LUA_PATH@ +/usr/bin/lua=@LUA_PATH@ +:Lua:E::lua::@LUA_PATH@: diff --git a/extensions/meson.build b/extensions/meson.build index 3bb1681644..1a526eb309 100644 --- a/extensions/meson.build +++ b/extensions/meson.build @@ -1,15 +1,19 @@ subdir('goat-exercises') -# Fallback fix to the problem of non-configured interpreters -if platform_windows and not meson.is_cross_build() and lua.found() +if not meson.is_cross_build() and lua.found() and (platform_windows or not relocatable_bundle) lua_config = configuration_data() - lua_config.set('LUA_PATH', '') + # For Windows, we set the binary name only. + # For other OSes, we use the full path (when not in a relocatable + # bundle). + if platform_windows + lua_config.set('LUA_PATH', lua_bin + '.exe') + else + lua_config.set('LUA_PATH', lua.full_path()) + endif - configure_file( - input : 'lua.interp.in', - output: 'lua.interp', - configuration: lua_config, - install: true, - install_dir: gimpplugindir / 'interpreters', - ) -endif \ No newline at end of file + configure_file(input : 'lua.interp.in', + output: 'lua.interp', + configuration: lua_config, + install: true, + install_dir: gimpplugindir / 'interpreters') +endif