From e94c92f1d06d713baecbf5230a0f30b371c4b3c9 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 6 Sep 2024 07:17:30 +0200 Subject: update to 1.0.8 drop patches merged upstream add patch to use pkg-config by default --- 61.patch | 30 - 64.patch | 31 - LICENSE | 1825 -------------------------------------------------- PHPINFO | 4 +- REFLECTION | 2 +- config.m4 | 60 -- php-pecl-phpy.spec | 35 +- phpy-pkgconfig.patch | 19 + 8 files changed, 34 insertions(+), 1972 deletions(-) delete mode 100644 61.patch delete mode 100644 64.patch delete mode 100644 LICENSE delete mode 100644 config.m4 create mode 100644 phpy-pkgconfig.patch diff --git a/61.patch b/61.patch deleted file mode 100644 index 19dca69..0000000 --- a/61.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c69b1c59e15402fad6def1a82c97730831af01b0 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 20 Aug 2024 10:30:31 +0200 -Subject: [PATCH] this is a c++ ext, use proper linker command - ---- - config.m4 | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/config.m4 b/config.m4 -index da07656..e63353a 100644 ---- a/config.m4 -+++ b/config.m4 -@@ -48,7 +48,6 @@ if test "$PHP_PHPY" != "no"; then - fi - - PHP_REQUIRE_CXX() -- PHP_ADD_LIBRARY(stdc++, 1, PHPY_SHARED_LIBADD) - - PHP_SUBST(PHPY_SHARED_LIBADD) - -@@ -69,7 +68,7 @@ if test "$PHP_PHPY" != "no"; then - phpy_source_files=$(cd $phpy_source_dir && find src -type f -name "*.cc") - phpy_source_files="phpy.cc $phpy_source_files" - -- PHP_NEW_EXTENSION(phpy, $phpy_source_files , $ext_shared) -+ PHP_NEW_EXTENSION(phpy, $phpy_source_files , $ext_shared,,, cxx) - - AC_MSG_RESULT([$ext_builddir]) - diff --git a/64.patch b/64.patch deleted file mode 100644 index f342d23..0000000 --- a/64.patch +++ /dev/null @@ -1,31 +0,0 @@ -From b3159e9d7d6ed9104246f183a3bad07e6cdfe187 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Tue, 20 Aug 2024 11:15:45 +0200 -Subject: [PATCH] report extension and python version - ---- - phpy.cc | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/phpy.cc b/phpy.cc -index 0690a0a..20f42b8 100644 ---- a/phpy.cc -+++ b/phpy.cc -@@ -7,6 +7,7 @@ - #include "php.h" - #include "ext/standard/info.h" - #include "php_phpy.h" -+#include - - /* {{{ PHP_RINIT_FUNCTION */ - PHP_RINIT_FUNCTION(phpy) -@@ -31,7 +32,8 @@ PHP_MINFO_FUNCTION(phpy) - php_info_print_table_row(2, "Copyright", "上海识沃网络科技有限公司"); - php_info_print_table_row(2, "Email", "service@swoole.com"); - php_info_print_table_row(2, "Website", "https://www.swoole.com/"); -- php_info_print_table_row(2, "Version", PHP_PHPY_VERSION); -+ php_info_print_table_row(2, "Extension Version", PHP_PHPY_VERSION); -+ php_info_print_table_row(2, "Python Version", PY_VERSION); - php_info_print_table_end(); - } - /* }}} */ diff --git a/LICENSE b/LICENSE deleted file mode 100644 index c4e69de..0000000 --- a/LICENSE +++ /dev/null @@ -1,1825 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - phpy/LICENSE at 1.0.6 · swoole/phpy · GitHub - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- Skip to content - - - - - - - - - - - -
-
- - - - - - - - - - - - - - -
- -
- - - - - - - - -
- - - - - -
- - - - - - - - - -
-
-
- - - - - - - - - - - - -
- -
- -
- -
- - - - / - - phpy - - - Public -
- - -
- -
- - -
-
- -
-
- - - - -
- - - - - - -
- - - - - - - - - - - - - - - - - - -
-
- - - - -
- -
- -
-
- -
- -
-

