Skip to content

Commit

Permalink
lua: update to 5.4.6
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <rosenp@gmail.com>
  • Loading branch information
neheb committed Jul 7, 2023
1 parent c58a411 commit 4296890
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 45 deletions.
4 changes: 3 additions & 1 deletion releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions subprojects/lua.wrap
Original file line number Diff line number Diff line change
@@ -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
70 changes: 33 additions & 37 deletions subprojects/packagefiles/lua/meson.build
Original file line number Diff line number Diff line change
@@ -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']
Expand All @@ -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',
Expand Down Expand Up @@ -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)
4 changes: 2 additions & 2 deletions subprojects/packagefiles/lua/meson_options.txt
Original file line number Diff line number Diff line change
@@ -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(
Expand Down

0 comments on commit 4296890

Please sign in to comment.