- Extract platform SDK version out of platform/build repo - Move version logic out of sub-makefile - Simplify GH_REVISION
96 lines
3 KiB
Makefile
96 lines
3 KiB
Makefile
# $FreeBSD$
|
|
|
|
PORTNAME= android-tools-fastboot
|
|
DISTVERSIONPREFIX= android-
|
|
DISTVERSION?= 8.1.0_r2
|
|
PORTREVISION?= 1
|
|
CATEGORIES= devel sysutils
|
|
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= aosp-mirror jbeich:extras,libselinux
|
|
GH_PROJECT= platform_system_core platform_system_extras:extras \
|
|
platform_external_libselinux:libselinux
|
|
GH_TAGNAME?= android-7.1.2_r17:libselinux
|
|
GH_SUBDIR= libselinux:libselinux
|
|
|
|
CONFLICTS_INSTALL?= ${PORTNAME}-devel-*
|
|
|
|
USES= compiler:c++11-lib pkgconfig uidfix
|
|
BUILD_WRKSRC= ${WRKSRC}/fastboot
|
|
INSTALL_WRKSRC= ${BUILD_WRKSRC}
|
|
CPPFLAGS+= -D_GLIBCXX_USE_C99 # XXX ports/193528
|
|
MAKEFILE?= ${.CURDIR}/files/Makefile
|
|
MAKE_ENV= BINDIR="${PREFIX}/bin" EXTRADIR="${FILESDIR}" \
|
|
FILESDIR="${DOCSDIR}" \
|
|
VERSION="${SDK_REVISION}-0 ${GH_REVISION}-android" \
|
|
MANDIR="${PREFIX}/man/man" \
|
|
LIBPCRE="${LOCALBASE}/lib/libpcre.a"
|
|
PLIST_FILES= bin/fastboot \
|
|
man/man1/fastboot.1.gz
|
|
PORTDOCS= *
|
|
SUB_FILES= pkg-message
|
|
|
|
# Generated by "make update-revision" for "fastboot --version"
|
|
SDK_REVISION?= 27.0.0
|
|
GH_REVISION= ${DISTVERSIONSUFFIX:U86c2b588a369:S/-g//}
|
|
|
|
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= 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})
|
|
|
|
post-install-BASH-on:
|
|
${MKDIR} ${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES:H}
|
|
${INSTALL_DATA} ${WRKSRC_bashcomp}/android \
|
|
${STAGEDIR}${PREFIX}/${BASH_PLIST_FILES}
|
|
|
|
update-revision:
|
|
@${REINPLACE_CMD} -i '' -e "/^SDK_REVISION?=/s/=.*/= $$(\
|
|
${FETCH_CMD} -qo- \
|
|
https://github.com/${GH_ACCOUNT}/platform_build/raw/${GH_TAGNAME}/core/version_defaults.mk | \
|
|
${SED} -n 's/^[[:space:]]*PLATFORM_SDK_VERSION := //p' \
|
|
).0.0/" \
|
|
${.CURDIR}/Makefile
|
|
# 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/:U[^}:]*/:U$$(\
|
|
${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; }' \
|
|
)/" \
|
|
${.CURDIR}/Makefile
|
|
|
|
.include <bsd.port.mk>
|
|
|
|
# XXX Work around !target(makesum)
|
|
.ifndef DISTVERSIONSUFFIX
|
|
makesum: update-revision
|
|
.endif
|