From 37cc66d4256c17393ae662207ddfbc51e4bc4ab5 Mon Sep 17 00:00:00 2001 From: jbeich Date: Tue, 3 Mar 2020 22:53:35 +0000 Subject: [PATCH] devel/android-tools-adb: update to 30.0.0 Changes: https://android.googlesource.com/platform/system/core/+log/platform-tools-29.0.6..platform-tools-30.0.0/adb Reported by: portscout --- devel/android-tools-adb/Makefile | 7 ++- devel/android-tools-adb/distinfo | 10 ++-- devel/android-tools-adb/files/Makefile | 19 ++++++- .../files/patch-adb_adb__auth.h | 12 ++++ .../files/patch-adb_client_adb__install.cpp | 57 ++++++++++--------- .../files/patch-adb_client_commandline.cpp | 10 ++-- ...pp => patch-adb_client_transport__usb.cpp} | 6 +- .../files/patch-adb_client_usb.h | 15 +++++ .../files/patch-adb_client_usb__libusb.cpp | 39 +++++-------- .../patch-adb_crypto_include_adb_crypto_key.h | 52 +++++++++++++++++ ...rypto_include_adb_crypto_x509__generator.h | 12 ++++ .../files/patch-adb_sysdeps.h | 17 ++++-- ...ch-adb_tls_include_adb_tls_adb__ca__list.h | 12 ++++ .../files/patch-adb_tls_tls__connection.cpp | 12 ++++ devel/android-tools-adb/files/patch-adb_usb.h | 20 ------- 15 files changed, 210 insertions(+), 90 deletions(-) create mode 100644 devel/android-tools-adb/files/patch-adb_adb__auth.h rename devel/android-tools-adb/files/{patch-adb_transport__usb.cpp => patch-adb_client_transport__usb.cpp} (63%) create mode 100644 devel/android-tools-adb/files/patch-adb_client_usb.h create mode 100644 devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_key.h create mode 100644 devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_x509__generator.h create mode 100644 devel/android-tools-adb/files/patch-adb_tls_include_adb_tls_adb__ca__list.h create mode 100644 devel/android-tools-adb/files/patch-adb_tls_tls__connection.cpp delete mode 100644 devel/android-tools-adb/files/patch-adb_usb.h diff --git a/devel/android-tools-adb/Makefile b/devel/android-tools-adb/Makefile index 5ded910467d5..aac8105c82ed 100644 --- a/devel/android-tools-adb/Makefile +++ b/devel/android-tools-adb/Makefile @@ -2,8 +2,8 @@ PORTNAME= android-tools-adb DISTVERSIONPREFIX= platform-tools- -DISTVERSION?= 29.0.6 -PORTREVISION?= 1 +DISTVERSION?= 30.0.0 +PORTREVISION?= 0 CATEGORIES= devel comms MAINTAINER= jbeich@FreeBSD.org @@ -11,6 +11,9 @@ COMMENT= Android debug bridge command line tool LICENSE= APACHE20 +LIB_DEPENDS= libbrotlienc.so:archivers/brotli \ + libprotobuf-lite.so:devel/protobuf + USE_GITHUB= yes GH_TUPLE= aosp-mirror:platform_system_core:${DISTVERSIONFULL} diff --git a/devel/android-tools-adb/distinfo b/devel/android-tools-adb/distinfo index d34e15abf65e..cacedfca9533 100644 --- a/devel/android-tools-adb/distinfo +++ b/devel/android-tools-adb/distinfo @@ -1,7 +1,7 @@ -TIMESTAMP = 1581453885 -SHA256 (aosp-mirror-platform_system_core-platform-tools-29.0.6_GH0.tar.gz) = 3d1898c1ad19f63641090576c60588ab761132b42b306ff4979d30723187d562 -SIZE (aosp-mirror-platform_system_core-platform-tools-29.0.6_GH0.tar.gz) = 72302409 +TIMESTAMP = 1587159609 +SHA256 (aosp-mirror-platform_system_core-platform-tools-30.0.0_GH0.tar.gz) = b51992bbdcd3fce29b1fdd46eb623fcf75177d74c2d421c43d0fdde95d12df69 +SIZE (aosp-mirror-platform_system_core-platform-tools-30.0.0_GH0.tar.gz) = 76689104 SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967 -SHA256 (aosp-mirror-platform_development-platform-tools-29.0.6_GH0.tar.gz) = 5560f767082834183e31af0fca9e121996e5e16aac67ce10f9321c4146809a0a -SIZE (aosp-mirror-platform_development-platform-tools-29.0.6_GH0.tar.gz) = 63959966 +SHA256 (aosp-mirror-platform_development-platform-tools-30.0.0_GH0.tar.gz) = d3fef9f8170352e2a2729206c7d3dbc54ac3f8dfafe3cffdca9d33a5071de8eb +SIZE (aosp-mirror-platform_development-platform-tools-30.0.0_GH0.tar.gz) = 63963575 diff --git a/devel/android-tools-adb/files/Makefile b/devel/android-tools-adb/files/Makefile index 515776f7d9c6..0dfead3697b5 100644 --- a/devel/android-tools-adb/files/Makefile +++ b/devel/android-tools-adb/files/Makefile @@ -20,7 +20,6 @@ SRCS+= ../adb/sockets.cpp SRCS+= sysdeps_unix.cpp SRCS+= transport.cpp SRCS+= transport_local.cpp -SRCS+= transport_usb.cpp SRCS+= types.cpp TEST_SRCS+= adb_io_test.cpp @@ -37,6 +36,7 @@ TEST_SRCS+= types_test.cpp .PATH: ${.CURDIR}/client SRCS+= adb_client.cpp SRCS+= adb_install.cpp +SRCS+= adb_wifi.cpp SRCS+= auth.cpp SRCS+= bugreport.cpp SRCS+= commandline.cpp @@ -45,8 +45,13 @@ SRCS+= file_sync_client.cpp SRCS+= line_printer.cpp SRCS+= main.cpp SRCS+= transport_mdns${MDNSEXT}.cpp +SRCS+= transport_usb.cpp SRCS+= usb_libusb.cpp +.PATH: ${.CURDIR}/crypto +SRCS+= key.cpp +SRCS+= x509_generator.cpp + .PATH: ${.CURDIR}/fdevent SRCS+= fdevent.cpp SRCS+= fdevent_poll.cpp @@ -59,6 +64,9 @@ TEST_SRCS+= stat_test.cpp .PATH: ${.CURDIR}/sysdeps/posix SRCS+= network.cpp +.PATH: ${.CURDIR}/tls +SRCS+= tls_connection.cpp + .PATH: ${.CURDIR}/../base SRCS+= chrono_utils.cpp SRCS+= file.cpp @@ -107,6 +115,10 @@ CPPFLAGS+= -Dpread64=pread CPPFLAGS+= -Dpwrite64=pwrite CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/client +CPPFLAGS+= -I${.CURDIR}/crypto/include +CPPFLAGS+= -I${.CURDIR}/pairing_connection/include +CPPFLAGS+= -I${.CURDIR}/proto +CPPFLAGS+= -I${.CURDIR}/tls/include CPPFLAGS+= -I${.CURDIR}/../include CPPFLAGS+= -I${.CURDIR}/../base/include CPPFLAGS+= -I${.CURDIR}/../diagnose_usb/include @@ -114,6 +126,8 @@ CPPFLAGS+= -I${.CURDIR}/../libcrypto_utils/include CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} CPPFLAGS+= $$(${PKG_CONFIG} libcrypto --cflags 2>/dev/null) CPPFLAGS+= $$(${PKG_CONFIG} libusb-1.0 --cflags 2>/dev/null) +CPPFLAGS+= $$(${PKG_CONFIG} protobuf-lite --cflags 2>/dev/null) +CPPFLAGS+= $$(${PKG_CONFIG} libbrotlidec libbrotlienc --cflags 2>/dev/null) CXXFLAGS+= -std=gnu++2a .ifndef COMPILE.c @@ -139,6 +153,9 @@ CLEANFILES+= ${PROG}_test ${TEST_OBJS} PKG_CONFIG?= pkg-config +beforebuild: + protoc --cpp_out=. proto/*.proto + beforeinstall: ${INSTALL} -d ${DESTDIR}${FILESDIR} diff --git a/devel/android-tools-adb/files/patch-adb_adb__auth.h b/devel/android-tools-adb/files/patch-adb_adb__auth.h new file mode 100644 index 000000000000..1081e761bc00 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_adb__auth.h @@ -0,0 +1,12 @@ +--- adb/adb_auth.h.orig 2020-04-17 21:40:09 UTC ++++ adb/adb_auth.h +@@ -23,6 +23,9 @@ + #include + + #include ++#if !defined(OPENSSL_IS_BORINGSSL) ++#include ++#endif + + /* AUTH packets first argument */ + /* Request */ diff --git a/devel/android-tools-adb/files/patch-adb_client_adb__install.cpp b/devel/android-tools-adb/files/patch-adb_client_adb__install.cpp index 5cd17d521128..0fbcd0f250f6 100644 --- a/devel/android-tools-adb/files/patch-adb_client_adb__install.cpp +++ b/devel/android-tools-adb/files/patch-adb_client_adb__install.cpp @@ -1,18 +1,23 @@ ---- adb/client/adb_install.cpp.orig 2019-10-18 00:22:21 UTC +--- adb/client/adb_install.cpp.orig 2020-04-17 21:40:09 UTC +++ adb/client/adb_install.cpp -@@ -35,9 +35,11 @@ +@@ -37,12 +37,16 @@ #include "adb_utils.h" #include "client/file_sync_client.h" #include "commandline.h" +#if defined(ENABLE_FASTDEPLOY) #include "fastdeploy.h" ++#endif + #include "incremental.h" + + using namespace std::literals; ++#if defined(ENABLE_FASTDEPLOY) static constexpr int kFastDeployMinApi = 24; +#endif namespace { -@@ -167,6 +169,7 @@ static int install_app_streamed(int argc, const char** +@@ -177,6 +181,7 @@ static int install_app_streamed(int argc, const char** } if (use_fastdeploy) { @@ -20,7 +25,7 @@ auto metadata = extract_metadata(file); if (metadata.has_value()) { // pass all but 1st (command) and last (apk path) parameters through to pm for -@@ -175,6 +178,9 @@ static int install_app_streamed(int argc, const char** +@@ -185,6 +190,9 @@ static int install_app_streamed(int argc, const char** auto patchFd = install_patch(pm_args.size(), pm_args.data()); return stream_patch(file, std::move(metadata.value()), std::move(patchFd)); } @@ -30,7 +35,7 @@ } struct stat sb; -@@ -189,7 +195,7 @@ static int install_app_streamed(int argc, const char** +@@ -199,7 +207,7 @@ static int install_app_streamed(int argc, const char** return 1; } @@ -39,7 +44,7 @@ posix_fadvise(local_fd.get(), 0, 0, POSIX_FADV_SEQUENTIAL | POSIX_FADV_NOREUSE); #endif -@@ -263,6 +269,7 @@ static int install_app_legacy(int argc, const char** a +@@ -277,6 +285,7 @@ static int install_app_legacy(int argc, const char** a argv[last_apk] = apk_dest.c_str(); /* destination name, not source location */ if (use_fastdeploy) { @@ -47,7 +52,7 @@ auto metadata = extract_metadata(apk_file[0]); if (metadata.has_value()) { auto patchFd = apply_patch_on_device(apk_dest.c_str()); -@@ -273,6 +280,9 @@ static int install_app_legacy(int argc, const char** a +@@ -287,6 +296,9 @@ static int install_app_legacy(int argc, const char** a return status; } @@ -56,46 +61,46 @@ +#endif } - if (do_sync_push(apk_file, apk_dest.c_str(), false)) { -@@ -288,7 +298,9 @@ int install_app(int argc, const char** argv) { - InstallMode installMode = INSTALL_DEFAULT; - bool use_fastdeploy = false; + if (do_sync_push(apk_file, apk_dest.c_str(), false, CompressionType::Any, false)) { +@@ -431,7 +443,9 @@ int install_app(int argc, const char** argv) { bool is_reinstall = false; + bool wait = false; + auto incremental_request = CmdlineOption::None; +#if defined(ENABLE_FASTDEPLOY) FastDeploy_AgentUpdateStrategy agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion; +#endif for (int i = 1; i < argc; i++) { - if (!strcmp(argv[i], "--streaming")) { -@@ -309,13 +321,19 @@ int install_app(int argc, const char** argv) { + if (argv[i] == "--streaming"sv) { +@@ -452,13 +466,19 @@ int install_app(int argc, const char** argv) { use_fastdeploy = false; - } else if (!strcmp(argv[i], "--force-agent")) { - processedArgIndicies.push_back(i); + } else if (argv[i] == "--force-agent"sv) { + processedArgIndices.push_back(i); +#if defined(ENABLE_FASTDEPLOY) agent_update_strategy = FastDeploy_AgentUpdateAlways; +#endif - } else if (!strcmp(argv[i], "--date-check-agent")) { - processedArgIndicies.push_back(i); + } else if (argv[i] == "--date-check-agent"sv) { + processedArgIndices.push_back(i); +#if defined(ENABLE_FASTDEPLOY) agent_update_strategy = FastDeploy_AgentUpdateNewerTimeStamp; +#endif - } else if (!strcmp(argv[i], "--version-check-agent")) { - processedArgIndicies.push_back(i); + } else if (argv[i] == "--version-check-agent"sv) { + processedArgIndices.push_back(i); +#if defined(ENABLE_FASTDEPLOY) agent_update_strategy = FastDeploy_AgentUpdateDifferentVersion; +#endif - } - } - -@@ -327,6 +345,7 @@ int install_app(int argc, const char** argv) { + } else if (strlen(argv[i]) >= "--incr"sv.size() && "--incremental"sv.starts_with(argv[i])) { + processedArgIndices.push_back(i); + incremental_request = CmdlineOption::Enable; +@@ -479,6 +499,7 @@ int install_app(int argc, const char** argv) { error_exit("Attempting to use streaming install on unsupported device"); } +#if defined(ENABLE_FASTDEPLOY) if (use_fastdeploy && get_device_api_level() < kFastDeployMinApi) { - printf("Fast Deploy is only compatible with devices of API version %d or higher, " - "ignoring.\n", -@@ -334,6 +353,7 @@ int install_app(int argc, const char** argv) { + fprintf(stderr, + "Fast Deploy is only compatible with devices of API version %d or higher, " +@@ -487,6 +508,7 @@ int install_app(int argc, const char** argv) { use_fastdeploy = false; } fastdeploy_set_agent_update_strategy(agent_update_strategy); diff --git a/devel/android-tools-adb/files/patch-adb_client_commandline.cpp b/devel/android-tools-adb/files/patch-adb_client_commandline.cpp index a572e6aef20a..23a6272f2e24 100644 --- a/devel/android-tools-adb/files/patch-adb_client_commandline.cpp +++ b/devel/android-tools-adb/files/patch-adb_client_commandline.cpp @@ -1,16 +1,16 @@ ---- adb/client/commandline.cpp.orig 2019-10-18 00:22:21 UTC +--- adb/client/commandline.cpp.orig 2020-04-17 21:40:09 UTC +++ adb/client/commandline.cpp -@@ -59,7 +59,9 @@ +@@ -63,7 +63,9 @@ #include "bugreport.h" #include "client/file_sync_client.h" #include "commandline.h" +#if defined(ENABLE_FASTDEPLOY) #include "fastdeploy.h" +#endif + #include "incremental_server.h" #include "services.h" #include "shell_protocol.h" - #include "sysdeps/chrono.h" -@@ -1012,7 +1014,11 @@ static int ppp(int argc, const char** argv) { +@@ -1038,7 +1040,11 @@ static int ppp(int argc, const char** argv) { // copy args const char** ppp_args = (const char**)alloca(sizeof(char*) * argc + 1); @@ -22,7 +22,7 @@ for (i = 2 ; i < argc ; i++) { //argv[2] and beyond become ppp_args[1] and beyond ppp_args[i - 1] = argv[i]; -@@ -1024,8 +1030,13 @@ static int ppp(int argc, const char** argv) { +@@ -1050,8 +1056,13 @@ static int ppp(int argc, const char** argv) { adb_close(STDERR_FILENO); adb_close(fd); diff --git a/devel/android-tools-adb/files/patch-adb_transport__usb.cpp b/devel/android-tools-adb/files/patch-adb_client_transport__usb.cpp similarity index 63% rename from devel/android-tools-adb/files/patch-adb_transport__usb.cpp rename to devel/android-tools-adb/files/patch-adb_client_transport__usb.cpp index a89b9bfac585..c526fe97f72e 100644 --- a/devel/android-tools-adb/files/patch-adb_transport__usb.cpp +++ b/devel/android-tools-adb/files/patch-adb_client_transport__usb.cpp @@ -1,6 +1,6 @@ ---- adb/transport_usb.cpp.orig 2018-06-21 00:58:42 UTC -+++ adb/transport_usb.cpp -@@ -186,6 +186,8 @@ int is_adb_interface(int usb_class, int usb_subclass, +--- adb/client/transport_usb.cpp.orig 2020-04-17 21:40:09 UTC ++++ adb/client/transport_usb.cpp +@@ -205,6 +205,8 @@ int is_adb_interface(int usb_class, int usb_subclass, bool should_use_libusb() { #if !ADB_HOST return false; diff --git a/devel/android-tools-adb/files/patch-adb_client_usb.h b/devel/android-tools-adb/files/patch-adb_client_usb.h new file mode 100644 index 000000000000..1985f8ee9342 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_client_usb.h @@ -0,0 +1,15 @@ +--- adb/client/usb.h.orig 2020-04-17 21:40:09 UTC ++++ adb/client/usb.h +@@ -41,8 +41,12 @@ ADB_USB_INTERFACE(libusb::usb_handle*); + } // namespace libusb + + namespace native { ++#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32) + struct usb_handle; + ADB_USB_INTERFACE(native::usb_handle*); ++#else ++using namespace libusb; ++#endif + } // namespace native + + // Empty base that both implementations' opaque handles inherit from. 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 5598261f5a52..102acd9c2f0e 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 @@ -1,15 +1,18 @@ ---- adb/client/usb_libusb.cpp.orig 2017-06-20 10:50:27 UTC +--- adb/client/usb_libusb.cpp.orig 2020-04-17 21:40:09 UTC +++ adb/client/usb_libusb.cpp -@@ -30,7 +30,7 @@ +@@ -30,7 +30,11 @@ #include #include --#include ++#if __has_include() + #include ++#else +#include ++#endif #include #include -@@ -39,6 +39,9 @@ +@@ -39,6 +43,9 @@ #include "adb.h" #include "adb_utils.h" @@ -17,21 +20,9 @@ +#include "sysdeps/chrono.h" +#endif #include "transport.h" - #include "usb.h" - -@@ -89,7 +89,11 @@ struct transfer_info { - }; - namespace libusb { -+#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32) - struct usb_handle : public ::usb_handle { -+#else -+struct usb_handle { -+#endif - 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 { + using android::base::StringPrintf; +@@ -150,7 +157,14 @@ struct usb_handle : public ::usb_handle { static auto& usb_handles = *new std::unordered_map>(); static auto& usb_handles_mutex = *new std::mutex(); @@ -46,7 +37,7 @@ 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) { +@@ -378,6 +392,7 @@ static void process_device(libusb_device* device) { LOG(INFO) << "registered new usb device '" << device_serial << "'"; } @@ -54,7 +45,7 @@ static std::atomic connecting_devices(0); static void device_connected(libusb_device* device) { -@@ -449,7 +461,31 @@ static int hotplug_callback(libusb_context*, libusb_de +@@ -452,7 +467,31 @@ static LIBUSB_CALL int hotplug_callback(libusb_context hotplug_queue.Push({event, device}); return 0; } @@ -86,7 +77,7 @@ void usb_init() { LOG(DEBUG) << "initializing libusb..."; int rc = libusb_init(nullptr); -@@ -457,6 +493,7 @@ void usb_init() { +@@ -460,6 +499,7 @@ void usb_init() { LOG(FATAL) << "failed to initialize libusb: " << libusb_error_name(rc); } @@ -94,7 +85,7 @@ // Register the hotplug callback. rc = libusb_hotplug_register_callback( nullptr, static_cast(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | -@@ -467,6 +504,7 @@ void usb_init() { +@@ -470,6 +510,7 @@ void usb_init() { if (rc != LIBUSB_SUCCESS) { LOG(FATAL) << "failed to register libusb hotplug callback"; } @@ -102,7 +93,7 @@ // Spawn a thread for libusb_handle_events. std::thread([]() { -@@ -475,10 +513,28 @@ void usb_init() { +@@ -478,10 +519,28 @@ void usb_init() { libusb_handle_events(nullptr); } }).detach(); @@ -130,4 +121,4 @@ +#endif } - // Dispatch a libusb transfer, unlock |device_lock|, and then wait for the result. + static LIBUSB_CALL void transfer_callback(libusb_transfer* transfer) { diff --git a/devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_key.h b/devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_key.h new file mode 100644 index 000000000000..96180ff4aaf7 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_key.h @@ -0,0 +1,52 @@ +--- adb/crypto/include/adb/crypto/key.h.orig 2020-04-17 21:40:09 UTC ++++ adb/crypto/include/adb/crypto/key.h +@@ -19,6 +19,49 @@ + #include + + #include ++#if !defined(OPENSSL_IS_BORINGSSL) ++#include ++// https://boringssl.googlesource.com/boringssl/+/d17d74d73f8a%5E!/ ++namespace bssl { ++namespace internal { ++// The Enable parameter is ignored and only exists so specializations can use ++// SFINAE. ++template ++struct DeleterImpl {}; ++ ++template ++struct Deleter { ++ void operator()(T *ptr) { ++ // Rather than specialize Deleter for each type, we specialize ++ // DeleterImpl. This allows bssl::UniquePtr to be used while only ++ // including base.h as long as the destructor is not emitted. This matches ++ // std::unique_ptr's behavior on forward-declared types. ++ // ++ // DeleterImpl itself is specialized in the corresponding module's header ++ // and must be included to release an object. If not included, the compiler ++ // will error that DeleterImpl does not have a method Free. ++ DeleterImpl::Free(ptr); ++ } ++}; ++ ++#define BORINGSSL_MAKE_DELETER(type, deleter) \ ++ template <> \ ++ struct DeleterImpl { \ ++ static void Free(type *ptr) { deleter(ptr); } \ ++ }; \ ++ ++BORINGSSL_MAKE_DELETER(EVP_PKEY, EVP_PKEY_free) ++BORINGSSL_MAKE_DELETER(X509, X509_free) ++BORINGSSL_MAKE_DELETER(BIO, BIO_free) ++} // namespace internal ++ ++// Holds ownership of heap-allocated BoringSSL structures. Sample usage: ++// bssl::UniquePtr rsa(RSA_new()); ++// bssl::UniquePtr bio(BIO_new(BIO_s_mem())); ++template ++using UniquePtr = std::unique_ptr>; ++} // namespace bssl ++#endif + + #include "key_type.pb.h" + diff --git a/devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_x509__generator.h b/devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_x509__generator.h new file mode 100644 index 000000000000..d596f4dae9eb --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_crypto_include_adb_crypto_x509__generator.h @@ -0,0 +1,12 @@ +--- adb/crypto/include/adb/crypto/x509_generator.h.orig 2020-04-17 21:40:09 UTC ++++ adb/crypto/include/adb/crypto/x509_generator.h +@@ -17,6 +17,9 @@ + #pragma once + + #include ++#if !defined(OPENSSL_IS_BORINGSSL) ++#include ++#endif + + namespace adb { + namespace crypto { diff --git a/devel/android-tools-adb/files/patch-adb_sysdeps.h b/devel/android-tools-adb/files/patch-adb_sysdeps.h index 36f436629b00..9d8ae10948e9 100644 --- a/devel/android-tools-adb/files/patch-adb_sysdeps.h +++ b/devel/android-tools-adb/files/patch-adb_sysdeps.h @@ -1,6 +1,15 @@ ---- adb/sysdeps.h.orig 2019-07-17 19:54:09 UTC +--- adb/sysdeps.h.orig 2020-04-17 21:40:09 UTC +++ adb/sysdeps.h -@@ -330,6 +330,11 @@ size_t ParseCompleteUTF8(const char* first, const char +@@ -42,7 +42,7 @@ + #include "sysdeps/network.h" + #include "sysdeps/stat.h" + +-#if defined(__APPLE__) ++#ifndef mempcpy + static inline void* mempcpy(void* dst, const void* src, size_t n) { + return static_cast(memcpy(dst, src, n)) + n; + } +@@ -387,6 +387,11 @@ size_t ParseCompleteUTF8(const char* first, const char #include @@ -12,8 +21,8 @@ #define OS_PATH_SEPARATORS "/" #define OS_PATH_SEPARATOR '/' #define OS_PATH_SEPARATOR_STR "/" -@@ -516,6 +521,12 @@ inline int adb_socket_get_local_port(borrowed_fd fd) { - static __inline__ int adb_thread_setname(const std::string& name) { +@@ -609,6 +614,12 @@ inline int adb_socket_get_local_port(borrowed_fd fd) { + static inline int adb_thread_setname(const std::string& name) { #ifdef __APPLE__ return pthread_setname_np(name.c_str()); +#elif defined(__Bitrig__) || defined(__DragonFly__) || \ diff --git a/devel/android-tools-adb/files/patch-adb_tls_include_adb_tls_adb__ca__list.h b/devel/android-tools-adb/files/patch-adb_tls_include_adb_tls_adb__ca__list.h new file mode 100644 index 000000000000..72942f77c045 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_tls_include_adb_tls_adb__ca__list.h @@ -0,0 +1,12 @@ +--- adb/tls/include/adb/tls/adb_ca_list.h.orig 2020-04-17 21:40:09 UTC ++++ adb/tls/include/adb/tls/adb_ca_list.h +@@ -16,7 +16,9 @@ + + #pragma once + ++#if defined(OPENSSL_IS_BORINGSSL) + #include ++#endif + #include + #include + diff --git a/devel/android-tools-adb/files/patch-adb_tls_tls__connection.cpp b/devel/android-tools-adb/files/patch-adb_tls_tls__connection.cpp new file mode 100644 index 000000000000..248c906e90c8 --- /dev/null +++ b/devel/android-tools-adb/files/patch-adb_tls_tls__connection.cpp @@ -0,0 +1,12 @@ +--- adb/tls/tls_connection.cpp.orig 2020-04-17 21:40:09 UTC ++++ adb/tls/tls_connection.cpp +@@ -23,6 +23,9 @@ + #include + #include + #include ++#if !defined(OPENSSL_IS_BORINGSSL) ++#include ++#endif + + using android::base::borrowed_fd; + diff --git a/devel/android-tools-adb/files/patch-adb_usb.h b/devel/android-tools-adb/files/patch-adb_usb.h deleted file mode 100644 index ca72a7ee6a48..000000000000 --- a/devel/android-tools-adb/files/patch-adb_usb.h +++ /dev/null @@ -1,20 +0,0 @@ ---- adb/usb.h.orig 2017-06-20 10:50:27 UTC -+++ adb/usb.h -@@ -43,6 +43,7 @@ namespace libusb { - ADB_USB_INTERFACE(libusb::usb_handle*); - } - -+#if defined(__linux__) || defined(__APPLE__) || defined(_WIN32) - namespace native { - struct usb_handle; - ADB_USB_INTERFACE(native::usb_handle*); -@@ -53,6 +54,9 @@ struct usb_handle { - }; - - ADB_USB_INTERFACE(::usb_handle*); -+#else -+using namespace libusb; -+#endif - - #endif // linux host || darwin -