Index: head/devel/android-tools-adb/Makefile =================================================================== --- head/devel/android-tools-adb/Makefile (revision 420786) +++ head/devel/android-tools-adb/Makefile (revision 420787) @@ -1,102 +1,94 @@ # $FreeBSD$ PORTNAME= android-tools-adb DISTVERSIONPREFIX= android- -DISTVERSION?= 6.0.1_r24 +DISTVERSION?= 7.0.0_r1 PORTREVISION?= 0 CATEGORIES= devel MAINTAINER= jbeich@FreeBSD.org COMMENT= Android debug bridge command line tool LICENSE= APACHE20 USE_GITHUB= yes GH_ACCOUNT= android GH_PROJECT= platform_system_core # Emulate GH_COMMIT without causing desync .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 INSTALL_WRKSRC= ${BUILD_WRKSRC} TEST_WRKSRC= ${BUILD_WRKSRC} MAKEFILE= ${FILESDIR}/Makefile MAKE_ENV= BINDIR="${PREFIX}/bin" EXTRADIR="${FILESDIR}" \ FILESDIR="${DOCSDIR}" REVISION="${GH_REVISION}" ALL_TARGET= all TEST_TARGET= test PLIST_FILES= bin/adb PORTDOCS= * OPTIONS_DEFINE+=BASH DOCS TEST OPTIONS_SUB= yes .if make(makesum) # for optional distfiles .MAKEFLAGS: WITH="${OPTIONS_DEFINE}" .endif 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 DOCS_MAKE_ARGS_OFF= FILES="" FILESDIR="" TEST_BUILD_DEPENDS= googletest>=1.6.0:devel/googletest TEST_ALL_TARGET= adb_test pre-install-TEST-on: do-test post-patch: # XXX C++ exception with description "regex_error" thrown in the test body. @if [ ${OPSYS} = FreeBSD -a ${OSREL:R} -lt 10 ]; then \ ${REINPLACE_CMD} -Ee '/^TEST/\ s/ (LOG|PLOG|UNIMPLEMENTED)/ DISABLED_\1/' \ ${WRKSRC}/base/logging_test.cpp; \ fi # XXX Hidden by poudriere/tinderbox, see lindev(4) for FreeBSD < 11.0 @if [ ! -e /dev/full ]; then \ ${REINPLACE_CMD} -e '/TEST/s/[^ ]*ENOSPC/DISABLED_&/' \ ${WRKSRC}/adb/adb_io_test.cpp; \ fi post-install-BASH-on: ${MKDIR} ${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES:H} ${INSTALL_DATA} ${WRKSRC_bashcomp}/android \ ${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES} update-revision: # https://developer.github.com/v3/repos/commits/#get-a-single-commit # Pretend to be curl(1) for pretty-printed JSON to help parse with sed(1) @${REINPLACE_CMD} -i '' -e "/^GH_REVISION.*$@/s/=.*/= $$(\ ${SETENV} HTTP_USER_AGENT=curl ${FETCH_CMD} -qo- \ https://api.github.com/repos/${GH_ACCOUNT}/${GH_PROJECT}/commits/${GH_TAGNAME} | \ ${SED} -n '/sha/ { s/.*\"\([0-9a-f]\{12\}\).*/\1/p; q; }' \ ) # generated by: make $@/" \ ${.CURDIR}/Makefile .include # XXX Work around !target(makesum) .ifndef DISTVERSIONSUFFIX makesum: update-revision .endif Index: head/devel/android-tools-adb/distinfo =================================================================== --- head/devel/android-tools-adb/distinfo (revision 420786) +++ head/devel/android-tools-adb/distinfo (revision 420787) @@ -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 Index: head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h =================================================================== --- head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h (revision 420786) +++ head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h (nonexistent) @@ -1,11 +0,0 @@ ---- base/include/base/logging.h.orig 2015-09-29 18:07:07 UTC -+++ base/include/base/logging.h -@@ -25,6 +25,8 @@ - #endif - #endif - -+#include -+ - #include - #include - #include Property changes on: head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/extra-patch-base_file.cpp =================================================================== --- head/devel/android-tools-adb/files/extra-patch-base_file.cpp (revision 420786) +++ head/devel/android-tools-adb/files/extra-patch-base_file.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- base/file.cpp.orig 2015-05-27 20:24:08 UTC -+++ base/file.cpp -@@ -21,6 +21,7 @@ - #include - #include - -+#include // strerror - #include - - #include "base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Property changes on: head/devel/android-tools-adb/files/extra-patch-base_file.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/extra-patch-base_file__test.cpp =================================================================== --- head/devel/android-tools-adb/files/extra-patch-base_file__test.cpp (revision 420786) +++ head/devel/android-tools-adb/files/extra-patch-base_file__test.cpp (nonexistent) @@ -1,68 +0,0 @@ -commit cf168a8 + cbf26b7 -Author: Spencer Low -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())); - } Property changes on: head/devel/android-tools-adb/files/extra-patch-base_file__test.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/extra-patch-base_logging.cpp =================================================================== --- head/devel/android-tools-adb/files/extra-patch-base_logging.cpp (revision 420786) +++ head/devel/android-tools-adb/files/extra-patch-base_logging.cpp (nonexistent) @@ -1,18 +0,0 @@ ---- base/logging.cpp.orig 2015-06-17 22:20:38 UTC -+++ base/logging.cpp -@@ -23,12 +23,14 @@ - #include - - // For getprogname(3) or program_invocation_short_name. --#if defined(__ANDROID__) || defined(__APPLE__) -+#if !defined(_WIN32) && !defined(__GLIBC__) - #include - #elif defined(__GLIBC__) - #include - #endif - -+#include // strlen -+#include // fprintf - #include - #include - #include Property changes on: head/devel/android-tools-adb/files/extra-patch-base_logging.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c =================================================================== --- head/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c (revision 420786) +++ head/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c (nonexistent) @@ -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 - #endif - #include -+#if (FAKE_LOG_DEVICE == 0) - #include -+#endif - #include - #include - #include Property changes on: head/devel/android-tools-adb/files/extra-patch-liblog_logd__write.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/Makefile =================================================================== --- head/devel/android-tools-adb/files/Makefile (revision 420786) +++ head/devel/android-tools-adb/files/Makefile (revision 420787) @@ -1,114 +1,133 @@ # $FreeBSD$ PROG_CXX=adb NO_MAN= BINDIR?=/usr/bin FILESDIR?=${DOCDIR}/${PROG} FILES= *.[Tt][Xx][Tt] SRCS+= adb.cpp SRCS+= adb_auth.cpp 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 .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) CPPFLAGS+= -DADB_REVISION="\"${REVISION}-android\"" CPPFLAGS+= -DADB_HOST=1 CPPFLAGS+= -DHAVE_FORKEXEC=1 CPPFLAGS+= -DHAVE_SYMLINKS CPPFLAGS+= -DHAVE_TERMIO_H CPPFLAGS+= -DHAVE_SYS_SOCKET_H CPPFLAGS+= -D_FILE_OFFSET_BITS=64 CPPFLAGS+= -I${.CURDIR} CPPFLAGS+= -I${.CURDIR}/../include CPPFLAGS+= -I${.CURDIR}/../base/include CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} CPPFLAGS+= $$(${PKG_CONFIG} libcrypto --cflags 2>/dev/null) CPPFLAGS+= $$(${PKG_CONFIG} libusb-1.0 --cflags 2>/dev/null) CXXFLAGS+= -std=gnu++11 .ifndef COMPILE.c CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif TEST_CPPFLAGS+= $$(${GTEST_CONFIG} --cppflags) .for f in ${TEST_SRCS} CPPFLAGS.${f}+= ${TEST_CPPFLAGS} .endfor LDADD+= $$(${PKG_CONFIG} libcrypto --libs 2>/dev/null || echo -lcrypto) LDADD+= $$(${PKG_CONFIG} libusb-1.0 --libs 2>/dev/null || echo -lusb) LDADD+= -lz \-lpthread DPADD+= ${LIBCRYPTO} ${LIBPTHREAD} ${LIBUSB} ${LIBZ} TEST_LDADD+= $$(${GTEST_CONFIG} --libs --ldflags) TEST_OBJS+= ${TEST_SRCS:R:S/$/.o/} CLEANFILES+= ${PROG}_test ${TEST_OBJS} GIT?= git GTEST_CONFIG?= gtest-config PKG_CONFIG?= pkg-config beforeinstall: ${INSTALL} -d ${DESTDIR}${FILESDIR} .include 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} Index: head/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp =================================================================== --- head/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp (nonexistent) +++ head/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp (revision 420787) @@ -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 + + #include ++#include // std::unique_ptr + #include + #include + #include Property changes on: head/devel/android-tools-adb/files/patch-adb_fdevent__test.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-adb_sysdeps.h =================================================================== --- head/devel/android-tools-adb/files/patch-adb_sysdeps.h (nonexistent) +++ head/devel/android-tools-adb/files/patch-adb_sysdeps.h (revision 420787) @@ -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 + #include +@@ -401,6 +401,11 @@ typedef std::unique_ptr + ++#if defined(__Bitrig__) || defined(__DragonFly__) || \ ++ defined(__FreeBSD__) || defined(__OpenBSD__) ++#include ++#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(); + Property changes on: head/devel/android-tools-adb/files/patch-adb_sysdeps.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h =================================================================== --- head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h (nonexistent) +++ head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h (revision 420787) @@ -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 + #endif Property changes on: head/devel/android-tools-adb/files/patch-adb_sysdeps_mutex.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-base_file.cpp =================================================================== --- head/devel/android-tools-adb/files/patch-base_file.cpp (nonexistent) +++ head/devel/android-tools-adb/files/patch-base_file.cpp (revision 420787) @@ -0,0 +1,11 @@ +--- base/file.cpp.orig 2016-08-08 21:10:17 UTC ++++ base/file.cpp +@@ -21,6 +21,8 @@ + #include + #include + ++#include // BUFSIZ ++#include // strerror + #include + + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Property changes on: head/devel/android-tools-adb/files/patch-base_file.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-base_include_android-base_logging.h =================================================================== --- head/devel/android-tools-adb/files/patch-base_include_android-base_logging.h (nonexistent) +++ head/devel/android-tools-adb/files/patch-base_include_android-base_logging.h (revision 420787) @@ -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 ++ + #include + #include + #include Property changes on: head/devel/android-tools-adb/files/patch-base_include_android-base_logging.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-base_logging.cpp =================================================================== --- head/devel/android-tools-adb/files/patch-base_logging.cpp (nonexistent) +++ head/devel/android-tools-adb/files/patch-base_logging.cpp (revision 420787) @@ -0,0 +1,50 @@ +--- base/logging.cpp.orig 2016-08-08 21:10:17 UTC ++++ base/logging.cpp +@@ -25,7 +25,7 @@ + #include + + // For getprogname(3) or program_invocation_short_name. +-#if defined(__ANDROID__) || defined(__APPLE__) ++#if !defined(_WIN32) && !defined(__GLIBC__) + #include + #elif defined(__GLIBC__) + #include +@@ -35,6 +35,8 @@ + #include + #endif + ++#include // strrchr ++#include // fprintf + #include + #include + #include +@@ -71,6 +72,14 @@ + #include + #elif defined(_WIN32) + #include ++#elif defined(__DragonFly__) ++#include ++#elif defined(__FreeBSD__) ++#include ++#elif defined(__NetBSD__) ++#include ++#else ++#include + #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 + } + Property changes on: head/devel/android-tools-adb/files/patch-base_logging.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp =================================================================== --- head/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp (nonexistent) +++ head/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp (revision 420787) @@ -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 // sscanf + #include + + #include "android-base/stringprintf.h" Property changes on: head/devel/android-tools-adb/files/patch-base_parsenetaddress.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/patch-liblog_logger__write.c =================================================================== --- head/devel/android-tools-adb/files/patch-liblog_logger__write.c (nonexistent) +++ head/devel/android-tools-adb/files/patch-liblog_logger__write.c (revision 420787) @@ -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 +-#include + #include + #include + #include + + #ifdef __BIONIC__ ++#include + #include + #endif + Property changes on: head/devel/android-tools-adb/files/patch-liblog_logger__write.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-adb/files/usb_libusb.cpp =================================================================== --- head/devel/android-tools-adb/files/usb_libusb.cpp (revision 420786) +++ head/devel/android-tools-adb/files/usb_libusb.cpp (revision 420787) @@ -1,656 +1,653 @@ /* * Copyright (C) 2009 bsdroid project * Alexey Tarasov * * Copyright (C) 2007 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ -#define TRACE_TAG TRACE_USB +#define TRACE_TAG USB #include "sysdeps.h" #include #include #include #include #include #include #include "adb.h" #include "transport.h" ADB_MUTEX_DEFINE( usb_lock ); static libusb_context *ctx = NULL; struct usb_handle { usb_handle *prev; usb_handle *next; libusb_device *dev; libusb_device_handle *devh; int interface; uint8_t dev_bus; uint8_t dev_addr; int zero_mask; unsigned char end_point_address[2]; char serial[128]; adb_cond_t notify; adb_mutex_t lock; }; static usb_handle handle_list = { .prev = &handle_list, .next = &handle_list, }; -void +static void usb_cleanup() { libusb_exit(ctx); } static void report_bulk_libusb_error(int r) { switch (r) { case LIBUSB_ERROR_TIMEOUT: D("Transfer timeout"); break; case LIBUSB_ERROR_PIPE: D("Control request is not supported"); break; case LIBUSB_ERROR_OVERFLOW: D("Device offered more data"); break; case LIBUSB_ERROR_NO_DEVICE : D("Device was disconnected"); break; default: D("Error %d during transfer", r); break; }; } static int usb_bulk_write(usb_handle *uh, const void *data, int len) { int r = 0; int transferred = 0; r = libusb_bulk_transfer(uh->devh, uh->end_point_address[1], (unsigned char *)data, len, &transferred, 0); if (r != 0) { D("usb_bulk_write(): "); report_bulk_libusb_error(r); return r; } return (transferred); } static int usb_bulk_read(usb_handle *uh, void *data, int len) { int r = 0; int transferred = 0; r = libusb_bulk_transfer(uh->devh, uh->end_point_address[0], (unsigned char *)data, len, &transferred, 0); if (r != 0) { D("usb_bulk_read(): "); report_bulk_libusb_error(r); return r; } return (transferred); } int usb_write(usb_handle *uh, const void *_data, int len) { unsigned char *data = (unsigned char*) _data; int n; int need_zero = 0; if (uh->zero_mask == 1) { if (!(len & uh->zero_mask)) { need_zero = 1; } } D("usb_write(): %p:%d -> transport %p", _data, len, uh); while (len > 0) { int xfer = (len > 4096) ? 4096 : len; n = usb_bulk_write(uh, data, xfer); if (n != xfer) { D("usb_write(): failed for transport %p (%d bytes left)", uh, len); return -1; } len -= xfer; data += xfer; } if (need_zero){ n = usb_bulk_write(uh, _data, 0); if (n < 0) { D("usb_write(): failed to finish operation for transport %p", uh); } return n; } return 0; } int usb_read(usb_handle *uh, void *_data, int len) { unsigned char *data = (unsigned char*)_data; int n; D("usb_read(): %p:%d <- transport %p", _data, len, uh); while (len > 0) { int xfer = (len > 4096) ? 4096 : len; n = usb_bulk_read(uh, data, xfer); if (n != xfer) { if (n > 0) { data += n; len -= n; continue; } D("usb_read(): failed for transport %p (%d bytes left)", uh, len); return -1; } len -= xfer; data += xfer; } return 0; } int usb_close(usb_handle *h) { D("usb_close(): closing transport %p", h); adb_mutex_lock(&usb_lock); h->next->prev = h->prev; h->prev->next = h->next; h->prev = NULL; h->next = NULL; libusb_release_interface(h->devh, h->interface); libusb_close(h->devh); libusb_unref_device(h->dev); adb_mutex_unlock(&usb_lock); free(h); return (0); } void usb_kick(usb_handle *h) { D("usb_kick(): kicking transport %p", h); adb_mutex_lock(&h->lock); unregister_usb_transport(h); adb_mutex_unlock(&h->lock); h->next->prev = h->prev; h->prev->next = h->next; h->prev = NULL; h->next = NULL; libusb_release_interface(h->devh, h->interface); libusb_close(h->devh); libusb_unref_device(h->dev); free(h); } static int check_usb_interface(libusb_interface const *interface, libusb_device_descriptor const *desc, usb_handle *uh) { int e; if (interface->num_altsetting == 0) { D("check_usb_interface(): No interface settings"); return -1; } libusb_interface_descriptor const *idesc = &interface->altsetting[0]; if (idesc->bNumEndpoints != 2) { D("check_usb_interface(): Interface have not 2 endpoints, ignoring"); return -1; } for (e = 0; e < idesc->bNumEndpoints; e++) { libusb_endpoint_descriptor const *edesc = &idesc->endpoint[e]; if (edesc->bmAttributes != LIBUSB_TRANSFER_TYPE_BULK) { D("check_usb_interface(): Endpoint (%u) is not bulk (%u), ignoring", edesc->bmAttributes, LIBUSB_TRANSFER_TYPE_BULK); return -1; } if (edesc->bEndpointAddress & LIBUSB_ENDPOINT_IN) uh->end_point_address[0] = edesc->bEndpointAddress; else uh->end_point_address[1] = edesc->bEndpointAddress; /* aproto 01 needs 0 termination */ if (idesc->bInterfaceProtocol == 0x01) { uh->zero_mask = edesc->wMaxPacketSize - 1; D("check_usb_interface(): Forced Android interface protocol v.1"); } } D("check_usb_interface(): Device: %04x:%04x " "iclass: %x, isclass: %x, iproto: %x ep: %x/%x-> ", desc->idVendor, desc->idProduct, idesc->bInterfaceClass, idesc->bInterfaceSubClass, idesc->bInterfaceProtocol, uh->end_point_address[0], uh->end_point_address[1]); if (!is_adb_interface(desc->idVendor, desc->idProduct, idesc->bInterfaceClass, idesc->bInterfaceSubClass, idesc->bInterfaceProtocol)) { D("not matches"); return -1; } D("matches"); return 1; } static int check_usb_interfaces(libusb_config_descriptor *config, libusb_device_descriptor *desc, usb_handle *uh) { int i; for (i = 0; i < config->bNumInterfaces; ++i) { if (check_usb_interface(&config->interface[i], desc, uh) != -1) { /* found some interface and saved information about it */ D("check_usb_interfaces(): Interface %d of %04x:%04x " "matches Android device", i, desc->idVendor, desc->idProduct); return i; } } return -1; } static int register_device(usb_handle *uh, const char *serial) { D("register_device(): Registering %p [%s] as USB transport", uh, serial); usb_handle* usb = reinterpret_cast(calloc(1, sizeof(usb_handle))); if (usb == nullptr) fatal("couldn't allocate usb_handle"); memcpy(usb, uh, sizeof(usb_handle)); strcpy(usb->serial, uh->serial); adb_cond_init(&usb->notify, 0); adb_mutex_init(&usb->lock, 0); adb_mutex_lock(&usb_lock); usb->next = &handle_list; usb->prev = handle_list.prev; usb->prev->next = usb; usb->next->prev = usb; adb_mutex_unlock(&usb_lock); char devpath[64]; snprintf(devpath, sizeof(devpath), "ugen%d.%d", uh->dev_bus, uh->dev_addr); register_usb_transport(usb, serial, devpath, 1); return (1); } static int already_registered(usb_handle *uh) { usb_handle *usb = NULL; int exists = 0; adb_mutex_lock(&usb_lock); for (usb = handle_list.next; usb != &handle_list; usb = usb->next) { if ((usb->dev_bus == uh->dev_bus) && (usb->dev_addr == uh->dev_addr)) { exists = 1; break; } } adb_mutex_unlock(&usb_lock); return exists; } static void check_device(libusb_device *dev) { usb_handle uh; int i = 0; int found = -1; char serial[256] = {0}; libusb_device_descriptor desc; libusb_config_descriptor *config = NULL; int r = libusb_get_device_descriptor(dev, &desc); if (r != LIBUSB_SUCCESS) { D("check_device(): Failed to get device descriptor"); return; } if ((desc.idVendor == 0) && (desc.idProduct == 0)) return; D("check_device(): Probing usb device %04x:%04x", desc.idVendor, desc.idProduct); if (!is_adb_interface(desc.idVendor, desc.idProduct, ADB_CLASS, ADB_SUBCLASS, ADB_PROTOCOL)) { D("check_device(): Ignored due unknown vendor id"); return; } uh.dev_bus = libusb_get_bus_number(dev); uh.dev_addr = libusb_get_device_address(dev); if (already_registered(&uh)) { D("check_device(): Device (bus: %d, address: %d) " "is already registered", uh.dev_bus, uh.dev_addr); return; } D("check_device(): Device bus: %d, address: %d", uh.dev_bus, uh.dev_addr); r = libusb_get_active_config_descriptor(dev, &config); if (r != 0) { if (r == LIBUSB_ERROR_NOT_FOUND) { D("check_device(): Device %4x:%4x is unconfigured", desc.idVendor, desc.idProduct); return; } D("check_device(): Failed to get configuration for %4x:%4x", desc.idVendor, desc.idProduct); return; } if (config == NULL) { D("check_device(): Sanity check failed after " "getting active config"); return; } if (config->interface != NULL) { found = check_usb_interfaces(config, &desc, &uh); } /* not needed anymore */ libusb_free_config_descriptor(config); r = libusb_open(dev, &uh.devh); uh.dev = dev; if (r != 0) { switch (r) { case LIBUSB_ERROR_NO_MEM: D("check_device(): Memory allocation problem"); break; case LIBUSB_ERROR_ACCESS: D("check_device(): Permissions problem, " "current user priveleges are messed up?"); break; case LIBUSB_ERROR_NO_DEVICE: D("check_device(): Device disconected, bad cable?"); break; default: D("check_device(): libusb triggered error %d", r); } // skip rest found = -1; } if (found >= 0) { D("check_device(): Device matches Android interface"); // read the device's serial number memset(serial, 0, sizeof(serial)); uh.interface = found; r = libusb_claim_interface(uh.devh, uh.interface); if (r < 0) { D("check_device(): Failed to claim interface %d", uh.interface); goto fail; } if (desc.iSerialNumber) { // reading serial uint16_t buffer[128] = {0}; uint16_t languages[128] = {0}; int languageCount = 0; memset(languages, 0, sizeof(languages)); r = libusb_control_transfer(uh.devh, LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE, LIBUSB_REQUEST_GET_DESCRIPTOR, LIBUSB_DT_STRING << 8, 0, (uint8_t *)languages, sizeof(languages), 0); if (r <= 0) { D("check_device(): Failed to get languages count"); goto fail; } languageCount = (r - 2) / 2; for (i = 1; i <= languageCount; ++i) { memset(buffer, 0, sizeof(buffer)); r = libusb_control_transfer(uh.devh, LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_STANDARD | LIBUSB_RECIPIENT_DEVICE, LIBUSB_REQUEST_GET_DESCRIPTOR, (LIBUSB_DT_STRING << 8) | desc.iSerialNumber, languages[i], (uint8_t *)buffer, sizeof(buffer), 0); if (r > 0) { /* converting serial */ int j = 0; r /= 2; for (j = 1; j < r; ++j) serial[j - 1] = buffer[j]; serial[j - 1] = '\0'; break; /* languagesCount cycle */ } } if (register_device(&uh, serial) == 0) { D("check_device(): Failed to register device"); goto fail_interface; } libusb_ref_device(dev); } } return; fail_interface: libusb_release_interface(uh.devh, uh.interface); fail: libusb_close(uh.devh); uh.devh = NULL; } static int check_device_connected(usb_handle *uh) { int r = libusb_kernel_driver_active(uh->devh, uh->interface); if (r == LIBUSB_ERROR_NO_DEVICE) return 0; if (r < 0) return -1; return 1; } static void kick_disconnected() { usb_handle *usb = NULL; adb_mutex_lock(&usb_lock); for (usb = handle_list.next; usb != &handle_list; usb = usb->next) { if (check_device_connected(usb) == 0) { D("kick_disconnected(): Transport %p is not online anymore", usb); usb_kick(usb); } } adb_mutex_unlock(&usb_lock); } static void scan_usb_devices() { D("scan_usb_devices(): started"); libusb_device **devs= NULL; libusb_device *dev= NULL; ssize_t cnt = libusb_get_device_list(ctx, &devs); if (cnt < 0) { D("scan_usb_devices(): Failed to get device list (error: %zd)", cnt); return; } int i = 0; while ((dev = devs[i++]) != NULL) { check_device(dev); } 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 (;;) { sleep(5); kick_disconnected(); scan_usb_devices(); } - - /* never reaching this point */ - return (NULL); } static void sigalrm_handler(int signo) { /* nothing */ } void usb_init() { D("usb_init(): started"); - adb_thread_t tid; struct sigaction actions; atexit(usb_cleanup); int r = libusb_init(&ctx); if (r != LIBUSB_SUCCESS) { fatal_errno("Failed to init libusb"); } memset(&actions, 0, sizeof(actions)); sigemptyset(&actions.sa_mask); actions.sa_flags = 0; actions.sa_handler = sigalrm_handler; sigaction(SIGALRM, &actions, NULL); /* initial device scan */ 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"); } D("usb_init(): finished"); } Index: head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp =================================================================== --- head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- adb/fdevent_test.cpp.orig 2015-09-17 22:58:36 UTC -+++ adb/fdevent_test.cpp -@@ -19,6 +19,7 @@ - #include - - #include -+#include // std::unique_ptr - #include - #include - #include Property changes on: head/devel/android-tools-adb-devel/files/patch-adb_fdevent__test.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb-devel/files/patch-base_file.cpp =================================================================== --- head/devel/android-tools-adb-devel/files/patch-base_file.cpp (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-base_file.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- base/file.cpp.orig 2016-08-08 21:10:17 UTC -+++ base/file.cpp -@@ -21,6 +21,8 @@ - #include - #include - -+#include // BUFSIZ -+#include // strerror - #include - - #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Property changes on: head/devel/android-tools-adb-devel/files/patch-base_file.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h =================================================================== --- head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h (nonexistent) @@ -1,11 +0,0 @@ ---- 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 -+ - #include - #include - #include Property changes on: head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c =================================================================== --- head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c (nonexistent) @@ -1,16 +0,0 @@ ---- liblog/logger_write.c.orig 2016-04-16 00:01:39 UTC -+++ liblog/logger_write.c -@@ -15,12 +15,12 @@ - */ - - #include --#include - #include - #include - #include - - #ifdef __BIONIC__ -+#include - #include - #endif - Property changes on: head/devel/android-tools-adb-devel/files/patch-liblog_logger__write.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h =================================================================== --- head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h (nonexistent) @@ -1,43 +0,0 @@ ---- 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 - #include -@@ -401,6 +401,11 @@ typedef std::unique_ptr - -+#if defined(__Bitrig__) || defined(__DragonFly__) || \ -+ defined(__FreeBSD__) || defined(__OpenBSD__) -+#include -+#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(); - Property changes on: head/devel/android-tools-adb-devel/files/patch-adb_sysdeps.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb-devel/files/patch-base_logging.cpp =================================================================== --- head/devel/android-tools-adb-devel/files/patch-base_logging.cpp (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-base_logging.cpp (nonexistent) @@ -1,50 +0,0 @@ ---- base/logging.cpp.orig 2016-08-08 21:10:17 UTC -+++ base/logging.cpp -@@ -25,7 +25,7 @@ - #include - - // For getprogname(3) or program_invocation_short_name. --#if defined(__ANDROID__) || defined(__APPLE__) -+#if !defined(_WIN32) && !defined(__GLIBC__) - #include - #elif defined(__GLIBC__) - #include -@@ -35,6 +35,8 @@ - #include - #endif - -+#include // strrchr -+#include // fprintf - #include - #include - #include -@@ -71,6 +72,14 @@ - #include - #elif defined(_WIN32) - #include -+#elif defined(__DragonFly__) -+#include -+#elif defined(__FreeBSD__) -+#include -+#elif defined(__NetBSD__) -+#include -+#else -+#include - #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 - } - Property changes on: head/devel/android-tools-adb-devel/files/patch-base_logging.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp =================================================================== --- head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp (revision 420786) +++ head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- base/parsenetaddress.cpp.orig 2016-02-20 02:39:51 UTC -+++ base/parsenetaddress.cpp -@@ -16,6 +16,7 @@ - - #include "android-base/parsenetaddress.h" - -+#include // sscanf - #include - - #include "android-base/stringprintf.h" Property changes on: head/devel/android-tools-adb-devel/files/patch-base_parsenetaddress.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/Makefile =================================================================== --- head/devel/android-tools-fastboot/Makefile (revision 420786) +++ head/devel/android-tools-fastboot/Makefile (revision 420787) @@ -1,95 +1,90 @@ # $FreeBSD$ 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 DISTFILES= fastboot.1?id=706e754:manpage EXTRACT_ONLY= ${DISTFILES:N*\:manpage:C/:.*//} MAINTAINER= jbeich@FreeBSD.org COMMENT= Android Fastboot protocol CLI tool LICENSE= APACHE20 BSD2CLAUSE PD LICENSE_COMB= multi LICENSE_FILE_PD= ${WRKSRC}/libselinux/NOTICE LIB_DEPENDS= libpcre.so:devel/pcre USE_GITHUB= yes GH_ACCOUNT= android jbeich:extras,libselinux GH_PROJECT= platform_system_core platform_system_extras:extras \ platform_external_libselinux:libselinux # Emulate GH_COMMIT without causing desync .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} MAKEFILE= ${.CURDIR}/files/Makefile # XXX ?= when bmake-only MAKE_ENV= BINDIR="${PREFIX}/bin" EXTRADIR="${FILESDIR}" \ FILESDIR="${DOCSDIR}" REVISION="${GH_REVISION}" \ MANDIR="${PREFIX}/man/man" \ LIBPCRE="${LOCALBASE}/lib/libpcre.a" PLIST_FILES= bin/fastboot \ man/man1/fastboot.1.gz PORTDOCS= * SUB_FILES= pkg-message OPTIONS_DEFINE= BASH DOCS OPTIONS_SUB= yes .if make(makesum) # for optional distfiles .MAKEFLAGS: WITH="${OPTIONS_DEFINE}" .endif 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 DOCS_MAKE_ARGS_OFF= FILES="" FILESDIR="" post-extract: @${CP} ${_DISTDIR}/${DISTFILES:M*\:manpage:C/:.*//} \ ${BUILD_WRKSRC}/${DISTFILES:M*\:manpage:C/\?.*//} # Adjust paths relative to core @(cd ${WRKSRC_extras} && ${COPYTREE_SHARE} . ${WRKSRC}) @${MV} ${WRKSRC_libselinux} ${WRKSRC}/libselinux post-install-BASH-on: ${MKDIR} ${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES:H} ${INSTALL_DATA} ${WRKSRC_bashcomp}/android \ ${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES} update-revision: # https://developer.github.com/v3/repos/commits/#get-a-single-commit # Pretend to be curl(1) for pretty-printed JSON to help parse with sed(1) @${REINPLACE_CMD} -i '' -e "/^GH_REVISION.*$@/s/=.*/= $$(\ ${SETENV} HTTP_USER_AGENT=curl ${FETCH_CMD} -qo- \ https://api.github.com/repos/${GH_ACCOUNT}/${GH_PROJECT}/commits/${GH_TAGNAME} | \ ${SED} -n '/sha/ { s/.*\"\([0-9a-f]\{12\}\).*/\1/p; q; }' \ ) # generated by: make $@/" \ ${.CURDIR}/Makefile .include # XXX Work around !target(makesum) .ifndef DISTVERSIONSUFFIX makesum: update-revision .endif Index: head/devel/android-tools-fastboot/distinfo =================================================================== --- head/devel/android-tools-fastboot/distinfo (revision 420786) +++ head/devel/android-tools-fastboot/distinfo (revision 420787) @@ -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 Index: head/devel/android-tools-fastboot/files/extra-patch-base_file.cpp =================================================================== --- head/devel/android-tools-fastboot/files/extra-patch-base_file.cpp (revision 420786) +++ head/devel/android-tools-fastboot/files/extra-patch-base_file.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- base/file.cpp.orig 2015-05-27 20:24:08 UTC -+++ base/file.cpp -@@ -21,6 +21,7 @@ - #include - #include - -+#include // strerror - #include - - #include "base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Property changes on: head/devel/android-tools-fastboot/files/extra-patch-base_file.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/extra-patch-liblog_logd__write.c =================================================================== --- head/devel/android-tools-fastboot/files/extra-patch-liblog_logd__write.c (revision 420786) +++ head/devel/android-tools-fastboot/files/extra-patch-liblog_logd__write.c (nonexistent) @@ -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 - #endif - #include -+#if (FAKE_LOG_DEVICE == 0) - #include -+#endif - #include - #include - #include Property changes on: head/devel/android-tools-fastboot/files/extra-patch-liblog_logd__write.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/Makefile =================================================================== --- head/devel/android-tools-fastboot/files/Makefile (revision 420786) +++ head/devel/android-tools-fastboot/files/Makefile (revision 420787) @@ -1,109 +1,135 @@ # $FreeBSD$ PROG_CXX=fastboot BINDIR?=/usr/bin 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 SRCS+= allocate.c SRCS+= contents.c SRCS+= crc16.c SRCS+= ext4_sb.c SRCS+= ext4_utils.c SRCS+= ext4fixup.c SRCS+= extent.c SRCS+= indirect.c 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 SRCS+= callbacks.c SRCS+= check_context.c SRCS+= freecon.c 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 SRCS+= backed_block.c SRCS+= output_file.c SRCS+= sparse.c SRCS+= sparse_crc32.c SRCS+= sparse_err.c SRCS+= sparse_read.c # required by libziparchive .PATH: ${.CURDIR}/../libutils SRCS+= FileMap.cpp # required by fastboot .PATH: ${.CURDIR}/../libziparchive SRCS+= zip_archive.cc REVISION?= $$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown) CPPFLAGS+= -DFASTBOOT_REVISION="\"${REVISION}-android\"" CPPFLAGS+= -Doff64_t=off_t CPPFLAGS+= -Dftruncate64=ftruncate CPPFLAGS+= -Dlseek64=lseek 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 CPPFLAGS+= -I${.CURDIR}/../f2fs_utils CPPFLAGS+= -I${.CURDIR}/../libselinux/include CPPFLAGS+= -I${.CURDIR}/../libsparse/include CPPFLAGS+= ${CPPFLAGS.${.IMPSRC:T}} CPPFLAGS+= $$(${PKG_CONFIG} libpcre --cflags 2>/dev/null) CPPFLAGS+= $$(${PKG_CONFIG} libusb-1.0 --cflags 2>/dev/null) CXXFLAGS+= -D__STDC_LIMIT_MACROS # DragonFly CXXFLAGS+= -std=gnu++11 .ifndef COMPILE.c CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif LDADD+= $$(${PKG_CONFIG} libpcre --libs 2>/dev/null || echo -lpcre) LDADD+= $$(${PKG_CONFIG} libusb-1.0 --libs 2>/dev/null || echo -lusb) LDADD+= -lz DPADD+= ${LIBPCRE} ${LIBUSB} ${LIBZ} GIT?= git PKG_CONFIG?= pkg-config beforeinstall: ${INSTALL} -d ${DESTDIR}${FILESDIR} .include Index: head/devel/android-tools-fastboot/files/patch-adb_sysdeps.h =================================================================== --- head/devel/android-tools-fastboot/files/patch-adb_sysdeps.h (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-adb_sysdeps.h (revision 420787) @@ -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 + #include +@@ -401,6 +401,11 @@ typedef std::unique_ptr + ++#if defined(__Bitrig__) || defined(__DragonFly__) || \ ++ defined(__FreeBSD__) || defined(__OpenBSD__) ++#include ++#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(); + Property changes on: head/devel/android-tools-fastboot/files/patch-adb_sysdeps.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp =================================================================== --- head/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp (revision 420787) @@ -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 ++#include + + namespace android { + namespace base { Property changes on: head/devel/android-tools-fastboot/files/patch-base_errors__unix.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/patch-base_file.cpp =================================================================== --- head/devel/android-tools-fastboot/files/patch-base_file.cpp (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-base_file.cpp (revision 420787) @@ -0,0 +1,11 @@ +--- base/file.cpp.orig 2016-08-08 21:10:17 UTC ++++ base/file.cpp +@@ -21,6 +21,8 @@ + #include + #include + ++#include // BUFSIZ ++#include // strerror + #include + + #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Property changes on: head/devel/android-tools-fastboot/files/patch-base_file.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h =================================================================== --- head/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h (revision 420787) @@ -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 ++ + #include + #include + #include Property changes on: head/devel/android-tools-fastboot/files/patch-base_include_android-base_logging.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp =================================================================== --- head/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp (revision 420787) @@ -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 // sscanf + #include + + #include "android-base/stringprintf.h" Property changes on: head/devel/android-tools-fastboot/files/patch-base_parsenetaddress.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/patch-fastboot_socket.h =================================================================== --- head/devel/android-tools-fastboot/files/patch-fastboot_socket.h (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-fastboot_socket.h (revision 420787) @@ -0,0 +1,14 @@ +--- fastboot/socket.h.orig 2016-02-20 02:39:51 UTC ++++ fastboot/socket.h +@@ -41,7 +41,10 @@ + + #include + #include +-#include ++ ++// Copied from ++#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 { Property changes on: head/devel/android-tools-fastboot/files/patch-fastboot_socket.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/patch-liblog_logger__write.c =================================================================== --- head/devel/android-tools-fastboot/files/patch-liblog_logger__write.c (nonexistent) +++ head/devel/android-tools-fastboot/files/patch-liblog_logger__write.c (revision 420787) @@ -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 +-#include + #include + #include + #include + + #ifdef __BIONIC__ ++#include + #include + #endif + Property changes on: head/devel/android-tools-fastboot/files/patch-liblog_logger__write.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot/files/usb_freebsd.cpp =================================================================== --- head/devel/android-tools-fastboot/files/usb_freebsd.cpp (revision 420786) +++ head/devel/android-tools-fastboot/files/usb_freebsd.cpp (revision 420787) @@ -1,200 +1,208 @@ /* * Copyright (C) 2011 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include #include #include #include +#include + #include "usb.h" struct usb_handle { libusb_device_handle *handle; libusb_device *dev; unsigned char ep_in; unsigned char ep_out; unsigned char iface; }; +class LibusbUsbTransport : public Transport { +public: + explicit LibusbUsbTransport(std::unique_ptr 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 h; + + DISALLOW_COPY_AND_ASSIGN(LibusbUsbTransport); +}; + static int -probe(usb_handle *h, ifc_match_func callback) +probe(std::unique_ptr &h, ifc_match_func callback) { usb_ifc_info info; libusb_device_descriptor ddesc; libusb_config_descriptor *pcfg; int i, j; if (libusb_open(h->dev, &h->handle) < 0) return (-1); if (libusb_get_device_descriptor(h->dev, &ddesc) < 0) { libusb_close(h->handle); return (-1); } memset(&info, 0, sizeof(info)); info.dev_vendor = ddesc.idVendor; info.dev_product = ddesc.idProduct; info.dev_class = ddesc.bDeviceClass; info.dev_subclass = ddesc.bDeviceSubClass; info.dev_protocol = ddesc.bDeviceProtocol; info.writable = 1; snprintf(info.device_path, sizeof(info.device_path), "ugen%d.%d", libusb_get_bus_number(h->dev), libusb_get_device_address(h->dev)); if (ddesc.iSerialNumber != 0) { libusb_get_string_descriptor_ascii(h->handle, ddesc.iSerialNumber, (unsigned char *)info.serial_number, sizeof(info.serial_number)); } if (libusb_get_active_config_descriptor(h->dev, &pcfg)) { libusb_close(h->handle); return (-1); } for (i = 0; i < pcfg->bNumInterfaces; i++) { h->ep_in = 0; h->ep_out = 0; h->iface = i; for (j = 0; j < pcfg->interface[i].altsetting[0].bNumEndpoints; j++) { unsigned char temp = pcfg->interface[i].altsetting[0]. endpoint[j].bEndpointAddress; unsigned char type = pcfg->interface[i].altsetting[0]. endpoint[j].bmAttributes & 0x03; /* check for BULK endpoint */ if ((type & 0x03) == 0x02) { /* check for IN endpoint */ if (temp & 0x80) h->ep_in = temp; else h->ep_out = temp; } } info.ifc_class = pcfg->interface[i].altsetting[0].bInterfaceClass; info.ifc_subclass = pcfg->interface[i].altsetting[0].bInterfaceSubClass; info.ifc_protocol = pcfg->interface[i].altsetting[0].bInterfaceProtocol; info.has_bulk_in = (h->ep_in != 0); info.has_bulk_out = (h->ep_out != 0); if (libusb_claim_interface(h->handle, h->iface) < 0) continue; if (callback(&info) == 0) { libusb_free_config_descriptor(pcfg); return (0); } libusb_release_interface(h->handle, h->iface); } libusb_free_config_descriptor(pcfg); libusb_close(h->handle); return (-1); } -static usb_handle * +static std::unique_ptr enumerate(ifc_match_func callback) { static libusb_context *ctx = NULL; - usb_handle *h; + std::unique_ptr h; libusb_device **ppdev; ssize_t ndev; ssize_t x; - h = reinterpret_cast(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]; if (probe(h, callback) == 0) { libusb_ref_device(h->dev); libusb_free_device_list(ppdev, 1); 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; if (libusb_bulk_transfer(h->handle, h->ep_out, (unsigned char *)_data, len, &actlen, 0) < 0) return (-1); return (actlen); } -int -usb_read(usb_handle * h, void *_data, int len) +ssize_t +LibusbUsbTransport::Read(void *_data, size_t len) { int actlen; if (libusb_bulk_transfer(h->handle, h->ep_in, (unsigned char *)_data, len, &actlen, 0) < 0) return (-1); 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 h = enumerate(callback); + return (h ? new LibusbUsbTransport(std::move(h)) : nullptr); } Index: head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- base/file.cpp.orig 2016-08-08 21:10:17 UTC -+++ base/file.cpp -@@ -21,6 +21,8 @@ - #include - #include - -+#include // BUFSIZ -+#include // strerror - #include - - #include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin. Property changes on: head/devel/android-tools-fastboot-devel/files/patch-base_file.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h (nonexistent) @@ -1,14 +0,0 @@ ---- fastboot/socket.h.orig 2016-02-20 02:39:51 UTC -+++ fastboot/socket.h -@@ -41,7 +41,10 @@ - - #include - #include --#include -+ -+// Copied from -+#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 { Property changes on: head/devel/android-tools-fastboot-devel/files/patch-fastboot_socket.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h (nonexistent) @@ -1,11 +0,0 @@ ---- 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 -+ - #include - #include - #include Property changes on: head/devel/android-tools-fastboot-devel/files/patch-base_include_android-base_logging.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c (nonexistent) @@ -1,16 +0,0 @@ ---- liblog/logger_write.c.orig 2016-04-16 00:01:39 UTC -+++ liblog/logger_write.c -@@ -15,12 +15,12 @@ - */ - - #include --#include - #include - #include - #include - - #ifdef __BIONIC__ -+#include - #include - #endif - Property changes on: head/devel/android-tools-fastboot-devel/files/patch-liblog_logger__write.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h (nonexistent) @@ -1,43 +0,0 @@ ---- 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 - #include -@@ -401,6 +401,11 @@ typedef std::unique_ptr - -+#if defined(__Bitrig__) || defined(__DragonFly__) || \ -+ defined(__FreeBSD__) || defined(__OpenBSD__) -+#include -+#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(); - Property changes on: head/devel/android-tools-fastboot-devel/files/patch-adb_sysdeps.h ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp (nonexistent) @@ -1,11 +0,0 @@ ---- 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 -+#include - - namespace android { - namespace base { Property changes on: head/devel/android-tools-fastboot-devel/files/patch-base_errors__unix.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp =================================================================== --- head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp (revision 420786) +++ head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp (nonexistent) @@ -1,10 +0,0 @@ ---- base/parsenetaddress.cpp.orig 2016-02-20 02:39:51 UTC -+++ base/parsenetaddress.cpp -@@ -16,6 +16,7 @@ - - #include "android-base/parsenetaddress.h" - -+#include // sscanf - #include - - #include "android-base/stringprintf.h" Property changes on: head/devel/android-tools-fastboot-devel/files/patch-base_parsenetaddress.cpp ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property