Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Dec 2017 10:49:10 +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: r456975 - in head/devel: android-tools-adb android-tools-adb/files android-tools-fastboot android-tools-fastboot/files
Message-ID:  <201712221049.vBMAnAZX083972@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Fri Dec 22 10:49:09 2017
New Revision: 456975
URL: https://svnweb.freebsd.org/changeset/ports/456975

Log:
  devel/android-tools-adb: update SDK version as part of makesum
  
  - Extract platform SDK version out of platform/build repo
  - Move version logic out of sub-makefile
  - Simplify GH_REVISION

Modified:
  head/devel/android-tools-adb/Makefile   (contents, props changed)
  head/devel/android-tools-adb/files/Makefile   (contents, props changed)
  head/devel/android-tools-fastboot/Makefile   (contents, props changed)
  head/devel/android-tools-fastboot/files/Makefile   (contents, props changed)

Modified: head/devel/android-tools-adb/Makefile
==============================================================================
--- head/devel/android-tools-adb/Makefile	Fri Dec 22 10:48:57 2017	(r456974)
+++ head/devel/android-tools-adb/Makefile	Fri Dec 22 10:49:09 2017	(r456975)
@@ -15,13 +15,6 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	aosp-mirror
 GH_PROJECT=	platform_system_core
 
-# Emulate GH_COMMIT without causing desync
-.ifdef DISTVERSIONSUFFIX
-GH_REVISION=	${DISTVERSIONSUFFIX:S/-g//} # snapshot
-.else
-GH_REVISION=	86c2b588a369 # generated by: make update-revision
-.endif
-
 CONFLICTS_INSTALL?=	${PORTNAME}-devel-*
 
 USES=		compiler:c++14-lang pkgconfig ssl uidfix
@@ -31,13 +24,17 @@ 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}" REVISION="${GH_REVISION}"
+		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
@@ -89,13 +86,19 @@ post-install-BASH-on:
 		${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/=.*/=	$$(\
+	@${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; }' \
-		) # generated by: make $@/" \
+		)/" \
 		${.CURDIR}/Makefile
 
 .include <bsd.port.mk>

Modified: head/devel/android-tools-adb/files/Makefile
==============================================================================
--- head/devel/android-tools-adb/files/Makefile	Fri Dec 22 10:48:57 2017	(r456974)
+++ head/devel/android-tools-adb/files/Makefile	Fri Dec 22 10:49:09 2017	(r456975)
@@ -4,6 +4,7 @@ PROG_CXX=adb
 NO_MAN=
 BINDIR?=/usr/bin
 FILESDIR?=${DOCDIR}/${PROG}
+VERSION?= 0.0.0-0
 
 FILES= *.[Tt][Xx][Tt]
 
@@ -99,9 +100,7 @@ SRCS+= logger_write.c
 SRCS+= logprint.c
 SRCS+= stderr_write.c
 
-REVISION?= $$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
-
-CPPFLAGS+= -DADB_VERSION="\"27.0.0-0 ${REVISION}-android\""
+CPPFLAGS+= -DADB_VERSION="\"${VERSION}\""
 CPPFLAGS+= -DADB_HOST=1
 CPPFLAGS+= -DHAVE_FORKEXEC=1
 CPPFLAGS+= -DHAVE_SYMLINKS
@@ -139,7 +138,6 @@ TEST_LDADD+= $$(${GMOCK_CONFIG} --libs --ldflags)
 TEST_OBJS+= ${TEST_SRCS:R:S/$/.o/}
 CLEANFILES+= ${PROG}_test ${TEST_OBJS}
 
-GIT?= git
 GTEST_CONFIG?= gtest-config
 GMOCK_CONFIG?= gmock-config
 PKG_CONFIG?= pkg-config

Modified: head/devel/android-tools-fastboot/Makefile
==============================================================================
--- head/devel/android-tools-fastboot/Makefile	Fri Dec 22 10:48:57 2017	(r456974)
+++ head/devel/android-tools-fastboot/Makefile	Fri Dec 22 10:49:09 2017	(r456975)
@@ -25,13 +25,6 @@ GH_PROJECT=	platform_system_core platform_system_extra
 GH_TAGNAME?=	android-7.1.2_r17:libselinux
 GH_SUBDIR=	libselinux:libselinux
 
-# Emulate GH_COMMIT without causing desync
-.ifdef DISTVERSIONSUFFIX
-GH_REVISION=	${DISTVERSIONSUFFIX:S/-g//} # snapshot
-.else
-GH_REVISION=	86c2b588a369 # generated by: make update-revision
-.endif
-
 CONFLICTS_INSTALL?=	${PORTNAME}-devel-*
 
 USES=		compiler:c++11-lib pkgconfig uidfix
@@ -40,7 +33,8 @@ 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}" REVISION="${GH_REVISION}" \
+		FILESDIR="${DOCSDIR}" \
+		VERSION="${SDK_REVISION}-0 ${GH_REVISION}-android" \
 		MANDIR="${PREFIX}/man/man" \
 		LIBPCRE="${LOCALBASE}/lib/libpcre.a"
 PLIST_FILES=	bin/fastboot \
@@ -48,6 +42,10 @@ PLIST_FILES=	bin/fastboot \
 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
 
@@ -75,13 +73,19 @@ post-install-BASH-on:
 		${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/=.*/=	$$(\
+	@${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; }' \
-		) # generated by: make $@/" \
+		)/" \
 		${.CURDIR}/Makefile
 
 .include <bsd.port.mk>

Modified: head/devel/android-tools-fastboot/files/Makefile
==============================================================================
--- head/devel/android-tools-fastboot/files/Makefile	Fri Dec 22 10:48:57 2017	(r456974)
+++ head/devel/android-tools-fastboot/files/Makefile	Fri Dec 22 10:49:09 2017	(r456975)
@@ -3,6 +3,7 @@
 PROG_CXX=fastboot
 BINDIR?=/usr/bin
 FILESDIR?=${DOCDIR}/${PROG}
+VERSION?=0.0.0-0
 
 FILES=	*.md
 
@@ -98,9 +99,7 @@ SRCS+=	FileMap.cpp
 .PATH:	${.CURDIR}/../libziparchive
 SRCS+=	zip_archive.cc
 
-REVISION?=	$$(${GIT} rev-parse --short=12 HEAD 2>/dev/null || echo unknown)
-
-CPPFLAGS+=	-DFASTBOOT_VERSION="\"27.0.0-0 ${REVISION}-android\""
+CPPFLAGS+=	-DFASTBOOT_VERSION="\"${VERSION}\""
 CPPFLAGS+=	-Doff64_t=off_t
 CPPFLAGS+=	-Dftruncate64=ftruncate
 CPPFLAGS+=	-Dlseek64=lseek
@@ -133,7 +132,6 @@ LDADD+=	$$(${PKG_CONFIG} libusb-1.0 --libs 2>/dev/null
 LDADD+=	-lz \-lpthread
 DPADD+=	${LIBPCRE} ${LIBPTHREAD} ${LIBUSB} ${LIBZ}
 
-GIT?=		git
 PKG_CONFIG?=	pkg-config
 
 beforeinstall:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712221049.vBMAnAZX083972>