diff options
author | Julien Lepiller <julien@lepiller.eu> | 2017-04-15 18:17:27 +0200 |
---|---|---|
committer | Julien Lepiller <julien@lepiller.eu> | 2017-04-18 23:32:07 +0200 |
commit | 5315fcfd773405506d38ec26dd85f05113611f70 (patch) | |
tree | ef996470a970a9ef0ef88adf67b4157a8423de8a /gnu/packages/patches/libbase-fix-includes.patch | |
parent | d72b42064b3cdeca7adbf13cce00faff5b61472a (diff) |
gnu: Add adb.
* gnu/packages/android.scm: New file.
* gnu/packages/patches/libbase-fix-includes.patch: New file.
* gnu/packages/patches/libbase-use-own-logging.patch: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES, dist_patch_DATA): Add them.
Co-Authored-By: Marius Bakke <mbakke@fastmail.com>
Diffstat (limited to 'gnu/packages/patches/libbase-fix-includes.patch')
-rw-r--r-- | gnu/packages/patches/libbase-fix-includes.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/gnu/packages/patches/libbase-fix-includes.patch b/gnu/packages/patches/libbase-fix-includes.patch new file mode 100644 index 0000000000..3071a0c400 --- /dev/null +++ b/gnu/packages/patches/libbase-fix-includes.patch @@ -0,0 +1,71 @@ +This patch fixes the build of adb on linux. + +Copied from archlinux repository: +https://git.archlinux.org/svntogit/community.git/tree/trunk/fix_build.patch?h=packages/android-tools + +diff --git a/adb/sysdeps.h b/adb/sysdeps.h +index 75dcc86..867f3ec 100644 +--- a/adb/sysdeps.h ++++ b/adb/sysdeps.h +@@ -25,6 +25,7 @@ + #endif + + #include <errno.h> ++#include <sys/syscall.h> + + #include <string> + #include <vector> +@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const char* path) { + + static __inline__ unsigned long adb_thread_id() + { +- return (unsigned long)gettid(); ++ // TODO: this function should be merged with GetThreadId ++#if defined(__BIONIC__) ++ return gettid(); ++#elif defined(__APPLE__) ++ return syscall(SYS_thread_selfid); ++#elif defined(__linux__) ++ return syscall(__NR_gettid); ++#elif defined(_WIN32) ++ return GetCurrentThreadId(); ++#endif + } + + #endif /* !_WIN32 */ +diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp +index 296995e..48269b6 100644 +--- a/base/errors_unix.cpp ++++ b/base/errors_unix.cpp +@@ -17,6 +17,7 @@ + #include "android-base/errors.h" + + #include <errno.h> ++#include <string.h> + + namespace android { + namespace base { +diff --git a/base/file.cpp b/base/file.cpp +index da1adba..91a3901 100644 +--- a/base/file.cpp ++++ b/base/file.cpp +@@ -20,6 +20,7 @@ + #include <fcntl.h> + #include <sys/stat.h> + #include <sys/types.h> ++#include <string.h> + + #include <string> + +diff --git a/base/logging.cpp b/base/logging.cpp +index 1741871..e97c7f1 100644 +--- a/base/logging.cpp ++++ b/base/logging.cpp +@@ -21,6 +21,7 @@ + #include "android-base/logging.h" + + #include <libgen.h> ++#include <string.h> + + // For getprogname(3) or program_invocation_short_name. + #if defined(__ANDROID__) || defined(__APPLE__) |