From 78ca1422a5f25788a0486ee1e836068d42f69e67 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Sun, 29 Dec 2024 12:17:33 +0300 Subject: [PATCH] avro-cpp: 1.11.3 -> 1.12.0 This is a major change to the public API. Now avro-cpp public headers depend on fmt as well as boost. The build system tries to do FetchContent on fmtlib unconditionally, which requires patching to circumvent. Looks like the least painful thing to do is to propagate both boost and fmt and hope that dependant packages don't break too much. --- .../0001-get-rid-of-fmt-fetchcontent.patch | 21 ++++++++++++++++ pkgs/by-name/av/avro-cpp/package.nix | 25 +++++++------------ 2 files changed, 30 insertions(+), 16 deletions(-) create mode 100644 pkgs/by-name/av/avro-cpp/0001-get-rid-of-fmt-fetchcontent.patch diff --git a/pkgs/by-name/av/avro-cpp/0001-get-rid-of-fmt-fetchcontent.patch b/pkgs/by-name/av/avro-cpp/0001-get-rid-of-fmt-fetchcontent.patch new file mode 100644 index 000000000000..09ff008d332c --- /dev/null +++ b/pkgs/by-name/av/avro-cpp/0001-get-rid-of-fmt-fetchcontent.patch @@ -0,0 +1,21 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 19059a41b..6e3ae0ad7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,15 +82,7 @@ endif () + find_package (Boost 1.38 REQUIRED + COMPONENTS filesystem iostreams program_options regex system) + +-include(FetchContent) +-FetchContent_Declare( +- fmt +- GIT_REPOSITORY https://github.com/fmtlib/fmt.git +- GIT_TAG 10.2.1 +- GIT_PROGRESS TRUE +- USES_TERMINAL_DOWNLOAD TRUE +-) +-FetchContent_MakeAvailable(fmt) ++find_package(fmt REQUIRED) + + find_package(Snappy) + if (SNAPPY_FOUND) diff --git a/pkgs/by-name/av/avro-cpp/package.nix b/pkgs/by-name/av/avro-cpp/package.nix index f82ef1924dbe..a21d247bb272 100644 --- a/pkgs/by-name/av/avro-cpp/package.nix +++ b/pkgs/by-name/av/avro-cpp/package.nix @@ -2,41 +2,34 @@ lib, stdenv, fetchurl, - fetchpatch, cmake, boost, python3, + fmt, }: stdenv.mkDerivation rec { pname = "avro-c++"; - version = "1.11.3"; + version = "1.12.0"; src = fetchurl { url = "mirror://apache/avro/avro-${version}/cpp/avro-cpp-${version}.tar.gz"; - hash = "sha256-+6JCrvd+yBnQdWH8upN1FyGVbejQyujh8vMAtUszG64="; + hash = "sha256-8u33cSanWw7BrRZncr4Fg1HOo9dESL5+LO8gBQwPmKs="; }; + patches = [ - # This patch fixes boost compatibility and can be removed when - # upgrading beyond 1.11.3 https://github.com/apache/avro/pull/1920 - (fetchpatch { - name = "fix-boost-compatibility.patch"; - url = "https://github.com/apache/avro/commit/016323828f147f185d03f50d2223a2f50bfafce1.patch"; - hash = "sha256-hP/5J2JzSplMvg8EjEk98Vim8DfTyZ4hZ/WGiVwvM1A="; - }) + ./0001-get-rid-of-fmt-fetchcontent.patch ]; - patchFlags = [ "-p3" ]; nativeBuildInputs = [ cmake python3 ]; - buildInputs = [ boost ]; - preConfigure = '' - substituteInPlace test/SchemaTests.cc --replace "BOOST_CHECKPOINT" "BOOST_TEST_CHECKPOINT" - substituteInPlace test/buffertest.cc --replace "BOOST_MESSAGE" "BOOST_TEST_MESSAGE" - ''; + propagatedBuildInputs = [ + boost + fmt + ]; meta = { description = "C++ library which implements parts of the Avro Specification";