[COPY] --- T2-COPYRIGHT-BEGIN --- [COPY] t2/package/*/lua/lua.desc [COPY] Copyright (C) 2004 - 2025 The T2 SDE Project [COPY] SPDX-License-Identifier: GPL-2.0 [COPY] --- T2-COPYRIGHT-END --- [I] A lightweight, extensible programming language [T] Lua is a powerful light-weight programming language designed for [T] extending applications. Lua is also frequently used as a general-purpose, [T] stand-alone language. [T] [T] Lua combines simple procedural syntax with powerful data description [T] constructs based on associative arrays and extensible semantics. Lua is [T] dynamically typed, interpreted from bytecodes, and has automatic memory [T] management with garbage collection, making it ideal for configuration, [T] scripting, and rapid prototyping. [U] https://www.lua.org/ [A] PUC-Rio, Brazil [M] Rene Rebe [C] extra/development [F] CROSS DIETLIBC FPIC NO-LTO [L] MIT [S] Stable [V] 5.4.8 [P] X -----5---9 149.800 [CV-URL] http://www.lua.org/ftp/ [D] 823fec30bb8229532c171676ef3623a09d0c7f521d926319d0c0ff0b lua-5.4.8.tar.gz http://www.lua.org/ftp/ # inherit variables like myCFLAGS, myLIBS . $base/package/*/*/lua-conf.in # latest, official Lua patch, unfortunatly unversioned and not -p1 :-( lpatch="`match_source_file -p .patch`" if [ "$lpatch" ]; then hook_add prepatch 5 "(cd src; patch -p0 < $lpatch)" fi # adjust installation path var_append makeopt ' ' "INSTALL_TOP=/$prefix INSTALL_LIB=$libdir" var_append makeinstopt ' ' "INSTALL_TOP=$root/$prefix INSTALL_LIB=$root$libdir" # guess aix bsd c89 freebsd linux-readline mingw posix solaris case $SDECFG_KERNEL in linux) var_append makeopt ' ' 'linux' ;; darwin) var_append makeopt ' ' 'macosx' ;; *) var_append makeopt ' ' 'generic' ;; esac # configure: # -enable dynamic module loading # -enable CLI with readline var_append makeopt ' ' "MYCFLAGS=\"$myCFLAGS\"" #[ $SDECFG_KERNEL = linux ] && var_insert myLIBS ' ' '-Wl,-E' var_append makeopt ' ' "MYLIBS=\"$myLIBS\"" # adjust luaconf.h header lua_conf() { if ! atstage toolchain; then LUA_ROOT="/$prefix" else LUA_ROOT="$root/$prefix" fi sed -i "s,^#define LUA_ROOT.*,#define LUA_ROOT \"$LUA_ROOT/\"," src/luaconf.h sed -i "s,^\(#define LUA_CDIR.*\)lib\(/.*\),\1${libdir##*/}\2," src/luaconf.h } hook_add premake 3 lua_conf # create a lua-config script lua_config_postmake() { sde_substitute $confdir/lua-config | sed -e "s,@LIBS@,$myLIBS," \ -e "s,@CFLAGS@,$myCFLAGS," \ -e "s,@pkglibdir@,$root$pkglibdir," \ -e "s,@pkgdatadir@,$root$pkgdatadir," \ -e "s,//,/,g" > $root$bindir/lua-config chmod 0755 $root$bindir/lua-config } hook_add postmake 3 lua_config_postmake # create a lua.pc pkgconfig file if pkginstalled pkgconfig; then lua_pc_postmake() { sde_substitute $confdir/lua.pc | sed -e "s,@LIBS@,$myLIBS," \ -e "s,@CFLAGS@,$myCFLAGS," \ -e "s,@pkglibdir@,$root$pkglibdir," \ -e "s,@pkgdatadir@,$root$pkgdatadir," \ -e "s,//,/,g" > $root$libdir/pkgconfig/lua.pc } hook_add postmake 3 lua_pc_postmake fi # create missing directories and copy documentation lua_postmake() { mkdir -p $root$pkglibdir/ mkdir -p $root$pkgdatadir/ mkdir -p $root$docdir cp -v doc/* $root$docdir } hook_add postmake 3 lua_postmake # shared object [ "$SDECFG_STATIC" != 1 ] && var_append patchfiles ' ' "$confdir/shared-object.diff" && var_append GCC_WRAPPER_APPEND ' ' -c?:-lm # cross build var_append AR ' ' rc