git » android-tools.git » commit 9ebd6d9

Fix build with GCC 12

author Evangelos Foutras
2022-06-11 16:41:07 UTC
committer Evangelos Foutras
2022-06-11 16:41:07 UTC
parent bfdde6276524100ef8fe31b71a205f390e1d8789

Fix build with GCC 12

PKGBUILD +8 -2
gcc12.patch +11 -0

diff --git a/PKGBUILD b/PKGBUILD
index 932a86e..8a3b587 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -12,8 +12,14 @@ url='http://tools.android.com/'
 license=(Apache MIT)
 depends=(libusb protobuf brotli zstd android-udev)
 makedepends=(pcre2 gtest cmake go ninja git)
-source=(https://github.com/nmeum/android-tools/releases/download/$_tag/android-tools-$_tag.tar.xz)
-sha256sums=('0ef69f919d58a2bdff2083d2e83a9ef38df079ec82651b2544e9e48086df5ab8')
+source=(https://github.com/nmeum/android-tools/releases/download/$_tag/android-tools-$_tag.tar.xz        gcc12.patch)
+sha256sums=('0ef69f919d58a2bdff2083d2e83a9ef38df079ec82651b2544e9e48086df5ab8'
+            'df27d803da03d0a2656c4feb3cf471a076c459f45004ec20ec86a5cfb36be862')
+
+prepare() {
+  cd android-tools-$_tag
+  patch -Np1 -i ../gcc12.patch
+}
 
 build() {
   cd android-tools-$_tag
diff --git a/gcc12.patch b/gcc12.patch
new file mode 100644
index 0000000..66fe43e
--- /dev/null
+++ b/gcc12.patch
@@ -0,0 +1,11 @@
+diff -upr android-tools-31.0.3p1.orig/vendor/adb/tls/include/adb/tls/tls_connection.h android-tools-31.0.3p1/vendor/adb/tls/include/adb/tls/tls_connection.h
+--- android-tools-31.0.3p1.orig/vendor/adb/tls/include/adb/tls/tls_connection.h	2021-03-22 19:48:10.000000000 +0200
++++ android-tools-31.0.3p1/vendor/adb/tls/include/adb/tls/tls_connection.h	2022-06-11 19:39:36.472011172 +0300
+@@ -19,6 +19,7 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ 
++#include <functional>
+ #include <string_view>
+ #include <vector>
+