lpeg: new recipe (#3656)

* lpeg: new recipe
This commit is contained in:
hanya
2019-02-26 16:56:28 +00:00
committed by Schrijvers Luc
parent 24e8bab158
commit 1e39015cf6

View File

@@ -0,0 +1,61 @@
SUMMARY="Pattern-matching library for Lua"
DESCRIPTION="LPeg is a new pattern-matching library for Lua, based on \
Parsing Expression Grammars (PEGs). This text is a reference manual \
for the library. For a more formal treatment of LPeg, as well as \
some discussion about its implementation, \
see A Text Pattern-Matching Tool based on Parsing Expression Grammars."
HOMEPAGE="http://www.inf.puc-rio.br/~roberto/lpeg/"
COPYRIGHT="2007-2017 Lua.org, PUC-Rio."
LICENSE="MIT"
REVISION="1"
SOURCE_URI="http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$portVersion.tar.gz"
CHECKSUM_SHA256="62d9f7a9ea3c1f215c77e0cadd8534c6ad9af0fb711c3f89188a8891c72f026b"
SOURCE_DIR="lpeg-$portVersion"
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
fi
PROVIDES="
lpeg$secondaryArchSuffix = $portVersion
lib:lpeg$secondaryArchSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
lib:liblua$secondaryArchSuffix >= 5.3
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:liblua$secondaryArchSuffix >= 5.3
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
"
PATCH()
{
sed -i \
's/(os.setlocale("C") == "C")/(os.setlocale("C") == "POSIX")/' \
test.lua
}
BUILD()
{
LUAVERSION_WITHOUT_DOT=$(lua -v | sed 's/Lua //' | head -c3 | tr -d '.')
make LUADIR="$(finddir B_SYSTEM_HEADERS_DIRECTORY)$secondaryArchSubDir/lua$LUAVERSION_WITHOUT_DOT"
}
INSTALL()
{
LUAVERSION=$(lua -v | sed 's/Lua //' | head -c3)
mkdir -p $libDir/lua/$LUAVERSION
cp lpeg.so $libDir/lua/$LUAVERSION
}
TEST()
{
make test
}