commit:     68c9c7920a0691afc56a2376e7d9e8b28a0adb7a
Author:     Zurab Kvachadze <zurabid2016 <AT> gmail <DOT> com>
AuthorDate: Tue Feb 18 15:14:52 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jul  5 07:27:01 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68c9c792

dev-lua/lua-resty-string: new package, add 0.16

lua-resty-string[1] is a Lua module for ngx-lua-module NGINX module
providing "string utilities and common hash functions for ngx_lua and
LuaJIT".

[1]: https://github.com/openresty/lua-resty-string

Signed-off-by: Zurab Kvachadze <zurabid2016 <AT> gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/37590
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lua/lua-resty-string/Manifest                  |  1 +
 ...sty-string-0.16-explicitly-load-libcrypto.patch | 73 ++++++++++++++++++++++
 .../lua-resty-string/lua-resty-string-0.16.ebuild  | 40 ++++++++++++
 dev-lua/lua-resty-string/metadata.xml              | 16 +++++
 4 files changed, 130 insertions(+)

diff --git a/dev-lua/lua-resty-string/Manifest 
b/dev-lua/lua-resty-string/Manifest
new file mode 100644
index 000000000000..dece9c7070ec
--- /dev/null
+++ b/dev-lua/lua-resty-string/Manifest
@@ -0,0 +1 @@
+DIST lua-resty-string-0.16.tar.gz 13078 BLAKE2B 
9c0903da36f6309fed47c9f184510c53877d35c86a8b6ba91e008c5010a8b65adec70b7e6911e51cae1121c5c2c64638b3c41117ae4b7949613766d5403fda31
 SHA512 
dff61ebfe42ea055c2d20ab8d54a53a88d67b40dfb87bb97aa91e857a8f95884c2444d50942a6b7e580f503cc98467799b421dc659dc5d1d41c64fb30d303746

diff --git 
a/dev-lua/lua-resty-string/files/lua-resty-string-0.16-explicitly-load-libcrypto.patch
 
b/dev-lua/lua-resty-string/files/lua-resty-string-0.16-explicitly-load-libcrypto.patch
new file mode 100644
index 000000000000..63712785d87b
--- /dev/null
+++ 
b/dev-lua/lua-resty-string/files/lua-resty-string-0.16-explicitly-load-libcrypto.patch
@@ -0,0 +1,73 @@
+From 73c6a2fbb376ee6550b15e2c6487c86c27ed3a71 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <[email protected]>
+Date: Fri, 14 Mar 2025 16:49:04 +0100
+Subject: [PATCH] lib/resty: Explicitly load libcrypto in all crypto-exporting
+ FFI modules
+
+Lua modules in lib/resty provide FFI wrappers for cryptographic OpenSSL
+functions without explicitly loading libcrypto itself. This commit makes
+the modules load the library.
+
+Signed-off-by: Zurab Kvachadze <[email protected]>
+---
+ lib/resty/aes.lua    | 2 ++
+ lib/resty/md5.lua    | 2 ++
+ lib/resty/random.lua | 2 ++
+ lib/resty/sha.lua    | 2 ++
+ 4 files changed, 8 insertions(+)
+
+diff --git a/lib/resty/aes.lua b/lib/resty/aes.lua
+index 377476f..8a9f9a1 100644
+--- a/lib/resty/aes.lua
++++ b/lib/resty/aes.lua
+@@ -11,6 +11,8 @@ local C = ffi.C
+ local setmetatable = setmetatable
+ --local error = error
+ local type = type
++-- Load libcrypto into global namespace.
++_ = ffi.load("crypto", true)
+ 
+ 
+ local _M = { _VERSION = '0.16' }
+diff --git a/lib/resty/md5.lua b/lib/resty/md5.lua
+index 66b3b3e..09ce8c8 100644
+--- a/lib/resty/md5.lua
++++ b/lib/resty/md5.lua
+@@ -7,6 +7,8 @@ local ffi_str = ffi.string
+ local C = ffi.C
+ local setmetatable = setmetatable
+ --local error = error
++-- Load libcrypto into global namespace.
++_ = ffi.load("crypto", true)
+ 
+ 
+ local _M = { _VERSION = '0.16' }
+diff --git a/lib/resty/random.lua b/lib/resty/random.lua
+index 153b1f3..673bf40 100644
+--- a/lib/resty/random.lua
++++ b/lib/resty/random.lua
+@@ -7,6 +7,8 @@ local ffi_str = ffi.string
+ local C = ffi.C
+ --local setmetatable = setmetatable
+ --local error = error
++-- Load libcrypto into global namespace.
++_ = ffi.load("crypto", true)
+ 
+ 
+ local _M = { _VERSION = '0.16' }
+diff --git a/lib/resty/sha.lua b/lib/resty/sha.lua
+index ce4e50a..b631b1f 100644
+--- a/lib/resty/sha.lua
++++ b/lib/resty/sha.lua
+@@ -2,6 +2,8 @@
+ 
+ 
+ local ffi = require "ffi"
++-- Load libcrypto into global namespace.
++_ = ffi.load("crypto", true)
+ 
+ 
+ local _M = { _VERSION = '0.16' }
+-- 
+2.45.3
+

diff --git a/dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild 
b/dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild
new file mode 100644
index 000000000000..e960aef0e7a6
--- /dev/null
+++ b/dev-lua/lua-resty-string/lua-resty-string-0.16.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Openresty only ever supports luajit.
+LUA_COMPAT=( luajit )
+inherit lua-single
+
+DESCRIPTION="String utilities and common hash functions for the ngx-lua-module 
NGINX module"
+HOMEPAGE="https://github.com/openresty/lua-resty-string";
+SRC_URI="
+       
https://github.com/openresty/lua-resty-string/archive/refs/tags/v${PV}.tar.gz 
-> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+# Tests require replicating much of nginx-module_src_test() in each
+# dev-lua/lua-resty-* ebuild.
+RESTRICT="test"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="
+       ${LUA_DEPS}
+       dev-libs/openssl:=
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-0.16-explicitly-load-libcrypto.patch"
+)
+
+src_configure() {
+       # The directory where to Lua files are to be installed, used by the 
build
+       # system.
+       export LUA_LIB_DIR="$(lua_get_lmod_dir)"
+       default
+}

diff --git a/dev-lua/lua-resty-string/metadata.xml 
b/dev-lua/lua-resty-string/metadata.xml
new file mode 100644
index 000000000000..a65b3294ea75
--- /dev/null
+++ b/dev-lua/lua-resty-string/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person" proxied="yes">
+               <email>[email protected]</email>
+               <name>Zurab Kvachadze</name>
+       </maintainer>
+       <maintainer type="project" proxied="proxy">
+               <email>[email protected]</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+       <upstream>
+               
<bugs-to>https://github.com/openresty/lua-resty-string/issues</bugs-to>
+               <remote-id type="github">openresty/lua-resty-string</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to