build out of sources tree
This commit is contained in:
Remi Collet 2023-10-03 08:03:03 +02:00
parent 15c3d91c28
commit a5b82734e3
3 changed files with 99 additions and 27 deletions

15
apcu-php83.patch Normal file
View File

@ -0,0 +1,15 @@
diff --git a/tests/typed_prop.phpt b/tests/typed_prop.phpt
index 80f0d3c..04e87c9 100644
--- a/tests/typed_prop.phpt
+++ b/tests/typed_prop.phpt
@@ -28,8 +28,8 @@ try {
var_dump($test->array);
?>
---EXPECT--
+--EXPECTF--
bool(true)
-Cannot assign bool to reference held by property Test::$array of type array
+Cannot assign %s to reference held by property Test::$array of type array
array(0) {
}

49
apcu-tests.patch Normal file
View File

@ -0,0 +1,49 @@
From 22a39fe4cb2db46aaf660ef2f724b4cd813d2481 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Tue, 6 Jun 2023 11:08:10 +0200
Subject: [PATCH] use TEST_PHP_ARGS if set
---
tests/server_test.inc | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/tests/server_test.inc b/tests/server_test.inc
index 88c7045..5e60f47 100644
--- a/tests/server_test.inc
+++ b/tests/server_test.inc
@@ -16,6 +16,7 @@ function server_start_one($host, $port, $code = 'echo "Hello world";', $php_opts
global $doc_root, $router, $handles, $ports;
$php_executable = getenv('TEST_PHP_EXECUTABLE');
+ $php_args = getenv('TEST_PHP_ARGS');
$descriptorspec = array(
0 => STDIN,
@@ -23,16 +24,18 @@ function server_start_one($host, $port, $code = 'echo "Hello world";', $php_opts
2 => STDERR,
);
- $ext = (substr(PHP_OS, 0, 3) == 'WIN') ? 'php_apcu.dll' : 'apcu.so';
- if (substr(PHP_OS, 0, 3) == 'WIN') {
- $part0 = 8 == PHP_INT_SIZE ? "x64" : "";
- $part1 = ZEND_DEBUG_BUILD ? "Debug" : "Release";
- $part1 = PHP_ZTS ? ($part1 . "_TS") : $part1;
- $php_args = "-d extension_dir=$doc_root/../$part0/$part1";
- } else {
- $php_args = "-d extension_dir=$doc_root/../modules";
+ if (!$php_args) {
+ $ext = (substr(PHP_OS, 0, 3) == 'WIN') ? 'php_apcu.dll' : 'apcu.so';
+ if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $part0 = 8 == PHP_INT_SIZE ? "x64" : "";
+ $part1 = ZEND_DEBUG_BUILD ? "Debug" : "Release";
+ $part1 = PHP_ZTS ? ($part1 . "_TS") : $part1;
+ $php_args = "-d extension_dir=$doc_root/../$part0/$part1";
+ } else {
+ $php_args = "-d extension_dir=$doc_root/../modules";
+ }
+ $php_args = "$php_args -d extension=$ext";
}
- $php_args = "$php_args -d extension=$ext";
if ($php_opts) {
$php_args = "$php_args -d " . implode(' -d ', $php_opts);;

View File

@ -7,22 +7,24 @@
# Please, preserve the changelog entries
#
# we don't want -z defs linker flag
%undefine _strict_symbol_defs_build
%global pecl_name apcu
%global with_zts 0%{?__ztsphp:1}
%global ini_name 40-%{pecl_name}.ini
%global pecl_name apcu
%global with_zts 0%{?__ztsphp:1}
%global ini_name 40-%{pecl_name}.ini
%global sources %{pecl_name}-%{version}
%global _configure ../%{sources}/configure
Name: php-pecl-apcu
Summary: APC User Cache
Version: 5.1.22
Release: 6%{?dist}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
Source0: https://pecl.php.net/get/%{sources}.tgz
Source1: %{pecl_name}.ini
Source2: %{pecl_name}-panel.conf
Source3: %{pecl_name}.conf.php
Patch0: %{pecl_name}-php83.patch
Patch1: %{pecl_name}-tests.patch
License: PHP-3.01
URL: https://pecl.php.net/package/APCu
@ -79,11 +81,13 @@ configuration, available on http://localhost/apcu-panel/
%prep
%setup -qc
mv %{pecl_name}-%{version} NTS
sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml
cd NTS
cd %{sources}
%patch -P0 -p1 -b.php83
%patch -P1 -p1 -b.pr490
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APCU_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
if test "x${extver}" != "x%{version}"; then
@ -92,30 +96,31 @@ if test "x${extver}" != "x%{version}"; then
fi
cd ..
mkdir NTS
%if %{with_zts}
# duplicate for ZTS build
cp -pr NTS ZTS
mkdir ZTS
%endif
# Fix path to configuration file
sed -e s:apc.conf.php:%{_sysconfdir}/apcu-panel/conf.php:g \
-i NTS/apc.php
-i %{sources}/apc.php
%build
cd NTS
%{_bindir}/phpize
cd %{sources}
%{__phpize}
cd ../NTS
%configure \
--enable-apcu \
--with-php-config=%{_bindir}/php-config
--with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
%{_bindir}/zts-phpize
%configure \
--enable-apcu \
--with-php-config=%{_bindir}/zts-php-config
--with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@ -136,7 +141,7 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# Install the Control Panel
# Pages
install -D -m 644 -p NTS/apc.php \
install -D -m 644 -p %{sources}/apc.php \
%{buildroot}%{_datadir}/apcu-panel/index.php
# Apache config
install -D -m 644 -p %{SOURCE2} \
@ -146,7 +151,7 @@ install -D -m 644 -p %{SOURCE3} \
%{buildroot}%{_sysconfdir}/apcu-panel/conf.php
# Test & Documentation
cd NTS
cd %{sources}
for i in $(grep 'role="test"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
done
@ -156,21 +161,20 @@ done
%check
cd NTS
%{_bindir}/php -n \
cd %{sources}
%{__php} -n \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
-m | grep 'apcu'
-m | grep '^apcu$'
# Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{_bindir}/php \
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
%{_bindir}/php -n run-tests.php -q --show-diff
%{__php} -n run-tests.php -q --show-diff
%if %{with_zts}
cd ../ZTS
%{__ztsphp} -n \
-d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
-m | grep 'apcu'
-m | grep '^apcu$'
# Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
@ -180,7 +184,7 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
%files
%license NTS/LICENSE
%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@ -211,6 +215,10 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
%changelog
* Tue Oct 03 2023 Remi Collet <remi@remirepo.net> - 5.1.22-6
- rebuild for https://fedoraproject.org/wiki/Changes/php83
- build out of sources tree
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.1.22-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild