diff mbox series

[3/3] package/lua-lgdbm: new package

Message ID 20240403085424.1650628-3-francois.perrad@gadz.org
State Accepted
Headers show
Series [1/3] package/lmdb: new package | expand

Commit Message

Francois Perrad April 3, 2024, 8:54 a.m. UTC
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/Config.in                               |  1 +
 package/lua-lgdbm/Config.in                     | 12 ++++++++++++
 package/lua-lgdbm/lua-lgdbm.hash                |  2 ++
 package/lua-lgdbm/lua-lgdbm.mk                  | 13 +++++++++++++
 support/testing/tests/package/test_lua_lgdbm.py | 14 ++++++++++++++
 5 files changed, 42 insertions(+)
 create mode 100644 package/lua-lgdbm/Config.in
 create mode 100644 package/lua-lgdbm/lua-lgdbm.hash
 create mode 100644 package/lua-lgdbm/lua-lgdbm.mk
 create mode 100644 support/testing/tests/package/test_lua_lgdbm.py

Comments

Yann E. MORIN April 3, 2024, 9:12 p.m. UTC | #1
Fraçois, All

On 2024-04-03 10:54 +0200, Francois Perrad spake thusly:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
[--SNIP--]
> diff --git a/package/lua-lgdbm/Config.in b/package/lua-lgdbm/Config.in
> new file mode 100644
> index 0000000000..ac5c64cc79
> --- /dev/null
> +++ b/package/lua-lgdbm/Config.in
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_LUA_LGDBM
> +	bool "lua-lgdbm"
> +	depends on BR2_PACKAGE_LUA_5_3 || BR2_PACKAGE_LUA_5_4
> +	select BR2_PACKAGE_GDBM

You need to propagate the dependencies of gdbm here: MMU and WCHAR.

> new file mode 100644
> index 0000000000..b21565fb6e
> --- /dev/null
> +++ b/support/testing/tests/package/test_lua_lgdbm.py
> @@ -0,0 +1,14 @@
> +from tests.package.test_lua import TestLuaBase
> +
> +
> +class TestLuaLgdbm(TestLuaBase):
> +    config = TestLuaBase.config + \
> +        """
> +        BR2_PACKAGE_LUA=y
> +        BR2_PACKAGE_LUA_LGDBM=y
> +        """
> +
> +    def test_run(self):
> +        self.login()
> +        self.module_test("gdbm")
> +

Runtime test, wee! :-)

But:

    $ ./utils/docker-run make check-package
    support/testing/tests/package/test_lua_lgdbm.py:0: run 'flake8' and fix the warnings

    $ ./utils/docker-run python3 -m flake8 support/testing/tests/package/test_lua_lgdbm.py
    support/testing/tests/package/test_lua_lgdbm.py:14:1: W391 blank line at end of file

Applied to master, with the gdbm dependencies propagated and the
check-package/flake8 issue fixed, thanks!

Regards,
Yann E. MORIN.

> -- 
> 2.39.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index e7032127cd..e8c210e22b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -739,6 +739,7 @@  menu "Lua libraries/modules"
 	source "package/lua-iconv/Config.in"
 	source "package/lua-inotify/Config.in"
 	source "package/lua-lightningmdb/Config.in"
+	source "package/lua-lgdbm/Config.in"
 	source "package/lua-livr/Config.in"
 	source "package/lua-livr-extra/Config.in"
 	source "package/lua-lpeg-patterns/Config.in"
diff --git a/package/lua-lgdbm/Config.in b/package/lua-lgdbm/Config.in
new file mode 100644
index 0000000000..ac5c64cc79
--- /dev/null
+++ b/package/lua-lgdbm/Config.in
@@ -0,0 +1,12 @@ 
+config BR2_PACKAGE_LUA_LGDBM
+	bool "lua-lgdbm"
+	depends on BR2_PACKAGE_LUA_5_3 || BR2_PACKAGE_LUA_5_4
+	select BR2_PACKAGE_GDBM
+	help
+	  A database library for Lua using GDBM.
+
+	  http://www.tecgraf.puc-rio.br/~lhf/ftp/lua/#lgdbm
+
+comment "lua-lgdbm needs Lua >= 5.2"
+	depends on !BR2_PACKAGE_LUA_5_3
+	depends on !BR2_PACKAGE_LUA_5_4
diff --git a/package/lua-lgdbm/lua-lgdbm.hash b/package/lua-lgdbm/lua-lgdbm.hash
new file mode 100644
index 0000000000..06f22f1509
--- /dev/null
+++ b/package/lua-lgdbm/lua-lgdbm.hash
@@ -0,0 +1,2 @@ 
+# computed by luarocks/buildroot
+sha256  8cb7e25254b1c9889894654f6cf26d09f2c2ee10fe966f45152eb5deb0a24f9b  lgdbm-20211118.52-0.src.rock
diff --git a/package/lua-lgdbm/lua-lgdbm.mk b/package/lua-lgdbm/lua-lgdbm.mk
new file mode 100644
index 0000000000..35ca9c93f4
--- /dev/null
+++ b/package/lua-lgdbm/lua-lgdbm.mk
@@ -0,0 +1,13 @@ 
+################################################################################
+#
+# lua-lgdbm
+#
+################################################################################
+
+LUA_LGDBM_VERSION = 20211118.52-0
+LUA_LGDBM_NAME_UPSTREAM = lgdbm
+LUA_LGDBM_SUBDIR = gdbm
+LUA_LGDBM_LICENSE = Public Domain
+LUA_LGDBM_DEPENDENCIES = gdbm
+
+$(eval $(luarocks-package))
diff --git a/support/testing/tests/package/test_lua_lgdbm.py b/support/testing/tests/package/test_lua_lgdbm.py
new file mode 100644
index 0000000000..b21565fb6e
--- /dev/null
+++ b/support/testing/tests/package/test_lua_lgdbm.py
@@ -0,0 +1,14 @@ 
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLgdbm(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_LGDBM=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("gdbm")
+