diff options
Diffstat (limited to 'devel/android-tools-adb')
16 files changed, 196 insertions, 146 deletions
diff --git a/devel/android-tools-adb/Makefile b/devel/android-tools-adb/Makefile index fcc30e00d435..0a4081f86cc4 100644 --- a/devel/android-tools-adb/Makefile +++ b/devel/android-tools-adb/Makefile @@ -2,7 +2,7 @@ PORTNAME= android-tools-adb DISTVERSIONPREFIX= android- -DISTVERSION?= 6.0.1_r24 +DISTVERSION?= 7.0.0_r1 PORTREVISION?= 0 CATEGORIES= devel @@ -19,19 +19,11 @@ GH_PROJECT= platform_system_core .ifdef DISTVERSIONSUFFIX GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot .else -GH_REVISION= 2a288d0f331c # generated by: make update-revision +GH_REVISION= 88f64719d756 # generated by: make update-revision .endif CONFLICTS_INSTALL?= ${PORTNAME}-devel-* -.ifndef EXTRA_PATCHES -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_include_base_logging.h -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_file__test.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_logging.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-liblog_logd__write.c -.endif - USES= compiler:c++11-lib uidfix USE_OPENSSL= yes BUILD_WRKSRC= ${WRKSRC}/adb @@ -55,7 +47,7 @@ OPTIONS_SUB= yes BASH_GH_ACCOUNT= mbrubeck:bashcomp BASH_GH_PROJECT= android-completion:bashcomp -BASH_GH_TAGNAME= 3b0fabe:bashcomp +BASH_GH_TAGNAME= c1b0656:bashcomp BASH_PLIST_FILES= etc/bash_completion.d/adb BASH_VARS= LICENSE+=MIT LICENSE_COMB=multi diff --git a/devel/android-tools-adb/distinfo b/devel/android-tools-adb/distinfo index f6c865ba8e60..083cbb99e272 100644 --- a/devel/android-tools-adb/distinfo +++ b/devel/android-tools-adb/distinfo @@ -1,4 +1,5 @@ -SHA256 (android-platform_system_core-android-6.0.1_r24_GH0.tar.gz) = f335756cc7f2ad3b6870dee7fb4641fd97df0a4d51c89bd508dce34802815b1e -SIZE (android-platform_system_core-android-6.0.1_r24_GH0.tar.gz) = 1184987 -SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc -SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948 +TIMESTAMP = 1472009581 +SHA256 (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = faa44f626dfab9e604f509cc541a8e491e7e46a9de42df3a9c1e24c36fd9f8c4 +SIZE (android-platform_system_core-android-7.0.0_r1_GH0.tar.gz) = 1570346 +SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c +SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967 diff --git a/devel/android-tools-adb/files/Makefile b/devel/android-tools-adb/files/Makefile index 4bf841d1fb66..7f0780076180 100644 --- a/devel/android-tools-adb/files/Makefile +++ b/devel/android-tools-adb/files/Makefile @@ -13,23 +13,33 @@ SRCS+= adb_auth_host.cpp SRCS+= adb_client.cpp SRCS+= adb_io.cpp SRCS+= adb_listeners.cpp -SRCS+= adb_main.cpp +SRCS+= adb_trace.cpp SRCS+= adb_utils.cpp SRCS+= commandline.cpp SRCS+= console.cpp +SRCS+= diagnose_usb.cpp SRCS+= fdevent.cpp SRCS+= file_sync_client.cpp +SRCS+= line_printer.cpp SRCS+= services.cpp -# XXX SuffFindDeps may fail to restore suffix lost in transformation +SRCS+= shell_service_protocol.cpp SRCS+= ../adb/sockets.cpp +SRCS+= sysdeps_unix.cpp SRCS+= transport.cpp SRCS+= transport_local.cpp SRCS+= transport_usb.cpp TEST_SRCS+= adb_io_test.cpp TEST_SRCS+= adb_utils_test.cpp +TEST_SRCS+= fdevent_test.cpp +TEST_SRCS+= shell_service_protocol_test.cpp +TEST_SRCS+= socket_test.cpp +TEST_SRCS+= sysdeps_test.cpp TEST_SRCS+= transport_test.cpp +.PATH: ${.CURDIR}/client +SRCS+= main.cpp + .PATH: ${EXTRADIR} SRCS+= get_my_path_freebsd.cpp SRCS+= usb_libusb.cpp @@ -37,30 +47,39 @@ SRCS+= usb_libusb.cpp .PATH: ${.CURDIR}/../base SRCS+= file.cpp SRCS+= logging.cpp -SRCS+= strings.cpp +SRCS+= parsenetaddress.cpp SRCS+= stringprintf.cpp +SRCS+= strings.cpp TEST_SRCS+= file_test.cpp TEST_SRCS+= logging_test.cpp +TEST_SRCS+= parsenetaddress_test.cpp TEST_SRCS+= stringprintf_test.cpp TEST_SRCS+= strings_test.cpp TEST_SRCS+= test_main.cpp TEST_SRCS+= test_utils.cpp .PATH: ${.CURDIR}/../libcutils -SRCS+= socket_inaddr_any_server.c -SRCS+= socket_local_client.c -SRCS+= socket_local_server.c -SRCS+= socket_loopback_client.c -SRCS+= socket_loopback_server.c -SRCS+= socket_network_client.c +SRCS+= socket_inaddr_any_server_unix.c +SRCS+= socket_local_client_unix.c +SRCS+= socket_local_server_unix.c +SRCS+= socket_loopback_client_unix.c +SRCS+= socket_loopback_server_unix.c +SRCS+= socket_network_client_unix.c +SRCS+= ../libcutils/sockets.cpp SRCS+= load_file.c SRCS+= threads.c +# XXX Obsolete after 10.2 or r279980/r280329 +CPPFLAGS.sockets.cpp+= -o ${.TARGET} # required by base/file.cpp .PATH: ${.CURDIR}/../liblog +SRCS+= config_write.c SRCS+= fake_log_device.c -SRCS+= logd_write.c -CPPFLAGS.logd_write.c+= -DFAKE_LOG_DEVICE=1 +SRCS+= fake_writer.c +SRCS+= logger_lock.c +SRCS+= logger_name.c +SRCS+= logger_write.c +CPPFLAGS.config_write.c+= -DFAKE_LOG_DEVICE=1 REVISION?= $$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown) @@ -110,5 +129,5 @@ beforeinstall: test: ${PROG}_test @for f in ${.ALLSRC}; do ./$$f; done -${PROG}_test: ${OBJS:Nadb_main.o:Ncommandline.o} ${TEST_OBJS} +${PROG}_test: ${OBJS:Nmain.o:Ncommandline.o} ${TEST_OBJS} ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} diff --git a/devel/android-tools-adb/files/extra-patch-base_file.cpp b/devel/android-tools-adb/files/extra-patch-base_file.cpp deleted file mode 100644 index 29638851e71d..000000000000 --- a/devel/android-tools-adb/files/extra-patch-base_file.cpp +++ /dev/null @@ -1,10 +0,0 @@ ---- base/file.cpp.orig 2015-05-27 20:24:08 UTC -+++ base/file.cpp -@@ -21,6 +21,7 @@ - #include <sys/stat.h> - #include <sys/types.h> - -+#include <cstring> // strerror - #include <string> - - #include "base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. diff --git a/devel/android-tools-adb/files/extra-patch-base_file__test.cpp b/devel/android-tools-adb/files/extra-patch-base_file__test.cpp deleted file mode 100644 index d0f287da3d7f..000000000000 --- a/devel/android-tools-adb/files/extra-patch-base_file__test.cpp +++ /dev/null @@ -1,68 +0,0 @@ -commit cf168a8 + cbf26b7 -Author: Spencer Low <CompareAndSwap@gmail.com> -Date: Mon Aug 3 20:43:24 2015 -0700 - - libbase_test: win32: get some tests working -[...] - - enh's edit to my previous change deleted a test that used - /proc/version, but I think another test was missed. Merge that test into - another. - ---- base/file_test.cpp.orig 2015-08-27 08:07:53 UTC -+++ base/file_test.cpp -@@ -34,16 +34,7 @@ TEST(file, ReadFileToString_ENOENT) { - EXPECT_EQ("", s); // s was cleared. - } - --TEST(file, ReadFileToString_success) { -- std::string s("hello"); -- ASSERT_TRUE(android::base::ReadFileToString("/proc/version", &s)) << errno; -- EXPECT_GT(s.length(), 6U); -- EXPECT_EQ('\n', s[s.length() - 1]); -- s[5] = 0; -- EXPECT_STREQ("Linux", s.c_str()); --} -- --TEST(file, WriteStringToFile) { -+TEST(file, ReadFileToString_WriteStringToFile) { - TemporaryFile tf; - ASSERT_TRUE(tf.fd != -1); - ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.filename)) << errno; -@@ -80,27 +71,20 @@ TEST(file, WriteStringToFd) { - EXPECT_EQ("abc", s); - } - --TEST(file, ReadFully) { -- int fd = open("/proc/version", O_RDONLY); -- ASSERT_NE(-1, fd) << strerror(errno); -- -- char buf[1024]; -- memset(buf, 0, sizeof(buf)); -- ASSERT_TRUE(android::base::ReadFully(fd, buf, 5)); -- ASSERT_STREQ("Linux", buf); -- -- ASSERT_EQ(0, lseek(fd, 0, SEEK_SET)) << strerror(errno); -- -- ASSERT_FALSE(android::base::ReadFully(fd, buf, sizeof(buf))); -- -- close(fd); --} -- - TEST(file, WriteFully) { - TemporaryFile tf; - ASSERT_TRUE(tf.fd != -1); - ASSERT_TRUE(android::base::WriteFully(tf.fd, "abc", 3)); -+ -+ ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << errno; -+ - std::string s; -- ASSERT_TRUE(android::base::ReadFileToString(tf.filename, &s)) << errno; -+ s.resize(3); -+ ASSERT_TRUE(android::base::ReadFully(tf.fd, &s[0], s.size())) << errno; - EXPECT_EQ("abc", s); -+ -+ ASSERT_EQ(0, lseek(tf.fd, 0, SEEK_SET)) << errno; -+ -+ s.resize(1024); -+ ASSERT_FALSE(android::base::ReadFully(tf.fd, &s[0], s.size())); - } diff --git a/devel/android-tools-adb/files/extra-patch-base_logging.cpp b/devel/android-tools-adb/files/extra-patch-base_logging.cpp deleted file mode 100644 index 53bf6fdd0537..000000000000 --- a/devel/android-tools-adb/files/extra-patch-base_logging.cpp +++ /dev/null @@ -1,18 +0,0 @@ ---- base/logging.cpp.orig 2015-06-17 22:20:38 UTC -+++ base/logging.cpp -@@ -23,12 +23,14 @@ - #include <libgen.h> - - // For getprogname(3) or program_invocation_short_name. --#if defined(__ANDROID__) || defined(__APPLE__) -+#if !defined(_WIN32) && !defined(__GLIBC__) - #include <stdlib.h> - #elif defined(__GLIBC__) - #include <errno.h> - #endif - -+#include <cstring> // strlen -+#include <cstdio> // fprintf - #include <iostream> - #include <limits> - #include <sstream> diff --git a/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c b/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c deleted file mode 100644 index d9a8890325d4..000000000000 --- a/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c +++ /dev/null @@ -1,12 +0,0 @@ ---- liblog/logd_write.c.orig 2015-05-27 20:24:08 UTC -+++ liblog/logd_write.c -@@ -22,7 +22,9 @@ - #include <pthread.h> - #endif - #include <stdarg.h> -+#if (FAKE_LOG_DEVICE == 0) - #include <stdatomic.h> -+#endif - #include <stdio.h> - #include <stdlib.h> - #include <string.h> diff --git a/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp b/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp new file mode 100644 index 000000000000..492e538cf860 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp @@ -0,0 +1,10 @@ +--- adb/fdevent_test.cpp.orig 2015-09-17 22:58:36 UTC ++++ adb/fdevent_test.cpp +@@ -19,6 +19,7 @@ + #include <gtest/gtest.h> + + #include <limits> ++#include <memory> // std::unique_ptr + #include <queue> + #include <string> + #include <vector> diff --git a/devel/android-tools-adb/files/patch-adb_sysdeps.h b/devel/android-tools-adb/files/patch-adb_sysdeps.h new file mode 100644 index 000000000000..8ca18724c86a --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_sysdeps.h @@ -0,0 +1,43 @@ +--- adb/sysdeps.h.orig 2015-09-05 00:01:27 UTC ++++ adb/sysdeps.h +@@ -61,11 +61,13 @@ + #endif + #endif + +-#ifdef _WIN32 +- ++#if !defined(__clang__) || __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 7) + // Clang-only nullability specifiers + #define _Nonnull + #define _Nullable ++#endif ++ ++#ifdef _WIN32 + + #include <ctype.h> + #include <direct.h> +@@ -401,6 +401,11 @@ typedef std::unique_ptr<HANDLE, handle_d + + #include <string> + ++#if defined(__Bitrig__) || defined(__DragonFly__) || \ ++ defined(__FreeBSD__) || defined(__OpenBSD__) ++#include <pthread_np.h> ++#endif ++ + #define OS_PATH_SEPARATORS "/" + #define OS_PATH_SEPARATOR '/' + #define OS_PATH_SEPARATOR_STR "/" +@@ -627,6 +632,12 @@ static __inline__ bool adb_thread_create + static __inline__ int adb_thread_setname(const std::string& name) { + #ifdef __APPLE__ + return pthread_setname_np(name.c_str()); ++#elif defined(__Bitrig__) || defined(__DragonFly__) || \ ++ defined(__FreeBSD__) || defined(__OpenBSD__) ++ pthread_set_name_np(pthread_self(), name.c_str()); ++ return 0; ++#elif defined(__NetBSD__) ++ return pthread_setname_np(pthread_self(), "%s", (void*)name.c_str()); + #else + const char *s = name.c_str(); + diff --git a/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h b/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h new file mode 100644 index 000000000000..792d29f7f738 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h @@ -0,0 +1,9 @@ +--- adb/sysdeps/mutex.h.orig 2016-06-23 07:04:56 UTC ++++ adb/sysdeps/mutex.h +@@ -104,4 +104,6 @@ + + } + ++#else ++#include <mutex> + #endif diff --git a/devel/android-tools-adb/files/patch-base_file.cpp b/devel/android-tools-adb/files/patch-base_file.cpp new file mode 100644 index 000000000000..754b02594d0c --- /dev/null +++ b/devel/android-tools-adb/files/patch-base_file.cpp @@ -0,0 +1,11 @@ +--- base/file.cpp.orig 2016-08-08 21:10:17 UTC ++++ base/file.cpp +@@ -21,6 +21,8 @@ + #include <sys/stat.h> + #include <sys/types.h> + ++#include <cstdio> // BUFSIZ ++#include <cstring> // strerror + #include <string> + + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. diff --git a/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h b/devel/android-tools-adb/files/patch-base_include_android-base_logging.h index 4770e9e0b411..7f170c3f521b 100644 --- a/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h +++ b/devel/android-tools-adb/files/patch-base_include_android-base_logging.h @@ -1,5 +1,5 @@ ---- base/include/base/logging.h.orig 2015-09-29 18:07:07 UTC -+++ base/include/base/logging.h +--- base/include/android-base/logging.h.orig 2015-09-29 18:07:07 UTC ++++ base/include/android-base/logging.h @@ -25,6 +25,8 @@ #endif #endif diff --git a/devel/android-tools-adb/files/patch-base_logging.cpp b/devel/android-tools-adb/files/patch-base_logging.cpp new file mode 100644 index 000000000000..10b83f259680 --- /dev/null +++ b/devel/android-tools-adb/files/patch-base_logging.cpp @@ -0,0 +1,50 @@ +--- base/logging.cpp.orig 2016-08-08 21:10:17 UTC ++++ base/logging.cpp +@@ -25,7 +25,7 @@ + #include <time.h> + + // For getprogname(3) or program_invocation_short_name. +-#if defined(__ANDROID__) || defined(__APPLE__) ++#if !defined(_WIN32) && !defined(__GLIBC__) + #include <stdlib.h> + #elif defined(__GLIBC__) + #include <errno.h> +@@ -35,6 +35,8 @@ + #include <sys/uio.h> + #endif + ++#include <cstring> // strrchr ++#include <cstdio> // fprintf + #include <iostream> + #include <limits> + #include <sstream> +@@ -71,6 +72,14 @@ + #include <unistd.h> + #elif defined(_WIN32) + #include <windows.h> ++#elif defined(__DragonFly__) ++#include <unistd.h> ++#elif defined(__FreeBSD__) ++#include <pthread_np.h> ++#elif defined(__NetBSD__) ++#include <lwp.h> ++#else ++#include <stdint.h> + #endif + + #if defined(_WIN32) +@@ -88,6 +97,14 @@ static thread_id GetThreadId() { + return syscall(__NR_gettid); + #elif defined(_WIN32) + return GetCurrentThreadId(); ++#elif defined(__DragonFly__) ++ return lwp_gettid(); ++#elif defined(__NetBSD__) ++ return _lwp_self(); ++#elif defined(__FreeBSD__) ++ return pthread_getthreadid_np(); ++#else ++ return (intptr_t) pthread_self(); + #endif + } + diff --git a/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp b/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp new file mode 100644 index 000000000000..b640a75485fa --- /dev/null +++ b/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp @@ -0,0 +1,10 @@ +--- base/parsenetaddress.cpp.orig 2016-02-20 02:39:51 UTC ++++ base/parsenetaddress.cpp +@@ -16,6 +16,7 @@ + + #include "android-base/parsenetaddress.h" + ++#include <stdio.h> // sscanf + #include <algorithm> + + #include "android-base/stringprintf.h" diff --git a/devel/android-tools-adb/files/patch-liblog_logger__write.c b/devel/android-tools-adb/files/patch-liblog_logger__write.c new file mode 100644 index 000000000000..481e87407296 --- /dev/null +++ b/devel/android-tools-adb/files/patch-liblog_logger__write.c @@ -0,0 +1,16 @@ +--- liblog/logger_write.c.orig 2016-04-16 00:01:39 UTC ++++ liblog/logger_write.c +@@ -15,12 +15,12 @@ + */ + + #include <errno.h> +-#include <stdatomic.h> + #include <stdlib.h> + #include <string.h> + #include <sys/time.h> + + #ifdef __BIONIC__ ++#include <stdatomic.h> + #include <android/set_abort_message.h> + #endif + diff --git a/devel/android-tools-adb/files/usb_libusb.cpp b/devel/android-tools-adb/files/usb_libusb.cpp index b7033259d8c5..cfed6aa214e6 100644 --- a/devel/android-tools-adb/files/usb_libusb.cpp +++ b/devel/android-tools-adb/files/usb_libusb.cpp @@ -17,7 +17,7 @@ * limitations under the License. */ -#define TRACE_TAG TRACE_USB +#define TRACE_TAG USB #include "sysdeps.h" @@ -58,7 +58,7 @@ static usb_handle handle_list = { .next = &handle_list, }; -void +static void usb_cleanup() { libusb_exit(ctx); @@ -600,9 +600,10 @@ scan_usb_devices() libusb_free_device_list(devs, 1); } -static void * -device_poll_thread(void* unused) +static void +device_poll_thread(void*) { + adb_thread_setname("USB scan"); D("device_poll_thread(): Created USB scan thread"); for (;;) { @@ -610,9 +611,6 @@ device_poll_thread(void* unused) kick_disconnected(); scan_usb_devices(); } - - /* never reaching this point */ - return (NULL); } static void @@ -625,7 +623,6 @@ void usb_init() { D("usb_init(): started"); - adb_thread_t tid; struct sigaction actions; atexit(usb_cleanup); @@ -648,7 +645,7 @@ usb_init() scan_usb_devices(); /* starting USB event polling thread */ - if (adb_thread_create(&tid, device_poll_thread, nullptr)) { + if (!adb_thread_create(device_poll_thread, nullptr)) { fatal_errno("cannot create USB scan thread"); } |