Index: head/devel/android-tools-adb/Makefile =================================================================== --- head/devel/android-tools-adb/Makefile (revision 403828) +++ head/devel/android-tools-adb/Makefile (revision 403829) @@ -1,98 +1,99 @@ # $FreeBSD$ PORTNAME= android-tools-adb DISTVERSIONPREFIX= android- DISTVERSION?= 6.0.0_r26 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= f7f765fd62bf # 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__test.cpp .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_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:${PORTSDIR}/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/files/patch-base_include_base_logging.h =================================================================== --- head/devel/android-tools-adb/files/patch-base_include_base_logging.h (revision 403828) +++ head/devel/android-tools-adb/files/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/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_include_base_logging.h =================================================================== --- head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h (nonexistent) +++ head/devel/android-tools-adb/files/extra-patch-base_include_base_logging.h (revision 403829) @@ -0,0 +1,11 @@ +--- 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 ___________________________________________________________________ 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-devel/Makefile =================================================================== --- head/devel/android-tools-adb-devel/Makefile (revision 403828) +++ head/devel/android-tools-adb-devel/Makefile (revision 403829) @@ -1,34 +1,30 @@ # $FreeBSD$ # Hint: git describe --abbrev=12 --match android-m-preview -DISTVERSION= m-preview-5498 -DISTVERSIONSUFFIX= -g0bb1ce06ea46 +DISTVERSION= m-preview-5956 +DISTVERSIONSUFFIX= -g461a29540c01 PORTREVISION= 0 PKGNAMESUFFIX= -devel CONFLICTS_INSTALL= ${PORTNAME}-[0-9]* MASTERDIR= ${.CURDIR}/../android-tools-adb DISTINFO_FILE= ${.CURDIR}/distinfo FILESDIR= ${.CURDIR}/files EXTRA_PATCHES= ${.CURDIR}/files/patch-* OPTIONS_DEFINE= TEST_PYTHON TEST_PYTHON_DESC= ${TEST_DESC:S/tests/python &/} TEST_PYTHON_GH_PROJECT= platform_development:development -TEST_PYTHON_GH_TAGNAME= ${DISTVERSIONFULL:C/-[0-9].*//}-2403-g084d084:development +TEST_PYTHON_GH_TAGNAME= ${DISTVERSIONFULL:C/-[0-9].*//}-2510-g72f24a0:development TEST_PYTHON_BUILD_DEPENDS=${PYTHON_PKGNAMEPREFIX}mock>0:${PORTSDIR}/devel/py-mock TEST_PYTHON_USES= python:2.7,build pre-install-TEST_PYTHON-on: # XXX python tests may leave behind running adb server -# test_adb.py remains in core repository for some reason ${SETENV} PATH=${BUILD_WRKSRC}:${PATH} \ PYTHONPATH=${WRKSRC_development}/python-packages \ - ${PYTHON_CMD} ${BUILD_WRKSRC}/test_adb.py - ${SETENV} PATH=${BUILD_WRKSRC}:${PATH} \ - PYTHONPATH=${WRKSRC_development}/python-packages \ - ${PYTHON_CMD} ${WRKSRC_development}/python-packages/adb/test_device.py + ${PYTHON_CMD} -m unittest discover -vs ${BUILD_WRKSRC} .include "${MASTERDIR}/Makefile" Index: head/devel/android-tools-adb-devel/distinfo =================================================================== --- head/devel/android-tools-adb-devel/distinfo (revision 403828) +++ head/devel/android-tools-adb-devel/distinfo (revision 403829) @@ -1,6 +1,6 @@ -SHA256 (android-platform_system_core-android-m-preview-5498-g0bb1ce06ea46_GH0.tar.gz) = 6495262da5f639cb76625437c82475c6220cab208666cf739508871ce36e79da -SIZE (android-platform_system_core-android-m-preview-5498-g0bb1ce06ea46_GH0.tar.gz) = 1407054 +SHA256 (android-platform_system_core-android-m-preview-5956-g461a29540c01_GH0.tar.gz) = 369b2d67c7887124d4d31e1d51934517d243a4c39f266f3685e709f8592b7d14 +SIZE (android-platform_system_core-android-m-preview-5956-g461a29540c01_GH0.tar.gz) = 1428466 SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948 -SHA256 (android-platform_development-android-m-preview-2403-g084d084_GH0.tar.gz) = a7c33bf2708d61ae2e44ff149fac2460f80746e7da936f08b373841be5750102 -SIZE (android-platform_development-android-m-preview-2403-g084d084_GH0.tar.gz) = 183883403 +SHA256 (android-platform_development-android-m-preview-2510-g72f24a0_GH0.tar.gz) = a7e3172a61be2b7545fb4c10d5516cceb68b574cf7c83b7fc00c5cac0527b182 +SIZE (android-platform_development-android-m-preview-2510-g72f24a0_GH0.tar.gz) = 183871106 Index: head/devel/android-tools-adb-devel/files/Makefile =================================================================== --- head/devel/android-tools-adb-devel/files/Makefile (revision 403828) +++ head/devel/android-tools-adb-devel/files/Makefile (revision 403829) @@ -1,122 +1,123 @@ # $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_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 SRCS+= shell_service_protocol.cpp # XXX SuffFindDeps may fail to restore suffix lost in transformation SRCS+= ../adb/sockets.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+= 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+= stringprintf.cpp TEST_SRCS+= file_test.cpp TEST_SRCS+= logging_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+= load_file.c SRCS+= threads.c # required by base/file.cpp .PATH: ${.CURDIR}/../liblog SRCS+= fake_log_device.c SRCS+= logd_write.c CPPFLAGS.logd_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:Nmain.o:Ncommandline.o} ${TEST_OBJS} ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} 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 (nonexistent) +++ head/devel/android-tools-adb-devel/files/patch-base_include_android-base_logging.h (revision 403829) @@ -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-devel/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-devel/files/patch-base_logging.cpp =================================================================== --- head/devel/android-tools-adb-devel/files/patch-base_logging.cpp (nonexistent) +++ head/devel/android-tools-adb-devel/files/patch-base_logging.cpp (revision 403829) @@ -0,0 +1,40 @@ +--- base/logging.cpp.orig 2015-12-14 21:12:52 UTC ++++ base/logging.cpp +@@ -66,6 +68,16 @@ + #include + #elif defined(_WIN32) + #include ++#elif defined(__DragonFly__) ++#include ++#elif defined(__FreeBSD__) ++#include ++#include ++#include ++#elif defined(__NetBSD__) ++#include ++#else ++#include + #endif + + static pid_t GetThreadId() { +@@ -77,6 +89,20 @@ static pid_t 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__) ++# if __FreeBSD_version > 900030 ++ return pthread_getthreadid_np(); ++# else ++ long lwpid; ++ thr_self(&lwpid); ++ return lwpid; ++# endif ++#else ++ return (intptr_t) pthread_self(); + #endif + } + Property changes on: head/devel/android-tools-adb-devel/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-fastboot-devel/Makefile =================================================================== --- head/devel/android-tools-fastboot-devel/Makefile (revision 403828) +++ head/devel/android-tools-fastboot-devel/Makefile (revision 403829) @@ -1,17 +1,18 @@ # $FreeBSD$ # Hint: git describe --abbrev=12 --match android-m-preview -DISTVERSION= m-preview-5498 -DISTVERSIONSUFFIX= -g0bb1ce06ea46 +DISTVERSION= m-preview-5956 +DISTVERSIONSUFFIX= -g461a29540c01 PORTREVISION= 0 PKGNAMESUFFIX= -devel -GH_TAGNAME= ${DISTVERSIONFULL:C/-[0-9].*//}-972-g442e952:extras \ - ${DISTVERSIONFULL:C/-[0-9].*//}-90-ga83098b:libselinux +GH_TAGNAME= ${DISTVERSIONFULL:C/-[0-9].*//}-1071-g4f5860d:extras \ + ${DISTVERSIONFULL:C/-[0-9].*//}-94-gbe5f860:libselinux CONFLICTS_INSTALL= ${PORTNAME}-[0-9]* MASTERDIR= ${.CURDIR}/../android-tools-fastboot +FILESDIR= ${.CURDIR}/files DISTINFO_FILE= ${.CURDIR}/distinfo .include "${MASTERDIR}/Makefile" Index: head/devel/android-tools-fastboot-devel/distinfo =================================================================== --- head/devel/android-tools-fastboot-devel/distinfo (revision 403828) +++ head/devel/android-tools-fastboot-devel/distinfo (revision 403829) @@ -1,10 +1,10 @@ SHA256 (fastboot.1?id=706e754) = 2af01b064440952a82f1602691a0fecc030302722a71444946fb70d9c423d283 SIZE (fastboot.1?id=706e754) = 5906 -SHA256 (android-platform_system_core-android-m-preview-5498-g0bb1ce06ea46_GH0.tar.gz) = 6495262da5f639cb76625437c82475c6220cab208666cf739508871ce36e79da -SIZE (android-platform_system_core-android-m-preview-5498-g0bb1ce06ea46_GH0.tar.gz) = 1407054 -SHA256 (jbeich-platform_system_extras-android-m-preview-972-g442e952_GH0.tar.gz) = 77082c3fae368dda9fe0a7edb2b54cfb3c47a849f5fe3ab160225304e3598e1e -SIZE (jbeich-platform_system_extras-android-m-preview-972-g442e952_GH0.tar.gz) = 76529760 -SHA256 (jbeich-platform_external_libselinux-android-m-preview-90-ga83098b_GH0.tar.gz) = 05afbdfad4028c4cdc62d1fa831760cded52883749e686a5c0cea5901d5aa33c -SIZE (jbeich-platform_external_libselinux-android-m-preview-90-ga83098b_GH0.tar.gz) = 58818 +SHA256 (android-platform_system_core-android-m-preview-5956-g461a29540c01_GH0.tar.gz) = 369b2d67c7887124d4d31e1d51934517d243a4c39f266f3685e709f8592b7d14 +SIZE (android-platform_system_core-android-m-preview-5956-g461a29540c01_GH0.tar.gz) = 1428466 +SHA256 (jbeich-platform_system_extras-android-m-preview-1071-g4f5860d_GH0.tar.gz) = 31376565de222f87cbcea4786346a198432c6aae257a857d7afa4ec1e3b5997d +SIZE (jbeich-platform_system_extras-android-m-preview-1071-g4f5860d_GH0.tar.gz) = 76521949 +SHA256 (jbeich-platform_external_libselinux-android-m-preview-94-gbe5f860_GH0.tar.gz) = 596a151d25a0cf1e39abc3157ea91f1c69471a9bb41859e915f6c4ac5efaf2c0 +SIZE (jbeich-platform_external_libselinux-android-m-preview-94-gbe5f860_GH0.tar.gz) = 58977 SHA256 (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = dc774f101acd9514baf3e7a0ac610068116f2c093b94987ba59203a39a6439dc SIZE (mbrubeck-android-completion-3b0fabe_GH0.tar.gz) = 5948 Index: head/devel/android-tools-fastboot-devel/files/Makefile =================================================================== --- head/devel/android-tools-fastboot-devel/files/Makefile (revision 403828) +++ head/devel/android-tools-fastboot-devel/files/Makefile (revision 403829) @@ -1,112 +1,118 @@ # $FreeBSD$ PROG_CXX=fastboot BINDIR?=/usr/bin FILESDIR?=${DOCDIR}/${PROG} FILES= *.[Tt][Xx][Tt] SRCS+= bootimg_utils.cpp SRCS+= engine.cpp SRCS+= fastboot.cpp SRCS+= fs.cpp SRCS+= protocol.cpp SRCS+= util.cpp .PATH: ${EXTRADIR} SRCS+= usb_freebsd.cpp SRCS+= util_freebsd.cpp -# required by fastboot and libziparchive +# required by fastboot +.PATH: ${.CURDIR}/../adb +SRCS+= diagnose_usb.cpp + +# required by fastboot, diagnose_usb and libziparchive .PATH: ${.CURDIR}/../base SRCS+= file.cpp SRCS+= strings.cpp +SRCS+= stringprintf.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 base and libutils .PATH: ${.CURDIR}/../liblog SRCS+= fake_log_device.c SRCS+= logd_write.c CPPFLAGS.logd_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-devel/files/pkg-message.in =================================================================== --- head/devel/android-tools-fastboot-devel/files/pkg-message.in (nonexistent) +++ head/devel/android-tools-fastboot-devel/files/pkg-message.in (revision 403829) @@ -0,0 +1,7 @@ +The port installed fastboot(1) under %%PREFIX%%/bin. However, there's +a different fastboot(8) under /sbin. To avoid accidentally invoking +the wrong command make sure either to + +- adjust PATH environment variable to have fastboot(1) found first +- create a shell alias with absolute path to fastboot(1) +- create a symlink with different name in PATH e.g., under ~/bin Property changes on: head/devel/android-tools-fastboot-devel/files/pkg-message.in ___________________________________________________________________ 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-devel/files/usb_freebsd.cpp =================================================================== --- head/devel/android-tools-fastboot-devel/files/usb_freebsd.cpp (nonexistent) +++ head/devel/android-tools-fastboot-devel/files/usb_freebsd.cpp (revision 403829) @@ -0,0 +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: + 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(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 std::unique_ptr +enumerate(ifc_match_func callback) +{ + static libusb_context *ctx = NULL; + std::unique_ptr h; + libusb_device **ppdev; + ssize_t ndev; + ssize_t x; + + if (ctx == NULL) + libusb_init(&ctx); + + ndev = libusb_get_device_list(ctx, &ppdev); + for (x = 0; x < ndev; x++) { + + 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); + } + } + h.reset(); + libusb_free_device_list(ppdev, 1); + return (nullptr); +} + +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); +} + +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 +LibusbUsbTransport::Close() +{ + libusb_close(h->handle); + h->handle = NULL; + libusb_unref_device(h->dev); + h.reset(); + return (0); +} + +Transport * +usb_open(ifc_match_func callback) +{ + std::unique_ptr h = enumerate(callback); + return (h ? new LibusbUsbTransport(std::move(h)) : nullptr); +} Property changes on: head/devel/android-tools-fastboot-devel/files/usb_freebsd.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-devel/files/util_freebsd.cpp =================================================================== --- head/devel/android-tools-fastboot-devel/files/util_freebsd.cpp (nonexistent) +++ head/devel/android-tools-fastboot-devel/files/util_freebsd.cpp (revision 403829) @@ -0,0 +1,37 @@ +/* + * 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 "fastboot.h" + +#include +#include + +void +get_my_path(char *path) +{ + getcwd(path, PATH_MAX - 1); +} Property changes on: head/devel/android-tools-fastboot-devel/files/util_freebsd.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