gnuchess: Update from 6.2.2 to 6.2.3
[termux-packages] / build-package.sh
index 539ec5b..7592de0 100755 (executable)
@@ -183,17 +183,10 @@ termux_download() {
        exit 1
 }
 
-# Get fresh versions of config.sub and config.guess
-for f in config.sub config.guess; do
-       if [ ! -f $TERMUX_COMMON_CACHEDIR/$f ]; then
-               termux_download "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=${f};hb=HEAD" $TERMUX_COMMON_CACHEDIR/$f
-       fi
-done
-
 # Have a debian-binary file ready for deb packaging:
 test ! -f $TERMUX_COMMON_CACHEDIR/debian-binary && echo "2.0" > $TERMUX_COMMON_CACHEDIR/debian-binary
 # The host tuple that may be given to --host configure flag, but normally autodetected so not needed explicitly
-TERMUX_HOST_TUPLE=`sh $TERMUX_COMMON_CACHEDIR/config.guess`
+TERMUX_HOST_TUPLE=`sh $TERMUX_SCRIPTDIR/scripts/config.guess`
 
 # Make $TERMUX_PREFIX/bin/sh executable on the builder, so that build script can assume that it works
 # on both builder and host later on:
@@ -252,8 +245,8 @@ termux_step_patch_package () {
                        patch --silent -p1
        done
 
-       find . -name config.sub -exec chmod u+w '{}' \; -exec cp $TERMUX_COMMON_CACHEDIR/config.sub '{}' \;
-       find . -name config.guess -exec chmod u+w '{}' \; -exec cp $TERMUX_COMMON_CACHEDIR/config.guess '{}' \;
+       find . -name config.sub -exec chmod u+w '{}' \; -exec cp $TERMUX_SCRIPTDIR/scripts/config.sub '{}' \;
+       find . -name config.guess -exec chmod u+w '{}' \; -exec cp $TERMUX_SCRIPTDIR/scripts/config.guess '{}' \;
 }
 
 termux_step_pre_configure () {
@@ -377,8 +370,12 @@ termux_step_massage () {
                rm -Rf share/info
        fi
 
-       # Remove other docs:
-       rm -Rf share/doc share/locale
+       # Remove locale files we're not interested in::
+       rm -Rf share/locale
+       if [ -z ${TERMUX_PKG_KEEP_SHARE_DOC+x} ]; then
+               # Remove info pages:
+               rm -Rf share/doc
+       fi
 
        # Remove old kept libraries (readline):
        find . -name '*.old' -delete
@@ -567,7 +564,7 @@ else
 fi
 # Bump the below version if a change is made in toolchain setup, to ensure
 # that everyone gets an updated toolchain:
-TERMUX_STANDALONE_TOOLCHAIN+="-v1"
+TERMUX_STANDALONE_TOOLCHAIN+="-v2"
 
 # We put this after system PATH to avoid picking up toolchain stripped python
 export PATH=$PATH:$TERMUX_STANDALONE_TOOLCHAIN/bin
@@ -649,7 +646,7 @@ if [ ! -d $TERMUX_STANDALONE_TOOLCHAIN ]; then
                _TERMUX_NDK_TOOLCHAIN_NAME="$TERMUX_HOST_PLATFORM"
        fi
 
-       if [ "$TERMUX_PKG_CLANG" = "" ]; then
+       if [ "$TERMUX_PKG_CLANG" = "no" ]; then
                _TERMUX_TOOLCHAIN="${_TERMUX_NDK_TOOLCHAIN_NAME}-4.9"
        else
                _TERMUX_TOOLCHAIN="${_TERMUX_NDK_TOOLCHAIN_NAME}-clang"
@@ -699,31 +696,26 @@ if [ ! -f $TERMUX_PREFIX/lib/libstdc++.so ]; then
        ln -f -s libgnustl_shared.so libstdc++.so
 fi
 
-if [ ! -f $PKG_CONFIG ]; then
-       echo "Creating pkg-config wrapper..."
-       # We use path to host pkg-config to avoid picking up a cross-compiled pkg-config later on
-       _HOST_PKGCONFIG=`which pkg-config`
-       mkdir -p $TERMUX_STANDALONE_TOOLCHAIN/bin $PKG_CONFIG_LIBDIR
-       cat > $PKG_CONFIG <<HERE
+# Create pkg-config wrapper. We use path to host pkg-config to
+# avoid picking up a cross-compiled pkg-config later on.
+_HOST_PKGCONFIG=`which pkg-config`
+mkdir -p $TERMUX_STANDALONE_TOOLCHAIN/bin $PKG_CONFIG_LIBDIR
+cat > $PKG_CONFIG <<HERE
 #!/bin/sh
 export PKG_CONFIG_DIR=
 export PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR
-# export PKG_CONFIG_SYSROOT_DIR=${TERMUX_PREFIX}
 exec $_HOST_PKGCONFIG "\$@"
 HERE
-       chmod +x $PKG_CONFIG
-
-       # Add a pkg-config file for the system zlib
-       cat > $PKG_CONFIG_LIBDIR/zlib.pc <<HERE
+chmod +x $PKG_CONFIG
+# Add a pkg-config file for the system zlib
+cat > $PKG_CONFIG_LIBDIR/zlib.pc <<HERE
 Name: zlib
 Description: zlib compression library
 Version: 1.2.3
 
 Requires:
-Libs: -L$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/lib -lz
-Cflags: -I$TERMUX_STANDALONE_TOOLCHAIN/sysroot/usr/include
+Libs: -lz
 HERE
-fi
 
 # Keep track of when build started so we can see what files have been created.
 # We start by sleeping so that any generated files above (such as zlib.pc) get