Commit | Line | Data |
---|---|---|
ecd1ff09 | 1 | TERMUX_PKG_HOMEPAGE=https://php.net |
e054b9eb | 2 | TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language" |
f653115e | 3 | TERMUX_PKG_VERSION=7.1.5 |
ecd1ff09 | 4 | TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz |
f653115e | 5 | TERMUX_PKG_SHA256=d149a3c396c45611f5dc6bf14be190f464897145a76a8e5851cf18ff7094f6ac |
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" |
2201a45d FF |
12 | # Building with clang causes gettype(-1) to return "double" instead of "integer". |
13 | # See https://github.com/termux/termux-packages/issues/890 | |
adeaac84 | 14 | TERMUX_PKG_CLANG=no |
da1533a4 | 15 | |
6788ea2c FF |
16 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" |
17 | ac_cv_func_res_nsearch=no | |
18 | --enable-bcmath | |
19 | --enable-calendar | |
20 | --enable-exif | |
21 | --enable-gd-native-ttf=$TERMUX_PREFIX | |
22 | --enable-mbstring | |
23 | --enable-opcache | |
24 | --enable-pcntl | |
25 | --enable-sockets | |
26 | --enable-zip | |
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 | |
74ad4596 | 36 | --with-png-dir=$TERMUX_PREFIX |
6788ea2c FF |
37 | --with-readline=$TERMUX_PREFIX |
38 | --with-zlib | |
53530ad8 FF |
39 | --with-pgsql=shared,$TERMUX_PREFIX |
40 | --with-pdo-pgsql=shared,$TERMUX_PREFIX | |
cc7bcfa2 VB |
41 | --enable-fpm |
42 | --sbindir=$TERMUX_PREFIX/bin | |
6788ea2c | 43 | " |
e054b9eb FF |
44 | |
45 | termux_step_pre_configure () { | |
ecd1ff09 | 46 | LDFLAGS+=" -landroid-glob -llog" |
eaf33403 | 47 | |
7e606cc7 | 48 | export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/ |
e339be42 FF |
49 | export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php |
50 | ||
e054b9eb | 51 | # Run autoconf since we have patched config.m4 files. |
e054b9eb | 52 | autoconf |
cc7bcfa2 VB |
53 | |
54 | export EXTENSION_DIR=$TERMUX_PREFIX/lib/php | |
e054b9eb FF |
55 | } |
56 | ||
57 | termux_step_post_configure () { | |
da1533a4 | 58 | # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>: |
57ae9050 | 59 | sed -i 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h |
da1533a4 | 60 | # Avoid src/ext/standard/dns.c trying to use struct __res_state: |
57ae9050 | 61 | sed -i 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h |
e054b9eb | 62 | } |
cc7bcfa2 VB |
63 | |
64 | termux_step_post_make_install () { | |
65 | mkdir -p $TERMUX_PREFIX/etc/php-fpm.d | |
66 | cp sapi/fpm/php-fpm.conf $TERMUX_PREFIX/etc/ | |
67 | cp sapi/fpm/www.conf $TERMUX_PREFIX/etc/php-fpm.d/ | |
57ae9050 FF |
68 | |
69 | sed -i 's/SED=.*/SED=sed/' $TERMUX_PREFIX/bin/phpize | |
cc7bcfa2 | 70 | } |