php: Bump revision after adding php-mysql subpkg
[termux-packages] / packages / php / build.sh
CommitLineData
ecd1ff09 1TERMUX_PKG_HOMEPAGE=https://php.net
e054b9eb 2TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
ff9d1809 3TERMUX_PKG_VERSION=7.1.11
f08f5fba 4TERMUX_PKG_REVISION=1
ff9d1809 5TERMUX_PKG_SHA256=074093e9d7d21afedc5106904218a80a47b854abe368d2728ed22184c884893e
ecd1ff09 6TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz
e339be42
FF
7# Build native php for phar to build (see pear-Makefile.frag.patch):
8TERMUX_PKG_HOSTBUILD=true
12c87316
FF
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"
42a606a2 11TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libbz2, libcrypt, libcurl, libgd, readline, freetype"
cc7bcfa2 12TERMUX_PKG_RM_AFTER_INSTALL="php/php/fpm"
da1533a4 13
6788ea2c
FF
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
74ad4596 34--with-png-dir=$TERMUX_PREFIX
6788ea2c
FF
35--with-readline=$TERMUX_PREFIX
36--with-zlib
53530ad8
FF
37--with-pgsql=shared,$TERMUX_PREFIX
38--with-pdo-pgsql=shared,$TERMUX_PREFIX
809be5bb 39--with-mysqli=shared,$TERMUX_PREFIX/bin/mysql_config
40--with-pdo-mysql=shared,$TERMUX_PREFIX/bin/mysql
41--with-mysql-sock=$TERMUX_PREFIX/tmp/mysqld.sock
6b78878e 42--with-apxs2=$TERMUX_PREFIX/bin/apxs
cc7bcfa2
VB
43--enable-fpm
44--sbindir=$TERMUX_PREFIX/bin
6788ea2c 45"
e054b9eb
FF
46
47termux_step_pre_configure () {
809be5bb 48 #because the new mariadb hides away all these includes inside server subdir
49 CFLAGS+=" -I$TERMUX_PREFIX/include/mysql/server -I$TERMUX_PREFIX/include/mysql"
ecd1ff09 50 LDFLAGS+=" -landroid-glob -llog"
eaf33403 51
7e606cc7 52 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
e339be42
FF
53 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
54
e054b9eb 55 # Run autoconf since we have patched config.m4 files.
e054b9eb 56 autoconf
cc7bcfa2
VB
57
58 export EXTENSION_DIR=$TERMUX_PREFIX/lib/php
e054b9eb
FF
59}
60
61termux_step_post_configure () {
da1533a4 62 # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:
57ae9050 63 sed -i 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
da1533a4 64 # Avoid src/ext/standard/dns.c trying to use struct __res_state:
57ae9050 65 sed -i 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
e054b9eb 66}
cc7bcfa2
VB
67
68termux_step_post_make_install () {
69 mkdir -p $TERMUX_PREFIX/etc/php-fpm.d
70 cp sapi/fpm/php-fpm.conf $TERMUX_PREFIX/etc/
71 cp sapi/fpm/www.conf $TERMUX_PREFIX/etc/php-fpm.d/
57ae9050
FF
72
73 sed -i 's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin/phpize
cc7bcfa2 74}