15 stdenv.mkDerivation rec {
19 src = fetchFromGitHub {
20 owner = "confluentinc";
23 hash = "sha256-rg4SWa9nIDT6JrnnCDwdiFE1cvpUn0HWHn+bPkXMHQ4=";
45 # avro-cpp public headers use at least C++17 features, but libserdes configure scripts
46 # basically cap it at C++11. It's really unfortunate that we have to patch the configure scripts for this,
47 # but this seems to be the most sensible way.
48 # - NIX_CFLAGS_COMPILE - fails because of -Werror in compiler checks since --std=... has no effect for C compilers.
49 # - CXXFLAGS without patching configure.self does nothing, because --std=c++11 is appended to the final flags, overriding
50 # everything specified manually.
51 "--CXXFLAGS=${toString [ "--std=c++17" ]}"
59 patchShebangs configure lds-gen.pl
60 # Don't append the standard to CXXFLAGS, since we want to set it higher for avro-cpp.
61 substituteInPlace configure.self --replace-fail \
62 'mkl_mkvar_append CXXFLAGS CXXFLAGS "--std=c++11"' \
63 ":" # Do nothing, we set the standard ourselves.
66 # Has a configure script but it’s not Autoconf so steal some bits from multiple-outputs.sh:
67 setOutputFlags = false;
70 configureFlagsArray+=(
71 "--libdir=''${!outputLib}/lib"
72 "--includedir=''${!outputInclude}/include"
77 installFlagsArray+=("pkgconfigdir=''${!outputDev}/lib/pkgconfig")
80 # Header files get installed with executable bit for some reason; get rid of it.
82 chmod -x ''${!outputInclude}/include/libserdes/*.h
85 passthru.updateScript = nix-update-script { };
88 description = "Schema-based serializer/deserializer C/C++ library with support for Avro and the Confluent Platform Schema Registry";
89 homepage = "https://github.com/confluentinc/libserdes";
90 license = licenses.asl20;
91 maintainers = with maintainers; [ liff ];
92 platforms = platforms.all;