Browse Source

ndk_patches: Define _POSIX2_VERSION to 200809

coreutils looks at _POSIX2_VERSION and enables broken obsolete
behaviour if not set.

Fixes https://github.com/termux/termux-app/issues/232.
android-5
Fredrik Fornwall 8 years ago
parent
commit
627fdeb162
  1. 2
      build-package.sh
  2. 12
      ndk_patches/sys-limits.h.patch
  3. 1
      packages/coreutils/build.sh
  4. 7
      packages/coreutils/tests/tails-c-flag.sh

2
build-package.sh

@ -187,7 +187,7 @@ termux_step_setup_variables() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_API_LEVEL}"
# Bump the below version if a change is made in toolchain setup to ensure
# that everyone gets an updated toolchain:
TERMUX_STANDALONE_TOOLCHAIN+="-v3"
TERMUX_STANDALONE_TOOLCHAIN+="-v4"
export TERMUX_TAR="tar"
export TERMUX_TOUCH="touch"

12
ndk_patches/sys-limits.h.patch

@ -0,0 +1,12 @@
diff -u -r /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/sys/limits.h ./usr/include/sys/limits.h
--- /home/fornwall/lib/android-ndk/platforms/android-21/arch-arm64/usr/include/sys/limits.h 2016-09-29 14:42:26.000000000 -0400
+++ ./usr/include/sys/limits.h 2017-01-07 01:23:19.004048281 -0500
@@ -116,7 +116,7 @@
/* Bionic-specific definitions */
#define _POSIX_VERSION 200112L /* Posix C language bindings version */
-#define _POSIX2_VERSION -1 /* we don't support Posix command-line tools */
+#define _POSIX2_VERSION 200809 /* Termux change to avoid coreutils obsolete breakage */
#define _POSIX2_C_VERSION _POSIX_VERSION
#define _XOPEN_VERSION 500 /* by Posix definition */
#define _XOPEN_XCU_VERSION -1 /* we don't support command-line utilities */

1
packages/coreutils/build.sh

@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/coreutils/
TERMUX_PKG_DESCRIPTION="Basic file, shell and text manipulation utilities from the GNU project"
TERMUX_PKG_VERSION=8.26
TERMUX_PKG_BUILD_REVISION=1
TERMUX_PKG_SRCURL=https://mirrors.kernel.org/gnu/coreutils/coreutils-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=155e94d748f8e2bc327c66e0cbebdb8d6ab265d2f37c3c928f7bf6c3beba9a8e
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="ac_cv_func_mkfifo=yes gl_cv_host_operating_system=Android --without-gmp --enable-single-binary=symlinks ac_cv_func_endpwent=no"

7
packages/coreutils/tests/tails-c-flag.sh

@ -0,0 +1,7 @@
set -e -u
RESULT=$(echo -n 123456 | tail -c 3)
if [ "$RESULT" != 456 ]; then
echo "Test failed - expectd 456, got $RESULT"
exit 1
fi
Loading…
Cancel
Save