package/lua-lyaml: new package
authorFrancois Perrad <fperrad@gmail.com>
Wed, 11 Mar 2020 07:09:31 +0000 (08:09 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Fri, 20 Mar 2020 22:00:30 +0000 (23:00 +0100)
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
.gitlab-ci.yml
package/Config.in
package/lua-lyaml/Config.in [new file with mode: 0644]
package/lua-lyaml/lua-lyaml.hash [new file with mode: 0644]
package/lua-lyaml/lua-lyaml.mk [new file with mode: 0644]
support/testing/tests/package/test_lua_lyaml.py [new file with mode: 0644]

index 4b84a5b709a8b3e469f178c97405d908e581cdff..cde757681eac42db5628b4f3250e4b6766e40a2b 100644 (file)
@@ -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 }
index 12e316533ab34a3b418e60d75644339641e3f201..cba756d9f116748e7390626f021fcf11a4aa3190 100644 (file)
@@ -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 (file)
index 0000000..ef2d382
--- /dev/null
@@ -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 (file)
index 0000000..dd19783
--- /dev/null
@@ -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 (file)
index 0000000..c88a438
--- /dev/null
@@ -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 (file)
index 0000000..ece3c67
--- /dev/null
@@ -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")