summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2018-01-02 05:14:35 -0500
committerMike Frysinger <vapier@gentoo.org>2018-01-26 17:40:11 -0500
commit4ae818f00f38343a8dca9787c3ee7337b3654546 (patch)
tree915eab53675a4d739f6607636d07ab6ab91306ee /dev-util/android-tools/files
parentx11-apps/fusion-icon: remove last rited package (diff)
downloadgentoo-4ae818f00f38343a8dca9787c3ee7337b3654546.tar.gz
gentoo-4ae818f00f38343a8dca9787c3ee7337b3654546.tar.bz2
gentoo-4ae818f00f38343a8dca9787c3ee7337b3654546.zip
dev-util/android-tools: version bump to 8.1.0_p1 #632382
Closes: https://bugs.gentoo.org/632382
Diffstat (limited to 'dev-util/android-tools/files')
-rw-r--r--dev-util/android-tools/files/android-tools-8.1.0_p1-build.patch30
-rwxr-xr-xdev-util/android-tools/files/make-tarballs.sh128
2 files changed, 158 insertions, 0 deletions
diff --git a/dev-util/android-tools/files/android-tools-8.1.0_p1-build.patch b/dev-util/android-tools/files/android-tools-8.1.0_p1-build.patch
new file mode 100644
index 000000000000..f3d664ef70a3
--- /dev/null
+++ b/dev-util/android-tools/files/android-tools-8.1.0_p1-build.patch
@@ -0,0 +1,30 @@
+--- a/adb/sysdeps.h
++++ b/adb/sysdeps.h
+@@ -66,6 +66,11 @@
+ #endif
+ #endif
+
++#ifndef __clang__
++#define _Nonnull
++#define _Nullable
++#endif
++
+ #ifdef _WIN32
+
+ // Clang-only nullability specifiers
+--- a/libcutils/include/cutils/trace.h
++++ b/libcutils/include/cutils/trace.h
+@@ -18,7 +18,13 @@
+ #define _LIBS_CUTILS_TRACE_H
+
+ #include <inttypes.h>
++// https://gcc.gnu.org/PR60932
++#ifdef __cplusplus
++#include <atomic>
++using namespace std;
++#else
+ #include <stdatomic.h>
++#endif
+ #include <stdbool.h>
+ #include <stdint.h>
+ #include <stdio.h>
diff --git a/dev-util/android-tools/files/make-tarballs.sh b/dev-util/android-tools/files/make-tarballs.sh
new file mode 100755
index 000000000000..5a0a775c1290
--- /dev/null
+++ b/dev-util/android-tools/files/make-tarballs.sh
@@ -0,0 +1,128 @@
+#!/bin/bash
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# Create the various tarballs we need. GoB does not provide stable archives (unlike github),
+# and some repos are uselessly fat, so we have to create things by hand. Fun times.
+
+set -e
+
+die() {
+ echo "error: $*" >&2
+ exit 1
+}
+
+fetch_boringssl() {
+ local ver=$1 tag=$2
+ local content hash
+
+ echo "checking boringssl in ${tag}"
+ content=$(wget -nv "https://android.googlesource.com/platform/external/boringssl/+/${tag}/BORINGSSL_REVISION?format=TEXT" -O -)
+ hash=$(echo "${content}" | base64 -d)
+ echo "using boringssl ${hash}"
+
+ local tar="${DISTDIR}/boringssl-${hash}.tar.gz"
+ if [[ ! -e ${tar} ]] ; then
+ # We use github as it provides stable tarballs. GoB does not (includes timestamps).
+ # https://boringssl.googlesource.com/boringssl/+archive/${hash}.tar.gz
+ wget -c "https://github.com/google/boringssl/archive/${hash}.tar.gz" -O "${tar}"
+ fi
+
+ du -h "${tar}"
+}
+
+# The extras repo has ballooned to ~200MB, so we have to strip the large useless
+# files and random binaries.
+fetch_extras() {
+ local ver=$1 tag=$2
+ local tar="${DISTDIR}/android-tools-${ver}-extras.tar.xz"
+
+ if [[ ! -e ${tar} ]] ; then
+ local prune=(
+ ioshark
+ memory_replay
+ perfprofd
+ simpleperf
+ )
+ local dir="${tag}-extras"
+ rm -rf "${dir}"
+ mkdir "${dir}"
+ cd "${dir}"
+
+ wget "https://android.googlesource.com/platform/system/extras/+archive/${tag}.tar.gz" -O extras.tar.gz
+ tar xf extras.tar.gz
+ rm -rf "${prune[@]}" extras.tar.gz
+
+ cd ..
+ tar cf - "${dir}" | xz -9 > "${dir}.tar.xz"
+ rm -rf "${dir}"
+
+ mv "${dir}.tar.xz" "${tar}"
+ fi
+
+ du -h "${tar}"
+}
+
+# Since the GoB archive is unstable, we might as well rewrite it into xz to shrink.
+fetch_selinux() {
+ local ver=$1 tag=$2
+ local tar="${DISTDIR}/android-tools-${ver}-selinux.tar.xz"
+
+ if [[ ! -e ${tar} ]] ; then
+ wget "https://android.googlesource.com/platform/external/selinux/+archive/${tag}.tar.gz" -O - | zcat | xz > "${tar}"
+ fi
+
+ du -h "${tar}"
+}
+
+# Since the GoB archive is unstable, we might as well rewrite it into xz to shrink.
+fetch_f2fs() {
+ local ver=$1 tag=$2
+ local tar="${DISTDIR}/android-tools-${ver}-f2fs-tools.tar.xz"
+
+ if [[ ! -e ${tar} ]] ; then
+ wget "https://android.googlesource.com/platform/external/f2fs-tools/+archive/${tag}.tar.gz" -O - | zcat | xz > "${tar}"
+ fi
+
+ du -h "${tar}"
+}
+
+usage() {
+ local status=$1
+
+ [[ ${status} -eq 1 ]] && exec 1>&2
+
+ cat <<-EOF
+ Usage: $0 <android version>
+
+ To find the next available version, consult:
+ https://git.archlinux.org/svntogit/community.git/log/trunk?h=packages/android-tools
+
+ They have some helper scripts for building the files directly.
+
+ Example:
+ $0 android-8.1.0_r1
+ EOF
+
+ exit ${status}
+}
+
+main() {
+ [[ $# -ne 1 ]] && usage 1
+ [[ $1 == "-h" || $1 == "--help" ]] && usage 0
+
+ if [[ -z ${DISTDIR} ]] ; then
+ eval $(portageq -v envvar DISTDIR)
+ fi
+ if [[ -z ${DISTDIR} ]] ; then
+ die "Please set \$DISTDIR first"
+ fi
+
+ local ver="${1#android-}"
+ local tag="android-${ver}"
+ fetch_boringssl "${ver}" "${tag}"
+ fetch_extras "${ver}" "${tag}"
+ fetch_selinux "${ver}" "${tag}"
+ fetch_f2fs "${ver}" "${tag}"
+}
+main "$@"