summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolftankk2015-06-14 17:40:39 +0800
committerwolftankk2015-06-14 17:40:39 +0800
commitd5ff7b0de66be06516f47abc11178199896ff9c1 (patch)
tree54aeaf92fc8f7d5ba24627bc4e95e887951c03a1
downloadaur-d5ff7b0de66be06516f47abc11178199896ff9c1.tar.gz
Init repo
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD64
2 files changed, 80 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..25b110175db
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = php-phalcon
+ pkgdesc = Web framework delivered as a C-extension for PHP
+ pkgver = 2.0.2
+ pkgrel = 1
+ url = http://phalconphp.com
+ arch = x86_64
+ arch = i686
+ license = PHP
+ makedepends = gcc
+ depends = php
+ backup = etc/php/conf.d/phalcon.ini
+ source = https://github.com/phalcon/cphalcon/archive/phalcon-v2.0.2.zip
+ sha256sums = f25e8259d256fa85400873e589b8c82fff9b83f2c3604f23c36c98f02d2362e6
+
+pkgname = php-phalcon
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..b63f840942a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,64 @@
+# Maintainer: wolftankk <wolftankk@gmail.com>
+pkgname=php-phalcon
+pkgver=2.0.2
+pkgrel=1
+pkgdesc="Web framework delivered as a C-extension for PHP"
+url="http://phalconphp.com"
+arch=('x86_64' 'i686')
+[[ $CARCH == 'i686' ]] && cd _arch=32bits || _arch=64bits
+license=('PHP')
+depends=('php')
+makedepends=('gcc')
+backup=('etc/php/conf.d/phalcon.ini')
+
+source=(
+ "https://github.com/phalcon/cphalcon/archive/phalcon-v$pkgver.zip"
+)
+
+sha256sums=('f25e8259d256fa85400873e589b8c82fff9b83f2c3604f23c36c98f02d2362e6')
+
+build() {
+ cd "$srcdir/cphalcon-phalcon-v$pkgver"
+ #Check best compilation flags for GCC
+ export CC="gcc"
+ export CFLAGS="-march=native -mtune=native -O2 -finline-functions -fomit-frame-pointer"
+ export CPPFLAGS="-DPHALCON_RELEASE"
+ 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 -finline-functions -fomit-frame-pointer $BFLAGS"
+ gcc $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
+ 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 dir
+ cd "$srcdir/cphalcon-phalcon-v$pkgver/build/$_arch"
+
+ #Clean current compilation
+ if [ -f Makefile ]; then
+ make clean
+ phpize --clean
+ fi
+
+ phpize
+ ./configure --prefix=/usr --enable-phalcon
+ make
+}
+
+package() {
+ cd "$srcdir/cphalcon-phalcon-v$pkgver/build/$_arch"
+
+ make INSTALL_ROOT="$pkgdir" install
+ echo 'extension=phalcon.so' > phalcon.ini
+ install -Dm644 phalcon.ini "$pkgdir/etc/php/conf.d/phalcon.ini"
+}