PHP package enhanced with curl, gd and mcrypt extensions
[termux-packages] / packages / php / build.sh
CommitLineData
e054b9eb
FF
1TERMUX_PKG_HOMEPAGE=http://php.net/
2TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
0106bb6c 3TERMUX_PKG_VERSION=5.6.20
727704d7 4TERMUX_PKG_BUILD_REVISION=2
e054b9eb 5TERMUX_PKG_SRCURL=http://php.net/get/php-${TERMUX_PKG_VERSION}.tar.xz/from/this/mirror
f72fc782 6TERMUX_PKG_NO_SRC_CACHE=yes # Caching with filename does not work for 'mirror'
e339be42
FF
7# Build native php for phar to build (see pear-Makefile.frag.patch):
8TERMUX_PKG_HOSTBUILD=true
e054b9eb 9TERMUX_PKG_FOLDERNAME=php-${TERMUX_PKG_VERSION}
727704d7 10TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libcrypt, libmcrypt, libcurl"
e054b9eb
FF
11# http://php.net/manual/en/libxml.installation.php
12# "If configure cannot find xml2-config in the directory specified by --with-libxml-dir,
13# then it'll continue on and check the default locations."
14TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-libxml-dir=$TERMUX_PREFIX"
e339be42
FF
15TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX"
16# http://php.net/manual/en/pcre.installation.php: pcre always enabled, use platform library:
c7bdfff6
FF
17TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-pcre-regex=$TERMUX_PREFIX"
18TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-iconv=$TERMUX_PREFIX"
727704d7
DM
19TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curl=$TERMUX_PREFIX"
20TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-mcrypt=$TERMUX_PREFIX"
21TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-gd=$TERMUX_PREFIX"
50111527 22TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-zlib"
c7bdfff6 23TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-zip"
e054b9eb
FF
24TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_res_nsearch=no"
25TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --mandir=$TERMUX_PREFIX/share/man"
f72fc782 26TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-sockets"
e054b9eb 27
daba97c6 28LDFLAGS+=" -landroid-glob"
29
e054b9eb 30termux_step_pre_configure () {
7e606cc7 31 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
e339be42
FF
32 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
33
e054b9eb
FF
34 # Run autoconf since we have patched config.m4 files.
35 cd $TERMUX_PKG_SRCDIR
36 autoconf
37}
38
39termux_step_post_configure () {
40 perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
727704d7 41 perl -p -i -e 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
e054b9eb 42}