1 TERMUX_PKG_HOMEPAGE
=https
://php.net
2 TERMUX_PKG_DESCRIPTION
="Server-side, HTML-embedded scripting language"
3 TERMUX_PKG_VERSION
=7.2.1
4 TERMUX_PKG_SHA256
=6c6cf82fda6660ed963821eb0525214bb3547e8e29f447b9c15b2d8e6efd8822
5 TERMUX_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):
7 TERMUX_PKG_HOSTBUILD
=true
8 # Build the native php without xml support as we only need phar:
9 TERMUX_PKG_EXTRA_HOSTBUILD_CONFIGURE_ARGS
="--disable-libxml --disable-dom --disable-simplexml --disable-xml --disable-xmlreader --disable-xmlwriter --without-pear"
10 TERMUX_PKG_DEPENDS
="libandroid-glob, libxml2, liblzma, openssl, pcre, libbz2, libcrypt, libcurl, libgd, readline, freetype"
11 # mysql modules were initially shared libs
12 TERMUX_PKG_CONFLICTS
="php-mysql"
13 TERMUX_PKG_REPLACES
="php-mysql"
14 TERMUX_PKG_RM_AFTER_INSTALL
="php/php/fpm"
16 TERMUX_PKG_EXTRA_CONFIGURE_ARGS
="
17 ac_cv_func_res_nsearch=no
21 --enable-gd-native-ttf=$TERMUX_PREFIX
27 --mandir=$TERMUX_PREFIX/share/man
28 --with-bz2=$TERMUX_PREFIX
29 --with-curl=$TERMUX_PREFIX
30 --with-freetype-dir=$TERMUX_PREFIX
31 --with-gd=$TERMUX_PREFIX
32 --with-iconv=$TERMUX_PREFIX
33 --with-libxml-dir=$TERMUX_PREFIX
34 --with-openssl=$TERMUX_PREFIX
35 --with-pcre-regex=$TERMUX_PREFIX
36 --with-png-dir=$TERMUX_PREFIX
37 --with-readline=$TERMUX_PREFIX
39 --with-pgsql=shared,$TERMUX_PREFIX
40 --with-pdo-pgsql=shared,$TERMUX_PREFIX
42 --with-pdo-mysql=mysqlnd
43 --with-mysql-sock=$TERMUX_PREFIX/tmp/mysqld.sock
44 --with-apxs2=$TERMUX_PREFIX/bin/apxs
46 --sbindir=$TERMUX_PREFIX/bin
49 termux_step_pre_configure
() {
50 LDFLAGS
+=" -landroid-glob -llog"
52 export PATH
=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi
/cli
/
53 export NATIVE_PHP_EXECUTABLE
=$TERMUX_PKG_HOSTBUILD_DIR/sapi
/cli
/php
55 # Run autoconf since we have patched config.m4 files.
58 export EXTENSION_DIR
=$TERMUX_PREFIX/lib
/php
61 termux_step_post_configure
() {
62 # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:
63 sed -i
's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main
/php_config.h
64 # Avoid src/ext/standard/dns.c trying to use struct __res_state:
65 sed -i
's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main
/php_config.h
68 termux_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
/
73 sed -i
's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin
/phpize