ndk-headers: fix paths in utmp.h

And bump toolchain and ndk-sysroot. Also update patch offsets while we
are at it.
This commit is contained in:
Henrik Grimler 2021-05-07 07:58:58 +02:00
parent eb55524127
commit 54975d7db5
8 changed files with 29 additions and 15 deletions

View File

@ -1,7 +1,7 @@
diff -uNr sysroot.orig/usr/include/linux/fcntl.h sysroot/usr/include/linux/fcntl.h
--- sysroot.orig/usr/include/linux/fcntl.h 2019-02-12 16:12:24.000000000 +0000
+++ sysroot/usr/include/linux/fcntl.h 2019-03-20 13:22:32.823142545 +0000
@@ -50,6 +50,12 @@
@@ -51,6 +51,12 @@
#define DN_ATTRIB 0x00000020
#define DN_MULTISHOT 0x80000000
#define AT_FDCWD - 100

View File

@ -25,7 +25,7 @@ diff -uNr ./usr.old/include/stdio.h ./usr/include/stdio.h
char* tempnam(const char* __dir, const char* __prefix)
__warnattr("tempnam is unsafe, use mkstemp or tmpfile instead");
@@ -241,8 +242,6 @@
@@ -289,8 +290,6 @@
FILE* freopen64(const char* __path, const char* __mode, FILE* __fp) __INTRODUCED_IN(24);
#endif /* __ANDROID_API__ >= 24 */
@ -34,7 +34,7 @@ diff -uNr ./usr.old/include/stdio.h ./usr/include/stdio.h
#if __ANDROID_API__ >= 24
FILE* tmpfile64(void) __INTRODUCED_IN(24);
#endif /* __ANDROID_API__ >= 24 */
@@ -256,10 +255,15 @@
@@ -304,10 +303,15 @@
#define L_ctermid 1024 /* size for ctermid() */
@ -53,7 +53,7 @@ diff -uNr ./usr.old/include/stdio.h ./usr/include/stdio.h
FILE* fdopen(int __fd, const char* __mode);
int fileno(FILE* __fp);
@@ -328,6 +332,30 @@
@@ -376,6 +380,30 @@
#include <bits/fortify/stdio.h>
#endif

View File

@ -9,7 +9,7 @@ diff -uNr sysroot.orig/usr/include/stdlib.h sysroot/usr/include/stdlib.h
#include <sys/cdefs.h>
#include <xlocale.h>
@@ -211,8 +212,7 @@
@@ -224,8 +225,7 @@
size_t wcstombs(char* __dst, const wchar_t* __src, size_t __n);
#if __ANDROID_API__ >= __ANDROID_API_L__

View File

@ -1,7 +1,7 @@
--- sysroot/usr/include/unistd.h 2018-04-30 19:24:22.000000000 +0000
+++ usr/include/unistd.h 2018-08-16 10:42:51.158596753 +0000
@@ -302,6 +302,74 @@
#include <bits/fortify/unistd.h>
@@ -377,4 +377,72 @@
#undef _UNISTD_H_
#endif
+#if !defined GETPASS_H && !defined getpass && !defined HAVE_GETPASS && !defined HAS_GETPASS && !defined NO_INLINE_GETPASS
@ -73,5 +73,3 @@
+#endif
+
__END_DECLS
#endif

15
ndk-patches/utmp.h.patch Normal file
View File

@ -0,0 +1,15 @@
--- sysroot/usr/include/utmp.h 2021-05-07 05:45:33.518467959 +0000
+++ usr/include/utmp.h 2021-05-07 05:46:25.195022662 +0000
@@ -32,9 +32,9 @@
#include <sys/types.h>
#include <time.h>
-#define _PATH_UTMP "/var/run/utmp"
-#define _PATH_WTMP "/var/log/wtmp"
-#define _PATH_LASTLOG "/var/log/lastlog"
+#define _PATH_UTMP "@TERMUX_PREFIX@/var/run/utmp"
+#define _PATH_WTMP "@TERMUX_PREFIX@/var/log/wtmp"
+#define _PATH_LASTLOG "@TERMUX_PREFIX@/var/log/lastlog"
#ifdef __LP64__
#define UT_NAMESIZE 32

View File

@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="System header and library files from the Android NDK nee
TERMUX_PKG_LICENSE="NCSA"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
TERMUX_PKG_REVISION=1
TERMUX_PKG_SKIP_SRC_EXTRACT=true
# This package has taken over <pty.h> from the previous libutil-dev
# and iconv.h from libandroid-support-dev:

View File

@ -1,19 +1,19 @@
--- data/data/com.termux/files/usr/include/c++/v1/cmath.orig 2019-03-24 00:31:49.512145195 +0000
+++ ./cmath 2019-03-24 00:32:19.392703442 +0000
@@ -302,7 +302,7 @@
@@ -301,7 +301,7 @@
*/
#include <__config>
-#include <math.h>
+#include <c++/v1/math.h>
#include "version"
#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
--- data/data/com.termux/files/usr/include/c++/v1/math.h.orig 2019-03-24 01:10:28.881807799 +0000
+++ ./math.h 2019-03-24 01:11:01.078384393 +0000
@@ -298,7 +298,7 @@
#pragma GCC system_header
#endif
@@ -300,7 +300,7 @@
#define _LIBCPP_STDLIB_INCLUDE_NEXT
#include <stdlib.h>
-#include_next <math.h>
+#include "../../math.h"

View File

@ -2,7 +2,7 @@ termux_step_start_build() {
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_COMMON_CACHEDIR/android-r${TERMUX_NDK_VERSION}-api-${TERMUX_PKG_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"
# shellcheck source=/dev/null
source "$TERMUX_PKG_BUILDER_SCRIPT"