c2078734943f07b1dcd958151a8abb4225fea685
[termux-packages] / packages / php / build.sh
1 TERMUX_PKG_HOMEPAGE=http://php.net/
2 TERMUX_PKG_DESCRIPTION="Server-side, HTML-embedded scripting language"
3 TERMUX_PKG_VERSION=5.6.21
4 TERMUX_PKG_BUILD_REVISION=1
5 TERMUX_PKG_SRCURL=http://mirror.internode.on.net/pub/php/php-${TERMUX_PKG_VERSION}.tar.xz
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_FOLDERNAME=php-${TERMUX_PKG_VERSION}
11 TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre, libcrypt, libmcrypt, libcurl, libgd, readline"
12 # http://php.net/manual/en/libxml.installation.php
13 # "If configure cannot find xml2-config in the directory specified by --with-libxml-dir,
14 # then it'll continue on and check the default locations."
15 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-libxml-dir=$TERMUX_PREFIX"
16 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX"
17 # http://php.net/manual/en/pcre.installation.php: pcre always enabled, use platform library:
18 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-pcre-regex=$TERMUX_PREFIX"
19 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-iconv=$TERMUX_PREFIX"
20 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-curl=$TERMUX_PREFIX"
21 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-mcrypt=$TERMUX_PREFIX"
22 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-gd=$TERMUX_PREFIX"
23 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-readline=$TERMUX_PREFIX"
24 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-zlib"
25 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-zip"
26 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_res_nsearch=no"
27 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --mandir=$TERMUX_PREFIX/share/man"
28 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-sockets"
29
30 LDFLAGS+=" -landroid-glob"
31
32 termux_step_pre_configure () {
33 export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
34 export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
35
36 # Run autoconf since we have patched config.m4 files.
37 cd $TERMUX_PKG_SRCDIR
38 autoconf
39 }
40
41 termux_step_post_configure () {
42 perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
43 perl -p -i -e 's/#define HAVE_GD_XPM 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
44 }