diff options
author | Jan Beich <jbeich@FreeBSD.org> | 2015-10-13 18:03:26 +0000 |
---|---|---|
committer | Jan Beich <jbeich@FreeBSD.org> | 2015-10-13 18:03:26 +0000 |
commit | 6a1cb428a494fec8d0d52f9c2840ed053706b9e9 (patch) | |
tree | e82fa887e8e06daa0355115a2b317898558e2871 /devel/android-tools-fastboot | |
parent | devel/android-tools-adb: explicitly include stdint.h for intptr_t (diff) |
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
Notes
Notes:
svn path=/head/; revision=399205
Diffstat (limited to 'devel/android-tools-fastboot')
-rw-r--r-- | devel/android-tools-fastboot/Makefile | 12 | ||||
-rw-r--r-- | devel/android-tools-fastboot/files/Makefile | 20 |
2 files changed, 24 insertions, 8 deletions
diff --git a/devel/android-tools-fastboot/Makefile b/devel/android-tools-fastboot/Makefile index 9a6f978ebb1f..aecacf8647cf 100644 --- a/devel/android-tools-fastboot/Makefile +++ b/devel/android-tools-fastboot/Makefile @@ -35,18 +35,18 @@ GH_REVISION= bb0c180e6270 # generated by: make update-revision 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 diff --git a/devel/android-tools-fastboot/files/Makefile b/devel/android-tools-fastboot/files/Makefile index 8426d4af708d..afca2f944a14 100644 --- a/devel/android-tools-fastboot/files/Makefile +++ b/devel/android-tools-fastboot/files/Makefile @@ -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> |