pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/49377: Fix build lua-lpeg on OSX



>Number:         49377
>Category:       pkg
>Synopsis:       Fix build lua-lpeg on OSX
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 08 19:15:00 +0000 2014
>Originator:     Jonathan Buschmann
>Release:        CURRENT / 2014Q3
>Organization:
>Environment:
>Description:
The package devel/lua-lpeg doesn't build on OSX

Currently you get something like :


types  -O2 -ansi -I/usr/include/lua5.1/ -fPIC -I/Volumes/adiunxi/jonthn/.pkgs/include/lua-5.2 -I/usr/include  -c -o lpprint.o lpprint.c
env gcc -shared -fPIC lpvm.o lpcap.o lptree.o lpcode.o lpprint.o -o lpeg.so
Undefined symbols for architecture x86_64:
  "_luaL_addlstring", referenced from:
      _stringcap in lpcap.o
      _substcap in lpcap.o
  "_luaL_addvalue", referenced from:
      _addonestring in lpcap.o
  "_luaL_argerror", referenced from:
      _lp_behind in lptree.o
      _lp_V in lptree.o
      _lp_argcapture in lptree.o
      _lp_range in lptree.o
      _getpatt in lptree.o
      _lp_divcapture in lptree.o
  "_luaL_buffinit", referenced from:
      _pushcapture in lpcap.o
  "_luaL_checkany", reference
    ......


The diff below fix the problem. Not sure if there is a more clean/correct way to fix but using the test.lua it seems work for me.
>How-To-Repeat:

>Fix:
diff --git a/devel/lua-lpeg/Makefile b/devel/lua-lpeg/Makefile
index 92dcd69..dc78718 100644
--- a/devel/lua-lpeg/Makefile
+++ b/devel/lua-lpeg/Makefile
@@ -15,9 +15,15 @@ LICENSE=	mit
 NO_CONFIGURE=	yes
 USE_TOOLS+=	gmake
 MAKE_FILE=	makefile
-BUILD_TARGET=	linux
 TEST_TARGET=	test

+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "Darwin"
+BUILD_TARGET=	macosx
+.else
+BUILD_TARGET=	linux
+.endif
+
 REPLACE_LUA+=	test.lua

 INSTALLATION_DIRS+=	${LUA_CDIR} ${LUA_LDIR} ${LUA_DOCDIR}



Home | Main Index | Thread Index | Old Index