summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-10-12 11:33:32 +0200
committerRemi Collet <remi@remirepo.net>2017-10-12 11:33:32 +0200
commiteda11ce9f13cd0582be607551a41e52c7b57c932 (patch)
tree1b2afb6a76bc632fdc73d641861aa85fa05783be
parentfb371cc729a625035332ba599de9406a0a317652 (diff)
v1.1.0
-rw-r--r--Makefile3
-rw-r--r--REFLECTION8
-rw-r--r--php-zephir-parser-build.patch74
-rw-r--r--php-zephir-parser.spec41
4 files changed, 108 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 91b0fd5..8357299 100644
--- a/Makefile
+++ b/Makefile
@@ -2,3 +2,6 @@ SRCDIR := $(shell pwd)
NAME := $(shell basename $(SRCDIR))
include ../../common/Makefile
+refl:
+ php -d extension=zephir_parser.so --re "zephir parser" > REFLECTION
+
diff --git a/REFLECTION b/REFLECTION
new file mode 100644
index 0000000..8d8785c
--- /dev/null
+++ b/REFLECTION
@@ -0,0 +1,8 @@
+Extension [ <persistent> extension #185 Zephir Parser version 1.1.0 ] {
+
+ - Functions {
+ Function [ <internal:Zephir Parser> function zephir_parse_file ] {
+ }
+ }
+}
+
diff --git a/php-zephir-parser-build.patch b/php-zephir-parser-build.patch
new file mode 100644
index 0000000..6c16bcb
--- /dev/null
+++ b/php-zephir-parser-build.patch
@@ -0,0 +1,74 @@
+diff -up ./install.rpm ./install
+--- ./install.rpm 2017-10-12 11:26:32.000000000 +0200
++++ ./install 2017-10-12 11:29:16.000000000 +0200
+@@ -33,7 +33,6 @@ fi
+
+ # Check best compilation flags for compiler
+ export CC=gcc
+-export CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer"
+
+ # Set defaults
+ PHPIZE_BIN=$(command -v phpize 2>/dev/null)
+@@ -74,28 +73,6 @@ if [ "${PHP_FULL_VERSION:0:3}" == "5.4"
+ exit 1
+ fi
+
+-# Detect possible flags
+-echo "int main() {}" > t.c
+-gcc ${CFLAGS} t.c -o t 2> t.t
+-if [ $? != 0 ]; then
+- chmod +x gcccpuopt
+- BFLAGS=`./gcccpuopt`
+- export CFLAGS="-O2 -fomit-frame-pointer $BFLAGS"
+- gcc ${CFLAGS} t.c -o t 2> t.t
+- if [ $? != 0 ]; then
+- export CFLAGS="-O2"
+- fi
+-fi
+-
+-# Activate some gcc specific optimizations for gcc >= 4
+-if [ $(gcc -dumpversion | cut -f1 -d.) -ge 4 ]; then
+- gcc ${CFLAGS} -fvisibility=hidden t.c -o t 2> t.t && export CFLAGS="$CFLAGS -fvisibility=hidden"
+-fi
+-
+-gcc ${CFLAGS} -flto t.c -o t 2> t.t && { export CFLAGS="$CFLAGS -flto"; export LDFLAGS="$LDFLAGS $CFLAGS"; }
+-
+-rm -f t.t t.c t
+-
+ cd ${CURRENT_DIR}/parser
+
+ # Cleanup
+@@ -166,33 +143,3 @@ if [ "$(uname -s 2>/dev/null)" = "Darwin
+ aclocal && ${LIBTOOLIZE_BIN} --force && autoheader && autoconf
+ fi
+
+-./configure --silent --with-php-config=${PHPCONFIG_BIN} --enable-zephir_parser
+-
+-make -s -j"$(getconf _NPROCESSORS_ONLN)"
+-make -s install
+-
+-# Clean current compilation
+-if [ -f Makefile ]; then
+- make -s clean
+- ${PHPIZE_BIN} --clean
+-fi
+-
+-cd ${CURRENT_DIR}/parser
+-
+-# Cleanup
+-rm -f \
+- *.o \
+- *.lo \
+- lemon \
+- scanner.c \
+- parser.c \
+- parser.php5.c \
+- parser.php5.h \
+- parser.php5.out \
+- parser.php7.c \
+- parser.php7.h \
+- parser.php7.out \
+- config.h.in~
+-
+-echo -e "\nThanks for compiling Zephir Parser!\nBuild succeed: Please restart your web server to complete the installation\n"
+-
diff --git a/php-zephir-parser.spec b/php-zephir-parser.spec
index 1f919f3..3bd4402 100644
--- a/php-zephir-parser.spec
+++ b/php-zephir-parser.spec
@@ -19,7 +19,7 @@
%endif
%endif
-%global gh_commit 475ce655ff418856c2ca836e10995907dbbc9b73
+%global gh_commit 0d16308092c2ff663dfc73e44a654e64d66362be
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20161126
%global gh_owner phalcon
@@ -27,7 +27,7 @@
%global ext_name zephir_parser
Name: %{?scl_prefix}%{gh_project}
-Version: 1.0.3
+Version: 1.1.0
Release: 1%{?gh_date:.%{gh_date}git%{gh_short}}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: Zephir parser extension
@@ -36,15 +36,11 @@ License: MIT
URL: https://getcomposer.org/
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+# honours RPM build flags and drop configure/make/install part
+Patch0: %{gh_project}-build.patch
+
BuildRequires: %{?scl_prefix}php-devel > 5.5
BuildRequires: re2c
-%if %{with_tests}
-# From composer.json, "require"
-# "phpunit/phpunit": "^4.8"
-BuildRequires: php-composer(phpunit/phpunit) >= 4.8
-# For test autoloader
-BuildRequires: php-composer(theseer/autoload)
-%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
@@ -61,12 +57,11 @@ The Zephir Parser delivered as a C extension for the PHP language.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-
-# drop install and cleanup stuff
-sed -e '/-s install/,$d' -i install
+%patch0 -p1 -b .rpm
+grep CFLAGS install && exit 1
# Sanity check, really often broken
-extver=$(sed -n '/#define PHP_ZEPHIR_PARSER_VERSION/{s/.* "//;s/".*$//;p}' php_zephir_parser.h)
+extver=$(sed -n '/#define PHP_ZEPHIR_PARSER_VERSION/{s/.* "//;s/".*$//;p}' zephir_parser.h)
if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}.
exit 1
@@ -75,8 +70,15 @@ fi
%build
%{?dtsenable}
+
%{?scl:scl enable %{scl}} ./install
+%configure \
+ --with-php-config=%{_bindir}/php-config \
+ --enable-zephir_parser
+
+make %{?_smp_mflags}
+
%install
%{?dtsenable}
@@ -88,12 +90,12 @@ make install INSTALL_ROOT=%{buildroot}
%{_bindir}/php -n -d extension=modules/%{ext_name}.so -m | grep "Zephir Parser"
%if %{with_tests}
-mkdir vendor
-%{_bindir}/phpab --output vendor/autoload.php unit-tests
-
: Run test suite
-%{_bindir}/php -d extension=modules/%{ext_name}.so %{_bindir}/phpunit \
- --verbose unit-tests
+TEST_PHP_EXECUTABLE=%{__php} \
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{ext_name}.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__php} -n run-tests.php --show-diff
%else
: Test suite disabled
%endif
@@ -108,6 +110,9 @@ mkdir vendor
%changelog
+* Thu Oct 12 2017 Remi Collet <remi@remirepo.net> - 1.1.0-1
+- update to 1.1.0
+
* Wed Oct 11 2017 Remi Collet <remi@remirepo.net> - 1.0.3-1
- rename from zephir-parser to php-zephir-parser
- update to 1.0.3 (for zephir 0.10)