From 42968901b8e70575d4906cae5d5ae1b8b156b9be Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 4 Jul 2023 15:03:25 -0700 Subject: [PATCH] lua: update to 5.4.6 Signed-off-by: Rosen Penev --- releases.json | 4 +- subprojects/lua.wrap | 10 +-- subprojects/packagefiles/lua/meson.build | 70 +++++++++---------- .../packagefiles/lua/meson_options.txt | 4 +- 4 files changed, 43 insertions(+), 45 deletions(-) diff --git a/releases.json b/releases.json index eec09b418..58dcf5987 100644 --- a/releases.json +++ b/releases.json @@ -1645,9 +1645,11 @@ }, "lua": { "dependency_names": [ - "lua-5.4" + "lua-5.4", + "lua" ], "versions": [ + "5.4.6-1", "5.4.4-1", "5.4.3-2", "5.4.3-1", diff --git a/subprojects/lua.wrap b/subprojects/lua.wrap index 214395318..28cb7341e 100644 --- a/subprojects/lua.wrap +++ b/subprojects/lua.wrap @@ -1,10 +1,10 @@ [wrap-file] -directory = lua-5.4.4 -source_url = https://www.lua.org/ftp/lua-5.4.4.tar.gz -source_filename = lua-5.4.4.tar.gz -source_hash = 164c7849653b80ae67bec4b7473b884bf5cc8d2dca05653475ec2ed27b9ebf61 +directory = lua-5.4.6 +source_url = https://www.lua.org/ftp/lua-5.4.6.tar.gz +source_filename = lua-5.4.6.tar.gz +source_hash = 7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88 patch_directory = lua [provide] lua-5.4 = lua_dep - +lua = lua_dep diff --git a/subprojects/packagefiles/lua/meson.build b/subprojects/packagefiles/lua/meson.build index 5029479b8..d53ca9df5 100644 --- a/subprojects/packagefiles/lua/meson.build +++ b/subprojects/packagefiles/lua/meson.build @@ -1,21 +1,17 @@ project( - 'lua-5.4', 'c', + 'lua-5.4', + 'c', license: 'MIT', meson_version: '>=0.49.2', - version: '5.4.4', + version: '5.4.6', + default_options: ['c_std=c99', 'warning_level=2'], ) lua_versions = meson.project_version().split('.') -# Override the c_std and warning_level of any superproject. -project_options = ['c_std=c99', 'warning_level=2'] cc = meson.get_compiler('c') # Skip bogus warning. -if cc.get_id() == 'clang' - add_project_arguments('-Wno-string-plus-int', language: 'c') -elif cc.get_id() == 'gcc' - add_project_arguments('-Wno-stringop-overflow', language: 'c') -endif +add_project_arguments(cc.get_supported_arguments('-Wno-string-plus-int', '-Wno-stringop-overflow'), language: 'c') # Platform-specific defines. is_posix = host_machine.system() not in ['windows', 'emscripten', 'android'] @@ -28,31 +24,32 @@ endif # Library dependencies. lua_lib_deps = [cc.find_library('m', required: false)] -if get_option('loadlib') - dl_dep = cc.find_library('dl', required: false) - lua_lib_deps += [dl_dep] - add_project_arguments('-DLUA_USE_DLOPEN', language: 'c') +if meson.version().version_compare('>= 0.62') + dl_dep = dependency('dl', required: get_option('loadlib')) +else + dl_dep = cc.find_library('dl', required: get_option('loadlib')) endif +if dl_dep.found() + lua_lib_deps += dl_dep + add_project_arguments('-DLUA_USE_DLOPEN', language: 'c') +endif # Interpreter dependencies. lua_exe_deps = [] lua_exe_args = [] -if get_option('line_editing') - readline_dep = dependency('readline', required: false) - if not readline_dep.found() - readline_dep = dependency('libedit', required: false) - if not readline_dep.found() - error('''Didn't find readline or libedit, can't enable line editing.''') - endif - endif - lua_exe_deps += [readline_dep] - lua_exe_args += ['-DLUA_USE_READLINE'] +readline_dep = dependency('readline', required: get_option('line_editing')) +if not readline_dep.found() + readline_dep = dependency('libedit', required: get_option('line_editing')) endif +lua_exe_deps += readline_dep +lua_exe_args += '-DLUA_USE_READLINE' + # Targets. -lua_lib = library('lua', +lua_lib = library( + 'lua', 'src/lapi.c', 'src/lauxlib.c', 'src/lbaselib.c', @@ -88,32 +85,31 @@ lua_lib = library('lua', dependencies: lua_lib_deps, version: meson.project_version(), soversion: lua_versions[0] + '.' + lua_versions[1], - override_options: project_options, implicit_include_directories: false, ) -lua_link = lua_lib +inc = include_directories('src') +lua_dep = declare_dependency( + link_with: lua_lib, + include_directories: inc, +) if get_option('interpreter') - lua_exe = executable('lua', + lua_exe = executable( + 'lua', 'src/lua.c', c_args: lua_exe_args, - link_with: lua_link, - dependencies: lua_exe_deps, - export_dynamic: get_option('loadlib'), - override_options: project_options, + dependencies: [lua_dep, lua_exe_deps], + export_dynamic: dl_dep.found(), implicit_include_directories: false, ) if get_option('default_library') == 'static' - luac_exe = executable('luac', + luac_exe = executable( + 'luac', 'src/luac.c', - link_with: lua_link, - override_options: project_options, + dependencies: lua_dep, implicit_include_directories: false, ) endif endif - -inc = include_directories('src') -lua_dep = declare_dependency(link_with: lua_lib, include_directories: inc) diff --git a/subprojects/packagefiles/lua/meson_options.txt b/subprojects/packagefiles/lua/meson_options.txt index 8c549e45b..ed148827c 100644 --- a/subprojects/packagefiles/lua/meson_options.txt +++ b/subprojects/packagefiles/lua/meson_options.txt @@ -1,9 +1,9 @@ option( - 'loadlib', type: 'boolean', value: false, + 'loadlib', type: 'feature', description: 'Allow Lua to "require" C extension modules' ) option( - 'line_editing', type: 'boolean', value: false, + 'line_editing', type: 'feature', description: 'Link with GNU readline (or libedit) to add history to the Lua interpreter.' ) option(