guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/5] Lua: enable shared library loading, build liblua.so


From: Leo Famulari
Subject: [PATCH 0/5] Lua: enable shared library loading, build liblua.so
Date: Mon, 2 Nov 2015 12:46:39 -0500

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]