PKGBUILDs/community/android-tools/PKGBUILD
2018-06-12 00:30:11 +00:00

68 lines
2.5 KiB
Bash

# $Id$
# Maintainer: Anatol Pomozov
# Contributor: 謝致邦 <Yeking@Red54.com>
# Contributor: Alucryd <alucryd at gmail dot com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - set -Wno-error=attributes to stop alignas(64) warnings as errors
pkgname=android-tools
pkgver=8.1.0_r33
pkgrel=1
pkgdesc='Android platform tools'
arch=(x86_64)
url='http://tools.android.com/'
license=(Apache MIT)
depends=(pcre2 libusb)
optdepends=('python: for mkbootimg script')
makedepends=(git clang gtest ruby cmake ninja go-pie)
_boringssl_commit=14308731e5446a73ac2258688a9688b524483cb6 # keep it in sync with android https://android.googlesource.com/platform/external/boringssl/+/$pkgver/BORINGSSL_REVISION
source=(git+https://android.googlesource.com/platform/system/core#tag=android-$pkgver
git+https://android.googlesource.com/platform/system/extras#tag=android-$pkgver
git+https://android.googlesource.com/platform/external/selinux#tag=android-$pkgver
git+https://android.googlesource.com/platform/external/f2fs-tools#tag=android-$pkgver
git+https://android.googlesource.com/platform/external/e2fsprogs#tag=android-$pkgver
git+https://boringssl.googlesource.com/boringssl#commit=$_boringssl_commit
generate_build.rb
fix_build_core.patch
fix_build_selinux.patch
fix_build_e2fsprogs.patch
bash_completion.fastboot)
# Bash completion file was taken from https://github.com/mbrubeck/android-completion
sha1sums=('SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'SKIP'
'89c0b62805506c729f76c1aa3c901c4ea2e3bfbe'
'e6ab688d0decfae64302d1402e1eee6678fc2549'
'ec473160d7445f97bccabd1c32ac0ae2f77900c1'
'e0d19de229f1a41a066ddb7a84f8e56e67bbc8bc'
'7004dbd0c193668827174880de6f8434de8ceaee')
prepare() {
PKGVER=$pkgver ./generate_build.rb > build.ninja
cd $srcdir/core
patch -p1 < ../fix_build_core.patch
cd $srcdir/selinux
patch -p1 < ../fix_build_selinux.patch
cd $srcdir/e2fsprogs
patch -p1 < ../fix_build_e2fsprogs.patch
sed -i 's/-fno-common/-fno-common -Wno-error=attributes/' $srcdir/boringssl/CMakeLists.txt
mkdir -p $srcdir/boringssl/build && cd $srcdir/boringssl/build && cmake -GNinja ..; ninja
}
build() {
ninja
}
package(){
install -m755 -d "$pkgdir"/usr/bin
install -m755 -t "$pkgdir"/usr/bin fastboot adb mke2fs.android e2fsdroid ext2simg core/mkbootimg/mkbootimg
install -Dm 644 bash_completion.fastboot "$pkgdir"/usr/share/bash-completion/completions/fastboot
}