* [v2 0/3] Lua shared library patch round-up @ 2015-12-14 6:57 Leo Famulari 2015-12-14 6:57 ` [v2 1/3] gnu: lua-5.2: Rewrite make flags Leo Famulari ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Leo Famulari @ 2015-12-14 6:57 UTC (permalink / raw) To: guix-devel These are "refreshed" versions of the unmerged Lua shared library patches from the series I submitted in November. As requested, I have moved the explanation of patch 1/3 from the commit message into a code comment. [0] Patch 2/3 is the same except that it integrates the code comment added in 1/3. Patch 3/3 is the same as before. The patches have been rebased and built on current git master. [0] https://lists.gnu.org/archive/html/guix-devel/2015-11/msg00222.html Leo Famulari (3): gnu: lua-5.2: Rewrite make flags. gnu: lua-5.2: Use make-flags and modify-phases. gnu: lua-5.1: Build with dynamic library support and a dynamic library. gnu/packages/lua.scm | 43 +++++++++++++++--------- gnu/packages/patches/lua51-liblua-so.patch | 53 +++++++++++++++++++----------- 2 files changed, 61 insertions(+), 35 deletions(-) -- 2.6.2 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [v2 1/3] gnu: lua-5.2: Rewrite make flags. 2015-12-14 6:57 [v2 0/3] Lua shared library patch round-up Leo Famulari @ 2015-12-14 6:57 ` Leo Famulari 2015-12-14 6:57 ` [v2 2/3] gnu: lua-5.2: Use make-flags and modify-phases Leo Famulari 2015-12-14 6:57 ` [v2 3/3] gnu: lua-5.1: Build with dynamic library support and a dynamic library Leo Famulari 2 siblings, 0 replies; 4+ messages in thread From: Leo Famulari @ 2015-12-14 6:57 UTC (permalink / raw) To: guix-devel * gnu/packages/lua.scm (lua-5.2)[arguments]: Rewrite make flags. --- gnu/packages/lua.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index d27c024..ace2c01 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2014 Raimon Grau <raimonster@gmail.com> ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr> +;;; Copyright © 2015 Leo Famulari <leo@famulari.name> ;;; ;;; This file is part of GNU Guix. ;;; @@ -48,7 +49,14 @@ #:test-target "test" #:phases (alist-replace 'build - (lambda _ (zero? (system* "make" "CFLAGS=-fPIC" "linux"))) + ;; We use $PLAT to select the platform-dependent method + ;; for loading shared libraries. We also build the Lua + ;; interpreter and shared library as position + ;; independent code. + (lambda _ (zero? (system* "make" + "PLAT=linux" + "MYCFLAGS=-fPIC" + "MYLDFLAGS=-fPIC"))) (alist-replace 'install (lambda* (#:key outputs #:allow-other-keys) -- 2.6.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [v2 2/3] gnu: lua-5.2: Use make-flags and modify-phases. 2015-12-14 6:57 [v2 0/3] Lua shared library patch round-up Leo Famulari 2015-12-14 6:57 ` [v2 1/3] gnu: lua-5.2: Rewrite make flags Leo Famulari @ 2015-12-14 6:57 ` Leo Famulari 2015-12-14 6:57 ` [v2 3/3] gnu: lua-5.1: Build with dynamic library support and a dynamic library Leo Famulari 2 siblings, 0 replies; 4+ messages in thread From: Leo Famulari @ 2015-12-14 6:57 UTC (permalink / raw) To: guix-devel * gnu/packages/lua.scm (lua-5.2)[arguments]: Use make-flags and modify-phases to control build process, replacing use of 'alist-' procedures. --- gnu/packages/lua.scm | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/gnu/packages/lua.scm b/gnu/packages/lua.scm index ace2c01..3a3de62 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -43,29 +43,20 @@ (build-system gnu-build-system) (inputs `(("readline", readline))) (arguments - '(#:modules ((guix build gnu-build-system) - (guix build utils) - (srfi srfi-1)) + '(#:phases (modify-phases %standard-phases + (delete 'configure)) #:test-target "test" - #:phases (alist-replace - 'build - ;; We use $PLAT to select the platform-dependent method - ;; for loading shared libraries. We also build the Lua - ;; interpreter and shared library as position - ;; independent code. - (lambda _ (zero? (system* "make" - "PLAT=linux" - "MYCFLAGS=-fPIC" - "MYLDFLAGS=-fPIC"))) - (alist-replace - 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (zero? (system* "make" "install" - (string-append "INSTALL_TOP=" out) - (string-append "INSTALL_MAN=" out - "/share/man/man1"))))) - (alist-delete 'configure %standard-phases))))) + ;; We use $PLAT to select the platform-dependent method + ;; for loading shared libraries. We also build the Lua + ;; interpreter and shared library as position + ;; independent code. + #:make-flags (list "PLAT= linux" + "MYCFLAGS= -fPIC" + "MYLDFLAGS= -fPIC" + (string-append "INSTALL_TOP= " + (assoc-ref %outputs "out")) + (string-append "INSTALL_MAN= " + (assoc-ref %outputs "out"))))) (home-page "http://www.lua.org/") (synopsis "Embeddable scripting language") (description -- 2.6.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [v2 3/3] gnu: lua-5.1: Build with dynamic library support and a dynamic library. 2015-12-14 6:57 [v2 0/3] Lua shared library patch round-up Leo Famulari 2015-12-14 6:57 ` [v2 1/3] gnu: lua-5.2: Rewrite make flags Leo Famulari 2015-12-14 6:57 ` [v2 2/3] gnu: lua-5.2: Use make-flags and modify-phases Leo Famulari @ 2015-12-14 6:57 ` Leo Famulari 2 siblings, 0 replies; 4+ messages in thread From: Leo Famulari @ 2015-12-14 6:57 UTC (permalink / raw) To: guix-devel * 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 3a3de62..b94d4c0 100644 --- a/gnu/packages/lua.scm +++ b/gnu/packages/lua.scm @@ -77,7 +77,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 <leo@famulari.name> +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 <allan@archlinux.org> 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.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-12-14 6:57 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-12-14 6:57 [v2 0/3] Lua shared library patch round-up Leo Famulari 2015-12-14 6:57 ` [v2 1/3] gnu: lua-5.2: Rewrite make flags Leo Famulari 2015-12-14 6:57 ` [v2 2/3] gnu: lua-5.2: Use make-flags and modify-phases Leo Famulari 2015-12-14 6:57 ` [v2 3/3] gnu: lua-5.1: Build with dynamic library support and a dynamic library Leo Famulari
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/guix.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.