btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / libserdes / package.nix
blob9c61d6a4079e46540bd688ef95630bea3f8b09cd
1 { stdenv
2 , lib
3 , fetchFromGitHub
4 , perl
5 , which
6 , boost
7 , rdkafka
8 , jansson
9 , curl
10 , avro-c
11 , avro-cpp
12 , nix-update-script }:
14 stdenv.mkDerivation rec {
15   pname = "libserdes";
16   version = "7.7.1";
18   src = fetchFromGitHub {
19     owner = "confluentinc";
20     repo = pname;
21     rev = "v${version}";
22     hash = "sha256-rg4SWa9nIDT6JrnnCDwdiFE1cvpUn0HWHn+bPkXMHQ4=";
23   };
25   outputs = [ "dev" "out" ];
27   nativeBuildInputs = [ perl which ];
29   buildInputs = [ boost rdkafka jansson curl avro-c avro-cpp ];
31   makeFlags = [ "GEN_PKG_CONFIG=y" ];
33   postPatch = ''
34     patchShebangs configure lds-gen.pl
35   '';
37   # Has a configure script but it’s not Autoconf so steal some bits from multiple-outputs.sh:
38   setOutputFlags = false;
40   preConfigure = ''
41     configureFlagsArray+=(
42       "--libdir=''${!outputLib}/lib"
43       "--includedir=''${!outputInclude}/include"
44     )
45   '';
47   preInstall = ''
48     installFlagsArray+=("pkgconfigdir=''${!outputDev}/lib/pkgconfig")
49   '';
51   # Header files get installed with executable bit for some reason; get rid of it.
52   postInstall = ''
53     chmod -x ''${!outputInclude}/include/libserdes/*.h
54   '';
56   passthru.updateScript = nix-update-script { };
58   meta = with lib; {
59     description = "Schema-based serializer/deserializer C/C++ library with support for Avro and the Confluent Platform Schema Registry";
60     homepage = "https://github.com/confluentinc/libserdes";
61     license = licenses.asl20;
62     maintainers = with maintainers; [ liff ];
63     platforms = platforms.all;
64   };