diff --git a/package/Config.in b/package/Config.in index 2eda8f6ad7..d499785801 100644 --- a/package/Config.in +++ b/package/Config.in @@ -662,6 +662,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 0000000000..98bdd88199 --- /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 0000000000..cb3404d303 --- /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 0000000000..6f787a907a --- /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 0000000000..8a2a57e659 --- /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")