diff mbox

[v5,2/3] lutok: new package

Message ID 1434063093-14906-3-git-send-email-sebastien.bourdelin@savoirfairelinux.com
State Accepted
Headers show

Commit Message

Sebastien Bourdelin June 11, 2015, 10:51 p.m. UTC
Lutok is a lightweight C++ API library for Lua.

https://github.com/jmmv/lutok

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
---
Changes v4 -> v5:
  suggested by Arnout Vandecapelle <arnout@mind.be>:
  - force the --without-atf option to not build the example tests.
  - puts the dependencies &&-ed in Config.in on 2 lines
  - adds comment to explain the need of dlopen

Changes v3 -> v4:
  - rebase

Changes v2 -> v3:
  - rebase

  suggested by Arnout Vandecapelle <arnout@mind.be>:
  - reworks comment in the Config.in for the required lua dependencies

Changes v1 -> v2:
  suggested by Arnout Vandecapelle <arnout@mind.be>:
  - reworks lua dependencies, doesn't work with luajit
  - adds comment in the Config.in for the required lua dependencies
  - uses the release archive instead of the github automatic one
  - updates the hash
  - removes the useless AUTORECONF option
  - adds optional dependency on atf
  - don't generate the doxygen doc
  - changes the license
---
 package/Config.in        |  1 +
 package/lutok/Config.in  | 13 +++++++++++++
 package/lutok/lutok.hash |  2 ++
 package/lutok/lutok.mk   | 20 ++++++++++++++++++++
 4 files changed, 36 insertions(+)
 create mode 100644 package/lutok/Config.in
 create mode 100644 package/lutok/lutok.hash
 create mode 100644 package/lutok/lutok.mk

Comments

Thomas Petazzoni June 12, 2015, 7:34 p.m. UTC | #1
Dear Sebastien Bourdelin,

On Thu, 11 Jun 2015 18:51:32 -0400, Sebastien Bourdelin wrote:

> +LUTOK_VERSION = 0.4
> +LUTOK_SITE = https://github.com/jmmv/lutok/releases/download/lutok-$(LUTOK_VERSION)
> +LUTOK_INSTALL_STAGING = YES
> +LUTOK_DEPENDENCIES = host-pkgconf lua
> +LUTOK_CONF_OPTS = --without-doxygen --without-atf

Both the lutok and kyua packages after --without-atf ? Why so ? You add
the atf package as the first patch, and then it isn't used in follow-up
patches ?

> +# liblua uses dlopen when dynamically linked
> +ifneq ($(BR2_STATIC_LIBS),y)

ifeq ($(BR2_STATIC_LIBS),)

maybe?

Thomas
Thomas Petazzoni June 12, 2015, 7:45 p.m. UTC | #2
Hello,

On Fri, 12 Jun 2015 21:34:19 +0200, Thomas Petazzoni wrote:

> Both the lutok and kyua packages after --without-atf ? Why so ? You add
> the atf package as the first patch, and then it isn't used in follow-up
> patches ?

Ok, --without-atf is not about ATF support, but about build ATF-based
tests. I've added a comment to explain this.

> > +# liblua uses dlopen when dynamically linked
> > +ifneq ($(BR2_STATIC_LIBS),y)
> 
> ifeq ($(BR2_STATIC_LIBS),)

Actually, I was able to build without adding -ldl, so I'm not sure why
it is needed. We'll see what the autobuilders have to say, unless you
have more details about the specific configuration that was causing
problems.

Thanks,

Thomas
Thomas Petazzoni June 12, 2015, 7:59 p.m. UTC | #3
Dear Sebastien Bourdelin,

On Thu, 11 Jun 2015 18:51:32 -0400, Sebastien Bourdelin wrote:
> Lutok is a lightweight C++ API library for Lua.
> 
> https://github.com/jmmv/lutok
> 
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
> ---
> Changes v4 -> v5:
>   suggested by Arnout Vandecapelle <arnout@mind.be>:
>   - force the --without-atf option to not build the example tests.
>   - puts the dependencies &&-ed in Config.in on 2 lines
>   - adds comment to explain the need of dlopen

