From f1fd3f2a5d5d85954cd68e2d6c715a866a10a7fb Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Thu, 10 Nov 2022 08:10:20 -0500 Subject: [PATCH] pkgsStatic.protobufc: fix build Upstream effectively puts "-lprotobuf -lprotoc" as linking flags, while in fact "protoc.a" depends on "protobuf.a", so flags should be in reverse order. It is simpler to append one more "-lprotobuf" than to make patch to fix order. That means that linker will scan "protobuf.a" twice, but price is neglectable. --- pkgs/development/libraries/protobufc/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/development/libraries/protobufc/default.nix b/pkgs/development/libraries/protobufc/default.nix index f7cf765e150d..dc3b2c92f191 100644 --- a/pkgs/development/libraries/protobufc/default.nix +++ b/pkgs/development/libraries/protobufc/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , autoreconfHook , pkg-config , protobuf @@ -19,6 +20,14 @@ stdenv.mkDerivation rec { hash = "sha256-TJCLzxozuZ8ynrBQ2lKyk03N+QA/lbOwywUjDUdTlbM="; }; + patches = [ + # https://github.com/protobuf-c/protobuf-c/pull/534 + (fetchpatch { + url = "https://github.com/protobuf-c/protobuf-c/commit/a6c9ea5207aeac61c57b446ddf5a6b68308881d8.patch"; + hash = "sha256-wTb8+YbvrCrOVpgthI5SJdG/CpQcOzCX4Bv47FPY804="; + }) + ]; + nativeBuildInputs = [ autoreconfHook pkg-config ]; buildInputs = [ protobuf zlib ];