summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 05b3ae1a7b1e569e9cb2ec82539d1decae5e4455 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: Kevin MacMartin <prurigro at gmail dot com>

# You may want to change this value if your target device is not API 19
_TARGET_API=19

_pkgname=fb-adb
pkgname=$_pkgname-git
pkgver=20170602.r363.b931596
pkgrel=6
pkgdesc='A better shell to use in place of adb when connecting to Android devices'
url='https://github.com/facebook/fb-adb'
license=('GPL3')
arch=('x86_64')
depends=('android-tools')
makedepends=('git' 'vim' 'android-sdk-build-tools' "android-platform-$_TARGET_API" 'android-ndk' 'python')
options=('!strip' '!buildflags')
source=("git+$url.git"
        'no-file-offset-bits-64.patch')
sha512sums=('SKIP'
            '17379e48d9a881c2af33d01fa4df5c4969ebe89ffa442809c6215b517a3943b61d2a1b3e7675470282e41e758d464fa8e420b01c6060e3be57704e7469340b87')

pkgver() {
  cd $_pkgname
  printf "%s.r%s.%s" "$(git show -s --format=%ci master | sed 's/\ .*//g;s/-//g')" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd $_pkgname

  patch -Np1 -i ../no-file-offset-bits-64.patch

  autoreconf -ifv
}

build() {
  # configure
  cd $_pkgname
  ./autogen.sh

  # In case that this package is built immediately after installing android-sdk...
  [ -z "$ANDROID_HOME" ] && export ANDROID_HOME=/opt/android-sdk
  # And NDK...
  [ -z "$ANDROID_NDK" ] && export ANDROID_NDK=/opt/android-ndk

  # build
  install -d build
  cd build
  ../configure \
      --enable-checking=yes \
      --with-android-sdk="$ANDROID_HOME" \
      --with-android-platform=android-$_TARGET_API
  make
}

package() {
  install -Dm755 $_pkgname/build/$_pkgname "$pkgdir/usr/bin/$_pkgname"
}