SHARE
TWEET

Phalcon 2.1.0-RC1 PKGBUILD for Arch Linux

a guest May 4th, 2016 153 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pkgname=php-phalcon
  2. pkgver=2.1.0.RC1
  3. pkgrel=1
  4. pkgdesc="Web framework delivered as a C-extension for PHP"
  5. url="http://phalconphp.com"
  6. arch=('x86_64')
  7. [[ $CARCH == 'i686' ]] && cd _arch=32bits || _arch=64bits
  8. license=('PHP')
  9. depends=('php')
  10. makedepends=('gcc')
  11. backup=('etc/php/conf.d/phalcon.ini')
  12.  
  13. source=(
  14.         "https://github.com/phalcon/cphalcon/archive/2.1.x.zip"
  15. )
  16.  
  17. sha256sums=('SKIP')
  18.  
  19. build() {
  20.   cd "$srcdir/cphalcon-2.1.x"
  21.   #Check best compilation flags for GCC
  22.   export CC="gcc"
  23.   export CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer"
  24.   export CPPFLAGS="-DPHALCON_RELEASE"
  25.   echo "int main() {}" > t.c
  26.   $CC $CFLAGS t.c -o t 2> t.t
  27.   if [ $? != 0 ]; then
  28.           chmod +x gcccpuopt
  29.           BFLAGS=`./gcccpuopt`
  30.           export CFLAGS="-O2 -fomit-frame-pointer $BFLAGS"
  31.           $CC $CFLAGS t.c -o t 2> t.t
  32.           if [ $? != 0 ]; then
  33.                   export CFLAGS="-O2"
  34.           fi
  35.   fi
  36.  
  37.   if [ $($CC -dumpversion | cut -f1 -d.) -ge 4 ]; then
  38.           $CC $CFLAGS -fvisibility=hidden t.c -o t 2> t.t && export CFLAGS="$CFLAGS -fvisibility=hidden"
  39.   fi
  40.   #gcc $CFLAGS -flto t.c -o t 2> t.t && { export CFLAGS="$CFLAGS -flto"; export LDFLAGS="$LDFLAGS $CFLAGS"; }
  41.   rm -f t.t t.c t
  42.  
  43.   #cd dir
  44.   cd "$srcdir/cphalcon-2.1.x/build/$_arch"
  45.  
  46.   #Clean current compilation
  47.   if [ -f Makefile ]; then
  48.           make clean
  49.           phpize --clean
  50.   fi
  51.  
  52.   phpize
  53.   ./configure --prefix=/usr --enable-phalcon
  54.   make
  55. }
  56.  
  57. package() {
  58.   cd "$srcdir/cphalcon-2.1.x/build/$_arch"
  59.  
  60.   make INSTALL_ROOT="$pkgdir" install
  61.   echo 'extension=phalcon.so' > phalcon.ini
  62.   install -Dm644 phalcon.ini "$pkgdir/etc/php/conf.d/phalcon.ini"
  63. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top