Bug 126659

Summary: [patch] lang/tolua++: build shared library
Product: Ports & Packages Reporter: tim
Component: Individual Port(s)Assignee: Dmitry Marakasov <amdmi3>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description tim 2008-08-19 16:00:11 UTC
The tolua++ port only builds the static library. With a trivial patch the shared library is built as well.

Fix: Attached patch causes the shared library to be built *additionally* to the static library (put into files/patch-makeso). Additionally required patches for installation:

--- Makefile~	2008-08-11 00:42:41.000000000 +0200
+++ Makefile	2008-08-19 16:41:03.000000000 +0200
@@ -31,5 +31,6 @@
 	${LN} -sf ${LUA_SUBDIR}/tolua++ ${PREFIX}/bin/tolua++-${LUA_VER}
 	${INSTALL_DATA} ${WRKSRC}/include/tolua++.h ${LUA_INCDIR}
 	${INSTALL_DATA} ${WRKSRC}/lib/libtolua++.a ${LUA_LIBDIR}
+	${INSTALL_DATA} ${WRKSRC}/lib/libtolua++.so ${LUA_LIBDIR}
 
 .include <bsd.port.mk>

--- pkg-plist~	2008-08-11 00:42:41.000000000 +0200
+++ pkg-plist	2008-08-19 16:40:50.000000000 +0200
@@ -1,4 +1,5 @@
 %%LUA_BINDIR%%/tolua++
 bin/tolua++-%%LUA_VER%%
 %%LUA_LIBDIR%%/libtolua++.a
+%%LUA_LIBDIR%%/libtolua++.so
 %%LUA_INCDIR%%/tolua++.h


Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-08-19 16:00:22 UTC
Responsible Changed
From-To: freebsd-ports-bugs->amdmi3

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dmitry Marakasov 2008-08-19 16:44:27 UTC
> Synopsis: [patch] lang/tolua++: build shared library

Is shared lib really needed?
- Shared lib is unsupported upstream
- Shared lib without version (.so instead of .so.0) may cause
  updating problems if ABI is changed.
- Building shared lib for tolua++ breaks consistency with tolua
  (which is pretty similar port and only install static lib as well),
  also I'll have to resend my patch to add tolua++ support to
  bsd.lua.mk. Yep, this is not actually an argument.

Static lib works pretty good and has a very small footprint. But
if there're good reasons for the shared lib, I'll commit this.

-- 
Dmitry Marakasov   .   55B5 0596 FF1E 8D84 5F56  9510 D35A 80DD F9D2 F77D
amdmi3@amdmi3.ru  ..:  jabber: amdmi3@jabber.ru    http://www.amdmi3.ru
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2008-08-19 21:40:45 UTC
State Changed
From-To: open->closed

Committed. Thanks!
Comment 4 tim 2008-08-20 01:12:34 UTC
Dmitry Marakasov schrieb:
>> Synopsis: [patch] lang/tolua++: build shared library
> 
> Is shared lib really needed?
> - Shared lib is unsupported upstream

I've tried to communicate with upstream but not response in months :-/
So basically the whole things seems unsupported.

> - Shared lib without version (.so instead of .so.0) may cause
>   updating problems if ABI is changed.

I think this could be added without too many problems. On Fedora we have
tolua++-$(LUA_VERSION).so.

> - Building shared lib for tolua++ breaks consistency with tolua
>   (which is pretty similar port and only install static lib as well),
>   also I'll have to resend my patch to add tolua++ support to
>   bsd.lua.mk. Yep, this is not actually an argument.

I think the better option would be to try to push it there as well then.

> Static lib works pretty good and has a very small footprint. But
> if there're good reasons for the shared lib, I'll commit this.

I'm heavily using tolua++ in our robot software and several
sub-libraries and plugins use it. If they all now have to link
statically against tolua++ it sums up, especially on an embedded
system... Having a shared library would be better in that regard.

I'm the package maintainer for tolua++ in Fedora and we've made no
negative experience with adding this patch (Fedora CVS is currently
down, once it's back you can see the spec and patches at
http://cvs.fedoraproject.org/viewcvs/rpms/tolua++/F-9). I think we gain
a useful feature at minimum cost and risk.

Regards from Aachen.
	Tim

-- 
    Tim Niemueller <tim@niemueller.de>      www.niemueller.de
=================================================================
 Imagination is more important than knowledge. (Albert Einstein)