android-tools: Fix build with protobuf-3.23

This commit is contained in:
Tobias Mayer 2023-08-17 09:15:25 +02:00
parent 2e936d668c
commit 3ff55b6c89
No known key found for this signature in database
GPG key ID: F8657E90819A1298

View file

@ -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 ];