Footer

- - - - -
-
- - - - - © 2024 GitHub, Inc. - -
- - -
-
- - - - - - - - - - - - - - - - - - - -
- -
-
- - - diff --git a/PHPINFO b/PHPINFO index bd983cc..333f3e3 100644 --- a/PHPINFO +++ b/PHPINFO @@ -5,5 +5,5 @@ phpy support => enabled Copyright => 上海识沃网络科技有限公司 Email => service@swoole.com Website => https://www.swoole.com/ -Extension Version => 1.0.6 -Python Version => 3.12.4 +Extension Version => 1.0.8 +Python Version => 3.12.5 (main, Aug 7 2024, 00:00:00) [GCC 13.3.1 20240522 (Red Hat 13.3.1-1)] diff --git a/REFLECTION b/REFLECTION index 2e069be..d04c4e7 100644 --- a/REFLECTION +++ b/REFLECTION @@ -1,4 +1,4 @@ -Extension [ extension #87 phpy version 1.0.6 ] { +Extension [ extension #88 phpy version 1.0.8 ] { - Classes [13] { Class [ class PyCore ] { diff --git a/config.m4 b/config.m4 deleted file mode 100644 index f10fc79..0000000 --- a/config.m4 +++ /dev/null @@ -1,60 +0,0 @@ -dnl $Id$ -dnl config.m4 for extension phpy - -PHP_ARG_WITH([python_version], - [version of python], - [AS_HELP_STRING([[--with-python-version[=VERSION]]], - [Specify version of python, or use default (ex: 3.12)])], [no], [no]) - -PHP_ARG_ENABLE([phpy], - [whether to enable phpy support], - [AS_HELP_STRING([--enable-phpy], - [Enable phpy support])], - [no]) - -if test "$PHP_PHPY" != "no"; then - dnl modern version use python3-embed, old (<= 3.6) use python3 - if test "$PHP_PYTHON_VERSION" = "no"; then - PKG_CHECK_MODULES([PYTHON], [python3-embed],, - [PKG_CHECK_MODULES([PYTHON], [python3])] - ) - else - PKG_CHECK_MODULES([PYTHON], [python-${PHP_PYTHON_VERSION}-embed],, - [PKG_CHECK_MODULES([PYTHON], [python-${PHP_PYTHON_VERSION}])] - ) - fi - PHP_EVAL_LIBLINE($PYTHON_LIBS, PHPY_SHARED_LIBADD) - PHP_EVAL_INCLINE($PYTHON_CFLAGS) - - PHP_REQUIRE_CXX() - - PHP_SUBST(PHPY_SHARED_LIBADD) - - AC_DEFINE(HAVE_PHPY, 1, [ Have phpy support ]) - - EXTRAS_CXXFLAGS="-Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -z now" - EXTRAS_CXXFLAGS="$EXTRAS_CXXFLAGS -std=c++14" - - if test -f "$abs_srcdir/phpy.cc"; then - phpy_source_dir=$abs_srcdir - elif test -f "phpy.cc"; then - phpy_source_dir=$(pwd) - else - phpy_source_dir="ext/phpy" - fi - - dnl AC_MSG_RESULT([$phpy_source_dir]) - - phpy_source_files=$(cd $phpy_source_dir && find src -type f -name "*.cc") - phpy_source_files="phpy.cc $phpy_source_files" - - PHP_NEW_EXTENSION(phpy, $phpy_source_files , $ext_shared,, $EXTRAS_CXXFLAGS, cxx) - - dnl AC_MSG_RESULT([$ext_builddir]) - - PHP_ADD_INCLUDE([$ext_srcdir/include]) - PHP_ADD_BUILD_DIR($ext_builddir/src) - PHP_ADD_BUILD_DIR($ext_builddir/src/bridge) - PHP_ADD_BUILD_DIR($ext_builddir/src/php) - PHP_ADD_BUILD_DIR($ext_builddir/src/python) -fi diff --git a/php-pecl-phpy.spec b/php-pecl-phpy.spec index f5d13c2..3f00af4 100644 --- a/php-pecl-phpy.spec +++ b/php-pecl-phpy.spec @@ -6,11 +6,7 @@ # # Please, preserve the changelog entries # -%if 0%{?scl:1} -%scl_package php-pecl-phpy -%else -%global _root_bindir %{_bindir} -%endif +%{?scl:%scl_package php-pecl-phpy} %global pecl_name phpy %global ini_name 40-%{pecl_name}.ini @@ -21,16 +17,15 @@ Summary: An extension for inter-calling Python and PHP Name: %{?scl_prefix}php-pecl-%{pecl_name} -Version: 1.0.6 -Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Version: 1.0.8 +Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: Apache-2.0 URL: https://pecl.php.net/package/%{pecl_name} Source0: https://pecl.php.net/get/%{sources}.tgz -Source1: https://github.com/swoole/phpy/blob/%{version}/LICENSE -Source2: config.m4 -Patch0: 61.patch -Patch1: 64.patch +# Always use pkg-config instead of python3-config +# see https://github.com/swoole/phpy/pull/65 +Patch0: %{pecl_name}-pkgconfig.patch BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -60,7 +55,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # Don't install/register tests sed -e 's/role="test"/role="src"/' \ - -e '/README/s/role="src"/role="doc"/' \ -e '/LICENSE/s/role="doc"/role="src"/' \ -i package.xml @@ -68,17 +62,7 @@ cd %{sources} # drop unneeded options (keep std=c++14) sed -s '/-Wall/d' -i config.m4 -# See https://github.com/swoole/phpy/pull/61 -%patch -P0 -p1 -b .pr61 - -# See https://github.com/swoole/phpy/pull/64 -%patch -P1 -p1 -b .pr64 - -# See https://github.com/swoole/phpy/pull/65 -cp %{SOURCE2} . - -# See https://github.com/swoole/phpy/pull/62 -cp %{SOURCE1} . +%patch -P0 -p1 -b .pkg # Sanity check, really often broken extver=$(sed -n '/# define PHP_PHPY_VERSION/{s/.* "//;s/".*$//;p}' php_phpy.h) @@ -179,6 +163,11 @@ cd %{sources} %changelog +* Fri Sep 6 2024 Remi Collet - 1.0.8-1 +- update to 1.0.8 +- drop patches merged upstream +- add patch to use pkg-config by default + * Wed Aug 21 2024 Remi Collet - 1.0.6-3 - test build for PR 65 diff --git a/phpy-pkgconfig.patch b/phpy-pkgconfig.patch new file mode 100644 index 0000000..2c9e7a3 --- /dev/null +++ b/phpy-pkgconfig.patch @@ -0,0 +1,19 @@ +diff -up phpy-1.0.8/config.m4.old phpy-1.0.8/config.m4 +--- phpy-1.0.8/config.m4.old 2024-09-06 06:58:54.678666785 +0200 ++++ phpy-1.0.8/config.m4 2024-09-06 06:59:02.749976475 +0200 +@@ -68,9 +68,12 @@ if test "$PHP_PHPY" != "no"; then + PHP_EVAL_LIBLINE($PYTHON_LIBS, PHPY_SHARED_LIBADD) + PHP_EVAL_INCLINE($PYTHON_CFLAGS) + else +- PHP_PYTHON_CONFIG="python3-config" +- GET_PYTHON_INCLUDES() +- GET_PYTHON_LDFLAGS() ++ dnl modern version use python3-embed, old (<= 3.6) use python3 ++ PKG_CHECK_MODULES([PYTHON], [python3-embed],, ++ [PKG_CHECK_MODULES([PYTHON], [python3])] ++ ) ++ PHP_EVAL_LIBLINE($PYTHON_LIBS, PHPY_SHARED_LIBADD) ++ PHP_EVAL_INCLINE($PYTHON_CFLAGS) + fi + + PHP_REQUIRE_CXX() -- cgit