Date: Tue, 13 Oct 2015 18:03:26 +0000 (UTC) From: Jan Beich <jbeich@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r399205 - in head/devel: android-tools-adb android-tools-adb-devel/files android-tools-adb/files android-tools-fastboot android-tools-fastboot-devel/files android-tools-fastboot/files a... Message-ID: <201510131803.t9DI3QLS012463@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jbeich Date: Tue Oct 13 18:03:26 2015 New Revision: 399205 URL: https://svnweb.freebsd.org/changeset/ports/399205 Log: devel/android-tools-*: slightly improve standalone build - Try to derive {ADB,FASTBOOT}_REVISION from git(1) - Use pkg-config for libcrypto/libpcre/libusb (e.g. if they aren't in base) - Convert PORTDOCS into FILES (bsd.port.mk vs. bsd.prog.mk) - Partially convert to new testing framework - Put -lpthread last as enforced by base r274849 but prevent := assignment from mucking $ escaping in $() - |make clean| to clean files built by test target - Move up bsd.prog.mk in order to use ${PROG} and ${OBJS} defined in it Modified: head/devel/android-tools-adb-devel/files/Makefile (contents, props changed) head/devel/android-tools-adb/Makefile (contents, props changed) head/devel/android-tools-adb/files/Makefile (contents, props changed) head/devel/android-tools-fastboot-devel/files/Makefile (contents, props changed) head/devel/android-tools-fastboot/Makefile (contents, props changed) head/devel/android-tools-fastboot/files/Makefile (contents, props changed) head/devel/android-tools-simpleperf/Makefile (contents, props changed) head/devel/android-tools-simpleperf/files/Makefile (contents, props changed) Modified: head/devel/android-tools-adb-devel/files/Makefile ============================================================================== --- head/devel/android-tools-adb-devel/files/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-adb-devel/files/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -3,6 +3,9 @@ PROG_CXX=adb NO_MAN= BINDIR?=/usr/bin +FILESDIR?=${DOCDIR}/${PROG} + +FILES= *.[Tt][Xx][Tt] SRCS+= adb.cpp SRCS+= adb_auth.cpp @@ -33,7 +36,7 @@ TEST_SRCS+= transport_test.cpp .PATH: ${.CURDIR}/client SRCS+= main.cpp -.PATH: ${FILESDIR} +.PATH: ${EXTRADIR} SRCS+= get_my_path_freebsd.cpp SRCS+= usb_libusb.cpp @@ -65,6 +68,9 @@ 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 @@ -75,6 +81,8 @@ 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 @@ -87,13 +95,26 @@ TEST_CPPFLAGS+= $$(${GTEST_CONFIG} --cpp CPPFLAGS.${f}+= ${TEST_CPPFLAGS} .endfor -LDADD+= -lcrypto -lpthread -lusb -lz +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 -adb_test: ${SRCS:R:S/$/.o/:Nmain.o:Ncommandline.o} ${TEST_SRCS:R:S/$/.o/} - ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} +beforeinstall: + ${INSTALL} -d ${DESTDIR}${FILESDIR} .include <bsd.prog.mk> + +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} Modified: head/devel/android-tools-adb/Makefile ============================================================================== --- head/devel/android-tools-adb/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-adb/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -36,25 +36,28 @@ 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" FILESDIR="${FILESDIR}" +MAKE_ENV= BINDIR="${PREFIX}/bin" EXTRADIR="${FILESDIR}" \ + FILESDIR="${DOCSDIR}" REVISION="${GH_REVISION}" ALL_TARGET= all -CPPFLAGS+= -DADB_REVISION='\"${GH_REVISION}-android\"' +TEST_TARGET= test PLIST_FILES= bin/adb \ %%BASH%%etc/bash_completion.d/adb -PORTDOCS= *.txt *.TXT +PORTDOCS= * OPTIONS_DEFINE+=BASH DOCS TEST OPTIONS_SUB= yes BASH_VARS= LICENSE+=MIT LICENSE_COMB=multi # debian/copyright +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: - ${BUILD_WRKSRC}/adb_test +pre-install-TEST-on: do-test post-patch: # XXX C++ exception with description "regex_error" thrown in the test body. @@ -73,8 +76,6 @@ post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/${PLIST_FILES:M%%BASH%%*:C/%%.*%%//:H} ${INSTALL_DATA} ${_DISTDIR}/${DISTFILES:M*\:bashcomp:C/:.*//} \ ${STAGEDIR}${PREFIX}/${PLIST_FILES:M%%BASH%%*:C/%%.*%%//} - (cd ${INSTALL_WRKSRC} && ${COPYTREE_SHARE} \ - "${PORTDOCS}" ${STAGEDIR}${DOCSDIR}) update-revision: # https://developer.github.com/v3/repos/commits/#get-a-single-commit Modified: head/devel/android-tools-adb/files/Makefile ============================================================================== --- head/devel/android-tools-adb/files/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-adb/files/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -3,6 +3,9 @@ PROG_CXX=adb NO_MAN= BINDIR?=/usr/bin +FILESDIR?=${DOCDIR}/${PROG} + +FILES= *.[Tt][Xx][Tt] SRCS+= adb.cpp SRCS+= adb_auth.cpp @@ -26,7 +29,7 @@ TEST_SRCS+= adb_io_test.cpp TEST_SRCS+= adb_utils_test.cpp TEST_SRCS+= transport_test.cpp -.PATH: ${FILESDIR} +.PATH: ${EXTRADIR} SRCS+= get_my_path_freebsd.cpp SRCS+= usb_libusb.cpp @@ -58,6 +61,9 @@ 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 @@ -68,6 +74,8 @@ 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 @@ -80,13 +88,26 @@ TEST_CPPFLAGS+= $$(${GTEST_CONFIG} --cpp CPPFLAGS.${f}+= ${TEST_CPPFLAGS} .endfor -LDADD+= -lcrypto -lpthread -lusb -lz +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 -adb_test: ${SRCS:R:S/$/.o/:Nadb_main.o:Ncommandline.o} ${TEST_SRCS:R:S/$/.o/} - ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} +beforeinstall: + ${INSTALL} -d ${DESTDIR}${FILESDIR} .include <bsd.prog.mk> + +test: ${PROG}_test + @for f in ${.ALLSRC}; do ./$$f; done + +${PROG}_test: ${OBJS:Nadb_main.o:Ncommandline.o} ${TEST_OBJS} + ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} Modified: head/devel/android-tools-fastboot-devel/files/Makefile ============================================================================== --- head/devel/android-tools-fastboot-devel/files/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-fastboot-devel/files/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -2,6 +2,9 @@ PROG_CXX=fastboot BINDIR?=/usr/bin +FILESDIR?=${DOCDIR}/${PROG} + +FILES= *.[Tt][Xx][Tt] SRCS+= bootimg_utils.cpp SRCS+= engine.cpp @@ -10,7 +13,7 @@ SRCS+= fs.cpp SRCS+= protocol.cpp SRCS+= util.cpp -.PATH: ${FILESDIR} +.PATH: ${EXTRADIR} SRCS+= usb_freebsd.cpp SRCS+= util_freebsd.cpp @@ -68,6 +71,9 @@ SRCS+= FileMap.cpp .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 @@ -82,6 +88,8 @@ 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 @@ -90,7 +98,15 @@ CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif -LDADD+= -lpcre -lusb -lz +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 <bsd.prog.mk> Modified: head/devel/android-tools-fastboot/Makefile ============================================================================== --- head/devel/android-tools-fastboot/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-fastboot/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -35,18 +35,18 @@ GH_REVISION= bb0c180e6270 # generated by CONFLICTS_INSTALL?= ${PORTNAME}-devel-* -USES= compiler:c++11-lib localbase uidfix +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= FILESDIR="${FILESDIR}" BINDIR="${PREFIX}/bin" \ +MAKE_ENV= BINDIR="${PREFIX}/bin" EXTRADIR="${FILESDIR}" \ + FILESDIR="${DOCSDIR}" REVISION="${GH_REVISION}" \ MANDIR="${PREFIX}/man/man" \ LIBPCRE="${LOCALBASE}/lib/libpcre.a" -CPPFLAGS+= -DFASTBOOT_REVISION='\"${GH_REVISION}-android\"' PLIST_FILES= bin/fastboot \ %%BASH%%etc/bash_completion.d/fastboot \ man/man1/fastboot.1.gz -PORTDOCS= fastboot_protocol.txt +PORTDOCS= * SUB_FILES= pkg-message OPTIONS_DEFINE= BASH DOCS @@ -54,6 +54,8 @@ OPTIONS_SUB= yes BASH_VARS= LICENSE+=MIT # debian/copyright +DOCS_MAKE_ARGS_OFF= FILES="" FILESDIR="" + post-extract: @${CP} ${_DISTDIR}/${DISTFILES:M*\:manpage:C/:.*//} \ ${BUILD_WRKSRC}/${DISTFILES:M*\:manpage:C/\?.*//} @@ -65,8 +67,6 @@ post-install: ${MKDIR} ${STAGEDIR}${PREFIX}/${PLIST_FILES:M%%BASH%%*:C/%%.*%%//:H} ${INSTALL_DATA} ${_DISTDIR}/${DISTFILES:M*\:bashcomp:C/:.*//} \ ${STAGEDIR}${PREFIX}/${PLIST_FILES:M%%BASH%%*:C/%%.*%%//} - (cd ${INSTALL_WRKSRC} && ${COPYTREE_SHARE} \ - "${PORTDOCS}" ${STAGEDIR}${DOCSDIR}) update-revision: # https://developer.github.com/v3/repos/commits/#get-a-single-commit Modified: head/devel/android-tools-fastboot/files/Makefile ============================================================================== --- head/devel/android-tools-fastboot/files/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-fastboot/files/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -2,6 +2,9 @@ PROG_CXX=fastboot BINDIR?=/usr/bin +FILESDIR?=${DOCDIR}/${PROG} + +FILES= *.[Tt][Xx][Tt] SRCS+= bootimg_utils.cpp SRCS+= engine.c @@ -10,7 +13,7 @@ SRCS+= fs.c SRCS+= protocol.c SRCS+= util.c -.PATH: ${FILESDIR} +.PATH: ${EXTRADIR} SRCS+= usb_freebsd.cpp SRCS+= util_freebsd.cpp @@ -66,6 +69,9 @@ SRCS+= FileMap.cpp .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 @@ -80,6 +86,8 @@ 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 @@ -88,7 +96,15 @@ CFLAGS+= ${CPPFLAGS} CXXFLAGS+= ${CPPFLAGS} .endif -LDADD+= -lpcre -lusb -lz +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 <bsd.prog.mk> Modified: head/devel/android-tools-simpleperf/Makefile ============================================================================== --- head/devel/android-tools-simpleperf/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-simpleperf/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -23,9 +23,11 @@ GH_TAGNAME= ${DISTVERSIONFULL:C/-[0-9].* USES= compiler:c++11-lib uidfix BUILD_WRKSRC= ${WRKSRC}/simpleperf INSTALL_WRKSRC= ${BUILD_WRKSRC} +TEST_WRKSRC= ${BUILD_WRKSRC} MAKEFILE= ${FILESDIR}/Makefile MAKE_ENV= BINDIR="${PREFIX}/bin" LLVM_CONFIG="llvm-config${LLVM_VER}" ALL_TARGET= all +TEST_TARGET= test LDFLAGS+= -Wl,--as-needed # avoid overlinking (llvm deps) PLIST_FILES= bin/simpleperf @@ -33,8 +35,8 @@ LLVM_VER?= 36 # XXX Move to DEFAULT_VERS OPTIONS_DEFINE= TEST -TEST_BUILD_DEPENDS=googletest>=1.6.0:${PORTSDIR}/devel/googletest -TEST_ALL_TARGET=simpleperf_unit_test +TEST_BUILD_DEPENDS= googletest>=1.6.0:${PORTSDIR}/devel/googletest +TEST_ALL_TARGET= simpleperf_test post-extract: # Adjust paths relative to extras @@ -49,7 +51,6 @@ post-patch: ${WRKSRC}/base/logging_test.cpp; \ fi -pre-install-TEST-on: - ${BUILD_WRKSRC}/simpleperf_unit_test +pre-install-TEST-on: do-test .include <bsd.port.mk> Modified: head/devel/android-tools-simpleperf/files/Makefile ============================================================================== --- head/devel/android-tools-simpleperf/files/Makefile Tue Oct 13 18:02:59 2015 (r399204) +++ head/devel/android-tools-simpleperf/files/Makefile Tue Oct 13 18:03:26 2015 (r399205) @@ -75,10 +75,16 @@ CPPFLAGS.${f}+= ${TEST_CPPFLAGS} LDADD+= $$(${LLVM_CONFIG} --system-libs --libs --ldflags) TEST_LDADD+= $$(${GTEST_CONFIG} --libs --ldflags) +TEST_OBJS+= ${TEST_SRCS:R:S/$/.o/} +CLEANFILES+= ${PROG}_test ${TEST_OBJS} + LLVM_CONFIG?= llvm-config GTEST_CONFIG?= gtest-config -simpleperf_unit_test: ${SRCS:R:S/$/.o/:Nmain.o} ${TEST_SRCS:R:S/$/.o/} - ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD} - .include <bsd.prog.mk> + +test: ${PROG}_test + @for f in ${.ALLSRC}; do ./$$f; done + +${PROG}_test: ${OBJS:Nmain.o} ${TEST_OBJS} + ${CXX} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} -o $@ $> ${LDADD} ${TEST_LDADD}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510131803.t9DI3QLS012463>