Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5 alpha support #76

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 38 additions & 26 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,43 @@ jobs:
"debian/stretch", "debian/buster",
"el/7"
]
php: [7.3, 7.4]
branch: ["v4.1.2"]
packagecloud_repo: ["stable-41"]
php: ["7.3", "7.4", "8.0"]
branch: ["v4.1.2", "v5.0.0alpha5"]
packagecloud_repo: ["stable-41", "nightly-50"]
zephir_parser_version: ["v1.3.8"]
zephir_version: ["0.12.21", "0.14.0-beta.3"]

exclude:
- os_dist: "ubuntu/trusty"
php: 7.4
php: "7.4"

- os_dist: "ubuntu/trusty"
php: "8.0"

- branch: "v4.1.2"
php: "8.0"

- branch: "v5.0.0alpha5"
php: "7.3"

- branch: "v4.1.2"
packagecloud_repo: "nightly-50"

- branch: "v4.1.2"
zephir_version: "0.14.0-beta.3"

- branch: "v5.0.0alpha5"
packagecloud_repo: "stable-41"

- branch: "v5.0.0alpha5"
zephir_version: "0.12.21"

runs-on: ubuntu-18.04
# continue-on-error: ${{ matrix.experimental }}

name: ${{ matrix.os_dist }} - PHP${{ matrix.php }} with ${{ matrix.branch }}

env:
# OS: ${{ matrix.os }}
# DIST: ${{ matrix.dist }}
# PACKAGE: ${{ matrix.package }}
CLONE_BRANCH: ${{ matrix.branch }}
PHP_VERSION: ${{ matrix.php }}
PACKAGECLOUD_REPO: ${{ matrix.packagecloud_repo }}
Expand All @@ -55,8 +75,8 @@ jobs:
# To build 4.x branch use
# ZEPHIR_VERSION >= 0.11.0 (for example 0.12.15)
# ZEPHIR_PARSER_VERSION >= v1.2.x (for example v1.3.3)
ZEPHIR_VERSION: "0.12.21"
ZEPHIR_PARSER_VERSION: "v1.3.6"
# ZEPHIR_VERSION: "0.12.21"
# ZEPHIR_PARSER_VERSION: "v1.3.6"

ZEND_BACKEND: "--backend=ZendEngine3"
STABLE_BUILD_VERSION: "1"
Expand All @@ -76,22 +96,6 @@ jobs:
with:
fetch-depth: 1

# Setup PHP
# - name: Setup cache environment
# id: extcache
# uses: shivammathur/cache-extensions@v1
# with:
# php-version: ${{ matrix.php }}
# extensions: ${{ env.PHP_EXTENSIONS }}
# key: "phalcon-packagecloud-v1"

# - name: Cache extensions
# uses: actions/cache@v2
# with:
# path: ${{ steps.extcache.outputs.dir }}
# key: ${{ steps.extcache.outputs.key }}
# restore-keys: ${{ steps.extcache.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand All @@ -104,6 +108,9 @@ jobs:
echo "OS=${os_dist[0]}" >> $GITHUB_ENV
echo "DIST=${os_dist[1]}" >> $GITHUB_ENV

echo "ZEPHIR_VERSION=${{ matrix.zephir_version }}" >> $GITHUB_ENV
echo "ZEPHIR_PARSER_VERSION=${{ matrix.zephir_parser_version }}" >> $GITHUB_ENV

echo "MAINLINE_BUILD_VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "NIGHTLY_BUILD_VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
echo "SOURCEDIR=${GITHUB_WORKSPACE}/cphalcon" >> $GITHUB_ENV
Expand All @@ -128,7 +135,6 @@ jobs:
- name: Clone cphalcon
uses: actions/checkout@v2
with:
fetch-depth: 1
repository: phalcon/cphalcon
ref: ${{ env.CLONE_BRANCH }}
path: cphalcon
Expand All @@ -145,6 +151,12 @@ jobs:

- run: ls -la build/

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.OS }}-${{ env.DIST }}-php-${{ matrix.php }}-${{ matrix.branch }}.zip
path: build/

- name: Push package to phalcon/${{ matrix.packagecloud_repo }}/${{ matrix.os_dist }}
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
run: |
Expand Down
2 changes: 1 addition & 1 deletion ci/prepare-debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ case "$PHP_VERSION" in
cp debian/postinsts/legacy debian/php5-phalcon.postinst
cp debian/preinsts/legacy debian/php5-phalcon.preinst
;;
"7.0" | "7.1"| "7.2" | "7.3" | "7.4")
"7.0" | "7.1"| "7.2" | "7.3" | "7.4" | "8.0")
cp "debian/controls/php-${PHP_VERSION}" debian/control
cp "debian/postinsts/php-${PHP_VERSION}" "debian/php${PHP_VERSION}-phalcon.postinst"
cp "debian/preinsts/php-${PHP_VERSION}" "debian/php${PHP_VERSION}-phalcon.preinst"
Expand Down
35 changes: 35 additions & 0 deletions debian/controls/php-8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Source: php-phalcon
Section: php
Priority: optional
Maintainer: Serghei Iakovlev <[email protected]>
Build-Depends: debhelper (>= 9), dpkg-dev (>= 1.16.1~), build-essential, re2c, php8.0-dev, php8.0-json, libpcre3-dev
Standards-Version: 3.9.7
Vcs-Git: git://github.com/phalcon/cphalcon.git
Vcs-Browser: https://github.com/phalcon/cphalcon

