mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-20 04:02:27 +00:00
a34da07c60
- Extract platform SDK version out of platform/build repo - Move version logic out of sub-makefile - Simplify GH_REVISION
110 lines
3.3 KiB
Makefile
110 lines
3.3 KiB
Makefile
# $FreeBSD$
|
|
|
|
PORTNAME= android-tools-adb
|
|
DISTVERSIONPREFIX= android-
|
|
DISTVERSION?= 8.1.0_r2
|
|
PORTREVISION?= 1
|
|
CATEGORIES= devel comms
|
|
|
|
MAINTAINER= jbeich@FreeBSD.org
|
|
COMMENT= Android debug bridge command line tool
|
|
|
|
LICENSE= APACHE20
|
|
|
|
USE_GITHUB= yes
|
|
GH_ACCOUNT= aosp-mirror
|
|
GH_PROJECT= platform_system_core
|
|
|
|
CONFLICTS_INSTALL?= ${PORTNAME}-devel-*
|
|
|
|
USES= compiler:c++14-lang pkgconfig ssl uidfix
|
|
BUILD_WRKSRC= ${WRKSRC}/adb
|
|
INSTALL_WRKSRC= ${BUILD_WRKSRC}
|
|
TEST_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"
|
|
ALL_TARGET= all
|
|
TEST_TARGET= test
|
|
PLIST_FILES= bin/adb
|
|
PORTDOCS= *
|
|
|
|
# Generated by "make update-revision" for "adb --version"
|
|
SDK_REVISION?= 27.0.0
|
|
GH_REVISION= ${DISTVERSIONSUFFIX:U86c2b588a369:S/-g//}
|
|
|
|
OPTIONS_DEFINE+=MDNSRESPONDER BASH DOCS TEST TEST_PYTHON
|
|
OPTIONS_DEFAULT=MDNSRESPONDER
|
|
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/adb
|
|
BASH_VARS= LICENSE+=MIT LICENSE_COMB=multi
|
|
|
|
DOCS_MAKE_ARGS_OFF= FILES="" FILESDIR=""
|
|
|
|
MDNSRESPONDER_LIB_DEPENDS= libdns_sd.so:net/mDNSResponder
|
|
MDNSRESPONDER_USES= localbase:ldflags
|
|
MDNSRESPONDER_LDFLAGS= -ldns_sd
|
|
MDNSRESPONDER_MAKE_ENV_OFF= MDNSEXT=_unsupported
|
|
|
|
TEST_BUILD_DEPENDS+= googlemock>=1.6.0:devel/googlemock \
|
|
googletest>=1.6.0:devel/googletest
|
|
TEST_ALL_TARGET= adb_test
|
|
|
|
TEST_PYTHON_DESC= ${TEST_DESC:S/tests/python &/}
|
|
TEST_PYTHON_GH_PROJECT= platform_development:development
|
|
TEST_PYTHON_BUILD_DEPENDS=${PYTHON_PKGNAMEPREFIX}mock>0:devel/py-mock@${PY_FLAVOR}
|
|
TEST_PYTHON_USES= python:2.7,build
|
|
|
|
post-patch:
|
|
# 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
|
|
|
|
pre-install-TEST-on: do-test
|
|
|
|
pre-install-TEST_PYTHON-on:
|
|
# XXX python tests may leave behind running adb server
|
|
${SETENV} PATH=${BUILD_WRKSRC}:${PATH} \
|
|
PYTHONPATH=${WRKSRC_development}/python-packages \
|
|
${PYTHON_CMD} -m unittest discover -vs ${BUILD_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
|