cmake: Depend on make and clang
[termux-packages] / packages / php / build.sh
... / ...
CommitLineData
1TERMUX_PKG_HOMEPAGE=https://php.net
2TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
3TERMUX_PKG_VERSION=7.1.7
4TERMUX_PKG_REVISION=2
5TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz
6TERMUX_PKG_SHA256=0d42089729be7b2bb0308cbe189c2782f9cb4b07078c8a235495be5874fff729
7# Build native php for phar to build (see pear-Makefile.frag.patch):
8TERMUX_PKG_HOSTBUILD=true
9# Build the native php without xml support as we only need phar:
10TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="--disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear"
11TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libbz2, libcrypt, libcurl, libgd, readline, freetype"
12TERMUX_PKG_RM_AFTER_INSTALL="php/php/fpm"
13
14TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
15ac_cv_func_res_nsearch=no
16--enable-bcmath
17--enable-calendar
18--enable-exif
19--enable-gd-native-ttf=$TERMUX_PREFIX
20--enable-mbstring
21--enable-opcache
22--enable-pcntl
23--enable-sockets
24--enable-zip
25--mandir=$TERMUX_PREFIX/share/man
26--with-bz2=$TERMUX_PREFIX
27--with-curl=$TERMUX_PREFIX
28--with-freetype-dir=$TERMUX_PREFIX
29--with-gd=$TERMUX_PREFIX
30--with-iconv=$TERMUX_PREFIX
31--with-libxml-dir=$TERMUX_PREFIX
32--with-openssl=$TERMUX_PREFIX
33--with-pcre-regex=$TERMUX_PREFIX
34--with-png-dir=$TERMUX_PREFIX
35--with-readline=$TERMUX_PREFIX
36--with-zlib
37--with-pgsql=shared,$TERMUX_PREFIX
38--with-pdo-pgsql=shared,$TERMUX_PREFIX
39--with-apxs2=$TERMUX_PREFIX/bin/apxs
40--enable-fpm
41--sbindir=$TERMUX_PREFIX/bin
42"
43
44termux_step_pre_configure () {
45 LDFLAGS+=" -landroid-glob -llog"
46
47 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
48 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
49
50 # Run autoconf since we have patched config.m4 files.
51 autoconf
52
53 export EXTENSION_DIR=$TERMUX_PREFIX/lib/php
54}
55
56termux_step_post_configure () {
57 # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:
58 sed -i 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
59 # Avoid src/ext/standard/dns.c trying to use struct __res_state:
60 sed -i 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
61}
62
63termux_step_post_make_install () {
64 mkdir -p $TERMUX_PREFIX/etc/php-fpm.d
65 cp sapi/fpm/php-fpm.conf $TERMUX_PREFIX/etc/
66 cp sapi/fpm/www.conf $TERMUX_PREFIX/etc/php-fpm.d/
67
68 sed -i 's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin/phpize
69}