d15a81ed53fb11d1bd93567e76b795525c79dfa0
[termux-packages] / packages / php / build.sh
1 TERMUX_PKG_HOMEPAGE=https://php.net
2 TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
3 TERMUX_PKG_VERSION=7.1.2
4 TERMUX_PKG_SRCURL=http://www.php.net/distributions/php-${TERMUX_PKG_VERSION}.tar.xz
5 TERMUX_PKG_SHA256=d815a0c39fd57bab1434a77ff0610fb507c22f790c66cd6f26e27030c4b3e971
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
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 "
35
36 termux_step_pre_configure () {
37 LDFLAGS+=" -landroid-glob -llog"
38
39 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
40 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
41
42 # Run autoconf since we have patched config.m4 files.
43 cd $TERMUX_PKG_SRCDIR
44 autoconf
45 }
46
47 termux_step_post_configure () {
48 # Avoid src/ext/gd/gd.c trying to include <X11/xpm.h>:
49 perl -p -i -e 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
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
52 }