[arch-commits] Commit in lpeg/trunk (PKGBUILD lpeg-0.12-makefile.patch)

Anatol Pomozov anatolik at archlinux.org
Mon May 4 20:20:47 UTC 2015


    Date: Monday, May 4, 2015 @ 22:20:47
  Author: anatolik
Revision: 238483

upgpkg: lpeg 0.12.2-1

Lua 5.3 rebuild

Modified:
  lpeg/trunk/PKGBUILD
Deleted:
  lpeg/trunk/lpeg-0.12-makefile.patch

--------------------------+
 PKGBUILD                 |   51 +++++++++++++++++++++++++++++++++------------
 lpeg-0.12-makefile.patch |   37 --------------------------------
 2 files changed, 38 insertions(+), 50 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2015-05-04 19:37:22 UTC (rev 238482)
+++ PKGBUILD	2015-05-04 20:20:47 UTC (rev 238483)
@@ -3,26 +3,24 @@
 # Contributor: Gustavo Alvarez <sl1pkn07 at gmail.com>
 
 pkgbase=lpeg
-pkgname=(lua-lpeg lua51-lpeg)
-pkgver=0.12
-pkgrel=2
+pkgname=(lua-lpeg lua51-lpeg lua52-lpeg)
+pkgver=0.12.2
+pkgrel=1
 arch=('i686' 'x86_64')
 url='http://www.inf.puc-rio.br/~roberto/lpeg'
 license=('MIT')
-makedepends=('lua' 'lua51')
+makedepends=('lua' 'lua51' 'lua52')
 source=(http://www.inf.puc-rio.br/~roberto/$pkgbase/$pkgbase-$pkgver.tar.gz
-        lpeg-0.12-makefile.patch
         LICENSE)
-md5sums=('4abb3c28cd8b6565c6a65e88f06c9162'
-         '75ea7deffd790f482c9473ff2e9e1cdf'
+md5sums=('fabb614eb46e370d4f6b8fd82d17ca7e'
          'dccb97b431c3a3ccaacc216c6242e9fd')
 
 prepare() {
-  pushd $pkgbase-$pkgver
-  patch -p1 -i ../lpeg-0.12-makefile.patch
-  popd
+  sed 's/^CFLAGS =/CFLAGS +=/' -i $pkgbase-$pkgver/makefile
+  sed 's/^COPT =/# COPT =/' -i $pkgbase-$pkgver/makefile
 
   cp -r $pkgbase-$pkgver $pkgbase-$pkgver-51
+  cp -r $pkgbase-$pkgver $pkgbase-$pkgver-52
 }
 
 build() {
@@ -31,15 +29,32 @@
 
   cd "$srcdir"/$pkgbase-$pkgver-51
   make LUADIR=/usr/include/lua5.1
+
+  cd "$srcdir"/$pkgbase-$pkgver-52
+  make LUADIR=/usr/include/lua5.2
 }
 
+check() {
+  msg2 "Testing with Lua 5.3"
+  cd $srcdir/$pkgbase-$pkgver
+  lua test.lua
+
+  msg2 "Testing with Lua 5.1"
+  cd $srcdir/$pkgbase-$pkgver-51
+  lua5.1 test.lua
+
+  msg2 "Testing with Lua 5.2"
+  cd $srcdir/$pkgbase-$pkgver-52
+  lua5.2 test.lua
+}
+
 package_lua-lpeg() {
-  pkgdesc='Pattern-matching library for Lua 5.2'
+  pkgdesc='Pattern-matching library for Lua 5.3'
   depends=('lua')
 
   cd $pkgbase-$pkgver
-  install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.2/$pkgbase.so
-  install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.2/re.lua
+  install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.3/$pkgbase.so
+  install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.3/re.lua
   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }
 
@@ -52,3 +67,13 @@
   install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.1/re.lua
   install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
 }
+
+package_lua52-lpeg() {
+  pkgdesc='Pattern-matching library for Lua 5.2'
+  depends=('lua52')
+
+  cd $pkgbase-$pkgver-52
+  install -Dm755 $pkgbase.so "$pkgdir"/usr/lib/lua/5.2/$pkgbase.so
+  install -Dm644 re.lua "$pkgdir"/usr/share/lua/5.2/re.lua
+  install -Dm644 ../LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+}

Deleted: lpeg-0.12-makefile.patch
===================================================================
--- lpeg-0.12-makefile.patch	2015-05-04 19:37:22 UTC (rev 238482)
+++ lpeg-0.12-makefile.patch	2015-05-04 20:20:47 UTC (rev 238483)
@@ -1,37 +0,0 @@
---- lpeg-0.12/makefile
-+++ lpeg-0.12/makefile
-@@ -1,7 +1,7 @@
- LIBNAME = lpeg
- LUADIR = /usr/include/lua5.1/
- 
--COPT = -O2
-+#COPT = -O2
- # COPT = -DLPEG_DEBUG -g
- 
- CWARNS = -Wall -Wextra -pedantic \
-@@ -22,21 +22,21 @@
- # -Wunreachable-code \
- 
- 
--CFLAGS = $(CWARNS) $(COPT) -ansi -I$(LUADIR) -fPIC
-+CFLAGS += $(CWARNS) $(COPT) -ansi -I$(LUADIR) -fPIC
- CC = gcc
- 
- FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o
- 
- # For Linux
- linux:
--	make lpeg.so "DLLFLAGS = -shared -fPIC"
-+	$(MAKE) lpeg.so "DLLFLAGS = -shared -fPIC"
- 
- # For Mac OS
- macosx:
--	make lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
-+	$(MAKE) lpeg.so "DLLFLAGS = -bundle -undefined dynamic_lookup"
- 
- lpeg.so: $(FILES)
--	env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so
-+	env $(CC) $(CFLAGS) $(DLLFLAGS) $(LDFLAGS) $(FILES) -o lpeg.so
- 
- $(FILES): makefile
- 



More information about the arch-commits mailing list