diff --git a/dev-lua/lpeg/lpeg-1.0.1.recipe b/dev-lua/lpeg/lpeg-1.0.1.recipe new file mode 100644 index 000000000..b2cb4d82a --- /dev/null +++ b/dev-lua/lpeg/lpeg-1.0.1.recipe @@ -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 +}