Applied, thanks, after doing the tweaks that I highlighted already:

    [Thomas:
     - move lutok inclusion in package/Config.in after including the Lua
       external modules
     - add a comment explaining why we are passing --without-atf
     - remove the logic around -ldl, it seems to build just fine without it.]

Thomas
Arnout Vandecappelle June 12, 2015, 11:04 p.m. UTC | #4
On 06/12/15 21:45, Thomas Petazzoni wrote:
> Hello,
> 
> On Fri, 12 Jun 2015 21:34:19 +0200, Thomas Petazzoni wrote:
> 
>> Both the lutok and kyua packages after --without-atf ? Why so ? You add
>> the atf package as the first patch, and then it isn't used in follow-up
>> patches ?
> 
> Ok, --without-atf is not about ATF support, but about build ATF-based
> tests. I've added a comment to explain this.
> 
>>> +# liblua uses dlopen when dynamically linked
>>> +ifneq ($(BR2_STATIC_LIBS),y)
>>
>> ifeq ($(BR2_STATIC_LIBS),)
> 
> Actually, I was able to build without adding -ldl, so I'm not sure why
> it is needed. We'll see what the autobuilders have to say, unless you
> have more details about the specific configuration that was causing
> problems.

 If you build --with-atf, then the linking of the tests will fail, because some
of them link with liblua and lua's .pc file forgets to add -ldl.

 See haserl.mk.

 Since now we build --without-atf, this package doesn't link anything anymore so
the -ldl is no longer needed - at least not here.

 Regards,
 Arnout

> 
> Thanks,
> 
> Thomas
>
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index d111a82..b006211 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -456,6 +456,7 @@  endif
 	source "package/lua/Config.in"
 	source "package/luainterpreter/Config.in"
 	source "package/luajit/Config.in"
+	source "package/lutok/Config.in"
 if BR2_PACKAGE_HAS_LUAINTERPRETER && !BR2_STATIC_LIBS
 # lua modules are dynamically loaded, so not available on static builds
 menu "Lua libraries/modules"
diff --git a/package/lutok/Config.in b/package/lutok/Config.in
new file mode 100644
index 0000000..d6c87cf
--- /dev/null
+++ b/package/lutok/Config.in
@@ -0,0 +1,13 @@ 
+config BR2_PACKAGE_LUTOK
+	bool "lutok"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_HAS_LUAINTERPRETER
+	depends on !BR2_PACKAGE_LUAJIT
+	help
+	  Lutok is a lightweight C++ API library for Lua.
+
+	  https://github.com/jmmv/lutok
+
+comment "lutok needs a toolchain w/ C++ and full Lua"
+	depends on !BR2_INSTALL_LIBSTDCPP || BR2_PACKAGE_LUAJIT
+	depends on BR2_PACKAGE_HAS_LUAINTERPRETER
diff --git a/package/lutok/lutok.hash b/package/lutok/lutok.hash
new file mode 100644
index 0000000..0ec8988
--- /dev/null
+++ b/package/lutok/lutok.hash
@@ -0,0 +1,2 @@ 
+# Locally computed
+sha256 2cec51efa0c8d65ace8b21eaa08384b77abc5087b46e785f78de1c21fb754cd5 lutok-0.4.tar.gz
diff --git a/package/lutok/lutok.mk b/package/lutok/lutok.mk
new file mode 100644
index 0000000..0b1f214
--- /dev/null
+++ b/package/lutok/lutok.mk
@@ -0,0 +1,20 @@ 
+################################################################################
+#
+# lutok
+#
+################################################################################
+
+LUTOK_VERSION = 0.4
+LUTOK_SITE = https://github.com/jmmv/lutok/releases/download/lutok-$(LUTOK_VERSION)
+LUTOK_INSTALL_STAGING = YES
+LUTOK_DEPENDENCIES = host-pkgconf lua
+LUTOK_CONF_OPTS = --without-doxygen --without-atf
+LUTOK_LICENSE = BSD-3c
+LUTOK_LICENSE_FILES = COPYING
+
+# liblua uses dlopen when dynamically linked
+ifneq ($(BR2_STATIC_LIBS),y)
+LUTOK_MAKE_OPTS = LIBS=-ldl
+endif
+
+$(eval $(autotools-package))