Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,10 @@ var USE_SDL_NET = 1;
// [link]
var USE_ICU = 0;

// 1 = use lua from PUC ftp
// [link]
var USE_LUA = 0;

// 1 = use zlib from emscripten-ports
// [link]
var USE_ZLIB = 0;
Expand Down
51 changes: 51 additions & 0 deletions tools/ports/lua.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Copyright 2021 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.

import logging
import os
import shutil


VERSION = '5.4.3'
HASH = '3a1a3ee8694b72b4ec9d3ce76705fe179328294353604ca950c53f41b41161b449877d43318ef4501fee44ecbd6c83314ce7468d7425ba9b2903c9c32a28bbc0'


def needed(settings):
return settings.USE_LUA


def get_lib_name(base_name, settings):
return base_name + ('-mt' if settings.USE_PTHREADS else '') + '.a'


def get(ports, settings, shared):
url = 'https://www.lua.org/ftp/lua-%s.tar.gz' % VERSION
ports.fetch_project('lua', url, 'lua', sha512hash=HASH)

def create(final):
logging.info('building port: lua')

source_path = os.path.join(ports.get_dir(), 'lua', 'lua-' + VERSION, 'src')
dest_path = os.path.join(ports.get_build_dir(), 'lua')

shutil.rmtree(dest_path, ignore_errors=True)
shutil.copytree(source_path, dest_path)
ports.build_port(dest_path, final, [dest_path], exclude_dirs=[], flags=[])

ports.install_headers(source_path)

return [shared.Cache.get_lib('liblua.a', create)]


def clear(ports, settings, shared):
shared.Cache.erase_lib('liblua.a')


def process_args(ports):
return []


def show():
return 'lua (USE_LUA=1; MIT License)'
1 change: 1 addition & 0 deletions tools/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'USE_VORBIS',
'USE_COCOS2D',
'USE_ICU',
'USE_LUA',
'USE_MODPLUG',
'USE_SDL_MIXER',
'USE_SDL_IMAGE',
Expand Down