summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--REFLECTION2
-rw-r--r--php-pecl-termbox.spec38
-rw-r--r--termbox-php7.patch145
3 files changed, 21 insertions, 164 deletions
diff --git a/REFLECTION b/REFLECTION
index 6696425..7f521f9 100644
--- a/REFLECTION
+++ b/REFLECTION
@@ -1,4 +1,4 @@
-Extension [ <persistent> extension #150 termbox version 0.1.2 ] {
+Extension [ <persistent> extension #118 termbox version 0.1.3 ] {
- Constants [100] {
Constant [ integer TB_KEY_F1 ] { 65535 }
diff --git a/php-pecl-termbox.spec b/php-pecl-termbox.spec
index 3760499..675ee6a 100644
--- a/php-pecl-termbox.spec
+++ b/php-pecl-termbox.spec
@@ -6,7 +6,14 @@
#
# Please, preserve the changelog entries
#
-%{?scl: %scl_package php-pecl-termbox}
+%if 0%{?scl:1}
+%if "%{scl}" == "rh-php56"
+%global sub_prefix more-php56-
+%else
+%global sub_prefix %{scl_prefix}
+%endif
+%scl_package php-pecl-termbox
+%endif
%global with_zts 0%{?__ztsphp:1}
%global pecl_name termbox
@@ -18,18 +25,14 @@
%endif
Summary: A termbox wrapper for PHP
-Name: %{?scl_prefix}php-pecl-%{pecl_name}
-Version: 0.1.2
-Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Name: %{?sub_prefix}php-pecl-%{pecl_name}
+Version: 0.1.3
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: ASL 2.0
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
-# Upstream patch
-Patch0: %{pecl_name}-php7.patch
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: termbox-devel
BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
@@ -44,8 +47,10 @@ Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
+%if "%{?scl_prefix}" != "%{?sub_prefix}"
Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+%endif
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
# Other third party repo stuff
@@ -65,6 +70,10 @@ Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
%endif
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
+Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
+%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
@@ -93,9 +102,6 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
-
-%patch0 -p1 -b .php7
-
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_TERMBOX_VERSION/{s/.* "//;s/".*$//;p}' php_termbox.h)
if test "x${extver}" != "x%{version}"; then
@@ -133,8 +139,6 @@ make %{?_smp_mflags}
%install
-rm -rf %{buildroot}
-
make -C NTS install INSTALL_ROOT=%{buildroot}
# install config file
@@ -209,12 +213,7 @@ REPORT_EXIT_STATUS=1 \
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%doc %{pecl_docdir}/%{pecl_name}
%{?_licensedir:%license NTS/LICENSE}
@@ -229,6 +228,9 @@ rm -rf %{buildroot}
%changelog
+* Thu Sep 01 2016 Remi Collet <remi@fedoraproject.org> - 0.1.3-1
+- Update to 0.1.3
+
* Sun Mar 6 2016 Remi Collet <remi@fedoraproject.org> - 0.1.2-8
- adapt for F24
diff --git a/termbox-php7.patch b/termbox-php7.patch
deleted file mode 100644
index 2eb0608..0000000
--- a/termbox-php7.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From 02a7c1c0a05614bd42e9d624aeda3be90d476f3a Mon Sep 17 00:00:00 2001
-From: Remi Collet <remi@php.net>
-Date: Sat, 28 Mar 2015 11:56:23 +0100
-Subject: [PATCH] PHP 7 compatibility
-
----
- php_termbox.h | 10 ++++++++++
- termbox.c | 30 +++++++++++++++++-------------
- 2 files changed, 27 insertions(+), 13 deletions(-)
-
-diff --git a/php_termbox.h b/php_termbox.h
-index 179dcd3..c21ac75 100644
---- a/php_termbox.h
-+++ b/php_termbox.h
-@@ -89,6 +89,16 @@ PHP_FUNCTION(termbox_last_error);
- #define TERMBOX_G(v) (termbox_globals.v)
- #endif
-
-+#if PHP_MAJOR_VERSION < 7
-+typedef long zend_long;
-+typedef int strsize;
-+#define TERMBOX_RETSTRL(a,l) RETURN_STRINGL(a,l,1)
-+#else
-+typedef size_t strsize;
-+#define TSRMLS_CC
-+#define TERMBOX_RETSTRL(a,l) RETURN_STRINGL(a,l)
-+#endif
-+
- #endif /* PHP_TERMBOX_H */
-
- /*
-diff --git a/termbox.c b/termbox.c
-index 0b51b0f..575b5dd 100644
---- a/termbox.c
-+++ b/termbox.c
-@@ -149,8 +149,7 @@ PHP_MINIT_FUNCTION(termbox)
- ZEND_INIT_MODULE_GLOBALS(termbox, _termbox_init_globals, NULL);
-
- /** Register constants */
-- #define PHP_TERMBOX_CONSTANT(NAME) \
-- zend_register_long_constant(#NAME, sizeof(#NAME), NAME, CONST_CS | CONST_PERSISTENT, module_number TSRMLS_CC);
-+ #define PHP_TERMBOX_CONSTANT(NAME) REGISTER_LONG_CONSTANT(#NAME, NAME, CONST_CS | CONST_PERSISTENT);
- #include "constants.h"
- #undef PHP_TERMBOX_CONSTANT
- return SUCCESS;
-@@ -262,7 +261,8 @@ PHP_FUNCTION(termbox_clear)
- initialized yet. */
- PHP_FUNCTION(termbox_set_clear_attributes)
- {
-- long fg, bg;
-+ zend_long fg, bg;
-+
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &fg, &bg) == FAILURE) {
- return;
- }
-@@ -292,7 +292,8 @@ PHP_FUNCTION(termbox_present)
- Cursor is hidden by default. Return FALSE if not initialized yet. */
- PHP_FUNCTION(termbox_set_cursor)
- {
-- long x, y;
-+ zend_long x, y;
-+
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ll", &x, &y) == FAILURE) {
- return;
- }
-@@ -307,7 +308,8 @@ PHP_FUNCTION(termbox_set_cursor)
- position. Return FALSE if not initialized yet. */
- PHP_FUNCTION(termbox_change_cell)
- {
-- long x, y, ch, fg, bg;
-+ zend_long x, y, ch, fg, bg;
-+
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lllll", &x, &y, &ch, &fg, &bg) == FAILURE) {
- return;
- }
-@@ -322,7 +324,8 @@ PHP_FUNCTION(termbox_change_cell)
- if not yet initialized. */
- PHP_FUNCTION(termbox_set_input_mode)
- {
-- long mode;
-+ zend_long mode;
-+
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &mode) == FAILURE) {
- return;
- }
-@@ -354,7 +357,8 @@ PHP_FUNCTION(termbox_get_input_mode) {
- yet initialized. */
- PHP_FUNCTION(termbox_set_output_mode)
- {
-- long mode;
-+ zend_long mode;
-+
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &mode) == FAILURE) {
- return;
- }
-@@ -398,7 +402,7 @@ static void _termbox_event_to_php_array(struct tb_event *event, zval *event_arr)
- NULL. If an error occurrs, return FALSE. */
- PHP_FUNCTION(termbox_peek_event)
- {
-- long timeout_ms;
-+ zend_long timeout_ms;
- struct tb_event event;
- int rc;
-
-@@ -449,7 +453,7 @@ PHP_FUNCTION(termbox_poll_event)
- PHP_FUNCTION(termbox_utf8_char_to_unicode)
- {
- char *str;
-- int str_len;
-+ strsize str_len;
- uint32_t unicode_int;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
-@@ -470,7 +474,7 @@ PHP_FUNCTION(termbox_utf8_unicode_to_char)
- {
- char str[7];
- int str_len;
-- long unicode;
-+ zend_long unicode;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &unicode) == FAILURE) {
- return;
-@@ -483,7 +487,7 @@ PHP_FUNCTION(termbox_utf8_unicode_to_char)
- str_len = 0;
- }
-
-- RETURN_STRINGL(str, str_len, 1);
-+ TERMBOX_RETSTRL(str, str_len);
- }
- /* }}} */
-
-@@ -493,8 +497,8 @@ PHP_FUNCTION(termbox_utf8_unicode_to_char)
- PHP_FUNCTION(termbox_print)
- {
- char *str;
-- int str_len;
-- long x, y, fg, bg;
-+ strsize str_len;
-+ zend_long x, y, fg, bg;
- uint32_t unicode;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sllll", &str, &str_len, &x, &y, &fg, &bg) == FAILURE) {
---
-2.1.4
-