From 9bf6a2d15b8505d3be92f66c86855d9f2f7b3a69 Mon Sep 17 00:00:00 2001
From: lx <lx@FreeBSD.org>
Date: Tue, 28 Jan 2014 20:16:01 +0000
Subject: Fix build and STAGEify.

PR:		ports/185899
Submitted by:	ashish@
---
 textproc/luaexpat/Makefile             |  2 +-
 textproc/luaexpat/files/patch-makefile | 30 ++++++++++++++++++++++--------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/textproc/luaexpat/Makefile b/textproc/luaexpat/Makefile
index dacd19b..b6e0db5 100644
--- a/textproc/luaexpat/Makefile
+++ b/textproc/luaexpat/Makefile
@@ -13,6 +13,7 @@ COMMENT=	LuaExpat is a SAX XML parser based on the Expat library
 
 LIB_DEPENDS=	expat.6:${PORTSDIR}/textproc/expat2
 
+USES=		gmake
 MAKEFILE=	makefile
 ALL_TARGET=	lib
 USE_LUA=	5.0-5.1
@@ -21,7 +22,6 @@ WANT_LUA_VER=	5.1
 
 CFLAGS+=	-fPIC
 
-NO_STAGE=	yes
 .include <bsd.port.pre.mk>
 
 .if ${LUA_VER} == 5.0
diff --git a/textproc/luaexpat/files/patch-makefile b/textproc/luaexpat/files/patch-makefile
index b3f6b29..9951461 100644
--- a/textproc/luaexpat/files/patch-makefile
+++ b/textproc/luaexpat/files/patch-makefile
@@ -1,6 +1,9 @@
---- makefile.orig	2009-06-25 06:07:16.000000000 +0000
-+++ makefile	2009-06-25 06:23:06.000000000 +0000
-@@ -4,15 +4,11 @@
+
+$FreeBSD$
+
+--- makefile.orig
++++ makefile
+@@ -4,10 +4,6 @@
  
  include $(CONFIG)
  
@@ -11,9 +14,20 @@
  OBJS= src/lxplib.o $(COMPAT_O)
  lib: src/$(LIBNAME)
  
- src/$(LIBNAME) : $(OBJS)
--	export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) -o src/$(LIBNAME) $(LIB_OPTION) $(OBJS) -lexpat
-+	export MACOSX_DEPLOYMENT_TARGET="10.3"; $(CC) -o src/$(LIBNAME) $(LIB_OPTION) lxplib.o $(COMPAT_O) -lexpat
- 
- $(COMPAT_DIR)/compat-5.1.o: $(COMPAT_DIR)/compat-5.1.c
+@@ -18,11 +14,11 @@
  	$(CC) -c $(CFLAGS) -o $@ $(COMPAT_DIR)/compat-5.1.c
+ 
+ install:
+-	mkdir -p $(LUA_LIBDIR)
+-	cp src/$(LIBNAME) $(LUA_LIBDIR)
+-	cd $(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
+-	mkdir -p $(LUA_DIR)/$T
+-	cp src/$T/lom.lua $(LUA_DIR)/$T
++	mkdir -p $(DESTDIR)$(LUA_LIBDIR)
++	cp src/$(LIBNAME) $(DESTDIR)$(LUA_LIBDIR)
++	cd $(DESTDIR)$(LUA_LIBDIR); ln -f -s $(LIBNAME) $T.so
++	mkdir -p $(DESTDIR)$(LUA_DIR)/$T
++	cp src/$T/lom.lua $(DESTDIR)$(LUA_DIR)/$T
+ 
+ clean:
+ 	rm -f src/$(LIBNAME) $(OBJS)
-- 
cgit v1.1