Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 02/24] lua: refactor install steps
Date: Tue, 25 Feb 2014 18:39:50 +0100	[thread overview]
Message-ID: <530CD566.7090305@mind.be> (raw)
In-Reply-To: <1393227301-14874-3-git-send-email-francois.perrad@gadz.org>

On 24/02/14 08:34, Francois Perrad wrote:
> since the commit (lua*: restore version in module paths),

 If you refer to a commit, please use its abbreviated sha.

> the upstream Makefiles are usable for install.
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/lua/5.1.5/lua-02-shared-libs-for-lua.patch |   22 ++++++++++++++
>  package/lua/5.2.3/lua-02-shared-libs-for-lua.patch |   22 ++++++++++++++
>  package/lua/lua.mk                                 |   30 ++------------------
>  3 files changed, 47 insertions(+), 27 deletions(-)
> 
> diff --git a/package/lua/5.1.5/lua-02-shared-libs-for-lua.patch b/package/lua/5.1.5/lua-02-shared-libs-for-lua.patch
> index 97a7068..1227cbd 100644
> --- a/package/lua/5.1.5/lua-02-shared-libs-for-lua.patch
> +++ b/package/lua/5.1.5/lua-02-shared-libs-for-lua.patch
> @@ -1,8 +1,30 @@
>  Add the compilation of a shared library.
>  Compile the lua binary with the shared library.
> +And install the shared library.
>  
>  Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>  
> +Index: b/Makefile
> +===================================================================
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -43,7 +43,7 @@
> + # What to install.
> + TO_BIN= lua luac
> + TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
> +-TO_LIB= liblua.a
> ++TO_LIB= liblua.a liblua.so.$(R)

 I think it's more appropriate to make a separate TO_SOLIB.

> + TO_MAN= lua.1 luac.1
> + 
> + # Lua version and release.
> +@@ -63,6 +63,7 @@
> + 	cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
> + 	cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
> + 	cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)

 Shouldn't this be INSTALL_EXEC for the .so?

> ++	cd $(INSTALL_LIB) && ln -sf liblua.so.$(R) liblua.so

 Seems more appropriate to me to do
	ln -sf $(TO_SOLIB) $(INSTALL_LIB)/liblua.so



 Not related to this patch, but it seems to me that the .so is built and
installed unconditionally, even on BR2_PREFER_STATIC and BINFMT_FLAT. How
can this even work?


 Regards,
 Arnout

