mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 21:30:08 +02:00
122 lines
3.4 KiB
Bash
122 lines
3.4 KiB
Bash
SUMMARY="A powerful, fast, light-weight, embeddable scripting language"
|
|
DESCRIPTION="Lua combines simple procedural syntax with powerful data \
|
|
description constructs based on associative arrays and extensible semantics. \
|
|
Lua is dynamically typed, runs by interpreting bytecode for a register-based \
|
|
virtual machine, and has automatic memory management with incremental garbage \
|
|
collection, making it ideal for configuration, scripting, and rapid prototyping."
|
|
HOMEPAGE="https://www.lua.org/"
|
|
COPYRIGHT="1994-2023 Lua.org, PUC-Rio"
|
|
LICENSE="MIT"
|
|
REVISION="2"
|
|
SOURCE_URI="http://www.lua.org/ftp/lua-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30"
|
|
PATCHES="lua-$portVersion.patchset"
|
|
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
|
|
PATCHES+="
|
|
lua-$portVersion.gcc2.patchset
|
|
"
|
|
fi
|
|
|
|
ARCHITECTURES="all"
|
|
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
|
|
|
libVersion="${portVersion%.*}"
|
|
libVersionCompat="$libVersion compat >= $libVersion"
|
|
portVersionCompat="$portVersion compat >= $libVersion"
|
|
luaInc="`echo ${libVersion} | tr -d '.'`"
|
|
luaVer="`echo $portVersion | cut -d~ -f1`"
|
|
|
|
PROVIDES="
|
|
lua$secondaryArchSuffix = $portVersionCompat
|
|
cmd:lua$secondaryArchSuffix = $portVersionCompat
|
|
cmd:lua$libVersion$secondaryArchSuffix = $portVersionCompat
|
|
cmd:luac$secondaryArchSuffix = $portVersionCompat
|
|
cmd:luac$libVersion$secondaryArchSuffix = $portVersionCompat
|
|
lib:liblua$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libreadline$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_devel="
|
|
lua${secondaryArchSuffix}_devel = $portVersionCompat
|
|
devel:liblua$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
REQUIRES_devel="
|
|
lua$secondaryArchSuffix == $portVersion base
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
devel:libreadline$secondaryArchSuffix >= 8
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:make
|
|
"
|
|
|
|
BUILD()
|
|
{
|
|
make haiku MYCFLAGS="-DLUA_ROOT='\"`finddir B_SYSTEM_DIRECTORY`/\"' \
|
|
-DLUA_USER_ROOT='\"`finddir B_USER_NONPACKAGED_DIRECTORY`/\"' \
|
|
-DLUA_LDIR='\"`finddir B_SYSTEM_DATA_DIRECTORY`/lua/$libVersion/\"'" \
|
|
LUA_T="lua$libVersion" LUAC_T="luac$libVersion" \
|
|
LUA_SO="liblua.so.$libVersion"
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir/man1" \
|
|
INSTALL_INC="$includeDir/lua$luaInc" INSTALL_LMOD="$dataDir/lua/$libVersion" \
|
|
INSTALL_LIB="$libDir" INSTALL_BIN="$binDir" TO_BIN="lua$libVersion luac$libVersion" \
|
|
TO_LIB="liblua.so.$libVersion"
|
|
|
|
ln -s lua$libVersion $binDir/lua
|
|
ln -s luac$libVersion $binDir/luac
|
|
ln -s liblua.so.$libVersion $libDir/liblua.so
|
|
|
|
mkdir -p $docDir
|
|
cp doc/{*.html,logo.gif,lua.css,manual.css,OSIApproved_100X125.png} $docDir
|
|
|
|
rm -r $dataDir #empty directory
|
|
rm -r $prefix/lib/lua #empty directory
|
|
|
|
mkdir -p $developLibDir/pkgconfig
|
|
cat > $developLibDir/pkgconfig/lua.pc << EOF
|
|
V=$libVersion
|
|
R=$luaVer
|
|
|
|
INSTALL_BIN=$binDir
|
|
INSTALL_INC=$includeDir
|
|
INSTALL_LIB=$libDir
|
|
INSTALL_MAN=$manDir
|
|
INSTALL_LMOD=${dataDir}/lua/\${V}
|
|
INSTALL_CMOD=${libDir}/lua/\${V}
|
|
exec_prefix=$prefix
|
|
libdir=$libDir
|
|
includedir=$includeDir
|
|
|
|
Name: Lua
|
|
Description: An Extensible Extension Language
|
|
Version: \${R}
|
|
Requires:
|
|
Libs: -L\${libdir} -llua
|
|
Cflags: -I\${includedir}/lua$luaInc
|
|
EOF
|
|
|
|
ln -s $developLibDir/pkgconfig/lua.pc $developLibDir/pkgconfig/lua$libVersion.pc
|
|
|
|
prepareInstalledDevelLib liblua
|
|
|
|
packageEntries devel $developDir \
|
|
$docDir
|
|
|
|
rm -rf $documentationDir/packages #empty directory
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
make LUA_T="lua$libVersion" test
|
|
}
|