From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: [PATCH 5/5] gnu: Build lua-5.1 with dynamic library support and a dynamic library. Date: Mon, 2 Nov 2015 12:46:44 -0500 Message-ID: References: Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39702) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtJC4-00069W-3K for guix-devel@gnu.org; Mon, 02 Nov 2015 12:46:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZtJC0-0003a8-Vk for guix-devel@gnu.org; Mon, 02 Nov 2015 12:46:55 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:48198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtJC0-0003Zb-RC for guix-devel@gnu.org; Mon, 02 Nov 2015 12:46:52 -0500 Received: from jasmine.lan (c-69-249-5-231.hsd1.pa.comcast.net [69.249.5.231]) by mail.messagingengine.com (Postfix) with ESMTPA id D79E56801A3 for ; Mon, 2 Nov 2015 12:46:49 -0500 (EST) In-Reply-To: In-Reply-To: References: 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: guix-devel@gnu.org * gnu/packages/lua.scm (lua-5.1)[arguments]: Rewrite make-flags so that Lua is built with platform-specific instructions for shared library loading (dlopen). * gnu/packages/patches/lua51-liblua-so.patch: Install liblua.so with execute bit set. Move "-fPIC" flag from patch to package definition. --- gnu/packages/lua.scm | 14 +++++++- gnu/packages/patches/lua51-liblua-so.patch | 53 +++++++++++++++++++----------- 2 files changed, 47 insertions(+), 20 deletions(-) diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index 1f58751..3f45b33 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -73,7 +73,19 @@ for configuration, scripting, and rapid prototyping.") version ".tar.gz")) (sha256 (base32 "0cskd4w0g6rdm2q8q3i4n1h3j8kylhs3rq8mxwl9vwlmlxbgqh16")) - (patches (list (search-patch "lua51-liblua-so.patch"))))))) + (patches (list (search-patch "lua51-liblua-so.patch"))))) + (arguments + '(#:phases (modify-phases %standard-phases + (delete 'configure)) + #:test-target "test" + #:make-flags (list "PLAT= linux" + "CFLAGS= -O2 -Wall -fPIC $(MYCFLAGS)" + "MYLDFLAGS= -fPIC" + (string-append "INSTALL_TOP= " + (assoc-ref %outputs "out")) + (string-append "INSTALL_MAN= " + (assoc-ref %outputs "out") + "/share/man/man1")))))) (define-public luajit (package diff --git a/gnu/packages/patches/lua51-liblua-so.patch b/gnu/packages/patches/lua51-liblua-so.patch index 6795f10..6b029de 100644 --- a/gnu/packages/patches/lua51-liblua-so.patch +++ b/gnu/packages/patches/lua51-liblua-so.patch @@ -1,13 +1,24 @@ +From 115e612016fe615e6c895af8df7db646114a9860 Mon Sep 17 00:00:00 2001 +From: Leo Famulari +Date: Mon, 2 Nov 2015 03:29:47 -0500 +Subject: [PATCH] lua-5.1: Changes to Makefile patches + +Install liblua.so with execute bit. +Don't set -fPIC from here. It will be set in the make flags. Patch the two Makefile to also create liblua.so Original patch by Allan McRae for Archlinux +--- + Makefile | 6 +++--- + src/Makefile | 10 +++++++++- + 2 files changed, 12 insertions(+), 4 deletions(-) - -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 @@ +diff --git a/Makefile b/Makefile +index 209a132..653dbed 100644 +--- a/Makefile ++++ b/Makefile +@@ -43,7 +43,7 @@ PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris # What to install. TO_BIN= lua luac TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp @@ -16,7 +27,7 @@ diff -ruN lua-5.1.5/Makefile lua-5.1.5-new/Makefile TO_MAN= lua.1 luac.1 # Lua version and release. -@@ -53,7 +53,7 @@ +@@ -53,7 +53,7 @@ R= 5.1.5 all: $(PLAT) $(PLATS) clean: @@ -25,19 +36,20 @@ diff -ruN lua-5.1.5/Makefile lua-5.1.5-new/Makefile 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= none +@@ -62,7 +62,7 @@ install: dummy + cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) + cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) + cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) +- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) ++ cd src && $(INSTALL_EXEC) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) - CC= gcc --CFLAGS= -O2 -Wall $(MYCFLAGS) -+CFLAGS= -O2 -Wall $(MYCFLAGS) -fPIC - AR= ar rcu - RANLIB= ranlib - RM= rm -f -@@ -34,9 +34,10 @@ + ranlib: +diff --git a/src/Makefile b/src/Makefile +index e0d4c9f..ebc17e9 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -34,9 +34,10 @@ LUA_O= lua.o LUAC_T= luac LUAC_O= luac.o print.o @@ -49,7 +61,7 @@ diff -ruN lua-5.1.5/src/Makefile lua-5.1.5-new/src/Makefile ALL_A= $(LUA_A) default: $(PLAT) -@@ -57,6 +58,13 @@ +@@ -57,6 +58,13 @@ $(LUA_T): $(LUA_O) $(LUA_A) $(LUAC_T): $(LUAC_O) $(LUA_A) $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) @@ -63,3 +75,6 @@ diff -ruN lua-5.1.5/src/Makefile lua-5.1.5-new/src/Makefile clean: $(RM) $(ALL_T) $(ALL_O) +-- +2.6.1 + -- 2.6.1