From 3ff55b6c89e8895580e93b7d6aae9de18bd87f76 Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Thu, 17 Aug 2023 09:15:25 +0200 Subject: [PATCH] android-tools: Fix build with protobuf-3.23 --- pkgs/tools/misc/android-tools/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/tools/misc/android-tools/default.nix b/pkgs/tools/misc/android-tools/default.nix index 6436e692ae4..6276d50c73d 100644 --- a/pkgs/tools/misc/android-tools/default.nix +++ b/pkgs/tools/misc/android-tools/default.nix @@ -16,6 +16,19 @@ stdenv.mkDerivation rec { hash = "sha256-YCNOy8oZoXp+L0akWBlg1kW3xVuHDZJKIUlMdqb1SOw="; }; + patches = [ + # Fix building with newer protobuf versions. + (fetchurl { + url = "https://gitlab.archlinux.org/archlinux/packaging/packages/android-tools/-/raw/295ad7d5cb1e3b4c75bd40281d827f9168bbaa57/protobuf-23.patch"; + hash = "sha256-KznGgZdYT6e5wG3gtfJ6i93bYfp/JFygLW/ZzvXUA0Y="; + }) + ]; + + # Fix linking with private abseil-cpp libraries. + postPatch = '' + sed -i '/^find_package(Protobuf REQUIRED)$/i find_package(protobuf CONFIG)' vendor/CMakeLists.txt + ''; + nativeBuildInputs = [ cmake pkg-config perl go ]; buildInputs = [ protobuf zlib gtest brotli lz4 zstd libusb1 pcre2 ]; propagatedBuildInputs = [ pythonEnv ];