diff mbox

[v4,2/3] lutok: new package

Message ID 1434056459-24075-3-git-send-email-sebastien.bourdelin@savoirfairelinux.com
State Superseded
Headers show

Commit Message

Sebastien Bourdelin June 11, 2015, 9 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 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   | 26 ++++++++++++++++++++++++++
 4 files changed, 42 insertions(+)
 create mode 100644 package/lutok/Config.in
 create mode 100644 package/lutok/lutok.hash
 create mode 100644 package/lutok/lutok.mk

Comments

Arnout Vandecappelle June 11, 2015, 9:56 p.m. UTC | #1
On 06/11/15 23:00, 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>
[snip]
> diff --git a/package/lutok/Config.in b/package/lutok/Config.in
> new file mode 100644
> index 0000000..ef885c8
> --- /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 \
> +		&& !BR2_PACKAGE_LUAJIT

 We only put several depends on one line if they're ||-ed. So make this

	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
[snip]
> +ifneq ($(BR2_STATIC_LIBS),y)
> +LUTOK_MAKE_OPTS = LIBS=-ldl
> +endif

 This is actually not needed for this package, it is needed for liblua. So add a
comment like in haserl:

# liblua uses dlopen when dynamically linked


> +
> +$(eval $(autotools-package))
> 

 Like atf, this package installs a bunch of tests in /usr/tests.

 Short term, get rid of them, either with a POST_INSTALL_TARGET_HOOK or by using
install-exec.

 Long term, we should consider adding a global option BR2_INSTALL_TESTS that
installs various tests. There are a bunch of packages that have a local option
for installing tests, but that's not sustainable. If we ever get around to doing
runtime tests, we'll need something like that. In the meantime, it could already
be useful for others.


 Regards,
 Arnout
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..ef885c8
--- /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 \
+		&& !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..0c78daa
--- /dev/null
+++ b/package/lutok/lutok.mk
@@ -0,0 +1,26 @@ 
+################################################################################
+#
+# 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
+LUTOK_LICENSE = BSD-3c
+LUTOK_LICENSE_FILES = COPYING
+
+ifeq ($(BR2_PACKAGE_ATF),y)
+LUTOK_DEPENDENCIES += atf
+LUTOK_CONF_OPTS += --with-atf
+else
+LUTOK_CONF_OPTS += --without-atf
+endif
+
+ifneq ($(BR2_STATIC_LIBS),y)
+LUTOK_MAKE_OPTS = LIBS=-ldl
+endif
+
+$(eval $(autotools-package))