Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
From fd775cedbb97b56f0d1b098a41519f4477f450c7 Mon Sep 17 00:00:00 2001
|
||||
From: cdosoftei <ciprian.dosoftei@gmail.com>
|
||||
Date: Mon, 10 Aug 2020 15:37:52 -0400
|
||||
Subject: [PATCH] ZEND_ACC_ALLOW_STATIC -> ZEND_ACC_STATIC for static method
|
||||
|
||||
[Hervé: Taken from https://github.com/laruence/php-lua/pull/47 to fix
|
||||
PHP8 compatibility.]
|
||||
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
|
||||
---
|
||||
lua.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lua.c b/lua.c
|
||||
index b05f4ef..f2648ac 100755
|
||||
--- a/lua.c
|
||||
+++ b/lua.c
|
||||
@@ -822,7 +822,7 @@ zend_function_entry lua_class_methods[] = {
|
||||
PHP_ME(lua, include, arginfo_lua_include, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(lua, call, arginfo_lua_call, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(lua, assign, arginfo_lua_assign, ZEND_ACC_PUBLIC)
|
||||
- PHP_ME(lua, getVersion, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_ALLOW_STATIC)
|
||||
+ PHP_ME(lua, getVersion, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_ME(lua, registerCallback, arginfo_lua_register, ZEND_ACC_PUBLIC)
|
||||
PHP_MALIAS(lua, __call, call, arginfo_lua_call, ZEND_ACC_PUBLIC)
|
||||
PHP_FE_END
|
||||
--
|
||||
2.31.1
|
||||
|
||||
68
package/php-lua/0002-php8-explicitly-declare-arginfo.patch
Normal file
68
package/php-lua/0002-php8-explicitly-declare-arginfo.patch
Normal file
@@ -0,0 +1,68 @@
|
||||
From 0f5132e09d970cacabcca3bab01405bc25b87d66 Mon Sep 17 00:00:00 2001
|
||||
From: cdosoftei <ciprian.dosoftei@gmail.com>
|
||||
Date: Tue, 11 Aug 2020 12:42:17 -0400
|
||||
Subject: [PATCH] php8: explicitly declare arginfo
|
||||
|
||||
[Hervé: Taken from https://github.com/laruence/php-lua/pull/47 to fix
|
||||
PHP8 compatibility.]
|
||||
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
|
||||
---
|
||||
lua.c | 7 +++++--
|
||||
lua_closure.c | 5 ++++-
|
||||
2 files changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lua.c b/lua.c
|
||||
index f2648ac..bbbd623 100755
|
||||
--- a/lua.c
|
||||
+++ b/lua.c
|
||||
@@ -35,6 +35,9 @@ static zend_object_handlers lua_object_handlers;
|
||||
/** {{{ ARG_INFO
|
||||
*
|
||||
*/
|
||||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0)
|
||||
+ZEND_END_ARG_INFO()
|
||||
+
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_lua_call, 0, 0, 2)
|
||||
ZEND_ARG_INFO(0, method)
|
||||
ZEND_ARG_INFO(0, args)
|
||||
@@ -817,12 +820,12 @@ PHP_METHOD(lua, __construct) {
|
||||
*
|
||||
*/
|
||||
zend_function_entry lua_class_methods[] = {
|
||||
- PHP_ME(lua, __construct, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
|
||||
+ PHP_ME(lua, __construct, arginfo_void, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
|
||||
PHP_ME(lua, eval, arginfo_lua_eval, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(lua, include, arginfo_lua_include, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(lua, call, arginfo_lua_call, ZEND_ACC_PUBLIC)
|
||||
PHP_ME(lua, assign, arginfo_lua_assign, ZEND_ACC_PUBLIC)
|
||||
- PHP_ME(lua, getVersion, NULL, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
+ PHP_ME(lua, getVersion, arginfo_void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
|
||||
PHP_ME(lua, registerCallback, arginfo_lua_register, ZEND_ACC_PUBLIC)
|
||||
PHP_MALIAS(lua, __call, call, arginfo_lua_call, ZEND_ACC_PUBLIC)
|
||||
PHP_FE_END
|
||||
diff --git a/lua_closure.c b/lua_closure.c
|
||||
index 50ef039..b0f6780 100644
|
||||
--- a/lua_closure.c
|
||||
+++ b/lua_closure.c
|
||||
@@ -39,6 +39,9 @@ static zend_object_handlers lua_closure_handlers;
|
||||
/** {{{ ARG_INFO
|
||||
*
|
||||
*/
|
||||
+ZEND_BEGIN_ARG_INFO_EX(arginfo_void, 0, 0, 0)
|
||||
+ZEND_END_ARG_INFO()
|
||||
+
|
||||
ZEND_BEGIN_ARG_INFO_EX(arginfo_lua_invoke, 0, 0, 1)
|
||||
ZEND_ARG_INFO(0, arg)
|
||||
ZEND_ARG_INFO(0, ...)
|
||||
@@ -145,7 +148,7 @@ PHP_METHOD(lua_closure, invoke) {
|
||||
/* {{{ lua_class_methods[]
|
||||
*/
|
||||
zend_function_entry lua_closure_methods[] = {
|
||||
- PHP_ME(lua_closure, __construct, NULL, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
|
||||
+ PHP_ME(lua_closure, __construct, arginfo_void, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
|
||||
PHP_ME(lua_closure, invoke, arginfo_lua_invoke, ZEND_ACC_PUBLIC)
|
||||
PHP_MALIAS(lua_closure, __invoke, invoke, arginfo_lua_invoke, ZEND_ACC_PUBLIC)
|
||||
PHP_FE_END
|
||||
--
|
||||
2.31.1
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
From de1068d634519abf2461dac9427b5ff24b6603af Mon Sep 17 00:00:00 2001
|
||||
From: Mikhail Galanin <mikhail.galanin@team.bumble.com>
|
||||
Date: Tue, 24 Aug 2021 08:28:47 +0100
|
||||
Subject: [PATCH] php8: Signature of write_property/read_property was changed
|
||||
in https://github.com/php/php-src/commit/91ef4124e56
|
||||
|
||||
Upstream: upstream dead, taken from fork at https://github.com/badoo/php-lua/pull/8
|
||||
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
|
||||
---
|
||||
lua.c | 28 ++++++++++++++--------------
|
||||
1 file changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/lua.c b/lua.c
|
||||
index edc2868..32c1471 100755
|
||||
--- a/lua.c
|
||||
+++ b/lua.c
|
||||
@@ -229,46 +229,46 @@ zend_object *php_lua_create_object(zend_class_entry *ce)
|
||||
|
||||
/** {{{ static zval * php_lua_read_property(zval *object, zval *member, int type)
|
||||
*/
|
||||
-zval *php_lua_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv){
|
||||
- lua_State *L = (Z_LUAVAL_P(object))->L;
|
||||
- zend_string *str_member;
|
||||
+zval *php_lua_read_property(zend_object *object, zend_string *member, int type, void **cache_slot, zval *rv){
|
||||
+ lua_State *L = php_lua_obj_from_obj(object)->L;
|
||||
|
||||
if (type != BP_VAR_R) {
|
||||
ZVAL_NULL(rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
- str_member = zval_get_string(member);
|
||||
#if (LUA_VERSION_NUM < 502)
|
||||
- lua_getfield(L, LUA_GLOBALSINDEX, ZSTR_VAL(str_member));
|
||||
+ lua_getfield(L, LUA_GLOBALSINDEX, ZSTR_VAL(member));
|
||||
#else
|
||||
- lua_getglobal(L, ZSTR_VAL(str_member));
|
||||
+ lua_getglobal(L, ZSTR_VAL(member));
|
||||
#endif
|
||||
- zend_string_release(str_member);
|
||||
|
||||
- php_lua_get_zval_from_lua(L, -1, object, rv);
|
||||
+ zval lua_zval_object;
|
||||
+ ZVAL_OBJ(&lua_zval_object, object);
|
||||
+
|
||||
+ php_lua_get_zval_from_lua(L, -1, &lua_zval_object, rv);
|
||||
lua_pop(L, 1);
|
||||
+
|
||||
return rv;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/** {{{ static void php_lua_write_property(zval *object, zval *member, zval *value)
|
||||
*/
|
||||
-static void php_lua_write_property(zval *object, zval *member, zval *value, void ** key) {
|
||||
- lua_State *L = (Z_LUAVAL_P(object))->L;
|
||||
- zend_string *str_member = zval_get_string(member);
|
||||
+static zval* php_lua_write_property(zend_object *object, zend_string *member, zval *value, void ** key) {
|
||||
+ lua_State *L = php_lua_obj_from_obj(object)->L;
|
||||
|
||||
#if (LUA_VERSION_NUM < 502)
|
||||
- php_lua_send_zval_to_lua(L, member);
|
||||
+ lua_pushlstring(L, ZSTR_VAL(val), ZSTR_LEN(val));
|
||||
php_lua_send_zval_to_lua(L, value);
|
||||
|
||||
lua_settable(L, LUA_GLOBALSINDEX);
|
||||
#else
|
||||
php_lua_send_zval_to_lua(L, value);
|
||||
- lua_setglobal(L, Z_STRVAL_P(member));
|
||||
+ lua_setglobal(L, ZSTR_VAL(member));
|
||||
#endif
|
||||
|
||||
- zend_string_release(str_member);
|
||||
+ return value;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From 7bf334832ad36d1f2976406d680b35a168ffaa91 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= <alexis.lothore@bootlin.com>
|
||||
Date: Mon, 8 Sep 2025 17:20:12 +0200
|
||||
Subject: [PATCH] lua.c: fix ZSTR_VAL usage when using lua < 5.2
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When using a lua interpreter with a version lower than 5.1, the
|
||||
php_lua_write_property ends up calling the ZSTR_VAL with the wrong
|
||||
variable (it is expected to receive "member", a zend_string variable,
|
||||
but it is "value" that is passed, which is a zval).
|
||||
|
||||
Fix php-lua compatibility with interpreters < 5.2 by passing the correct
|
||||
variable
|
||||
|
||||
Upstream: upstream dead, custom patch
|
||||
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
|
||||
---
|
||||
lua.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lua.c b/lua.c
|
||||
index a40e5da442a4..5889bc7f83ea 100755
|
||||
--- a/lua.c
|
||||
+++ b/lua.c
|
||||
@@ -244,7 +244,7 @@ static zval* php_lua_write_property(zend_object *object, zend_string *member, zv
|
||||
lua_State *L = php_lua_obj_from_obj(object)->L;
|
||||
|
||||
#if (LUA_VERSION_NUM < 502)
|
||||
- lua_pushlstring(L, ZSTR_VAL(val), ZSTR_LEN(val));
|
||||
+ lua_pushlstring(L, ZSTR_VAL(member), ZSTR_LEN(member));
|
||||
php_lua_send_zval_to_lua(L, value);
|
||||
|
||||
lua_settable(L, LUA_GLOBALSINDEX);
|
||||
--
|
||||
2.51.0
|
||||
|
||||
34
package/php-lua/0005-add-support-for-php-8.5.patch
Normal file
34
package/php-lua/0005-add-support-for-php-8.5.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 2c8b642b70edf5b0602b10a25d3f04874e175276 Mon Sep 17 00:00:00 2001
|
||||
From: Romain Naour <romain.naour@smile.fr>
|
||||
Date: Mon, 2 Feb 2026 22:12:48 +0100
|
||||
Subject: [PATCH] add support for php >= 8.5
|
||||
|
||||
php removed zend_exception_get_default() and replaced by zend_ce_exception.
|
||||
|
||||
[1] https://github.com/php/php-src/commit/a812a74c2e60a0ba080057067a7634e4da3f2b9b
|
||||
|
||||
Upstream: upstream dead, custom patch
|
||||
Signed-off-by: Romain Naour <romain.naour@smile.fr>
|
||||
---
|
||||
lua.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/lua.c b/lua.c
|
||||
index 5889bc7..62f8f0a 100755
|
||||
--- a/lua.c
|
||||
+++ b/lua.c
|
||||
@@ -871,7 +871,11 @@ PHP_MINIT_FUNCTION(lua) {
|
||||
|
||||
INIT_CLASS_ENTRY(ce, "LuaException", NULL);
|
||||
|
||||
+#if ((PHP_MAJOR_VERSION == 5) && (PHP_MINOR_VERSION < 5)) || (PHP_MAJOR_VERSION < 5)
|
||||
lua_exception_ce = zend_register_internal_class_ex(&ce, zend_exception_get_default());
|
||||
+#else
|
||||
+ lua_exception_ce = zend_register_internal_class_ex(&ce, zend_ce_exception);
|
||||
+#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
--
|
||||
2.52.0
|
||||
|
||||
11
package/php-lua/Config.in
Normal file
11
package/php-lua/Config.in
Normal file
@@ -0,0 +1,11 @@
|
||||
config BR2_PACKAGE_PHP_LUA
|
||||
bool "php-lua"
|
||||
depends on BR2_PACKAGE_HAS_LUAINTERPRETER
|
||||
help
|
||||
This extension embeds the lua interpreter and offers an
|
||||
OO-API to lua variables and functions.
|
||||
|
||||
https://pecl.php.net/package/lua
|
||||
|
||||
comment "php-lua needs the lua interpreter"
|
||||
depends on !BR2_PACKAGE_HAS_LUAINTERPRETER
|
||||
2
package/php-lua/php-lua.hash
Normal file
2
package/php-lua/php-lua.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
sha256 86545e1e09b79e3693dd93f2a5a8f15ea161b5a1928f315c7a27107744ee8772 lua-2.0.7.tgz
|
||||
sha256 b6e00df9cb3b91977c0d64a7c4db48cb6f5041f6eeda6583c236775f70a35b78 LICENSE
|
||||
39
package/php-lua/php-lua.mk
Normal file
39
package/php-lua/php-lua.mk
Normal file
@@ -0,0 +1,39 @@
|
||||
################################################################################
|
||||
#
|
||||
# php-lua
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PHP_LUA_VERSION = 2.0.7
|
||||
PHP_LUA_SITE = http://pecl.php.net/get
|
||||
PHP_LUA_SOURCE = lua-$(PHP_LUA_VERSION).tgz
|
||||
PHP_LUA_LICENSE = PHP-3.01
|
||||
PHP_LUA_LICENSE_FILES = LICENSE
|
||||
PHP_LUA_DEPENDENCIES = php luainterpreter host-autoconf host-pkgconf
|
||||
|
||||
PHP_LUA_CONF_OPTS = \
|
||||
--with-php-config=$(STAGING_DIR)/usr/bin/php-config \
|
||||
--with-lua=$(STAGING_DIR)/usr
|
||||
|
||||
# The php-lua package uses the following code to search for the lua library
|
||||
# if test "$PHP_LUA_VERSION" != "yes" -a "$PHP_LUA_VERSION" != "no"; then
|
||||
# LUA_LIB_SUFFIX=lua$PHP_LUA_VERSION
|
||||
# else
|
||||
# LUA_LIB_SUFFIX=lua
|
||||
# fi
|
||||
# LUA_LIB_NAME=lib$LUA_LIB_SUFFIX
|
||||
# luajit library name is libluajit-x.y with x.y the api version.
|
||||
# In order to use luajit, we use jit-x.y as "lua-version".
|
||||
ifeq ($(BR2_PACKAGE_LUAJIT),y)
|
||||
PHP_LUA_CONF_OPTS += --with-lua-version=jit-$(LUAINTERPRETER_ABIVER)
|
||||
endif
|
||||
|
||||
define PHP_LUA_PHPIZE
|
||||
(cd $(@D); \
|
||||
PHP_AUTOCONF=$(HOST_DIR)/bin/autoconf \
|
||||
PHP_AUTOHEADER=$(HOST_DIR)/bin/autoheader \
|
||||
$(STAGING_DIR)/usr/bin/phpize)
|
||||
endef
|
||||
PHP_LUA_PRE_CONFIGURE_HOOKS += PHP_LUA_PHPIZE
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user