Commit | Line | Data |
---|---|---|
ecd1ff09 | 1 | TERMUX_PKG_HOMEPAGE=https://php.net |
e054b9eb | 2 | TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language" |
3a1a159e FF |
3 | TERMUX_PKG_VERSION=7.1.8 |
4 | TERMUX_PKG_SHA256=8943858738604acb33ecedb865d6c4051eeffe4e2d06f3a3c8f794daccaa2aab | |
ecd1ff09 | 5 | TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz |
e339be42 FF |
6 | # Build native php for phar to build (see pear-Makefile.frag.patch): |
7 | TERMUX_PKG_HOSTBUILD=true | |
12c87316 FF |
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" | |
42a606a2 | 10 | TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libbz2, libcrypt, libcurl, libgd, readline, freetype" |
cc7bcfa2 | 11 | TERMUX_PKG_RM_AFTER_INSTALL="php/php/fpm" |
da1533a4 | 12 | |
6788ea2c FF |
13 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" |
14 | ac_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 | |
74ad4596 | 33 | --with-png-dir=$TERMUX_PREFIX |
6788ea2c FF |
34 | --with-readline=$TERMUX_PREFIX |
35 | --with-zlib | |
53530ad8 FF |
36 | --with-pgsql=shared,$TERMUX_PREFIX |
37 | --with-pdo-pgsql=shared,$TERMUX_PREFIX | |
6b78878e | 38 | --with-apxs2=$TERMUX_PREFIX/bin/apxs |
cc7bcfa2 VB |
39 | --enable-fpm |
40 | --sbindir=$TERMUX_PREFIX/bin | |
6788ea2c | 41 | " |
e054b9eb FF |
42 | |
43 | termux_step_pre_configure () { | |
ecd1ff09 | 44 | LDFLAGS+=" -landroid-glob -llog" |
eaf33403 | 45 | |
7e606cc7 | 46 | export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/ |
e339be42 FF |
47 | export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php |
48 | ||
e054b9eb | 49 | # Run autoconf since we have patched config.m4 files. |
e054b9eb | 50 | autoconf |
cc7bcfa2 VB |
51 | |
52 | export EXTENSION_DIR=$TERMUX_PREFIX/lib/php | |
e054b9eb FF |
53 | } |
54 | ||
55 | termux_step_post_configure () { | |
da1533a4 | 56 | # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>: |
57ae9050 | 57 | sed -i 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h |
da1533a4 | 58 | # Avoid src/ext/standard/dns.c trying to use struct __res_state: |
57ae9050 | 59 | sed -i 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h |
e054b9eb | 60 | } |
cc7bcfa2 VB |
61 | |
62 | termux_step_post_make_install () { | |
63 | mkdir -p $TERMUX_PREFIX/etc/php-fpm.d | |
64 | cp sapi/fpm/php-fpm.conf $TERMUX_PREFIX/etc/ | |
65 | cp sapi/fpm/www.conf $TERMUX_PREFIX/etc/php-fpm.d/ | |
57ae9050 FF |
66 | |
67 | sed -i 's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin/phpize | |
cc7bcfa2 | 68 | } |