From c605a7cc6e4fea0cd2eeaa55f5277843f33d0af9 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 23 Jul 2022 07:13:01 +0200 Subject: update to 2.7.0 drop patch merged upstream --- PHPINFO | 6 +-- REFLECTION | 15 +++---- php-pecl-sdl.spec | 10 ++--- sdl-pr60.patch | 126 ------------------------------------------------------ 4 files changed, 15 insertions(+), 142 deletions(-) delete mode 100644 sdl-pr60.patch diff --git a/PHPINFO b/PHPINFO index 2301e29..bf7ffd7 100644 --- a/PHPINFO +++ b/PHPINFO @@ -2,6 +2,6 @@ SDL SDL support => enabled -SDL module version => 2.6.0 -SDL2 headers version => 2.0.20 -SDL2 library version => 2.0.20 +SDL module version => 2.7.0 +SDL2 headers version => 2.0.22 +SDL2 library version => 2.0.22 diff --git a/REFLECTION b/REFLECTION index a00c702..197e7ed 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #120 SDL version 2.6.0 ] { +Extension [ extension #119 SDL version 2.7.0 ] { - Constants [738] { Constant [ int SDL_BLENDMODE_NONE ] { 0 } @@ -716,11 +716,11 @@ Extension [ extension #120 SDL version 2.6.0 ] { Constant [ int SDL_PREALLOC ] { 1 } Constant [ int SDL_RLEACCEL ] { 2 } Constant [ int SDL_DONTFREE ] { 4 } - Constant [ int SDL_COMPILEDVERSION ] { 2020 } + Constant [ int SDL_COMPILEDVERSION ] { 2022 } Constant [ int SDL_MAJOR_VERSION ] { 2 } Constant [ int SDL_MINOR_VERSION ] { 0 } - Constant [ int SDL_PATCHLEVEL ] { 20 } - Constant [ string SDL_REVISION ] { @21791b5012198ae204842be1197e9a0b915f4aaa } + Constant [ int SDL_PATCHLEVEL ] { 22 } + Constant [ string SDL_REVISION ] { @43731479f9fa870eec31a9c8686f1df088c0fda5 } Constant [ int SDL_WINDOW_FULLSCREEN ] { 1 } Constant [ int SDL_WINDOW_OPENGL ] { 2 } Constant [ int SDL_WINDOW_SHOWN ] { 4 } @@ -1064,7 +1064,7 @@ Extension [ extension #120 SDL version 2.6.0 ] { - Parameters [0] { } } - Function [ function SDL_GetRevisionNumber ] { + Function [ function SDL_GetRevisionNumber ] { - Parameters [0] { } @@ -1953,9 +1953,8 @@ Extension [ extension #120 SDL version 2.6.0 ] { } Function [ function SDL_GetKeyboardState ] { - - Parameters [2] { - Parameter #0 [ &$numkeys = ] - Parameter #1 [ $allkeys = ] + - Parameters [1] { + Parameter #0 [ ?int &$numkeys = ] } } Function [ function SDL_GetModState ] { diff --git a/php-pecl-sdl.spec b/php-pecl-sdl.spec index c202871..b8180f9 100644 --- a/php-pecl-sdl.spec +++ b/php-pecl-sdl.spec @@ -14,16 +14,13 @@ Summary: Simple DirectMedia Layer for PHP Name: %{?scl_prefix}php-pecl-sdl -Version: 2.6.0 +Version: 2.7.0 Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: PHP Group: Development/Languages URL: https://pecl.php.net/package/sdl Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz -# https://github.com/Ponup/php-sdl/pull/60 -Patch0: %{pecl_name}-pr60.patch - BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?scl_prefix}php-devel >= 8.0 @@ -72,7 +69,6 @@ mv %{pecl_name}-%{version} NTS cd NTS #sed -e 's/2.3.0/%{version}/' -i src/php_sdl.h -%patch0 -p1 -b .pr60 # Sanity check, really often broken extver=$(sed -n '/#define PHP_SDL_VERSION/{s/.* "//;s/".*$//;p}' src/php_sdl.h) @@ -202,6 +198,10 @@ fi %changelog +* Sat Jul 23 2022 Remi Collet - 2.7.0-1 +- update to 2.7.0 +- drop patch merged upstream + * Mon Mar 21 2022 Remi Collet - 2.6.0-1 - update to 2.6.0 - fix build with PHP 8.0 using patch from diff --git a/sdl-pr60.patch b/sdl-pr60.patch deleted file mode 100644 index 149a137..0000000 --- a/sdl-pr60.patch +++ /dev/null @@ -1,126 +0,0 @@ -From b6c4b90482558b18e0dba665768b1ad0855684d5 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 21 Mar 2022 08:21:19 +0100 -Subject: [PATCH 1/2] fix PHP 8.0 build - ---- - src/pixels.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/src/pixels.c b/src/pixels.c -index ef1525b..4594d58 100644 ---- a/src/pixels.c -+++ b/src/pixels.c -@@ -20,6 +20,12 @@ - #include "zend_interfaces.h" - #include "zend_operators.h" - -+/* for PHP 8.0 */ -+#ifndef ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX -+#define ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \ -+ ZEND_BEGIN_ARG_INFO_EX(name, 0, return_reference, required_num_args) -+#endif -+ - static zend_class_entry *php_sdl_color_ce; - static zend_object_handlers php_sdl_color_handlers; - struct php_sdl_color { - -From c5105dc060edec6d1291e36c3aed30e892630b14 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Mon, 21 Mar 2022 09:07:45 +0100 -Subject: [PATCH 2/2] register rect functions in rect.c - ---- - src/php_sdl.c | 18 +++--------------- - src/rect.c | 11 +++++++++++ - src/rect.h | 1 + - 3 files changed, 15 insertions(+), 15 deletions(-) - -diff --git a/src/php_sdl.c b/src/php_sdl.c -index 531f842..c409c6c 100644 ---- a/src/php_sdl.c -+++ b/src/php_sdl.c -@@ -31,7 +31,6 @@ - #include "power.h" - #include "pixels.h" - #include "rect.h" --#include "rect_arginfo.h" - #include "render.h" - #include "rwops.h" - #include "sdl.h" -@@ -68,6 +67,7 @@ zend_bool php_sdl_check_overflow(int a, int b, int silent) - - - #define PHP_MINIT_CALL(func) PHP_MINIT(func)(INIT_FUNC_ARGS_PASSTHRU) -+#define PHP_MSHUTDOWN_CALL(func) PHP_MSHUTDOWN(func)(SHUTDOWN_FUNC_ARGS_PASSTHRU) - - /* {{{ PHP_MINIT_FUNCTION */ - PHP_MINIT_FUNCTION(sdl) -@@ -107,6 +107,8 @@ PHP_MINIT_FUNCTION(sdl) - /* {{{ PHP_MSHUTDOWN_FUNCTION */ - PHP_MSHUTDOWN_FUNCTION(sdl) - { -+ PHP_MSHUTDOWN_CALL(sdl_rect); -+ - return SUCCESS; - } - /* }}} */ -@@ -260,20 +262,6 @@ static zend_function_entry sdl_functions[] = { - //PHP_FALIAS(SDL_BlitSurface, SDL_UpperBlit, arginfo_SDL_UpperBlit) - //PHP_FALIAS(SDL_BlitScaled, SDL_UpperBlitScaled, arginfo_SDL_UpperBlit) - -- // Rect -- ZEND_FE(SDL_RectEmpty, arginfo_SDL_RectEmpty) -- ZEND_FE(SDL_RectEquals, arginfo_SDL_RectEquals) -- ZEND_FE(SDL_HasIntersection, arginfo_SDL_HasIntersection) -- ZEND_FE(SDL_IntersectRect, arginfo_SDL_IntersectRect) -- ZEND_FE(SDL_UnionRect, arginfo_SDL_UnionRect) -- ZEND_FE(SDL_IntersectRectAndLine, arginfo_SDL_IntersectRectAndLine) -- ZEND_FE(SDL_EnclosePoints, arginfo_SDL_EnclosePoints) -- ZEND_FE(SDL_PointInRect, arginfo_SDL_PointInRect) -- -- ZEND_FE(SDL_FRectEmpty, arginfo_SDL_FRectEmpty) -- ZEND_FE(SDL_HasIntersectionF, arginfo_SDL_HasIntersectionF) -- ZEND_FE(SDL_IntersectFRect, arginfo_SDL_IntersectFRect) -- - // Events - ZEND_FE(SDL_WaitEvent, arginfo_SDL_WaitEvent) - ZEND_FE(SDL_PollEvent, arginfo_SDL_PollEvent) -diff --git a/src/rect.c b/src/rect.c -index 6773f56..926d1b2 100644 ---- a/src/rect.c -+++ b/src/rect.c -@@ -697,6 +697,8 @@ PHP_FUNCTION(SDL_PointInRect) - /* {{{ MINIT */ - PHP_MINIT_FUNCTION(sdl_rect) - { -+ zend_register_functions(NULL, ext_functions, NULL, type); -+ - php_sdl_rect_ce = register_class_SDL_Rect(); - memcpy(&php_sdl_rect_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); - -@@ -712,3 +714,12 @@ PHP_MINIT_FUNCTION(sdl_rect) - return SUCCESS; - } - /* }}} */ -+ -+/* {{{ PHP_MSHUTDOWN_FUNCTION */ -+PHP_MSHUTDOWN_FUNCTION(sdl_rect) -+{ -+ zend_unregister_functions(ext_functions, -1, NULL); -+ -+ return SUCCESS; -+} -+/* }}} */ -diff --git a/src/rect.h b/src/rect.h -index 67ba131..baddfd6 100644 ---- a/src/rect.h -+++ b/src/rect.h -@@ -40,6 +40,7 @@ zend_class_entry *get_php_sdl_fpoint_ce(void); - zend_bool zval_to_sdl_fpoint(zval *value, SDL_FPoint *rect); - - PHP_MINIT_FUNCTION(sdl_rect); -+PHP_MSHUTDOWN_FUNCTION(sdl_rect); - - #ifdef __cplusplus - } // extern "C" -- cgit