void-packages/srcpkgs/android-tools/template

80 lines
2.9 KiB
Bash

# Template file for 'android-tools'
pkgname=android-tools
# NOTE: not all upstream updates has code changes for the parts
# of android used by android-tools. Check for diff with:
# curl -L http://git.io/vvC0Z | sh -s 5.0.2_r1 5.1.0_r1
version=9.0.0r30
revision=1
_distver=${version/r/_r}
create_wrksrc=yes
hostmakedepends="ruby cmake ninja perl go"
makedepends="gtest-devel zlib-devel libressl-devel libusb-devel pcre2-devel"
short_desc="Android platform tools (adb and fastboot)"
maintainer="John <johnz@posteo.net>"
license="Apache-2.0, ISC, GPL-2.0-only, MIT"
homepage="http://developer.android.com/tools/help/adb.html"
_baseurl=https://android.googlesource.com/platform
distfiles="
${_baseurl}/system/core/+archive/android-${_distver}.tar.gz>core.tar.gz
${_baseurl}/system/extras/+archive/android-${_distver}.tar.gz>extras.tar.gz
${_baseurl}/external/selinux/+archive/android-${_distver}.tar.gz>selinux.tar.gz
${_baseurl}/external/f2fs-tools/+archive/android-${_distver}.tar.gz>f2fs-tools.tar.gz
${_baseurl}/external/e2fsprogs/+archive/android-${_distver}.tar.gz>e2fsprogs.tar.gz
${_baseurl}/external/avb/+archive/android-${_distver}.tar.gz>avb.tar.gz
https://boringssl.googlesource.com/boringssl/+archive/3359.tar.gz>boringssl.tar.gz"
# Contents checksums because the tarballs change with every download
checksum="@8799c86b9bdcfe3bf0fd47df41ba5e6df7f85b9cc57ba0ad297d5187766b900c
@6569cc9bf9d303c099070cfb3d0687ab839d3203e082a865a236de616062f75c
@9f2b5e379eca4c56e2d422598831bfd7bdf2b7b3c3d011ce513c7603aa46b574
@f1efc86a1e78521f4754d184d682c1f6660c04f74496913f37cae9e2670db0e8
@e98509632e865e792dc4b344b0a1ada0662dda7571534fa7c5d1a8902dcfb0f4
@5c2fcb88154f9b6ffed8d24a069e4bad0a7aea1936be2ce18af972ad8762e09a
@9ec3dd8c7f6ec5f4d8b60e22d8dcba3dc4432763ec8a637c05ba24d3b58b2826"
nocross="error: requested alignment 64 is larger than 8 [-Werror=attributes]"
do_extract() {
local tarball p
for p in ${distfiles}; do
tarball=${p##*>}
mkdir -p ${wrksrc}/${tarball/.*}
tar -x --no-same-permissions --no-same-owner -f \
${XBPS_SRCDISTDIR}/${pkgname}-${version}/${tarball} \
-C ${wrksrc}/${tarball/.*}
done
}
pre_configure() {
PKGVER=${_distver} ${FILESDIR}/generate_build.rb > build.ninja
mkdir -p boringssl/build
cd boringssl/build
cmake -GNinja \
-DBUILD_SHARED_LIBS=FALSE \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
..
ninja
}
do_build() {
ninja
}
do_install() {
for i in adb fastboot mke2fs.android e2fsdroid ext2simg \
core/mkbootimg/mkbootimg avb/avbtool ;do
vbin $i
done
vlicense boringssl/LICENSE boringssl.LICENSE
vlicense boringssl/third_party/fiat/LICENSE fiat.LICENSE
vlicense boringssl/third_party/googletest/LICENSE gtest.LICENSE
vlicense boringssl/third_party/android-cmake/LICENSE android-cmake.LICENSE
vsv adb
}
# REMARKS:
# If there is any reason at all that fastboot may not be a position independent
# executable, please document it here.