Package: php8.0-phalcon
Architecture: any
Priority: optional
Pre-Depends: dpkg (>= 1.15.7.2)
Depends: ucf, ${shlibs:Depends}, ${php:Depends}, ${misc:Depends}, php8.0-psr
Suggests: php8.0-mysql, php8.0-sqlite3, php8.0-pgsql, php8.0-memcached
Description: High performance PHP framework
Phalcon is an open source web framework delivered as a C extension for
the PHP language providing high performance and lower resource consumption.
.
This package provides the Phalcon PHP extension.

Package: php8.0-phalcon-dbgsym
Depends: ucf, ${misc:Depends}, php8.0-phalcon (= ${binary:Version})
Recommends: gdb
Replaces: php8.0-phalcon-dbg (<< 3.1.0)
Suggests: php8.0-common-dbgsym
Section: debug
Priority: extra
Architecture: any
Description: Debug symbols for php8.0-phalcon
Phalcon is an open source web framework delivered as a C extension for
the PHP language providing high performance and lower resource consumption.
.
This package provides the debug symbols for Phalcon PHP extension
needed for properly debugging errors with gdb.
33 changes: 33 additions & 0 deletions debian/postinsts/php-8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

set -e

#EXTRA#

if [ "$1" = "configure" ]; then
# Install the new versioned configuration
inidir=/etc/php/8.0/mods-available

if [ -e /usr/lib/php/php-maintscript-helper ] ; then
. /usr/lib/php/php-maintscript-helper

# Register new conffile with UCF
ucf /usr/share/php8.0-phalcon/phalcon/phalcon.ini ${inidir}/phalcon.ini
ucfr --force php8.0-phalcon ${inidir}/phalcon.ini

if [ -f "${inidir}/phalcon.ini.dpkg-new" ]; then
md5sum="$(md5sum ${inidir}/phalcon.ini.dpkg-new | sed -e 's/ .*//')"
old_md5sum="$(md5sum ${inidir}/phalcon.ini | sed -e 's/ .*//')"

if [ "$md5sum" = "$old_md5sum" ]; then
mv "${inidir}/phalcon.ini.dpkg-new" "${inidir}/phalcon.ini"
fi
fi

php_invoke enmod 8.0 ALL phalcon
fi
fi

#DEBHELPER#

exit 0
38 changes: 38 additions & 0 deletions debian/preinsts/php-8.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e

#EXTRA#

if [ "$1" = "upgrade" ]; then
inidir=/etc/php/8.0/mods-available

# First purge the old unversioned configuration
if [ -e ${inidir}/phalcon.ini ]; then
for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist; do
rm -f ${inidir}/phalcon.ini${ext}
done

rm -f ${inidir}/phalcon.ini

if which ucf >/dev/null; then
ucf --purge ${inidir}/phalcon.ini >/dev/null || true
fi

if which ucfr >/dev/null; then
ucfr --force --purge php8.0-phalcon ${inidir}/phalcon.ini >/dev/null || true
fi
fi

# Cleanup of the old symlinks (including broken symlinks)
find /etc/php/8.0/ -type l |
while read symlink; do
if [ "$(readlink $symlink)" = "${inidir}/phalcon.ini" ]; then
rm -f "${symlink}"
fi
done
fi

#DEBHELPER#

exit 0
11 changes: 7 additions & 4 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ PHP_API_VERSION=$(shell php-config --phpapi)
endif

PHALCON_SUBSTVARS=$(PACKAGE).substvars

SOURCEDIR=build/php$(PHP_MAJOR_VERSION)/safe
SOURCEDIR_V5=build/phalcon

DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)

ifeq ($(DEB_HOST_ARCH),$(filter $(DEB_HOST_ARCH),i386))
Expand Down Expand Up @@ -80,17 +83,17 @@ prepare-files-stamp:
touch prepare-files-stamp

override_dh_auto_configure:
cd $(SOURCEDIR); \
[ -d "$(SOURCEDIR_V5)" ] && cd $(SOURCEDIR_V5) || cd $(SOURCEDIR); \
phpize; \
./configure --enable-phalcon=shared

override_dh_auto_build:
$(MAKE) -C $(SOURCEDIR)
[ -d "$(SOURCEDIR_V5)" ] && $(MAKE) -C $(SOURCEDIR_V5) || $(MAKE) -C $(SOURCEDIR)

override_dh_auto_clean:
dh_auto_clean
( \
cd $(SOURCEDIR); \
[ -d "$(SOURCEDIR_V5)" ] && cd $(SOURCEDIR_V5) || cd $(SOURCEDIR); \
[ -f Makefile ] && $(MAKE) distclean; \
phpize --clean; \
rm -f tmp-php.ini; \
Expand All @@ -100,7 +103,7 @@ override_dh_installdirs: prepare-files-stamp
dh_installdirs

override_dh_auto_install:
INSTALL_ROOT=$(BUILD) $(MAKE) -C $(SOURCEDIR) install
[ -d "$(SOURCEDIR_V5)" ] && INSTALL_ROOT=$(BUILD) $(MAKE) -C $(SOURCEDIR_V5) install || INSTALL_ROOT=$(BUILD) $(MAKE) -C $(SOURCEDIR) install

override_dh_strip:
dh_strip -s --dbg-package=$(PACKAGE)-dbgsym
Expand Down