From mboxrd@z Thu Jan 1 00:00:00 1970 From: lemonnierk@ulrar.net Subject: Re: gnu: Have lua-5.1 compile a .so Date: Thu, 11 Sep 2014 10:12:59 +0200 Message-ID: <20140911081259.GH31169@luwin.ulrar.net> References: <20140910223135.GF31169@luwin.ulrar.net> <87r3ziwpof.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Q6STzHxy03qt/hK9" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XRzVA-0007vF-27 for guix-devel@gnu.org; Thu, 11 Sep 2014 04:13:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XRzV1-0002Sv-7d for guix-devel@gnu.org; Thu, 11 Sep 2014 04:13:12 -0400 Content-Disposition: inline In-Reply-To: <87r3ziwpof.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?iso-8859-1?Q?Court=E8s?= Cc: guix-devel@gnu.org --Q6STzHxy03qt/hK9 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, According to someone on stackoverflow, "The lua team does not include suppo= rt for shared libraries by default because doing so in a portable manner is not si= mple." http://stackoverflow.com/questions/20848275/compiling-lua-create-so-files But I believe all distributions have some kind of way of getting that .so. Here is the patch : =46rom 81f659884cf02d0d63846b45be5f93d794a9e092 Mon Sep 17 00:00:00 2001 =46rom: Kevin Lemonnier Date: Thu, 11 Sep 2014 03:12:39 +0200 Subject: [PATCH] gnu: Have lua-5.1 compile a .so * gnu/packages/patches/lua51-liblua-so.patch: New file * gnu/packages/lua.scm: Use of lua51-liblua-so.patch in lua-5.1 --- gnu/packages/lua.scm | 3 +- gnu/packages/patches/lua51-liblua-so.patch | 65 ++++++++++++++++++++++++++= ++++ 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/lua51-liblua-so.patch diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index a85c120..92ffc22 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -75,7 +75,8 @@ for configuration, scripting, and rapid prototyping.") (uri (string-append "http://www.lua.org/ftp/lua-" version ".tar.gz")) (sha256 - (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh1= 6")))))) + (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh1= 6")) + (patches (list (search-patch "lua51-liblua-so.patch"))))))) =20 (define-public luajit (package diff --git a/gnu/packages/patches/lua51-liblua-so.patch b/gnu/packages/patc= hes/lua51-liblua-so.patch new file mode 100644 index 0000000..4442858 --- /dev/null +++ b/gnu/packages/patches/lua51-liblua-so.patch @@ -0,0 +1,65 @@ + +Patch the two Makefile to also create liblua.so +Original patch by Allan McRae +for Archlinux + + +diff -ruN lua-5.1.5/Makefile lua-5.1.5-new/Makefile +--- lua-5.1.5/Makefile 2012-02-10 10:50:23.000000000 +0100 ++++ lua-5.1.5-new/Makefile 2014-09-10 20:17:28.913951433 +0200 +@@ -43,7 +43,7 @@ + # What to install. + TO_BIN=3D lua luac + TO_INC=3D lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp +-TO_LIB=3D liblua.a ++TO_LIB=3D liblua.a liblua.so liblua.so.${V} + TO_MAN=3D lua.1 luac.1 +=20 + # Lua version and release. +@@ -53,7 +53,7 @@ + all: $(PLAT) +=20 + $(PLATS) clean: +- cd src && $(MAKE) $@ ++ cd src && $(MAKE) $@ V=3D$(V) R=3D$(R) +=20 + test: dummy + src/lua test/hello.lua +diff -ruN lua-5.1.5/src/Makefile lua-5.1.5-new/src/Makefile +--- lua-5.1.5/src/Makefile 2012-02-13 21:41:22.000000000 +0100 ++++ lua-5.1.5-new/src/Makefile 2014-09-10 20:16:09.982952152 +0200 +@@ -8,7 +8,7 @@ + PLAT=3D none +=20 + CC=3D gcc +-CFLAGS=3D -O2 -Wall $(MYCFLAGS) ++CFLAGS=3D -O2 -Wall $(MYCFLAGS) -fPIC + AR=3D ar rcu + RANLIB=3D ranlib + RM=3D rm -f +@@ -34,9 +34,10 @@ +=20 + LUAC_T=3D luac + LUAC_O=3D luac.o print.o ++LUA_SO=3D liblua.so +=20 + ALL_O=3D $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) +-ALL_T=3D $(LUA_A) $(LUA_T) $(LUAC_T) ++ALL_T=3D $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) + ALL_A=3D $(LUA_A) +=20 + default: $(PLAT) +@@ -57,6 +58,13 @@ + $(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) +=20 ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFL= AGS) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO) ++ ++ ++ + clean: + $(RM) $(ALL_T) $(ALL_O) +=20 --=20 1.8.4 On Thu, Sep 11, 2014 at 10:02:08AM +0200, Ludovic Court=C3=A8s wrote: > Hello! >=20 > lemonnierk@ulrar.net skribis: >=20 > > While working on getting weechat to build with the lua plugin enabled, > > I noticed the lua package doesn't produce a liblua.so file. So here is > > a patch to make it do so. It's basically the same patch as in ArchLinux, > > with a few differences like actually installing the .so file. >=20 > I think the comments of Eric and Cyril need to be addressed. >=20 > Other than that, I=E2=80=99m wondering: is there a reason why upstream Lua > doesn=E2=80=99t install a shared library by default? Is it because the n= ormal > way to use it is to include the source in the package that uses it? >=20 > IOW, is it OK to diverge from upstream? >=20 > If in doubt, it=E2=80=99s probably fine, IMO, but I just wanted to make s= ure. >=20 > Thanks, > Ludo=E2=80=99. --=20 Kevin Lemonnier PGP Fingerprint : C123 47CA 9E64 FCF0 3907 --Q6STzHxy03qt/hK9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUEVmLAAoJEEfKnmT88DkHuyUP/jnpixrTZD9JdE8MmR29/XnA LsURVT58e+4JSRqLoiCshknKHD1WqLCY4mrMMcVEpB5FEZpDWezp8J6/ni8BbCPT +8AbBH/88f7IrK+EiYG4bornjdn7po70wcdbF3uJNdso7hw5laZdAxcsh31smbLH iocqmHDW3JoIdhxna7SZFnW1uDGwq86GIcFiRnarpdZWNY7AmMaWj9GRg0+lkgJx FfBnZFIXzjvZMPDD2GH8thHSYM5dKiFWMBai4NZYpYEk9y5BVQNZbfoXRigKaBEG 8BiHlnGiVazPBMuEC5jGGQIRWXrvcw3q1HnR/33NIXs+efN0S+Rk4cCwg91f/esJ ziU12XfcrdnwgaZ2hZJ58roptOwqLNjtgQdvcMpNVar1Eug5ODrXNLukvM10uXTg LEDnlCujne1OXi2dkDLQ2SYl9geUc69SwUuGSETuJ4HlfU7HwM0xukgBLJM9AOAy vYbB5GrCjfRm9x4I2kbeJbgOz1iZrYl95C+EHwOzlYLVt3cx/rkl9HGOj5hZzjGk zfqpF80YlzZu2itOmN7imtdkP6PxXqSrmn99tVRazogKsuvxTvnbt325h1Jl2reb NuBdIGwvB/mDA7HmrBAw98Q1SSwUb4p5C7wIU3MwC8UYOALah6QwQVnVKfqF6+Qq xRliN/Hk2s4OXBEBdjQo =CZgC -----END PGP SIGNATURE----- --Q6STzHxy03qt/hK9--