summaryrefslogtreecommitdiff
path: root/devel/android-tools-adb
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2017-10-30 18:36:22 +0000
committerJan Beich <jbeich@FreeBSD.org>2017-10-30 18:36:22 +0000
commita139cacf4408741878dfd078ae538b23e3128fcb (patch)
tree08c7f90ba8b17075600d3a27c8bf84cde099f445 /devel/android-tools-adb
parentdevel/renpy: update to 6.99.13 (diff)
devel/android-tools-{adb,fastboot}: update to 8.0.0.r24
Changes: https://android.googlesource.com/platform/system/core/+log/android-8.0.0_r4..android-8.0.0_r24/adb Changes: https://android.googlesource.com/platform/system/core/+log/android-8.0.0_r4..android-8.0.0_r24/fastboot
Diffstat (limited to 'devel/android-tools-adb')
-rw-r--r--devel/android-tools-adb/Makefile16
-rw-r--r--devel/android-tools-adb/distinfo10
-rw-r--r--devel/android-tools-adb/files/Makefile2
-rw-r--r--devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp100
-rw-r--r--devel/android-tools-adb/files/patch-base_include_android-base_logging.h9
5 files changed, 118 insertions, 19 deletions
diff --git a/devel/android-tools-adb/Makefile b/devel/android-tools-adb/Makefile
index 6d8f2ba11e5a..e5a2163485c3 100644
--- a/devel/android-tools-adb/Makefile
+++ b/devel/android-tools-adb/Makefile
@@ -2,16 +2,10 @@
PORTNAME= android-tools-adb
DISTVERSIONPREFIX= android-
-DISTVERSION?= 8.0.0_r4
-PORTREVISION?= 1
+DISTVERSION?= 8.0.0_r24
+PORTREVISION?= 0
CATEGORIES= devel comms
-.ifndef EXTRA_PATCHES
-PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
-PATCHFILES+= 46de1d7f03b7.patch:-p1
-PATCHFILES+= 5d002b8d6ae0.patch:-p1
-.endif
-
MAINTAINER= jbeich@FreeBSD.org
COMMENT= Android debug bridge command line tool
@@ -25,15 +19,11 @@ GH_PROJECT= platform_system_core
.ifdef DISTVERSIONSUFFIX
GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot
.else
-GH_REVISION= f6a78079a81a # generated by: make update-revision
+GH_REVISION= 6cd85e2a8934 # generated by: make update-revision
.endif
CONFLICTS_INSTALL?= ${PORTNAME}-devel-*
-.ifndef EXTRA_PATCHES
-EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-base_include_android-base_logging.h
-.endif
-
USES= compiler:c++14-lang pkgconfig ssl uidfix
BUILD_WRKSRC= ${WRKSRC}/adb
INSTALL_WRKSRC= ${BUILD_WRKSRC}
diff --git a/devel/android-tools-adb/distinfo b/devel/android-tools-adb/distinfo
index 0c0e5504e65c..5ffd71488b24 100644
--- a/devel/android-tools-adb/distinfo
+++ b/devel/android-tools-adb/distinfo
@@ -1,10 +1,10 @@
-TIMESTAMP = 1498603192
-SHA256 (android-platform_system_core-android-8.0.0_r4_GH0.tar.gz) = 3eb686edb1ccaa7312fb195b65c413823a6d60442d519c499c18b2d18c3094a9
-SIZE (android-platform_system_core-android-8.0.0_r4_GH0.tar.gz) = 5115403
+TIMESTAMP = 1502781926
+SHA256 (android-platform_system_core-android-8.0.0_r24_GH0.tar.gz) = 6b55a409e6c03f58add5a0d13765ebcb6aee7ecef6452ef5d780228209cb8a3a
+SIZE (android-platform_system_core-android-8.0.0_r24_GH0.tar.gz) = 5190913
SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c
SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967
-SHA256 (android-platform_development-android-8.0.0_r4_GH0.tar.gz) = b6399cc349a332ef818f5041dd39742322bcf96d54663ec8a11e38cb5271096c
-SIZE (android-platform_development-android-8.0.0_r4_GH0.tar.gz) = 93751770
+SHA256 (android-platform_development-android-8.0.0_r24_GH0.tar.gz) = 1477bab3bfe7202ab7bc716a20deb99e5c151d69df44a6a478e7de2cf10acb4d
+SIZE (android-platform_development-android-8.0.0_r24_GH0.tar.gz) = 93766075
SHA256 (46de1d7f03b7.patch) = 93bf49a9a93f2b660f39041f8dbd179ea8f1170c1bebeee42f7df1dc1c393579
SIZE (46de1d7f03b7.patch) = 12346
SHA256 (5d002b8d6ae0.patch) = 0d105587abea3afbfd320a95be3f8532f213778a6f699150c4d4477334c9eef2
diff --git a/devel/android-tools-adb/files/Makefile b/devel/android-tools-adb/files/Makefile
index 015102eb24b5..df2c0985117f 100644
--- a/devel/android-tools-adb/files/Makefile
+++ b/devel/android-tools-adb/files/Makefile
@@ -101,7 +101,7 @@ SRCS+= stderr_write.c
REVISION?= $$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
-CPPFLAGS+= -DADB_REVISION="\"${REVISION}-android\""
+CPPFLAGS+= -DADB_VERSION="\"26.0.0 rc1-${REVISION}-android\""
CPPFLAGS+= -DADB_HOST=1
CPPFLAGS+= -DHAVE_FORKEXEC=1
CPPFLAGS+= -DHAVE_SYMLINKS
diff --git a/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp b/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp
index 438930e32b32..dba0da73601d 100644
--- a/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp
+++ b/devel/android-tools-adb/files/patch-adb_client_usb__libusb.cpp
@@ -28,3 +28,103 @@
usb_handle(const std::string& device_address, const std::string& serial,
unique_device_handle&& device_handle, uint8_t interface, uint8_t bulk_in,
uint8_t bulk_out, size_t zero_mask, size_t max_packet_size)
+@@ -152,7 +156,14 @@ struct usb_handle : public ::usb_handle {
+ static auto& usb_handles = *new std::unordered_map<std::string, std::unique_ptr<usb_handle>>();
+ static auto& usb_handles_mutex = *new std::mutex();
+
++#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
+ static libusb_hotplug_callback_handle hotplug_handle;
++#else
++static std::thread* device_poll_thread = nullptr;
++static bool terminate_device_poll_thread = false;
++static auto& device_poll_mutex = *new std::mutex();
++static auto& device_poll_cv = *new std::condition_variable();
++#endif
+
+ static std::string get_device_address(libusb_device* device) {
+ return StringPrintf("usb:%d:%d", libusb_get_bus_number(device),
+@@ -380,6 +391,7 @@ static void process_device(libusb_device* device) {
+ LOG(INFO) << "registered new usb device '" << device_serial << "'";
+ }
+
++#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
+ static std::atomic<int> connecting_devices(0);
+
+ static void device_connected(libusb_device* device) {
+@@ -449,7 +461,31 @@ static int hotplug_callback(libusb_context*, libusb_de
+ hotplug_queue.Push({event, device});
+ return 0;
+ }
++#else
++static void poll_for_devices() {
++ libusb_device** list;
++ adb_thread_setname("device poll");
++ while (true) {
++ const ssize_t device_count = libusb_get_device_list(nullptr, &list);
+
++ LOG(VERBOSE) << "found " << device_count << " attached devices";
++
++ for (ssize_t i = 0; i < device_count; ++i) {
++ process_device(list[i]);
++ }
++
++ libusb_free_device_list(list, 1);
++
++ adb_notify_device_scan_complete();
++
++ std::unique_lock<std::mutex> lock(device_poll_mutex);
++ if (device_poll_cv.wait_for(lock, 500ms, []() { return terminate_device_poll_thread; })) {
++ return;
++ }
++ }
++}
++#endif
++
+ void usb_init() {
+ LOG(DEBUG) << "initializing libusb...";
+ int rc = libusb_init(nullptr);
+@@ -457,6 +493,7 @@ void usb_init() {
+ LOG(FATAL) << "failed to initialize libusb: " << libusb_error_name(rc);
+ }
+
++#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
+ // Register the hotplug callback.
+ rc = libusb_hotplug_register_callback(
+ nullptr, static_cast<libusb_hotplug_event>(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
+@@ -467,6 +504,7 @@ void usb_init() {
+ if (rc != LIBUSB_SUCCESS) {
+ LOG(FATAL) << "failed to register libusb hotplug callback";
+ }
++#endif
+
+ // Spawn a thread for libusb_handle_events.
+ std::thread([]() {
+@@ -475,10 +513,28 @@ void usb_init() {
+ libusb_handle_events(nullptr);
+ }
+ }).detach();
++
++#if !defined(LIBUSB_API_VERSION) || LIBUSB_API_VERSION < 0x01000102
++ std::unique_lock<std::mutex> lock(device_poll_mutex);
++ device_poll_thread = new std::thread(poll_for_devices);
++#endif
+ }
+
+ void usb_cleanup() {
++#if defined(LIBUSB_API_VERSION) && LIBUSB_API_VERSION >= 0x01000102
+ libusb_hotplug_deregister_callback(nullptr, hotplug_handle);
++#else
++ {
++ std::unique_lock<std::mutex> lock(device_poll_mutex);
++ terminate_device_poll_thread = true;
++
++ if (!device_poll_thread) {
++ return;
++ }
++ }
++ device_poll_cv.notify_all();
++ device_poll_thread->join();
++#endif
+ }
+
+ // Dispatch a libusb transfer, unlock |device_lock|, and then wait for the result.
diff --git a/devel/android-tools-adb/files/patch-base_include_android-base_logging.h b/devel/android-tools-adb/files/patch-base_include_android-base_logging.h
index 7f170c3f521b..55a6b47c6301 100644
--- a/devel/android-tools-adb/files/patch-base_include_android-base_logging.h
+++ b/devel/android-tools-adb/files/patch-base_include_android-base_logging.h
@@ -9,3 +9,12 @@
#include <functional>
#include <memory>
#include <ostream>
+@@ -321,7 +321,7 @@ struct LogAbortAfterFullExpr {
+ // DCHECKs are debug variants of CHECKs only enabled in debug builds. Generally
+ // CHECK should be used unless profiling identifies a CHECK as being in
+ // performance critical code.
+-#if defined(NDEBUG) && !defined(__clang_analyzer__)
++#if defined(NDEBUG) && !defined(__clang_analyzer__) || !defined(__ANDROID__)
+ static constexpr bool kEnableDChecks = false;
+ #else
+ static constexpr bool kEnableDChecks = true;