From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: [PATCH 0/5] Lua: enable shared library loading, build liblua.so Date: Mon, 2 Nov 2015 12:46:39 -0500 Message-ID: Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39699) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtJC4-00069V-2u 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-0003Zk-Qs for guix-devel@gnu.org; Mon, 02 Nov 2015 12:46:55 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:58928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZtJC0-0003Xw-KO 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 3A5D66800C2 for ; Mon, 2 Nov 2015 12:46:49 -0500 (EST) 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 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