2021-06-28 23:13:55 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, lib
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, perl
|
2024-01-02 11:29:13 +00:00
|
|
|
|
, which
|
2021-06-28 23:13:55 +00:00
|
|
|
|
, boost
|
|
|
|
|
, rdkafka
|
|
|
|
|
, jansson
|
|
|
|
|
, curl
|
|
|
|
|
, avro-c
|
2024-01-02 11:29:13 +00:00
|
|
|
|
, avro-cpp
|
|
|
|
|
, nix-update-script }:
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "libserdes";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
version = "7.5.3";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
|
owner = "confluentinc";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
hash = "sha256-rg4SWa9nIDT6JrnnCDwdiFE1cvpUn0HWHn+bPkXMHQ4=";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs = [ "dev" "out" ];
|
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
|
nativeBuildInputs = [ perl which ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
|
|
buildInputs = [ boost rdkafka jansson curl avro-c avro-cpp ];
|
|
|
|
|
|
|
|
|
|
makeFlags = [ "GEN_PKG_CONFIG=y" ];
|
|
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
|
patchShebangs configure lds-gen.pl
|
2024-01-02 11:29:13 +00:00
|
|
|
|
'' + lib.optionalString (stdenv.cc.libcxx != null) ''
|
|
|
|
|
# fix for https://github.com/NixOS/nixpkgs/issues/166205
|
|
|
|
|
# llvm12+ isn't adding libc++abi
|
|
|
|
|
substituteInPlace src-cpp/Makefile \
|
|
|
|
|
--replace "LIBS += -lstdc++" "LIBS += -lc++ -l${stdenv.cc.libcxx.cxxabi.libName}"
|
2021-06-28 23:13:55 +00:00
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# Has a configure script but it’s not Autoconf so steal some bits from multiple-outputs.sh:
|
|
|
|
|
setOutputFlags = false;
|
|
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
configureFlagsArray+=(
|
|
|
|
|
"--libdir=''${!outputLib}/lib"
|
|
|
|
|
"--includedir=''${!outputInclude}/include"
|
|
|
|
|
)
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
|
installFlagsArray+=("pkgconfigdir=''${!outputDev}/lib/pkgconfig")
|
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
# Header files get installed with executable bit for some reason; get rid of it.
|
|
|
|
|
postInstall = ''
|
|
|
|
|
chmod -x ''${!outputInclude}/include/libserdes/*.h
|
|
|
|
|
'';
|
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "A schema-based serializer/deserializer C/C++ library with support for Avro and the Confluent Platform Schema Registry";
|
|
|
|
|
homepage = "https://github.com/confluentinc/libserdes";
|
|
|
|
|
license = licenses.asl20;
|
|
|
|
|
maintainers = with maintainers; [ liff ];
|
|
|
|
|
platforms = platforms.all;
|
|
|
|
|
};
|
|
|
|
|
}
|