git » android-tools.git » commit 9713275

upgpkg: 34.0.1-2: protobuf 23 rebuild, actually build the package in build()

author Antonio Rojas
2023-06-28 22:05:01 UTC
committer Antonio Rojas
2023-06-28 22:05:01 UTC
parent 1b9cca670144e9b67804331f39474c1cb4a5a0ff

upgpkg: 34.0.1-2: protobuf 23 rebuild, actually build the package in build()

PKGBUILD +11 -3
protobuf-23.patch +31 -0

diff --git a/PKGBUILD b/PKGBUILD
index d79fade..e2227d1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,15 +5,22 @@
 pkgname=android-tools
 pkgver=34.0.1
 _tag=${pkgver} # https://github.com/nmeum/android-tools sometimes carries extra patch version on top of the upstream versioning
-pkgrel=1
+pkgrel=2
 pkgdesc='Android platform tools'
 arch=(x86_64)
 url='http://tools.android.com/'
 license=(Apache MIT)
 depends=(libusb protobuf brotli zstd android-udev pcre2)
 makedepends=(gtest cmake go ninja git)
-source=(https://github.com/nmeum/android-tools/releases/download/$_tag/android-tools-$_tag.tar.xz)
-sha256sums=('60234ecbca19a17a7e2f46a4581960d645b7c55b870d924a21494c76a6f548ec')
+source=(https://github.com/nmeum/android-tools/releases/download/$_tag/android-tools-$_tag.tar.xz
+        protobuf-23.patch)
+sha256sums=('60234ecbca19a17a7e2f46a4581960d645b7c55b870d924a21494c76a6f548ec'
+            '4de4a9951a2748b2816514c66d326488bf65d89cff0af94962a6f9ee4f450462')
+
+prepare() {
+  cd android-tools-$_tag
+  patch -p1 -i ../protobuf-23.patch
+}
 
 build() {
   cd android-tools-$_tag
@@ -24,6 +31,7 @@ build() {
     -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
     -DCMAKE_C_FLAGS="$CFLAGS" \
     -G Ninja -S . -B build
+  cmake --build build
 }
 
 package() {
diff --git a/protobuf-23.patch b/protobuf-23.patch
new file mode 100644
index 0000000..517fcf5
--- /dev/null
+++ b/protobuf-23.patch
@@ -0,0 +1,31 @@
+--- android-tools-34.0.1.orig/vendor/CMakeLists.txt     2023-06-28 23:15:15.544237905 +0200
++++ android-tools-34.0.1/vendor/CMakeLists.txt  2023-06-28 23:45:28.672277935 +0200
+@@ -73,6 +73,8 @@
+ pkg_check_modules(libzstd REQUIRED IMPORTED_TARGET libzstd)
+ 
++find_package(Protobuf CONFIG REQUIRED)
+ find_package(Protobuf REQUIRED)
++set(PROTOBUF_LIBRARIES protobuf::libprotobuf)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+ 
+--- android-tools-34.0.1.orig/vendor/extras/libjsonpb/parse/jsonpb.cpp  2023-06-28 23:15:15.414236253 +0200
++++ android-tools-34.0.1/vendor/extras/libjsonpb/parse/jsonpb.cpp       2023-06-28 23:34:21.672962973 +0200
+@@ -51,7 +51,7 @@
+ #if GOOGLE_PROTOBUF_VERSION < 3016000
+     return MakeError<std::string>(status.error_message().as_string());
+ #else
+-    return MakeError<std::string>(status.message().as_string());
++    return MakeError<std::string>(std::string(status.message()));
+ #endif
+   }
+   return ErrorOr<std::string>(std::move(json));
+@@ -68,7 +68,7 @@
+ #if GOOGLE_PROTOBUF_VERSION < 3016000
+     return MakeError<std::monostate>(status.error_message().as_string());
+ #else
+-    return MakeError<std::monostate>(status.message().as_string());
++    return MakeError<std::monostate>(std::string(status.message()));
+ #endif
+   }
+   if (!message->ParseFromString(binary)) {