blob: f80ab3614cb98b1591e430ad18f4534b23ca3b13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# PACKAGER: wolftankk <wolftankk@gmail.com>
# Maintainer: Joseph R. Quinn <quinn.josephr@protonmail.com>
pkgname=php-phalcon
_pkgname=cphalcon
pkgver=5.1.2
pkgrel=1
pkgdesc="Web framework delivered as a C-extension for PHP"
url="http://phalconphp.com"
arch=('x86_64' 'i686')
license=('PHP')
depends=('php' 'php-psr')
backup=('etc/php/conf.d/phalcon.ini')
source=("https://github.com/phalcon/cphalcon/archive/refs/tags/v$pkgver.tar.gz")
b2sums=('652e670b4ec60aeca5a58e7f4be363ef5485efa4a4cfc6c1b3262cb75577e9a26e46cc05435847a711ba80ee4e288a4283f6e29e6d7ca841a3827aa2cc1b5b30')
prepare() {
cd "$srcdir/$_pkgname-$pkgver/build"
export CPPFLAGS="-DPHALCON_RELEASE"
PHPIZE_BIN=$(command -v phpize 2>/dev/null)
PHPCONFIG_BIN=$(command -v php-config 2>/dev/null)
PHP_FULL_VERSION=`${PHPCONFIG_BIN} --version`
php gen-build.php
echo "int main() {}" > t.c
cc ${CFLAGS} t.c -o t 2> t.t
if [ $? != 0 ]; then
chmod +x gcccpuopt
BFLAGS=`./gcccpuopt`
export CFLAGS="-O2 -fomit-frame-pointer $BFLAGS"
cc ${CFLAGS} t.c -o t 2> t.t
if [ $? != 0 ]; then
export CFLAGS="-O2"
fi
fi
if [ $(gcc -dumpversion | cut -f1 -d.) -ge 4 ]; then
cc ${CFLAGS}-fvisibility=hidden t.c -o t 2> t.t && export CFLAGS="$CFLAGS -fvisibility=hidden"
fi
rm -f t.t t.c t
cd "phalcon/"
if [ -f Makefile ]; then
make clean
${PHPIZE_BIN} --clean
fi
${PHPIZE_BIN}
export echo=echo
./configure --silent --with-php-config=${PHPCONFIG_BIN} --enable-phalcon
}
build() {
cd "$srcdir/$_pkgname-$pkgver/build/phalcon"
make -s -j"$(getconf _NPROCESSORS_ONLN)"
}
package() {
cd "$srcdir/$_pkgname-$pkgver/build/phalcon"
make INSTALL_ROOT="$pkgdir" install
echo 'extension=phalcon.so' > phalcon.ini
install -Dm644 phalcon.ini "$pkgdir/etc/php/conf.d/phalcon.ini"
install -Dm644 "$srcdir/$_pkgname-$pkgver/LICENSE.txt" "$pkgdir/usr/share/licenses/php-phalcon/LICENSE.txt"
}
|