Skip to content

Instantly share code, notes, and snippets.

@pagdot
Last active August 23, 2019 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pagdot/919e7a7d8300aa2c5a8b008952e7d6d2 to your computer and use it in GitHub Desktop.
Save pagdot/919e7a7d8300aa2c5a8b008952e7d6d2 to your computer and use it in GitHub Desktop.
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