Skip to content

Instantly share code, notes, and snippets.

@pagdot

pagdot/build_adb.sh

Last active Aug 23, 2019
Embed
What would you like to do?
Script to build adb
pkgver=29.0.2
tag=platform-tools-$pkgver
export CC = gcc
export CXX = g++
export CFLAGS =
export CXXFLAGS =
export LDFLAGS =
export PLATFORM_TOOLS_VERSION =
#get arch files
git clone -b packages/android-tools --single-branch https://git.archlinux.org/svntogit/community.git
sed '/^link("adb/q' community/trunk/generate_build.rb > gen_adb_build.rb
chmod +x gen_adb_build.rb
#get sources
_boringssl_commit=`curl https://android.googlesource.com/platform/external/boringssl/+/refs/tags/$tag/BORINGSSL_REVISION?format=TEXT | base64 -d`
git clone -b $tag --single-branch https://android.googlesource.com/platform/system/core
git clone -b $tag --single-branch https://android.googlesource.com/platform/system/extras
git clone https://boringssl.googlesource.com/boringssl
PLATFORM_TOOLS_VERSION="$pkgver" LDFLAGS='-Wl,-z,relro,-z,now' ./gen_adb_build.rb > build.ninja
cd core
patch -p1 < ../community/trunk/fix_build_core.patch
cd ../boringssl
git reset --hard $_boringssl_commit
mkdir -p build && cd build && cmake -GNinja ..; ninja crypto/libcrypto.a
cd ../..
echo $PWD
ninja
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment