php: Update from 7.1.11 to 7.1.12
[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.12
4TERMUX_PKG_SHA256=a0118850774571b1f2d4e30b4fe7a4b958ca66f07d07d65ebdc789c54ba6eeb3
5TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz
6# Build native php for phar to build (see pear-Makefile.frag.patch):
7TERMUX_PKG_HOSTBUILD=true
8# Build the native php without xml support as we only need phar:
9TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS="--disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear"
10TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libbz2, libcrypt, libcurl, libgd, readline, freetype"
11TERMUX_PKG_RM_AFTER_INSTALL="php/php/fpm"
12
13TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
14ac_cv_func_res_nsearch=no
15--enable-bcmath
16--enable-calendar
17--enable-exif
18--enable-gd-native-ttf=$TERMUX_PREFIX
19--enable-mbstring
20--enable-opcache
21--enable-pcntl
22--enable-sockets
23--enable-zip
24--mandir=$TERMUX_PREFIX/share/man
25--with-bz2=$TERMUX_PREFIX
26--with-curl=$TERMUX_PREFIX
27--with-freetype-dir=$TERMUX_PREFIX
28--with-gd=$TERMUX_PREFIX
29--with-iconv=$TERMUX_PREFIX
30--with-libxml-dir=$TERMUX_PREFIX
31--with-openssl=$TERMUX_PREFIX
32--with-pcre-regex=$TERMUX_PREFIX
33--with-png-dir=$TERMUX_PREFIX
34--with-readline=$TERMUX_PREFIX
35--with-zlib
36--with-pgsql=shared,$TERMUX_PREFIX
37--with-pdo-pgsql=shared,$TERMUX_PREFIX
38--with-mysqli=shared,$TERMUX_PREFIX/bin/mysql_config
39--with-pdo-mysql=shared,$TERMUX_PREFIX/bin/mysql
40--with-mysql-sock=$TERMUX_PREFIX/tmp/mysqld.sock
41--with-apxs2=$TERMUX_PREFIX/bin/apxs
42--enable-fpm
43--sbindir=$TERMUX_PREFIX/bin
44"
45
46termux_step_pre_configure () {
47 #because the new mariadb hides away all these includes inside server subdir
48 CFLAGS+=" -I$TERMUX_PREFIX/include/mysql/server -I$TERMUX_PREFIX/include/mysql"
49 LDFLAGS+=" -landroid-glob -llog"
50
51 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
52 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
53
54 # Run autoconf since we have patched config.m4 files.
55 autoconf
56
57 export EXTENSION_DIR=$TERMUX_PREFIX/lib/php
58}
59
60termux_step_post_configure () {
61 # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:
62 sed -i 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
63 # Avoid src/ext/standard/dns.c trying to use struct __res_state:
64 sed -i 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
65}
66
67termux_step_post_make_install () {
68 mkdir -p $TERMUX_PREFIX/etc/php-fpm.d
69 cp sapi/fpm/php-fpm.conf $TERMUX_PREFIX/etc/
70 cp sapi/fpm/www.conf $TERMUX_PREFIX/etc/php-fpm.d/
71
72 sed -i 's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin/phpize
73}