All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/lua-argon2: new package
@ 2021-12-06 18:42 Francois Perrad
  2021-12-27 21:27 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Francois Perrad @ 2021-12-06 18:42 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/Config.in                             |  1 +
 package/lua-argon2/Config.in                  | 13 ++++++++++
 package/lua-argon2/lua-argon2.hash            |  2 ++
 package/lua-argon2/lua-argon2.mk              | 23 +++++++++++++++++
 .../testing/tests/package/test_lua_argon2.py  | 25 +++++++++++++++++++
 5 files changed, 64 insertions(+)
 create mode 100644 package/lua-argon2/Config.in
 create mode 100644 package/lua-argon2/lua-argon2.hash
 create mode 100644 package/lua-argon2/lua-argon2.mk
 create mode 100644 support/testing/tests/package/test_lua_argon2.py

diff --git a/package/Config.in b/package/Config.in
index cb94e30be..ba9eeda23 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -661,6 +661,7 @@ menu "Lua libraries/modules"
 	source "package/lpty/Config.in"
 	source "package/lrandom/Config.in"
 	source "package/lsqlite3/Config.in"
+	source "package/lua-argon2/Config.in"
 	source "package/lua-augeas/Config.in"
 	source "package/lua-basexx/Config.in"
 	source "package/lua-binaryheap/Config.in"
diff --git a/package/lua-argon2/Config.in b/package/lua-argon2/Config.in
new file mode 100644
index 000000000..98bdd8819
--- /dev/null
+++ b/package/lua-argon2/Config.in
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_LUA_ARGON2
+	bool "lua-argon2"
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_USE_MMU # libargon2
+	select BR2_PACKAGE_LIBARGON2
+	help
+	  Lua C binding for the Argon2 password hashing algorithm.
+
+	  https://github.com/thibaultcha/lua-argon2
+
+comment "lua-argon2 needs a toolchain w/ dynamic library"
+	depends on BR2_USE_MMU
+	depends on BR2_STATIC_LIBS
diff --git a/package/lua-argon2/lua-argon2.hash b/package/lua-argon2/lua-argon2.hash
new file mode 100644
index 000000000..cb3404d30
--- /dev/null
+++ b/package/lua-argon2/lua-argon2.hash
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  d109c6e8e93cd9e27e8738567a998a2763d56252cc1abca1f0f2ac36ef8ce0f4  lua-argon2-3.0.1.tar.gz
diff --git a/package/lua-argon2/lua-argon2.mk b/package/lua-argon2/lua-argon2.mk
new file mode 100644
index 000000000..6f787a907
--- /dev/null
+++ b/package/lua-argon2/lua-argon2.mk
@@ -0,0 +1,23 @@
+################################################################################
+#
+# lua-argon2
+#
+################################################################################
+
+LUA_ARGON2_VERSION = 3.0.1
+LUA_ARGON2_SITE = $(call github,thibaultcha,lua-argon2,$(LUA_ARGON2_VERSION))
+LUA_ARGON2_LICENSE = MIT
+LUA_ARGON2_DEPENDENCIES = luainterpreter libargon2
+
+define LUA_ARGON2_BUILD_CMDS
+	$(MAKE) -C $(@D) \
+		CC=$(TARGET_CC) \
+		CFLAGS="$(TARGET_CFLAGS) -fPIC" \
+		PREFIX="$(STAGING_DIR)/usr"
+endef
+
+define LUA_ARGON2_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 755 -D $(@D)/argon2.so $(TARGET_DIR)/usr/lib/lua/$(LUAINTERPRETER_ABIVER)/argon2.so
+endef
+
+$(eval $(generic-package))
diff --git a/support/testing/tests/package/test_lua_argon2.py b/support/testing/tests/package/test_lua_argon2.py
new file mode 100644
index 000000000..8a2a57e65
--- /dev/null
+++ b/support/testing/tests/package/test_lua_argon2.py
@@ -0,0 +1,25 @@
+from tests.package.test_lua import TestLuaBase
+
+
+class TestLuaLuaArgon2(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUA=y
+        BR2_PACKAGE_LUA_ARGON2=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("argon2")
+
+
+class TestLuajitLuaArgon2(TestLuaBase):
+    config = TestLuaBase.config + \
+        """
+        BR2_PACKAGE_LUAJIT=y
+        BR2_PACKAGE_LUA_ARGON2=y
+        """
+
+    def test_run(self):
+        self.login()
+        self.module_test("argon2")
-- 
2.32.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH] package/lua-argon2: new package
  2021-12-06 18:42 [Buildroot] [PATCH] package/lua-argon2: new package Francois Perrad
@ 2021-12-27 21:27 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2021-12-27 21:27 UTC (permalink / raw)
  To: Francois Perrad; +Cc: buildroot

On Mon,  6 Dec 2021 19:42:00 +0100
Francois Perrad <fperrad@gmail.com> wrote:

> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/Config.in                             |  1 +
>  package/lua-argon2/Config.in                  | 13 ++++++++++
>  package/lua-argon2/lua-argon2.hash            |  2 ++
>  package/lua-argon2/lua-argon2.mk              | 23 +++++++++++++++++
>  .../testing/tests/package/test_lua_argon2.py  | 25 +++++++++++++++++++
>  5 files changed, 64 insertions(+)
>  create mode 100644 package/lua-argon2/Config.in
>  create mode 100644 package/lua-argon2/lua-argon2.hash
>  create mode 100644 package/lua-argon2/lua-argon2.mk
>  create mode 100644 support/testing/tests/package/test_lua_argon2.py

Applied to master, thanks. It would be great for upstream to add a
license file to the repository, though. Perhaps you could ask them
about this?

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-27 21:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 18:42 [Buildroot] [PATCH] package/lua-argon2: new package Francois Perrad
2021-12-27 21:27 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.