Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [pkg-luarocks infra V4 05/10] luarocks: new package
Date: Sun, 22 Dec 2013 18:28:58 +0100	[thread overview]
Message-ID: <20131222182858.1709cbc3@skate> (raw)
In-Reply-To: <1384520859-3189-5-git-send-email-francois.perrad@gadz.org>

Dear Francois Perrad,

On Fri, 15 Nov 2013 14:07:34 +0100, Francois Perrad wrote:
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/luarocks/luarocks-build-minimal.patch |   17 ++++++++++
>  package/luarocks/luarocks-unpack.patch        |   24 ++++++++++++++

We want patches to be numbered:

 luarocks-001-<foo>.patch
 luarocks-002-<bar>.patch

This guarantees that they are applied in the right order.

>  package/luarocks/luarocks.mk                  |   42 +++++++++++++++++++++++++
>  3 files changed, 83 insertions(+)
>  create mode 100644 package/luarocks/luarocks-build-minimal.patch
>  create mode 100644 package/luarocks/luarocks-unpack.patch
>  create mode 100644 package/luarocks/luarocks.mk
> 
> diff --git a/package/luarocks/luarocks-build-minimal.patch b/package/luarocks/luarocks-build-minimal.patch
> new file mode 100644
> index 0000000..3a4794e
> --- /dev/null
> +++ b/package/luarocks/luarocks-build-minimal.patch
> @@ -0,0 +1,17 @@
> +hack for buildroot which needs independant steps : download, unpack, build
> +
> +Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> +
> +Index: b/src/luarocks/build.lua
> +===================================================================
> +--- a/src/luarocks/build.lua
> ++++ b/src/luarocks/build.lua
> +@@ -362,6 +362,8 @@
> + 
> +    if flags["pack-binary-rock"] then
> +       return pack.pack_binary_rock(name, version, do_build, name, version, deps.get_deps_mode(flags))
> ++   elseif flags["minimal"] then
> ++      return build_rockspec(name, false, true, "none")
> +    else
> +       local ok, err = fs.check_command_permissions(flags)
> +       if not ok then return nil, err end
> diff --git a/package/luarocks/luarocks-unpack.patch b/package/luarocks/luarocks-unpack.patch
> new file mode 100644
> index 0000000..0f036ee
> --- /dev/null
> +++ b/package/luarocks/luarocks-unpack.patch
> @@ -0,0 +1,24 @@
> +allows unpack in existing directory
> +
> +Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> +
> +Index: b/src/luarocks/unpack.lua
> +===================================================================
> +--- a/src/luarocks/unpack.lua
> ++++ b/src/luarocks/unpack.lua
> +@@ -101,11 +101,10 @@
> +       return nil, file.." does not seem to be a valid filename."
> +    end
> +    
> +-   if (fs.exists(dir_name)) then
> +-      return nil, "Directory "..dir_name.." already exists."
> ++   if not fs.exists(dir_name) then
> ++      local ok, err = fs.make_dir(dir_name)
> ++      if not ok then return nil, err end
> +    end
> +-   local ok, err = fs.make_dir(dir_name)
> +-   if not ok then return nil, err end
> +    local rollback = util.schedule_function(fs.delete, fs.absolute_name(dir_name))
> + 
> +    local rockspec, err
> +

Any chance these patches make it their way upstream?

> diff --git a/package/luarocks/luarocks.mk b/package/luarocks/luarocks.mk
> new file mode 100644
> index 0000000..d996ccc
> --- /dev/null
> +++ b/package/luarocks/luarocks.mk
> @@ -0,0 +1,42 @@
> +################################################################################
> +#
> +# luarocks
> +#
> +################################################################################
> +
> +LUAROCKS_VERSION = 2.1.1
> +LUAROCKS_SITE = http://luarocks.org/releases/
> +LUAROCKS_LICENSE = MIT
> +LUAROCKS_LICENSE_FILES = COPYING
> +
> +HOST_LUAROCKS_DEPENDENCIES = host-lua luainterpreter
> +
> +LUAROCKS_CONFIG_DIR  = $(HOST_DIR)/usr/etc/luarocks
> +LUAROCKS_CONFIG_FILE = $(LUAROCKS_CONFIG_DIR)/config-5.1.lua
> +
> +define HOST_LUAROCKS_CONFIGURE_CMDS
> +	cd $(@D) && ./configure \
> +		--prefix=$(TARGET_DIR)/usr \
> +		--sysconfdir=$(LUAROCKS_CONFIG_DIR) \
> +		--with-lua=$(HOST_DIR)/usr \
> +		--with-lua-include=$(STAGING_DIR)/usr/include \
> +		--with-lua-lib=$(STAGING_DIR)/usr/lib
> +	@echo "$(@D)/config.unix generated"

