From 51cd97ae1d74e0cccd7173fdabb71f6af26bef62 Mon Sep 17 00:00:00 2001 From: Andy Postnikov Date: Sat, 13 Jun 2020 00:37:46 +0300 Subject: [PATCH] testing/php7-pecl-solr: fix license and improve --- testing/php7-pecl-solr/APKBUILD | 26 +++++++++++++++----------- testing/php7-pecl-solr/fix-musl.patch | 23 +++++++++++++++++++++++ testing/php7-pecl-solr/fix-tests.patch | 11 +++++++++++ 3 files changed, 49 insertions(+), 11 deletions(-) create mode 100644 testing/php7-pecl-solr/fix-musl.patch create mode 100644 testing/php7-pecl-solr/fix-tests.patch diff --git a/testing/php7-pecl-solr/APKBUILD b/testing/php7-pecl-solr/APKBUILD index 93c7c9172f8..6f2788cd6a8 100644 --- a/testing/php7-pecl-solr/APKBUILD +++ b/testing/php7-pecl-solr/APKBUILD @@ -3,36 +3,40 @@ pkgname=php7-pecl-solr _pkgreal=solr pkgver=2.5.0 -_pkgver=${pkgver} -pkgrel=0 +pkgrel=1 pkgdesc="Apache SOLR extension for PHP" -url="https://pecl.php.net/package/$_pkgreal" +url="https://pecl.php.net/package/solr" arch="all" -license="PHP" +license="PHP-3.01" depends="php7-json" -makedepends="php7-dev curl-dev libxml2-dev autoconf pcre-dev" -source="https://pecl.php.net/get/$_pkgreal-$_pkgver.tgz" -builddir="$srcdir"/$_pkgreal-$_pkgver +makedepends="php7-dev curl-dev libxml2-dev pcre-dev" +source="$pkgname-$pkgver.tgz::https://pecl.php.net/get/$_pkgreal-$pkgver.tgz + fix-musl.patch + fix-tests.patch" +builddir="$srcdir"/$_pkgreal-$pkgver provides="php7-solr=$pkgver-r$pkgrel" # for backward compatibility replaces="php7-solr" # for backward compatibility build() { - cd "$builddir" phpize7 ./configure --prefix=/usr --with-php-config=php-config7 make } check() { - # Require Solr installed php7 -d extension="$builddir"/modules/$_pkgreal.so --ri $_pkgreal + make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 SKIP_ONLINE_TESTS=1 test \ + PHP_TEST_SHARED_EXTENSIONS=" \ + -d extension=/usr/lib/php7/modules/json.so \ + -d extension=modules/$_pkgreal.so" } package() { - cd "$builddir" make INSTALL_ROOT="$pkgdir"/ install install -d "$pkgdir"/etc/php7/conf.d echo "extension=$_pkgreal.so" > "$pkgdir"/etc/php7/conf.d/40_$_pkgreal.ini } -sha512sums="5b24366942aa6eb0227da9d3d95bd0a9fd23a8163859e833c248cdab8f83391dc54df9fdae490ad9bc9bc5074b0b0c2c637918bc2f1738d5028f5e23c4d060cc solr-2.5.0.tgz" +sha512sums="5b24366942aa6eb0227da9d3d95bd0a9fd23a8163859e833c248cdab8f83391dc54df9fdae490ad9bc9bc5074b0b0c2c637918bc2f1738d5028f5e23c4d060cc php7-pecl-solr-2.5.0.tgz +4cd795db8597f9a7eaabd744e1531807e5a597bea05d2871fb452dd0c07ef22cbc0b55c68736986c147b0c23371d15412a9af35588acf1b8738e26c5cd337242 fix-musl.patch +553503d194c8c8c4db065a4c21136e51d4ba8bb9a74327d312a6506e12d91b4d2b72c5082741e961df7f3852fecf2374333c8f00a173ca2e6e7e6f1049ecf6cb fix-tests.patch" diff --git a/testing/php7-pecl-solr/fix-musl.patch b/testing/php7-pecl-solr/fix-musl.patch new file mode 100644 index 00000000000..655a2e00fd9 --- /dev/null +++ b/testing/php7-pecl-solr/fix-musl.patch @@ -0,0 +1,23 @@ +From 3f3fb4ec3546acdf80cc2957636d41de8d1a6cf4 Mon Sep 17 00:00:00 2001 +From: Andy Postnikov +Date: Sat, 13 Jun 2020 02:02:55 +0300 +Subject: [PATCH] Fix float parsing on musl + +Using the zend strtod implementation fixes this. +--- + src/php7/solr_functions_params.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/php7/solr_functions_params.c b/src/php7/solr_functions_params.c +index 584577f..1cdfce5 100644 +--- a/src/php7/solr_functions_params.c ++++ b/src/php7/solr_functions_params.c +@@ -766,7 +766,7 @@ PHP_SOLR_API void solr_normal_param_value_display_double(solr_param_t *solr_para + { + solr_param_value_t *current_ptr = solr_param->head; + +- double return_value = atof(current_ptr->contents.normal.str); ++ double return_value = zend_strtod(current_ptr->contents.normal.str, (const char **) NULL); + + ZVAL_DOUBLE(param_value, return_value); + } diff --git a/testing/php7-pecl-solr/fix-tests.patch b/testing/php7-pecl-solr/fix-tests.patch new file mode 100644 index 00000000000..58dd72ce456 --- /dev/null +++ b/testing/php7-pecl-solr/fix-tests.patch @@ -0,0 +1,11 @@ +Summary: skip tests which require solr server +--- a/tests/test.config.inc ++++ b/tests/test.config.inc +@@ -1,6 +1,6 @@ +