diff options
author | jbeich <jbeich@FreeBSD.org> | 2016-08-24 20:41:31 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2016-08-24 20:41:31 +0800 |
commit | 37ae3c945d9de76ad416e8236349b5c4b9cc65c9 (patch) | |
tree | a2b168f33c9c1286567be477e7ce0bfcc28f0fb8 /devel/android-tools-fastboot | |
parent | 82d139a21c7e7fc8f917d3af5cb4d485b2bc2228 (diff) | |
download | freebsd-ports-gnome-37ae3c945d9de76ad416e8236349b5c4b9cc65c9.tar.gz freebsd-ports-gnome-37ae3c945d9de76ad416e8236349b5c4b9cc65c9.tar.zst freebsd-ports-gnome-37ae3c945d9de76ad416e8236349b5c4b9cc65c9.zip |
devel/android-tools-{adb,fastboot}: update to 7.0.0.r1 (nougat)
Changes: https://android.googlesource.com/platform/system/core/+log/android-6.0.1_r24..android-7.0.0_r1/adb
Changes: https://android.googlesource.com/platform/system/core/+log/android-6.0.0_r26..android-7.0.0_r1/fastboot
Diffstat (limited to 'devel/android-tools-fastboot')
13 files changed, 195 insertions, 71 deletions
diff --git a/devel/android-tools-fastboot/Makefile b/devel/android-tools-fastboot/Makefile index b74efbec2808..b164b8369e38 100644 --- a/devel/android-tools-fastboot/Makefile +++ b/devel/android-tools-fastboot/Makefile @@ -2,7 +2,7 @@ PORTNAME= android-tools-fastboot DISTVERSIONPREFIX= android- -DISTVERSION?= 6.0.0_r26 +DISTVERSION?= 7.0.0_r1 PORTREVISION?= 0 CATEGORIES= devel MASTER_SITES= https://anonscm.debian.org/cgit/android-tools/android-tools.git/plain/debian/:manpage @@ -27,16 +27,11 @@ GH_PROJECT= platform_system_core platform_system_extras:extras \ .ifdef DISTVERSIONSUFFIX GH_REVISION= ${DISTVERSIONSUFFIX:S/-g//} # snapshot .else -GH_REVISION= f7f765fd62bf # 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_file.cpp -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-liblog_logd__write.c -.endif - USES= compiler:c++11-lib pkgconfig uidfix BUILD_WRKSRC= ${WRKSRC}/fastboot INSTALL_WRKSRC= ${BUILD_WRKSRC} @@ -59,7 +54,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/fastboot BASH_VARS= LICENSE+=MIT diff --git a/devel/android-tools-fastboot/distinfo b/devel/android-tools-fastboot/distinfo index e8aaea8220cf..7d9e0c3f72b8 100644 --- a/devel/android-tools-fastboot/distinfo +++ b/devel/android-tools-fastboot/distinfo @@ -1,10 +1,11 @@ +TIMESTAMP = 1472009581 SHA256 (fastboot.1?id=706e754) = 2af01b064440952a82f1602691a0fecc030302722a71444946fb70d9c423d283 SIZE (fastboot.1?id=706e754) = 5906 -SHA256 (android-platform_system_core-android-6.0.0_r26_GH0.tar.gz) = 75c3135b44874e1a6d6b98cf7fc2c7513f77bd41b0302cd1f8d0a5a9ade46a36 -SIZE (android-platform_system_core-android-6.0.0_r26_GH0.tar.gz) = 1182157 -SHA256 (jbeich-platform_system_extras-android-6.0.0_r26_GH0.tar.gz) = 2364ecc2c91209af7ecab294bee0a6e8e12e4faf54b33ab3559e53ad9e44634c -SIZE (jbeich-platform_system_extras-android-6.0.0_r26_GH0.tar.gz) = 650471 -SHA256 (jbeich-platform_external_libselinux-android-6.0.0_r26_GH0.tar.gz) = 735a4be6b2c80b43ff19f7fa29c6aac7c361e4e8c0e5f65b70ec74ea5bfc3c18 -SIZE (jbeich-platform_external_libselinux-android-6.0.0_r26_GH0.tar.gz) = 50960 -SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc -SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948 +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 (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = ff2ea6db032da70374edcd6867bd11d765a475a32d732b983d0dad6ae16e209b +SIZE (jbeich-platform_system_extras-android-7.0.0_r1_GH0.tar.gz) = 79621110 +SHA256 (jbeich-platform_external_libselinux-android-7.0.0_r1_GH0.tar.gz) = bf335619fb77fc523e33d08523d20795de17a6a906b87e16fd7d79911f186a15 +SIZE (jbeich-platform_external_libselinux-android-7.0.0_r1_GH0.tar.gz) = 59544 +SHA256 (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = ca3311ba47a5edd56c929ac9aae57c02c2c3f1636519c5f67abb00b6e3ecd75c +SIZE (mbrubeck-android-completion-c1b0656_GH0.tar.gz) = 5967 diff --git a/devel/android-tools-fastboot/files/Makefile b/devel/android-tools-fastboot/files/Makefile index d37c577a3aed..35d91180ab89 100644 --- a/devel/android-tools-fastboot/files/Makefile +++ b/devel/android-tools-fastboot/files/Makefile @@ -7,19 +7,30 @@ FILESDIR?=${DOCDIR}/${PROG} FILES= *.[Tt][Xx][Tt] SRCS+= bootimg_utils.cpp -SRCS+= engine.c +SRCS+= engine.cpp SRCS+= fastboot.cpp -SRCS+= fs.c -SRCS+= protocol.c -SRCS+= util.c +SRCS+= ../fastboot/fs.cpp +SRCS+= protocol.cpp +SRCS+= socket.cpp +SRCS+= tcp.cpp +SRCS+= udp.cpp +SRCS+= util.cpp .PATH: ${EXTRADIR} SRCS+= usb_freebsd.cpp SRCS+= util_freebsd.cpp -# required by libziparchive +# required by fastboot +.PATH: ${.CURDIR}/../adb +SRCS+= diagnose_usb.cpp + +# required by fastboot, diagnose_usb and libziparchive .PATH: ${.CURDIR}/../base +SRCS+= errors_unix.cpp SRCS+= file.cpp +SRCS+= parsenetaddress.cpp +SRCS+= stringprintf.cpp +SRCS+= strings.cpp # required by fastboot .PATH: ${.CURDIR}/../ext4_utils @@ -35,11 +46,23 @@ SRCS+= make_ext4fs.c SRCS+= sha1.c SRCS+= wipe.c +# required by fastboot +.PATH: ${.CURDIR}/../libcutils +SRCS+= ../libcutils/sockets.cpp +SRCS+= socket_inaddr_any_server_unix.c +SRCS+= socket_network_client_unix.c +SRCS+= sockets_unix.cpp +CPPFLAGS.sockets.cpp+= -o ${.TARGET} # XXX pre-r279980 + # required by base and libutils .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 # required by ext4_utils .PATH: ${.CURDIR}/../libselinux/src @@ -50,6 +73,8 @@ SRCS+= init.c SRCS+= label.c SRCS+= label_android_property.c SRCS+= label_file.c +SRCS+= label_support.c +CPPFLAGS.label_file.c+= -D_WITH_GETLINE # required by fastboot and ext4_utils .PATH: ${.CURDIR}/../libsparse @@ -78,6 +103,7 @@ CPPFLAGS+= -Dmmap64=mmap CPPFLAGS+= -Dpread64=pread CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/../include +CPPFLAGS+= -I${.CURDIR}/../adb CPPFLAGS+= -I${.CURDIR}/../mkbootimg CPPFLAGS+= -I${.CURDIR}/../base/include CPPFLAGS+= -I${.CURDIR}/../ext4_utils diff --git a/devel/android-tools-fastboot/files/extra-patch-base_file.cpp b/devel/android-tools-fastboot/files/extra-patch-base_file.cpp deleted file mode 100644 index 29638851e71d..000000000000 --- a/devel/android-tools-fastboot/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-fastboot/files/extra-patch-liblog_logd__write.c b/devel/android-tools-fastboot/files/extra-patch-liblog_logd__write.c deleted file mode 100644 index d9a8890325d4..000000000000 --- a/devel/android-tools-fastboot/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-fastboot/files/patch-adb_sysdeps.h b/devel/android-tools-fastboot/files/patch-adb_sysdeps.h new file mode 100644 index 000000000000..8ca18724c86a --- /dev/null +++ b/devel/android-tools-fastboot/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-fastboot/files/patch-base_errors__unix.cpp b/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp new file mode 100644 index 000000000000..f9ccad0a59b5 --- /dev/null +++ b/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp @@ -0,0 +1,11 @@ +--- base/errors_unix.cpp.orig 2016-02-20 02:39:51 UTC ++++ base/errors_unix.cpp +@@ -16,7 +16,7 @@ + + #include "android-base/errors.h" + +-#include <errno.h> ++#include <string.h> + + namespace android { + namespace base { diff --git a/devel/android-tools-fastboot/files/patch-base_file.cpp b/devel/android-tools-fastboot/files/patch-base_file.cpp new file mode 100644 index 000000000000..754b02594d0c --- /dev/null +++ b/devel/android-tools-fastboot/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-fastboot/files/patch-base_include_android-base_logging.h b/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h new file mode 100644 index 000000000000..7f170c3f521b --- /dev/null +++ b/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h @@ -0,0 +1,11 @@ +--- 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 + ++#include <errno.h> ++ + #include <functional> + #include <memory> + #include <ostream> diff --git a/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp b/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp new file mode 100644 index 000000000000..b640a75485fa --- /dev/null +++ b/devel/android-tools-fastboot/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-fastboot/files/patch-fastboot_socket.h b/devel/android-tools-fastboot/files/patch-fastboot_socket.h new file mode 100644 index 000000000000..6b0b4bf20dd5 --- /dev/null +++ b/devel/android-tools-fastboot/files/patch-fastboot_socket.h @@ -0,0 +1,14 @@ +--- fastboot/socket.h.orig 2016-02-20 02:39:51 UTC ++++ fastboot/socket.h +@@ -41,7 +41,10 @@ + + #include <android-base/macros.h> + #include <cutils/sockets.h> +-#include <gtest/gtest_prod.h> ++ ++// Copied from <gtest/gtest_prod.h> ++#define FRIEND_TEST(test_case_name, test_name)\ ++friend class test_case_name##_##test_name##_Test + + // Socket interface to be implemented for each platform. + class Socket { diff --git a/devel/android-tools-fastboot/files/patch-liblog_logger__write.c b/devel/android-tools-fastboot/files/patch-liblog_logger__write.c new file mode 100644 index 000000000000..481e87407296 --- /dev/null +++ b/devel/android-tools-fastboot/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-fastboot/files/usb_freebsd.cpp b/devel/android-tools-fastboot/files/usb_freebsd.cpp index e85fb297b74f..1eb0ca809ee6 100644 --- a/devel/android-tools-fastboot/files/usb_freebsd.cpp +++ b/devel/android-tools-fastboot/files/usb_freebsd.cpp @@ -30,6 +30,8 @@ #include <string.h> #include <libusb.h> +#include <memory> + #include "usb.h" struct usb_handle { @@ -40,8 +42,24 @@ struct usb_handle { unsigned char iface; }; +class LibusbUsbTransport : public Transport { +public: + explicit LibusbUsbTransport(std::unique_ptr<usb_handle> handle): + h(std::move(handle)) {} + ~LibusbUsbTransport() override = default; + + ssize_t Read(void *_data, size_t len) override; + ssize_t Write(const void *_data, size_t len) override; + int Close() override; + +private: + std::unique_ptr<usb_handle> h; + + DISALLOW_COPY_AND_ASSIGN(LibusbUsbTransport); +}; + static int -probe(usb_handle *h, ifc_match_func callback) +probe(std::unique_ptr<usb_handle> &h, ifc_match_func callback) { usb_ifc_info info; libusb_device_descriptor ddesc; @@ -120,26 +138,22 @@ probe(usb_handle *h, ifc_match_func callback) return (-1); } -static usb_handle * +static std::unique_ptr<usb_handle> enumerate(ifc_match_func callback) { static libusb_context *ctx = NULL; - usb_handle *h; + std::unique_ptr<usb_handle> h; libusb_device **ppdev; ssize_t ndev; ssize_t x; - h = reinterpret_cast<usb_handle*>(malloc(sizeof(*h))); - if (h == NULL) - return (h); - if (ctx == NULL) libusb_init(&ctx); ndev = libusb_get_device_list(ctx, &ppdev); for (x = 0; x < ndev; x++) { - memset(h, 0, sizeof(*h)); + h.reset(new usb_handle); h->dev = ppdev[x]; @@ -149,13 +163,13 @@ enumerate(ifc_match_func callback) return (h); } } - free(h); + h.reset(); libusb_free_device_list(ppdev, 1); - return (NULL); + return (nullptr); } -int -usb_write(usb_handle * h, const void *_data, int len) +ssize_t +LibusbUsbTransport::Write(const void *_data, size_t len) { int actlen; @@ -165,8 +179,8 @@ usb_write(usb_handle * h, const void *_data, int len) return (actlen); } -int -usb_read(usb_handle * h, void *_data, int len) +ssize_t +LibusbUsbTransport::Read(void *_data, size_t len) { int actlen; @@ -176,25 +190,19 @@ usb_read(usb_handle * h, void *_data, int len) return (actlen); } -int -usb_close(usb_handle * h) +int +LibusbUsbTransport::Close() { libusb_close(h->handle); h->handle = NULL; libusb_unref_device(h->dev); - free(h); + h.reset(); return (0); } -usb_handle * +Transport * usb_open(ifc_match_func callback) { - return (enumerate(callback)); -} - -int -usb_wait_for_disconnect(usb_handle * h) -{ - /* TODO: Punt for now */ - return 0; + std::unique_ptr<usb_handle> h = enumerate(callback); + return (h ? new LibusbUsbTransport(std::move(h)) : nullptr); } |