diff --git a/pkgs/by-name/pr/protobufc/package.nix b/pkgs/by-name/pr/protobufc/package.nix index c71242bd98dd..8e3537d9a224 100644 --- a/pkgs/by-name/pr/protobufc/package.nix +++ b/pkgs/by-name/pr/protobufc/package.nix @@ -36,6 +36,21 @@ stdenv.mkDerivation (finalAttrs: { zlib ]; + # The upstream macro is vendored from a very old autoconf archive: + # https://github.com/protobuf-c/protobuf-c/commit/42612b4ba4b11d48b76e3643fa6d42f617e661b6 + # and the build system appears to arbitrarily require C++17 specifically: + # https://github.com/protobuf-c/protobuf-c/blob/4719fdd7760624388c2c5b9d6759eb6a47490626/configure.ac#L72 + # However, the default standard version used by GCC continues to increase + # (e.g. C++20 for GCC 16), and so protobuf-c's dependencies do as well. In + # particular, abseil-cpp has headers that protobuf-c includes and are + # sensitive to the standard version. While we could override the standard + # version used by these dependents, it is simpler to drop the requirement and + # allow the compiler default standard to be used. + postPatch = '' + substituteInPlace configure.ac --replace-fail \ + "AX_CXX_COMPILE_STDCXX(17, noext, mandatory)" "" + ''; + env.PROTOC = lib.getExe buildPackages.protobuf_33; meta = {