r21 cross over in progress

This commit is contained in:
its-pointless 2020-01-19 09:18:11 +11:00 committed by Henrik Grimler
parent a6ecbd5015
commit 43f5eb9281
6 changed files with 36 additions and 26 deletions

View File

@ -1,7 +1,6 @@
diff -uNr sysroot.orig/usr/include/pwd.h sysroot/usr/include/pwd.h
--- sysroot.orig/usr/include/pwd.h 2019-02-12 16:12:24.000000000 +0000
+++ sysroot/usr/include/pwd.h 2019-03-20 13:26:24.283060011 +0000
@@ -89,13 +89,58 @@
--- ./usr/include/pwd.h.orig 2020-01-17 23:55:20.029173926 +0000
+++ ./usr/include/pwd.h 2020-01-18 00:04:18.758398251 +0000
@@ -89,13 +89,59 @@
struct passwd* getpwent(void) __INTRODUCED_IN(26);
void setpwent(void) __INTRODUCED_IN(26);
@ -9,22 +8,22 @@ diff -uNr sysroot.orig/usr/include/pwd.h sysroot/usr/include/pwd.h
#endif /* __ANDROID_API__ >= 26 */
int getpwnam_r(const char* __name, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12);
int getpwuid_r(uid_t __uid, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result) __INTRODUCED_IN(12);
int getpwnam_r(const char* __name, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result);
int getpwuid_r(uid_t __uid, struct passwd* __pwd, char* __buf, size_t __n, struct passwd** __result);
+int access(const char* __path, int __mode);
+
+static void android_setup_pwd(struct passwd* pw) {
+ char const* result = "@TERMUX_PREFIX@/bin/login";
+ if (result == NULL || access(result, /*X_OK*/1) == -1) {
+ pw->pw_shell = "@TERMUX_PREFIX@/bin/bash";
+ } else {
+ pw->pw_shell = (char*) result;
+ }
+ pw->pw_dir = "@TERMUX_HOME@";
+ pw->pw_passwd = "*";
+ char const* result = "@TERMUX_PREFIX@/bin/login";
+ if (result == NULL || access(result, /*X_OK*/1) == -1) {
+ pw->pw_shell = "@TERMUX_PREFIX@/bin/bash";
+ } else {
+ pw->pw_shell = (char*) result;
+ }
+ pw->pw_dir = "@TERMUX_HOME@";
+ pw->pw_passwd = "*";
+#ifdef __LP64__
+ pw->pw_gecos = ""; /* Avoid NULL field. */
+ pw->pw_gecos = ""; /* Avoid NULL field. */
+#endif
+}
+
@ -57,6 +56,7 @@ diff -uNr sysroot.orig/usr/include/pwd.h sysroot/usr/include/pwd.h
+#define getpwuid android_polyfill_getpwuid
+#define getpwuid_r android_polyfill_getpwuid_r
+static void endpwent(void) { /* Do nothing. */ }
+
+
__END_DECLS

View File

@ -1,10 +1,9 @@
diff -uNr sysroot.orig/usr/include/sys/cdefs.h sysroot/usr/include/sys/cdefs.h
--- sysroot.orig/usr/include/sys/cdefs.h 2019-02-12 16:12:24.000000000 +0000
+++ sysroot/usr/include/sys/cdefs.h 2019-03-20 13:27:29.977876824 +0000
@@ -336,3 +340,6 @@
#include <android/versioning.h>
#include <android/api-level.h>
+
--- ./usr/include/sys/cdefs.h.orig 2020-01-18 00:06:05.760188085 +0000
+++ ./usr/include/sys/cdefs.h 2020-01-18 00:09:52.363968728 +0000
@@ -358,3 +358,6 @@
#if __has_include(<android/ndk-version.h>)
#include <android/ndk-version.h>
#endif
+#define __TERMUX__ 1
+#define __TERMUX_PREFIX__ "@TERMUX_PREFIX@"
+

View File

@ -5,7 +5,7 @@ TERMUX_PKG_VERSION=0.15.4
TERMUX_PKG_SRCURL=https://github.com/sharkdp/bat/archive/v$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=03b7c8ad6221ca87cecd71f9e3e2167f04f750401e2d3dcc574183aabeb76a8b
# bat calls less with '--RAW-CONTROL-CHARS' which busybox less does not support:
TERMUX_PKG_DEPENDS="less, zlib"
TERMUX_PKG_DEPENDS="less, libgit2"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_pre_configure() {
@ -14,6 +14,7 @@ termux_step_pre_configure() {
# See https://github.com/nagisa/rust_libloading/issues/54
export CC_x86_64_unknown_linux_gnu=gcc
export CFLAGS_x86_64_unknown_linux_gnu=""
export LIBGIT2_SYS_USE_PKG_CONFIG=1
}
termux_step_post_make_install() {

View File

@ -0,0 +1,11 @@
--- ./src/shims/atomic.h.orig 2020-01-18 03:08:41.044959773 +0000
+++ ./src/shims/atomic.h 2020-01-18 03:08:53.745179911 +0000
@@ -35,7 +35,7 @@
#if defined(__cplusplus) && (defined(__FreeBSD__) || defined(_WIN32))
#define _Bool bool
#endif
-#include <stdatomic.h>
+#include <bits/stdatomic.h>
#define memory_order_ordered memory_order_seq_cst
#define memory_order_dependency memory_order_acquire

View File

@ -2,7 +2,6 @@ TERMUX_PKG_HOMEPAGE=https://developer.android.com/tools/sdk/ndk/index.html
TERMUX_PKG_DESCRIPTION="Multilib binaries for cross-compilation"
TERMUX_PKG_LICENSE="NCSA"
TERMUX_PKG_VERSION=$TERMUX_NDK_VERSION
TERMUX_PKG_REVISION=4
TERMUX_PKG_SKIP_SRC_EXTRACT=true
TERMUX_PKG_PLATFORM_INDEPENDENT=true
TERMUX_PKG_NO_STATICSPLIT=true

View File

@ -1,5 +1,5 @@
TERMUX_ANDROID_BUILD_TOOLS_VERSION=29.0.2
TERMUX_NDK_VERSION_NUM=20
TERMUX_NDK_VERSION_NUM=21
TERMUX_NDK_REVISION=""
TERMUX_NDK_VERSION=$TERMUX_NDK_VERSION_NUM$TERMUX_NDK_REVISION