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.
This commit is contained in:
@@ -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)
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user