> + 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
> + 
> + ranlib:
>  Index: b/src/Makefile
>  ===================================================================
>  --- a/src/Makefile
> diff --git a/package/lua/5.2.3/lua-02-shared-libs-for-lua.patch b/package/lua/5.2.3/lua-02-shared-libs-for-lua.patch
> index 4679325..9321c62 100644
> --- a/package/lua/5.2.3/lua-02-shared-libs-for-lua.patch
> +++ b/package/lua/5.2.3/lua-02-shared-libs-for-lua.patch
> @@ -1,8 +1,30 @@
>  Add the compilation of a shared library.
>  Compile the lua binary with the shared library.
> +And install the shared library.
>  
>  Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>  
> +Index: b/Makefile
> +===================================================================
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -41,7 +41,7 @@
> + # What to install.
> + TO_BIN= lua luac
> + TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
> +-TO_LIB= liblua.a
> ++TO_LIB= liblua.a liblua.so.$(R)
> + TO_MAN= lua.1 luac.1
> + 
> + # Lua version and release.
> +@@ -62,6 +62,7 @@
> + 	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 $(INSTALL_LIB) && ln -sf liblua.so.$(R) liblua.so
> + 	cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
> + 
> + uninstall:
>  Index: b/src/Makefile
>  ===================================================================
>  --- a/src/Makefile
> diff --git a/package/lua/lua.mk b/package/lua/lua.mk
> index a20531c..c016d7e 100644
> --- a/package/lua/lua.mk
> +++ b/package/lua/lua.mk
> @@ -65,43 +65,19 @@ define HOST_LUA_BUILD_CMDS
>  endef
>  
>  define LUA_INSTALL_STAGING_CMDS
> +	$(MAKE) INSTALL_TOP="$(STAGING_DIR)/usr" -C $(@D) install
>  	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
>  		$(STAGING_DIR)/usr/lib/pkgconfig/lua.pc
> -	$(INSTALL) -m 0755 -D $(@D)/src/lua $(STAGING_DIR)/usr/bin/lua
> -	$(INSTALL) -m 0755 -D $(@D)/src/luac $(STAGING_DIR)/usr/bin/luac
> -	$(INSTALL) -m 0755 -D $(@D)/src/liblua.so.$(LUA_VERSION) \
> -		$(STAGING_DIR)/usr/lib/liblua.so.$(LUA_VERSION)
> -	ln -sf liblua.so.$(LUA_VERSION) $(STAGING_DIR)/usr/lib/liblua.so
> -	$(INSTALL) -m 0644 -D $(@D)/src/liblua.a $(STAGING_DIR)/usr/lib/liblua.a
> -	$(INSTALL) -m 0644 -D $(@D)/src/lua.h $(STAGING_DIR)/usr/include/lua.h
> -	$(INSTALL) -m 0644 -D $(@D)/src/luaconf.h $(STAGING_DIR)/usr/include/luaconf.h
> -	$(INSTALL) -m 0644 -D $(@D)/src/lualib.h $(STAGING_DIR)/usr/include/lualib.h
> -	$(INSTALL) -m 0644 -D $(@D)/src/lauxlib.h $(STAGING_DIR)/usr/include/lauxlib.h
>  endef
>  
>  define LUA_INSTALL_TARGET_CMDS
> -	$(INSTALL) -m 0755 -D $(@D)/src/lua $(TARGET_DIR)/usr/bin/lua
> -	$(INSTALL) -m 0755 -D $(@D)/src/luac $(TARGET_DIR)/usr/bin/luac
> -	$(INSTALL) -m 0755 -D $(@D)/src/liblua.so.$(LUA_VERSION) \
> -		$(TARGET_DIR)/usr/lib/liblua.so.$(LUA_VERSION)
> -	ln -sf liblua.so.$(LUA_VERSION) $(TARGET_DIR)/usr/lib/liblua.so
> -	mkdir -p $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)
> -	mkdir -p $(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)
> +	$(MAKE) INSTALL_TOP="$(TARGET_DIR)/usr" -C $(@D) install
>  endef
>  
>  define HOST_LUA_INSTALL_CMDS
> -	$(INSTALL) -m 0755 -D $(@D)/src/lua $(HOST_DIR)/usr/bin/lua
> -	$(INSTALL) -m 0755 -D $(@D)/src/luac $(HOST_DIR)/usr/bin/luac
> -	$(INSTALL) -m 0755 -D $(@D)/src/liblua.so.$(LUA_VERSION) \
> -		$(HOST_DIR)/usr/lib/liblua.so.$(LUA_VERSION)
> -	ln -sf liblua.so.$(LUA_VERSION) $(HOST_DIR)/usr/lib/liblua.so
> -	$(INSTALL) -m 0644 -D $(@D)/src/liblua.a $(HOST_DIR)/usr/lib/liblua.a
> +	$(MAKE) INSTALL_TOP="$(HOST_DIR)/usr" -C $(@D) install
>  	$(INSTALL) -m 0644 -D $(@D)/etc/lua.pc \
>  		$(HOST_DIR)/usr/lib/pkgconfig/lua.pc
> -	$(INSTALL) -m 0644 -D $(@D)/src/lua.h $(HOST_DIR)/usr/include/lua.h
> -	$(INSTALL) -m 0644 -D $(@D)/src/luaconf.h $(HOST_DIR)/usr/include/luaconf.h
> -	$(INSTALL) -m 0644 -D $(@D)/src/lualib.h $(HOST_DIR)/usr/include/lualib.h
> -	$(INSTALL) -m 0644 -D $(@D)/src/lauxlib.h $(HOST_DIR)/usr/include/lauxlib.h
>  endef
>  
>  $(eval $(generic-package))
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  reply	other threads:[~2014-02-25 17:39 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-24  7:34 [Buildroot] [PATCH 00/24] lua Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 01/24] lua: remove LUA_INSTALLED_FILES Francois Perrad
2014-02-24 19:44   ` Arnout Vandecappelle
2014-02-24  7:34 ` [Buildroot] [PATCH 02/24] lua: refactor install steps Francois Perrad
2014-02-25 17:39   ` Arnout Vandecappelle [this message]
2014-02-25 20:30     ` Arnout Vandecappelle
2014-02-25 21:07     ` François Perrad
2014-02-25 21:38       ` Arnout Vandecappelle
2014-02-24  7:34 ` [Buildroot] [PATCH 03/24] luarocks: never wraps script Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 04/24] luajit: refactor without dont-strip.patch Francois Perrad
2014-02-27  6:39   ` Arnout Vandecappelle
2014-02-24  7:34 ` [Buildroot] [PATCH 05/24] luajit: refactor without shared-lib.patch Francois Perrad
2014-02-27  6:40   ` Arnout Vandecappelle
2014-02-27  9:05   ` Samuel Martin
2014-02-28  8:22     ` François Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 06/24] luajit: add host-luajit Francois Perrad
2014-02-27  6:44   ` Arnout Vandecappelle
2014-02-24  7:34 ` [Buildroot] [PATCH 07/24] luarocks: allow to work with host-luajit Francois Perrad
2014-02-27  7:02   ` Arnout Vandecappelle
2014-02-24  7:34 ` [Buildroot] [PATCH 08/24] ljlinenoise: new package Francois Perrad
2014-02-27  7:04   ` Arnout Vandecappelle
2014-02-24  7:34 ` [Buildroot] [PATCH 09/24] lpeg: " Francois Perrad
2014-02-27  7:08   ` Arnout Vandecappelle
2014-03-01 14:40   ` Thomas Petazzoni
2014-02-24  7:34 ` [Buildroot] [PATCH 10/24] cosmo: " Francois Perrad
2014-02-27  7:08   ` Arnout Vandecappelle
2014-03-01 14:42   ` Thomas Petazzoni
2014-02-24  7:34 ` [Buildroot] [PATCH 11/24] lua-iconv: " Francois Perrad
2014-02-27  7:16   ` Arnout Vandecappelle
2014-03-01 15:58     ` François Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 12/24] luajson: " Francois Perrad
2014-02-27  7:18   ` Arnout Vandecappelle
2014-03-01 15:06   ` Thomas Petazzoni
2014-02-24  7:34 ` [Buildroot] [PATCH 13/24] lualogging: " Francois Perrad
2014-03-01 15:10   ` Thomas Petazzoni
2014-02-24  7:34 ` [Buildroot] [PATCH 14/24] dado: " Francois Perrad
2014-03-01 15:12   ` Thomas Petazzoni
2014-02-24  7:34 ` [Buildroot] [PATCH 15/24] lrandom: " Francois Perrad
2014-03-01 15:15   ` Thomas Petazzoni
2014-02-24  7:34 ` [Buildroot] [PATCH 16/24] lua-testmore: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 17/24] lua-coat: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 18/24] lua-coatpersistent: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 19/24] lua-messagepack: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 20/24] lua-csnappy: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 21/24] lzlib: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 22/24] lunit: " Francois Perrad
2014-02-24  7:34 ` [Buildroot] [PATCH 23/24] lpty: " Francois Perrad
2014-02-24  7:35 ` [Buildroot] [PATCH 24/24] lsqlite3: " Francois Perrad
2014-03-01 15:09 ` [Buildroot] [PATCH 00/24] lua Thomas Petazzoni
2014-03-01 15:34   ` François Perrad
2014-03-01 15:42     ` Thomas Petazzoni
2014-03-02  7:57       ` François Perrad
2014-03-02  8:39         ` Thomas Petazzoni
2014-03-01 16:12 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530CD566.7090305@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox