From owner-svn-ports-all@freebsd.org Sat Jul 18 16:51:12 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 501519A49C5; Sat, 18 Jul 2015 16:51:12 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34E3815F5; Sat, 18 Jul 2015 16:51:12 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.14.9/8.14.9) with ESMTP id t6IGpCCX071301; Sat, 18 Jul 2015 16:51:12 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.14.9/8.14.9/Submit) id t6IGp9ep071083; Sat, 18 Jul 2015 16:51:09 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201507181651.t6IGp9ep071083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Sat, 18 Jul 2015 16:51:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r392432 - in head/devel: android-tools-fastboot android-tools-fastboot-devel android-tools-fastboot-devel/files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Jul 2015 16:51:12 -0000 Author: jbeich Date: Sat Jul 18 16:51:08 2015 New Revision: 392432 URL: https://svnweb.freebsd.org/changeset/ports/392432 Log: devel/android-tools-fastboot-devel: move FreeBSD code to C++ Copy files in order to fix the following errors. files/usb_freebsd.cpp:132:4: error: assigning to 'usb_handle *' from incompatible type 'void *' h = malloc(sizeof(*h)); ^ ~~~~~~~~~~~~~~~~~~ files/usb_freebsd.cpp:162:6: error: no matching function for call to 'libusb_bulk_transfer' if (libusb_bulk_transfer(h->handle, h->ep_out, (void *)(long)_data, len, &actlen, 0) < 0) ^~~~~~~~~~~~~~~~~~~~ /usr/include/libusb.h:478:5: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'uint8_t *' (aka 'unsigned char *') int libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, uint32_t timeout); ^ files/usb_freebsd.cpp:172:6: error: no matching function for call to 'libusb_bulk_transfer' if (libusb_bulk_transfer(h->handle, h->ep_in, _data, len, &actlen, 0) < 0) ^~~~~~~~~~~~~~~~~~~~ /usr/include/libusb.h:478:5: note: candidate function not viable: cannot convert argument of incomplete type 'void *' to 'uint8_t *' (aka 'unsigned char *') int libusb_bulk_transfer(libusb_device_handle * devh, uint8_t endpoint, uint8_t *data, int length, int *transferred, uint32_t timeout); ^ 3 errors generated. fastboot.o: In function `find_item(char const*, char const*)': fastboot.cpp:(.text+0xea): undefined reference to `get_my_path' Added: head/devel/android-tools-fastboot-devel/files/pkg-message.in - copied unchanged from r392431, head/devel/android-tools-fastboot/files/pkg-message.in head/devel/android-tools-fastboot-devel/files/usb_freebsd.cpp - copied, changed from r392431, head/devel/android-tools-fastboot/files/usb_freebsd.c head/devel/android-tools-fastboot-devel/files/util_freebsd.cpp - copied, changed from r392431, head/devel/android-tools-fastboot/files/util_freebsd.c Modified: head/devel/android-tools-fastboot-devel/Makefile head/devel/android-tools-fastboot-devel/files/Makefile head/devel/android-tools-fastboot/Makefile Modified: head/devel/android-tools-fastboot-devel/Makefile ============================================================================== --- head/devel/android-tools-fastboot-devel/Makefile Sat Jul 18 16:42:27 2015 (r392431) +++ head/devel/android-tools-fastboot-devel/Makefile Sat Jul 18 16:51:08 2015 (r392432) @@ -2,7 +2,7 @@ DISTVERSION= m-preview-190 DISTVERSIONSUFFIX= -g683790a -PORTREVISION= 0 +PORTREVISION= 1 PKGNAMESUFFIX= -devel GH_TAGNAME= m-preview-100-gdece0f9:extras \ @@ -12,7 +12,7 @@ CONFLICTS_INSTALL= ${PORTNAME}-[0-9]* MASTERDIR= ${.CURDIR}/../android-tools-fastboot DISTINFO_FILE= ${.CURDIR}/distinfo -MAKEFILE= ${.CURDIR}/files/Makefile +FILESDIR= ${.CURDIR}/files EXTRA_PATCHES+= ${.CURDIR}/files/patch-* USES= compiler:c++11-lib Modified: head/devel/android-tools-fastboot-devel/files/Makefile ============================================================================== --- head/devel/android-tools-fastboot-devel/files/Makefile Sat Jul 18 16:42:27 2015 (r392431) +++ head/devel/android-tools-fastboot-devel/files/Makefile Sat Jul 18 16:51:08 2015 (r392432) @@ -11,8 +11,8 @@ SRCS+= protocol.cpp SRCS+= util.cpp .PATH: ${FILESDIR} -SRCS+= usb_freebsd.c -SRCS+= util_freebsd.c +SRCS+= usb_freebsd.cpp +SRCS+= util_freebsd.cpp # required by libziparchive .PATH: ${.CURDIR}/../base Copied: head/devel/android-tools-fastboot-devel/files/pkg-message.in (from r392431, head/devel/android-tools-fastboot/files/pkg-message.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/android-tools-fastboot-devel/files/pkg-message.in Sat Jul 18 16:51:08 2015 (r392432, copy of r392431, head/devel/android-tools-fastboot/files/pkg-message.in) @@ -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 Copied and modified: head/devel/android-tools-fastboot-devel/files/usb_freebsd.cpp (from r392431, head/devel/android-tools-fastboot/files/usb_freebsd.c) ============================================================================== --- head/devel/android-tools-fastboot/files/usb_freebsd.c Sat Jul 18 16:42:27 2015 (r392431, copy source) +++ head/devel/android-tools-fastboot-devel/files/usb_freebsd.cpp Sat Jul 18 16:51:08 2015 (r392432) @@ -41,11 +41,11 @@ struct usb_handle { }; static int -probe(struct usb_handle *h, ifc_match_func callback) +probe(usb_handle *h, ifc_match_func callback) { - struct usb_ifc_info info; - struct libusb_device_descriptor ddesc; - struct libusb_config_descriptor *pcfg; + usb_ifc_info info; + libusb_device_descriptor ddesc; + libusb_config_descriptor *pcfg; int i, j; if (libusb_open(h->dev, &h->handle) < 0) @@ -129,7 +129,7 @@ enumerate(ifc_match_func callback) ssize_t ndev; ssize_t x; - h = malloc(sizeof(*h)); + h = reinterpret_cast(malloc(sizeof(*h))); if (h == NULL) return (h); @@ -159,7 +159,8 @@ usb_write(usb_handle * h, const void *_d { int actlen; - if (libusb_bulk_transfer(h->handle, h->ep_out, (void *)(long)_data, len, &actlen, 0) < 0) + if (libusb_bulk_transfer(h->handle, h->ep_out, + (unsigned char *)_data, len, &actlen, 0) < 0) return (-1); return (actlen); } @@ -169,7 +170,8 @@ usb_read(usb_handle * h, void *_data, in { int actlen; - if (libusb_bulk_transfer(h->handle, h->ep_in, _data, len, &actlen, 0) < 0) + if (libusb_bulk_transfer(h->handle, h->ep_in, + (unsigned char *)_data, len, &actlen, 0) < 0) return (-1); return (actlen); } Copied and modified: head/devel/android-tools-fastboot-devel/files/util_freebsd.cpp (from r392431, head/devel/android-tools-fastboot/files/util_freebsd.c) ============================================================================== --- head/devel/android-tools-fastboot/files/util_freebsd.c Sat Jul 18 16:42:27 2015 (r392431, copy source) +++ head/devel/android-tools-fastboot-devel/files/util_freebsd.cpp Sat Jul 18 16:51:08 2015 (r392432) @@ -25,6 +25,8 @@ * SUCH DAMAGE. */ +#include "fastboot.h" + #include #include Modified: head/devel/android-tools-fastboot/Makefile ============================================================================== --- head/devel/android-tools-fastboot/Makefile Sat Jul 18 16:42:27 2015 (r392431) +++ head/devel/android-tools-fastboot/Makefile Sat Jul 18 16:51:08 2015 (r392432) @@ -31,7 +31,7 @@ CONFLICTS_INSTALL?= ${PORTNAME}-devel-* USES+= uidfix BUILD_WRKSRC= ${WRKSRC}/fastboot INSTALL_WRKSRC= ${BUILD_WRKSRC} -MAKEFILE= ${.CURDIR}/files/Makefile # XXX ?= when bmake-only +MAKEFILE= ${FILESDIR}/Makefile MAKE_ENV= FILESDIR="${FILESDIR}" BINDIR="${PREFIX}/bin" \ MANDIR="${PREFIX}/man/man" \ LIBPCRE="${LOCALBASE}/lib/libpcre.a"