all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH 0/5] Lua: enable shared library loading, build liblua.so
@ 2015-11-02 17:46 Leo Famulari
  2015-11-02 17:46 ` [PATCH 1/5] gnu: Remove tabulation from luajit Leo Famulari
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Leo Famulari @ 2015-11-02 17:46 UTC (permalink / raw)
  To: guix-devel

These patches do 4 things:
1) Build lua-5.1 and lua-5.2 so that they can load shared libraries.
2) Make the build process for lua-5.1 and lua-5.2 emit liblua.so.
3) Rewrite the build arguments to lua-5.1 and lua-5.2 for clarity.
4) Replace some tabs with spaces in the luajit package definition.

Things that still need to be done for Lua:
* Make a pkg-config .pc file for lua-5.1, or figure out if lua-5.2's can
  be re-used.
* Figure out the best way to find shared Lua libraries at runtime (nix
  uses 'makeWrapper', which I think is like 'wrap-program'. See the
  nixpkg for Prosody).

Details about changes:
1) Build lua-5.1 and lua-5.2 so that they can load shared libraries.

This involved making sure that the compiler gets some platform specific
instructions on how to load shared libraries. This wasn't happening
before.

2) Make the build process for lua-5.1 and lua-5.2 emit a working
liblua.so.

This involved adding the patch lua52-liblua-so.patch and applying it
from the lua-5.2 package definition. Lua-5.2's make-flags also had to be
altered to pass "-fPIC" to the linker.

For lua-5.1, I set the execute bit of liblua.so (it seems a convention
that Guix makes shared libraries executable). Also, I moved the
instruction that sets "-fPIC" from lua51-liblua-so.patch into the
package definition's make-flags. The lua-5.1 Makefile is not as general
as lua-5.2's and so the make-flags are a little messier.

Also, for lua-5.1, I regenerated lua51-liblua-so.patch rather than
patching the patch. A patched patch seems too difficult for humans to
understand.

3) Rewrite the build arguments to lua-5.1 and lua-5.2 to use
modify-phases and #:make-flags, which I think is much clearer than the
'alist-' procedures.

For lua-5.2, this change is separated into its own commit (49aea9d). I
didn't do this for lua-5.1 (3056c20) because I needed to alter
lua-5.1-liblua-so.patch, and git wouldn't separate those "hunks"
properly. If you want me to spend more time trying to split that commit
up, I will try.

4) Replace some tabs with spaces.

Leo Famulari (5):
  gnu: Remove tabulation from luajit.
  gnu: Build lua-5.2 with dynamic library support.
  gnu: Build lua-5.2 with a dynamic library
  gnu: Use make-flags and modify-phases for lua-5.2.
  gnu: Build lua-5.1 with dynamic library support and a dynamic library.

 gnu/packages/lua.scm                       | 46 ++++++++++--------
 gnu/packages/patches/lua51-liblua-so.patch | 53 ++++++++++++--------
 gnu/packages/patches/lua52-liblua-so.patch | 78 ++++++++++++++++++++++++++++++
 3 files changed, 139 insertions(+), 38 deletions(-)
 create mode 100644 gnu/packages/patches/lua52-liblua-so.patch

-- 
2.6.1

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [PATCH 3/5] gnu: Build lua-5.2 with a dynamic library
@ 2015-11-11  0:54 Leo Famulari
  0 siblings, 0 replies; 14+ messages in thread
From: Leo Famulari @ 2015-11-11  0:54 UTC (permalink / raw)
  To: guix-devel

Forgot to send this one to the list...
To: Ludovic Courtès <ludo@gnu.org>
Subject: Re: [PATCH 3/5] gnu: Build lua-5.2 with a dynamic library
Date: Mon, 09 Nov 2015 18:46:39 -0500

> This is not optimal though because:
> 
>   1. We’re still providing liblua.a, but that archives actually contains
>      PIC code.
> 
>   2. The ‘lua’ and ‘luac’ executables are not linked against liblua.so.

Agreed. I will look into it.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-12-14  6:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-02 17:46 [PATCH 0/5] Lua: enable shared library loading, build liblua.so Leo Famulari
2015-11-02 17:46 ` [PATCH 1/5] gnu: Remove tabulation from luajit Leo Famulari
2015-11-02 17:46 ` [PATCH 2/5] gnu: Build lua-5.2 with dynamic library support Leo Famulari
2015-11-08 21:08   ` Ludovic Courtès
2015-12-14  6:23     ` Leo Famulari
2015-11-02 17:46 ` [PATCH 3/5] gnu: Build lua-5.2 with a dynamic library Leo Famulari
2015-11-08 21:12   ` Ludovic Courtès
2015-11-02 17:46 ` [PATCH 4/5] gnu: Use make-flags and modify-phases for lua-5.2 Leo Famulari
2015-12-13 16:24   ` Ludovic Courtès
2015-12-14  6:22     ` Leo Famulari
2015-11-02 17:46 ` [PATCH 5/5] gnu: Build lua-5.1 with dynamic library support and a dynamic library Leo Famulari
2015-12-13 16:27   ` Ludovic Courtès
2015-12-14  6:22     ` Leo Famulari
  -- strict thread matches above, loose matches on Subject: below --
2015-11-11  0:54 [PATCH 3/5] gnu: Build lua-5.2 with " 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.