Commit | Line | Data |
---|---|---|
ecd1ff09 | 1 | TERMUX_PKG_HOMEPAGE=https://php.net |
e054b9eb | 2 | TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language" |
6788ea2c | 3 | TERMUX_PKG_VERSION=7.1.2 |
ecd1ff09 | 4 | TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz |
6788ea2c | 5 | TERMUX_PKG_SHA256=d815a0c39fd57bab1434a77ff0610fb507c22f790c66cd6f26e27030c4b3e971 |
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" |
da1533a4 | 11 | |
6788ea2c FF |
12 | TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" |
13 | ac_cv_func_res_nsearch=no | |
14 | --enable-bcmath | |
15 | --enable-calendar | |
16 | --enable-exif | |
17 | --enable-gd-native-ttf=$TERMUX_PREFIX | |
18 | --enable-mbstring | |
19 | --enable-opcache | |
20 | --enable-pcntl | |
21 | --enable-sockets | |
22 | --enable-zip | |
23 | --mandir=$TERMUX_PREFIX/share/man | |
24 | --with-bz2=$TERMUX_PREFIX | |
25 | --with-curl=$TERMUX_PREFIX | |
26 | --with-freetype-dir=$TERMUX_PREFIX | |
27 | --with-gd=$TERMUX_PREFIX | |
28 | --with-iconv=$TERMUX_PREFIX | |
29 | --with-libxml-dir=$TERMUX_PREFIX | |
30 | --with-openssl=$TERMUX_PREFIX | |
31 | --with-pcre-regex=$TERMUX_PREFIX | |
32 | --with-readline=$TERMUX_PREFIX | |
33 | --with-zlib | |
34 | " | |
e054b9eb FF |
35 | |
36 | termux_step_pre_configure () { | |
ecd1ff09 | 37 | LDFLAGS+=" -landroid-glob -llog" |
eaf33403 | 38 | |
7e606cc7 | 39 | export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/ |
e339be42 FF |
40 | export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php |
41 | ||
e054b9eb FF |
42 | # Run autoconf since we have patched config.m4 files. |
43 | cd $TERMUX_PKG_SRCDIR | |
44 | autoconf | |
45 | } | |
46 | ||
47 | termux_step_post_configure () { | |
da1533a4 | 48 | # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>: |
727704d7 | 49 | perl -p -i -e 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h |
da1533a4 FF |
50 | # Avoid src/ext/standard/dns.c trying to use struct __res_state: |
51 | perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h | |
e054b9eb | 52 | } |