summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-08-22 22:23:15 +0100
committerSam James <sam@gentoo.org>2023-08-22 22:23:15 +0100
commit6715861d4786d75621d8ed980121b37be523f5bb (patch)
tree30beffd5146c6a74e180ec2d4b2a06db41b36a15 /dev-util/android-tools
parentsys-cluster/kubeadm: use the version of go on the host (diff)
downloadgentoo-6715861d4786d75621d8ed980121b37be523f5bb.tar.gz
gentoo-6715861d4786d75621d8ed980121b37be523f5bb.tar.bz2
gentoo-6715861d4786d75621d8ed980121b37be523f5bb.zip
dev-util/android-tools: fix build w/ new protobuf
Closes: https://bugs.gentoo.org/912789 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/android-tools')
-rw-r--r--dev-util/android-tools/Manifest1
-rw-r--r--dev-util/android-tools/android-tools-34.0.1.ebuild95
-rw-r--r--dev-util/android-tools/files/android-tools-34.0.0-protobuf.patch41
3 files changed, 137 insertions, 0 deletions
diff --git a/dev-util/android-tools/Manifest b/dev-util/android-tools/Manifest
index 157b8efb06a8..d89c8e9b9823 100644
--- a/dev-util/android-tools/Manifest
+++ b/dev-util/android-tools/Manifest
@@ -1,3 +1,4 @@
DIST android-tools-31.0.3-no-gtest.patch 3152 BLAKE2B da71e3cba87b21ffcb144602a06d7e269faabd173233363b757cd2191c051f8d3281f591117d4551d7acc029d6e2d421f702f9f836dfe0dec6c676aa39a2d9fe SHA512 a28d2264bf40c420a279acf1f4c3b4588d96ce2d6e2d6d322abbde62d773804bef10dc33f13dd52c7de80ace6c58f91ae28f5d4e8e97dfae4d2a8473d8537423
DIST android-tools-33.0.3.tar.xz 25300756 BLAKE2B 4254f0ab8657966cf56e2a7c3e9a3d889dfa9f26e61d8b46480bb74c5a8be33494f450827e3b2db4087006b3160892e6a846ef33719870cbbd032647cfc3ce78 SHA512 78c8141f5f13f1c0e5da474e1d79760a612e911519af4e9f21c0e5005f2ce99f3aeacf16f3fcdfe1250fc795a88190fa243592e1066a2156e1fd8d2b9c3d7f71
DIST android-tools-34.0.0.tar.xz 37882448 BLAKE2B 19698c08dd650abba61e5cad9f7474ee3993f5b1fd2f173221560e5ccfc1677093758c325833993a68058c1427e132986b009f9e69a1eae9c4447053920b6feb SHA512 2d24cd95df7da1efa902fab3c848e2ebf09d3335fac61e667b19e1892e95c30a850413d354ceda72a402014623bbda4154cc33fb93a62c31fece8857efbbd596
+DIST android-tools-34.0.1.tar.xz 37904276 BLAKE2B 6b4d31dadbc646d52c8abd65602264dc16127eb36286d23be447539b0d9b46154592a04af37b3e7617933e62529e953b958db8cb77622e72cfe5ab176f822437 SHA512 413ddcca9a461d1c0a12d7fd19b9d8955619b281e1153318ed961bec17ad92bec103671abc8d63525bc83669376f37c11c887cc4cada85719120dff6c3951274
diff --git a/dev-util/android-tools/android-tools-34.0.1.ebuild b/dev-util/android-tools/android-tools-34.0.1.ebuild
new file mode 100644
index 000000000000..d8c292897706
--- /dev/null
+++ b/dev-util/android-tools/android-tools-34.0.1.ebuild
@@ -0,0 +1,95 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+
+inherit cmake python-r1
+
+DESCRIPTION="Android platform tools (adb, fastboot, and mkbootimg)"
+HOMEPAGE="https://github.com/nmeum/android-tools/ https://developer.android.com/"
+
+MY_PV="${PV//_/}"
+SRC_URI="https://github.com/nmeum/android-tools/releases/download/${MY_PV}/${PN}-${MY_PV}.tar.xz
+ https://dev.gentoo.org/~zmedico/dist/${PN}-31.0.3-no-gtest.patch
+"
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+# The entire source code is Apache-2.0, except for fastboot which is BSD-2.
+LICENSE="Apache-2.0 BSD-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~arm64 x86"
+IUSE="python udev"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+# dev-libs/libpcre only required for e2fsdroid
+DEPEND="
+ app-arch/brotli:=
+ app-arch/lz4:=
+ app-arch/zstd:=
+ dev-libs/libpcre2:=
+ >=dev-libs/protobuf-3.0.0:=
+ sys-libs/zlib:=
+ virtual/libusb:1=
+"
+RDEPEND="${DEPEND}
+ udev? ( dev-util/android-udev-rules )
+ python? ( ${PYTHON_DEPS} )
+"
+BDEPEND="
+ dev-lang/go
+ dev-lang/perl
+"
+
+DOCS=()
+
+src_prepare() {
+ eapply "${DISTDIR}/${PN}-31.0.3-no-gtest.patch"
+ eapply "${FILESDIR}/${PN}-34.0.0-protobuf.patch"
+
+ cd "${S}/vendor/core" || die
+ eapply "${S}/patches/core/0011-Remove-the-useless-dependency-on-gtest.patch"
+
+ cd "${S}/vendor/libziparchive" || die
+ eapply "${S}/patches/libziparchive/0004-Remove-the-useless-dependency-on-gtest.patch"
+
+ cd "${S}" || die
+ rm -r patches || die
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ # Statically link the bundled boringssl
+ -DBUILD_SHARED_LIBS=OFF
+ )
+ cmake_src_configure
+}
+
+src_compile() {
+ export GOCACHE="${T}/go-build"
+ export GOFLAGS="-mod=vendor"
+ cmake_src_compile
+}
+
+src_install() {
+ cmake_src_install
+ rm "${ED}/usr/bin/mkbootimg" || die
+ rm "${ED}/usr/bin/unpack_bootimg" || die
+ rm "${ED}/usr/bin/repack_bootimg" || die
+ rm "${ED}/usr/bin/mkdtboimg" || die
+ rm "${ED}/usr/bin/avbtool" || die
+
+ if use python; then
+ python_foreach_impl python_newexe vendor/mkbootimg/mkbootimg.py mkbootimg
+ python_foreach_impl python_newexe vendor/mkbootimg/unpack_bootimg.py unpack_bootimg
+ python_foreach_impl python_newexe vendor/mkbootimg/repack_bootimg.py repack_bootimg
+ python_foreach_impl python_newexe vendor/libufdt/utils/src/mkdtboimg.py mkdtboimg
+ python_foreach_impl python_newexe vendor/avb/avbtool.py avbtool
+ fi
+ docinto adb
+ dodoc vendor/adb/*.{txt,TXT}
+ docinto fastboot
+ dodoc vendor/core/fastboot/README.md
+}
diff --git a/dev-util/android-tools/files/android-tools-34.0.0-protobuf.patch b/dev-util/android-tools/files/android-tools-34.0.0-protobuf.patch
new file mode 100644
index 000000000000..d7aa309410a4
--- /dev/null
+++ b/dev-util/android-tools/files/android-tools-34.0.0-protobuf.patch
@@ -0,0 +1,41 @@
+https://bugs.gentoo.org/912789
+https://github.com/nmeum/android-tools/commit/c5eae90a06072c6982e483f8154e490b47e620f7
+https://github.com/nmeum/android-tools/pull/120#issuecomment-1621066529
+
+--- a/vendor/CMakeLists.txt
++++ b/vendor/CMakeLists.txt
+@@ -73,6 +73,8 @@
+ pkg_check_modules(libzstd REQUIRED IMPORTED_TARGET libzstd)
+
++find_package(Protobuf CONFIG)
+ find_package(Protobuf REQUIRED)
++set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+
+--- a/vendor/extras/libjsonpb/parse/jsonpb.cpp
++++ b/vendor/extras/libjsonpb/parse/jsonpb.cpp
+@@ -50,8 +50,10 @@
+ if (!status.ok()) {
+ #if GOOGLE_PROTOBUF_VERSION < 3016000
+ return MakeError<std::string>(status.error_message().as_string());
+-#else
++#elif GOOGLE_PROTOBUF_VERSION < 4022000
+ return MakeError<std::string>(status.message().as_string());
++#else
++ return MakeError<std::string>(std::string(status.message()));
+ #endif
+ }
+ return ErrorOr<std::string>(std::move(json));
+@@ -67,8 +69,10 @@
+ if (!status.ok()) {
+ #if GOOGLE_PROTOBUF_VERSION < 3016000
+ return MakeError<std::monostate>(status.error_message().as_string());
+-#else
++#elif GOOGLE_PROTOBUF_VERSION < 4022000
+ return MakeError<std::monostate>(status.message().as_string());
++#else
++ return MakeError<std::monostate>(std::string(status.message()));
+ #endif
+ }
+ if (!message->ParseFromString(binary)) {