This echo is probably not needed.

> +endef
> +
> +define HOST_LUAROCKS_INSTALL_CMDS
> +	$(MAKE1) -C $(@D) install \
> +		PREFIX=$(HOST_DIR)/usr
> +	echo "-- BR cross-compilation"                          >> $(LUAROCKS_CONFIG_FILE)
> +	echo "variables = {"                                    >> $(LUAROCKS_CONFIG_FILE)
> +	echo "   CC = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
> +	echo "   LD = [[$(TARGET_CC)]],"                        >> $(LUAROCKS_CONFIG_FILE)
> +	echo "   CFLAGS = [[$(TARGET_CFLAGS)]],"                >> $(LUAROCKS_CONFIG_FILE)
> +	echo "   LIBFLAG = [[-shared $(TARGET_LDFLAGS)]],"      >> $(LUAROCKS_CONFIG_FILE)
> +	echo "}"                                                >> $(LUAROCKS_CONFIG_FILE)
> +	echo "external_deps_dirs = { [[$(STAGING_DIR)/usr]] }"  >> $(LUAROCKS_CONFIG_FILE)
> +	echo "gcc_rpath = false"                                >> $(LUAROCKS_CONFIG_FILE)
> +endef
> +
> +$(eval $(host-generic-package))
> +

Other than that, it looks ok to me.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2013-12-22 17:28 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 13:07 [Buildroot] [pkg-luarocks infra V4 01/10] luainterpreter: create virtual package Francois Perrad
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 02/10] luajit: allow to build Lua extensions without lua Francois Perrad
2013-12-22 17:23   ` Thomas Petazzoni
2014-01-07 14:11     ` François Perrad
2014-01-10  2:34       ` Thomas Petazzoni
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 03/10] lua: remove a too invasive patch Francois Perrad
2013-12-22 17:24   ` Thomas Petazzoni
2013-12-22 17:30     ` Yann E. MORIN
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 04/10] lua*: restore version in module paths Francois Perrad
2013-12-22 17:26   ` Thomas Petazzoni
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 05/10] luarocks: new package Francois Perrad
2013-12-22 17:28   ` Thomas Petazzoni [this message]
2013-12-22 20:45     ` Yann E. MORIN
2013-12-23  7:56     ` François Perrad
2013-12-23  8:21       ` Thomas Petazzoni
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 06/10] luarocks: new infrastructure Francois Perrad
2013-12-22 17:31   ` Thomas Petazzoni
2013-12-22 20:47     ` Yann E. MORIN
2013-12-23  8:20     ` François Perrad
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 07/10] lua-cjson: restore official name Francois Perrad
2013-12-22 17:32   ` Thomas Petazzoni
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 08/10] luasql-sqlite3: renamed like with LuaRocks Francois Perrad
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 09/10] lua*: refactor with luarocks infrastructure Francois Perrad
2013-12-22 17:34   ` Thomas Petazzoni
2013-11-15 13:07 ` [Buildroot] [pkg-luarocks infra V4 10/10] manual: adding packages luarocks Francois Perrad
2013-12-22 17:40   ` Thomas Petazzoni
2013-12-22 20:51     ` Yann E. MORIN
2013-12-22 20:02   ` Yann E. MORIN
2013-12-22 20:52     ` Yann E. MORIN
2013-12-22 17:22 ` [Buildroot] [pkg-luarocks infra V4 01/10] luainterpreter: create virtual package Thomas Petazzoni
2013-12-22 20:44   ` Yann E. MORIN
2013-12-22 17:37 ` Yann E. MORIN
2013-12-22 20:56   ` Yann E. MORIN

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=20131222182858.1709cbc3@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --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