summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9b94764baac2a5c0015a799383d1d80bd45a5d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Maintainer: Franck Lucien Duriez <franck.lucien.duriez@gmail.com>

pkgname=fastboot-arm64
pkgver=5.1.1
pkgrel=1
pkgdesc='fastboot for Raspberry 3'
arch=('aarch64')
url='http://developer.android.com/sdk/index.html'
license=('custom')
depends=('zlib' 'ncurses' 'repo')
provides=('fastboot')
conflicts=('fastboot')
source=("license.txt"
	"Makefile")
sha1sums=('SKIP'
	  'SKIP')

_branch='android-5.1.1_r9'

build() {
  mkdir -p system external
  test -d system/core || \
    git clone -b "$_branch" https://android.googlesource.com/platform/system/core system/core
  test -d external/zlib || \
    git clone -b "$_branch" https://android.googlesource.com/platform/external/zlib external/zlib
  test -d system/extras || \
    git clone -b "$_branch" https://android.googlesource.com/platform/system/extras system/extras
  test -d external/libselinux || \
    git clone -b "$_branch" https://android.googlesource.com/platform/external/libselinux external/libselinux
  test -d external/pcre || \
    git clone -b "$_branch" https://android.googlesource.com/platform/external/pcre external/pcre
  grep --quiet '#include <sys/sysmacros.h>' 'system/core/fastboot/usb_linux.c' || \
    sed -i '1s|^|#include <sys/sysmacros.h>\n|' 'system/core/fastboot/usb_linux.c'
  sed -i 's|extern char \*sys_errlist|extern char const *const sys_errlist|' 'external/pcre/dist/pcregrep.c'
  cp Makefile system/core/fastboot/Makefile
  cd system/core/fastboot
  make
}

package() {
  install -Dm644 "${srcdir}/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
  install -d "${pkgdir}/etc/profile.d"
  install -Dm755 "${srcdir}/system/core/fastboot/fastboot" "${pkgdir}/usr/bin/fastboot"
}