aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Francois Perrad <fperrad@gmail.com>2020-03-11 08:09:31 +0100
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2020-03-20 23:00:30 +0100
commit6500cb3cc6e8a03cd151827a98eeb84567abec99 (patch)
tree16dcde743179dbe55b8e1bcc0ddc9de2a594813a
parenta30e00da893f1f9c01b89ea0085a1d580f53ff4b (diff)
downloadbuildroot-6500cb3cc6e8a03cd151827a98eeb84567abec99.tar.gz
buildroot-6500cb3cc6e8a03cd151827a98eeb84567abec99.tar.bz2
package/lua-lyaml: new package
Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
-rw-r--r--.gitlab-ci.yml2
-rw-r--r--package/Config.in1
-rw-r--r--package/lua-lyaml/Config.in9
-rw-r--r--package/lua-lyaml/lua-lyaml.hash3
-rw-r--r--package/lua-lyaml/lua-lyaml.mk33
-rw-r--r--support/testing/tests/package/test_lua_lyaml.py27
6 files changed, 75 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4b84a5b709..cde757681e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -400,6 +400,8 @@ tests.package.test_lua_gd.TestLuaLuaGD: { extends: .runtime_test }
tests.package.test_lua_gd.TestLuajitLuaGD: { extends: .runtime_test }
tests.package.test_lua_http.TestLuaHttp: { extends: .runtime_test }
tests.package.test_lua_http.TestLuajitHttp: { extends: .runtime_test }
+tests.package.test_lua_lyaml.TestLuaLuaLyaml: { extends: .runtime_test }
+tests.package.test_lua_lyaml.TestLuajitLuaLyaml: { extends: .runtime_test }
tests.package.test_lua_sdl2.TestLuaLuaSDL2: { extends: .runtime_test }
tests.package.test_lua_sdl2.TestLuajitLuaSDL2: { extends: .runtime_test }
tests.package.test_lua_utf8.TestLuaUtf8: { extends: .runtime_test }
diff --git a/package/Config.in b/package/Config.in
index 12e316533a..cba756d9f1 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -654,6 +654,7 @@ menu "Lua libraries/modules"
source "package/lua-livr-extra/Config.in"
source "package/lua-lpeg-patterns/Config.in"
source "package/lua-lunitx/Config.in"
+ source "package/lua-lyaml/Config.in"
source "package/lua-markdown/Config.in"
source "package/lua-messagepack/Config.in"
source "package/lua-msgpack-native/Config.in"
diff --git a/package/lua-lyaml/Config.in b/package/lua-lyaml/Config.in
new file mode 100644
index 0000000000..ef2d3823d1
--- /dev/null
+++ b/package/lua-lyaml/Config.in
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_LUA_LYAML
+ bool "lua-lyaml"
+ select BR2_PACKAGE_LIBYAML
+ help
+ This is a Lua binding for the fast libYAML C library for
+ converting between `%YAML 1.1` and Lua tables, with a
+ flexible Lua language API to load and save YAML documents.
+
+ http://github.com/gvvaughan/lyaml
diff --git a/package/lua-lyaml/lua-lyaml.hash b/package/lua-lyaml/lua-lyaml.hash
new file mode 100644
index 0000000000..dd19783852
--- /dev/null
+++ b/package/lua-lyaml/lua-lyaml.hash
@@ -0,0 +1,3 @@
+# locally computed
+sha256 f4015ba47a389fc4fe0656cbcb8a216239275ec53309a0df79b0733c843e7bba lua-lyaml-6.2.4.tar.gz
+sha256 c7ec2f52d258088437cddeeee38cfc97d60d464c8801aa77decefb993400ec6e LICENSE
diff --git a/package/lua-lyaml/lua-lyaml.mk b/package/lua-lyaml/lua-lyaml.mk
new file mode 100644
index 0000000000..c88a438d5e
--- /dev/null
+++ b/package/lua-lyaml/lua-lyaml.mk
@@ -0,0 +1,33 @@
+################################################################################
+#
+# lua-lyaml
+#
+################################################################################
+
+LUA_LYAML_VERSION = 6.2.4
+LUA_LYAML_NAME_UPSTREAM = lyaml
+LUA_LYAML_SITE = $(call github,gvvaughan,$(LUA_LYAML_NAME_UPSTREAM),v$(LUA_LYAML_VERSION))
+LUA_LYAML_LICENSE = MIT
+LUA_LYAML_LICENSE_FILES = LICENSE
+LUA_LYAML_DEPENDENCIES = libyaml luainterpreter host-lua
+
+define LUA_LYAML_BUILD_CMDS
+ (cd $(@D); \
+ $(LUA_RUN) build-aux/luke \
+ version="'$(LUA_LYAML_VERSION)'" \
+ CC="$(TARGET_CC)" \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ LUA_INCDIR=$(STAGING_DIR)/usr/include \
+ YAML_DIR=$(STAGING_DIR)/usr \
+ )
+endef
+
+define LUA_LYAML_INSTALL_TARGET_CMDS
+ (cd $(@D); \
+ $(LUA_RUN) build-aux/luke install \
+ INST_LIBDIR="$(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)" \
+ INST_LUADIR="$(TARGET_DIR)/usr/share/lua/$(LUAINTERPRETER_ABIVER)" \
+ )
+endef
+
+$(eval $(generic-package))
diff --git a/support/testing/tests/package/test_lua_lyaml.py b/support/testing/tests/package/test_lua_lyaml.py
new file mode 100644
index 0000000000..ece3c675a2
--- /dev/null
+++ b/support/testing/tests/package/test_lua_lyaml.py
@@ -0,0 +1,27 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaLyaml(TestLuaBase):
+ config = TestLuaBase.config + \
+ """
+ BR2_PACKAGE_LUA=y
+ BR2_PACKAGE_LUA_LYAML=y
+ """
+
+ def test_run(self):
+ self.login()
+ self.module_test("yaml")
+ self.module_test("lyaml")
+
+
+class TestLuajitLuaLyaml(TestLuaBase):
+ config = TestLuaBase.config + \
+ """
+ BR2_PACKAGE_LUAJIT=y
+ BR2_PACKAGE_LUA_LYAML=y
+ """
+
+ def test_run(self):
+ self.login()
+ self.module_test("yaml")
+ self.module_test("lyaml")