chiark / gitweb /
php: Enable glob() function
[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.17
4 TERMUX_PKG_SRCURL=http://php.net/get/php-${TERMUX_PKG_VERSION}.tar.xz/from/this/mirror
5 TERMUX_PKG_NO_SRC_CACHE=yes # Caching with filename does not work for 'mirror'
6 # Build native php for phar to build (see pear-Makefile.frag.patch):
7 TERMUX_PKG_HOSTBUILD=true
8 TERMUX_PKG_FOLDERNAME=php-${TERMUX_PKG_VERSION}
9 TERMUX_PKG_DEPENDS="libandroid-glob, libxml2, liblzma, openssl, pcre"
10 # http://php.net/manual/en/libxml.installation.php
11 # "If configure cannot find xml2-config in the directory specified by --with-libxml-dir,
12 # then it'll continue on and check the default locations."
13 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-libxml-dir=$TERMUX_PREFIX"
14 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-openssl=$TERMUX_PREFIX"
15 # http://php.net/manual/en/pcre.installation.php: pcre always enabled, use platform library:
16 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-pcre-regex=$TERMUX_PREFIX"
17 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --with-iconv=$TERMUX_PREFIX"
18 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-zip"
19 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" ac_cv_func_res_nsearch=no"
20 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --mandir=$TERMUX_PREFIX/share/man"
21 TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --enable-sockets"
22
23 LDFLAGS+=" -landroid-glob"
24
25 termux_step_pre_configure () {
26         export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
27         export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
28
29         # Run autoconf since we have patched config.m4 files.
30         cd $TERMUX_PKG_SRCDIR
31         autoconf
32 }
33
34 termux_step_post_configure () {
35         perl -p -i -e 's/#define HAVE_RES_NSEARCH 1//' $TERMUX_PKG_BUILDDIR/main/php_config.h
36 }