Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jul 2013 21:18:43 -0400 (EDT)
From:      Julio Merino <julio+host-mastodon-jmmv@meroh.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/180786: lua52 lacks a pkgconfig file
Message-ID:  <201307240118.r6O1IhDe001471@mastodon.meroh.net>
Resent-Message-ID: <201307240120.r6O1K0vj051715@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         180786
>Category:       ports
>Synopsis:       lua52 lacks a pkgconfig file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 24 01:20:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Julio Merino
>Release:        FreeBSD 10.0-CURRENT powerpc
>Organization:
>Environment:
System: FreeBSD mastodon.meroh.net 10.0-CURRENT FreeBSD 10.0-CURRENT #2 r253517M: Sun Jul 21 09:10:24 EDT 2013 jmmv@mastodon.meroh.net:/usr/obj/usr/src/sys/GENERIC64 powerpc


	
>Description:
	The lua52 package does not install a pkgconfig file, just like
	other versions of lua did.  This prevents software that rely on
	such file to exist from building.
>How-To-Repeat:
	Install lua52.  Attempt to build lutok against it and see it not
	find Lua.
>Fix:

Index: Makefile
===================================================================
--- Makefile	(revision 323554)
+++ Makefile	(working copy)
@@ -3,6 +3,7 @@
 
 PORTNAME=	lua
 PORTVERSION=	5.2.2
+PORTREVISION=	1
 CATEGORIES=	lang
 MASTER_SITES=	http://www.lua.org/ftp/
 
@@ -24,6 +25,7 @@
 LUA_MODSHAREDIR=	${LUA_PREFIX}/share/lua/${LUA_VER}
 
 ALL_TARGET=	freebsd
+USES=		pkgconfig
 USE_LDCONFIG=	yes
 MAKE_JOBS_SAFE=	yes
 MAKE_ENV=	LUA_SONAME="liblua-${LUA_VER}.so.${LUA_VER_SH}" \
@@ -57,6 +59,13 @@
 	@${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}|" \
 		${WRKSRC}/src/luaconf.h
 
+post-build:
+	@${SED} -Ee \
+		's|%%version%%|${PORTVERSION}| ; \
+        	s|%%libdir%%|${LUA_LIBDIR}| ; \
+		s|%%includedir%%|${LUA_INCDIR}|' \
+		${FILESDIR}/lua.pc >${WRKDIR}/lua-${LUA_VER}.pc
+
 post-install:
 .for f in lua luac
 	${LN} -sf ${LUA_BINDIR}/${f} ${PREFIX}/bin/${f}-${LUA_VER}
@@ -64,6 +73,7 @@
 	${LN} -sf ${LUA_LIBDIR}/liblua-${LUA_VER}.so.${LUA_VER_SH} ${LUA_LIBDIR}/liblua.so
 	${LN} -sf ${LUA_SUBDIR}/liblua-${LUA_VER}.so.${LUA_VER_SH} ${PREFIX}/lib
 	${LN} -sf liblua-${LUA_VER}.so.${LUA_VER_SH} ${PREFIX}/lib/liblua-${LUA_VER}.so
+	${INSTALL_DATA} ${WRKDIR}/lua-${LUA_VER}.pc ${PREFIX}/libdata/pkgconfig
 
 # Documentation.
 .if ${PORT_OPTIONS:MDOCS}
Index: files/lua.pc
===================================================================
--- files/lua.pc	(revision 0)
+++ files/lua.pc	(working copy)
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+version=%%version%%
+libdir=%%libdir%%
+includedir=%%includedir%%
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${version}
+Libs: -L${libdir} -llua -lm
+Cflags: -I${includedir}
Index: pkg-plist
===================================================================
--- pkg-plist	(revision 323554)
+++ pkg-plist	(working copy)
@@ -12,6 +12,7 @@
 lib/lua52/liblua-5.2.so.1
 lib/lua52/liblua.a
 lib/lua52/liblua.so
+libdata/pkgconfig/lua-5.2.pc
 %%PORTDOCS%%%%DOCSDIR%%/contents.html
 %%PORTDOCS%%%%DOCSDIR%%/logo.gif
 %%PORTDOCS%%%%DOCSDIR%%/lua.css
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307240118.r6O1IhDe001471>