[89869] trunk/dports/devel

and.damore at macports.org and.damore at macports.org
Mon Feb 13 08:36:52 PST 2012


Revision: 89869
          http://trac.macports.org/changeset/89869
Author:   and.damore at macports.org
Date:     2012-02-13 08:36:46 -0800 (Mon, 13 Feb 2012)
Log Message:
-----------
new port lua-lpeg: pattern matching library

Added Paths:
-----------
    trunk/dports/devel/lua-lpeg/
    trunk/dports/devel/lua-lpeg/Portfile
    trunk/dports/devel/lua-lpeg/files/
    trunk/dports/devel/lua-lpeg/files/patch-makefile.diff

Added: trunk/dports/devel/lua-lpeg/Portfile
===================================================================
--- trunk/dports/devel/lua-lpeg/Portfile	                        (rev 0)
+++ trunk/dports/devel/lua-lpeg/Portfile	2012-02-13 16:36:46 UTC (rev 89869)
@@ -0,0 +1,51 @@
+# $Id$
+PortSystem          1.0
+
+name                lua-lpeg
+version             0.10.2
+categories          devel
+platforms           darwin
+maintainers         and.damore openmaintainer
+description         Parsing Expression Grammars For Lua
+long_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
+
+homepage            http://www.inf.puc-rio.br/~roberto/lpeg
+master_sites        ${homepage}
+distname            lpeg-${version}
+checksums           md5     1402433f02e37ddadff04a3d4118b026 \
+                    sha1    f2cd5857efb6e1bb02dfb9fbd68e74a451467462 \
+                    rmd160  77dc2f7ca88ac84e6f185cf6077aaf88a130c3af
+
+depends_lib         port:lua
+use_configure       no
+
+patchfiles          patch-makefile.diff
+post-patch {
+    reinplace   "s|%PREFIX%|${prefix}|"             ${worksrcpath}/makefile
+    reinplace "s|%COMPILER%|${configure.compiler}|" ${worksrcpath}/makefile
+
+    reinplace "s|/usr/bin/env lua5.1|${prefix}/bin/lua|" ${worksrcpath}/test.lua
+}
+
+build.env-append    CFLAGS="${configure.cflags}" \
+                    LDFLAGS="${configure.ldflags} -llua -lm"G
+
+build.target        lpeg.so
+
+# makefile is missing install target, override destroot
+destroot {
+    xinstall -d 755 ${destroot}${prefix}/lib/lua/5.1
+    xinstall -m 644 ${worksrcpath}/lpeg.so ${destroot}${prefix}/lib/lua/5.1
+
+    xinstall -d 755 ${destroot}${prefix}/share/doc/${name}
+    xinstall -m 644 \
+        -W ${worksrcpath} lpeg.html re.html lpeg-128.gif HISTORY \
+        ${destroot}${prefix}/share/doc/${name}
+
+    xinstall -d 755 ${destroot}${prefix}/share/examples/${name}
+    xinstall -m 755 ${worksrcpath}/test.lua        ${destroot}${prefix}/share/examples/${name}
+    xinstall -m 644 ${worksrcpath}/re.lua test.lua ${destroot}${prefix}/share/examples/${name}
+}
+


Property changes on: trunk/dports/devel/lua-lpeg/Portfile
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: trunk/dports/devel/lua-lpeg/files/patch-makefile.diff
===================================================================
--- trunk/dports/devel/lua-lpeg/files/patch-makefile.diff	                        (rev 0)
+++ trunk/dports/devel/lua-lpeg/files/patch-makefile.diff	2012-02-13 16:36:46 UTC (rev 89869)
@@ -0,0 +1,42 @@
+--- makefile.orig	2012-02-13 17:04:53.000000000 +0100
++++ makefile	2012-02-13 17:09:39.000000000 +0100
+@@ -1,7 +1,7 @@
+ LIBNAME = lpeg
+-LUADIR = /usr/include/lua5.1/
++LUADIR = %PREFIX%/include
+ 
+-COPT = -O2 -DNDEBUG
++COPT = -DNDEBUG
+ 
+ CWARNS = -Wall -Wextra -pedantic \
+         -Waggregate-return \
+@@ -21,16 +21,16 @@
+ 	#  -Wunreachable-code \
+ 
+ 
+-CFLAGS = $(CWARNS) $(COPT) -ansi -I$(LUADIR)
+-CC = gcc
++CFLAGS += $(CWARNS) $(COPT) -ansi -I$(LUADIR)
++CC = %COMPILER%
+ 
+ # For Linux
+-DLLFLAGS = -shared -fpic
+-ENV = 
++#DLLFLAGS = -shared -fpic
++#ENV = 
+ 
+ # For Mac OS
+-# ENV = MACOSX_DEPLOYMENT_TARGET=10.4
+-# DLLFLAGS = -bundle -undefined dynamic_lookup
++ENV = MACOSX_DEPLOYMENT_TARGET=10.4
++DLLFLAGS = $(LDFLAGS) -bundle -undefined dynamic_lookup
+ 
+ lpeg.so: lpeg.o
+ 	env $(ENV) $(CC) $(DLLFLAGS) lpeg.o -o lpeg.so
+@@ -38,5 +38,5 @@
+ lpeg.o:		makefile lpeg.c lpeg.h
+ 
+ test: test.lua re.lua lpeg.so
+-	test.lua
++	./test.lua
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120213/1cd729cb/attachment.html>


More information about the macports-changes mailing list