about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pulsar/default.nix
blob: b6dfde67706b5ea59140b5f72318197c4e15eaf3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, cmake
, pkg-config
, libpulsar
, pybind11
, certifi
}:

buildPythonPackage rec {
  pname = "pulsar";
  version = "3.5.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "apache";
    repo = "pulsar-client-python";
    rev = "refs/tags/v${version}";
    hash = "sha256-2Ahv0lfeHuBhGIYhiTjKegEKsJqHkpK3Qu6xBnjsanI=";
  };

  disabled = pythonOlder "3.7";

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    libpulsar
    pybind11
  ];

  preBuild = ''
    make -j$NIX_BUILD_CORES
    make install
    cd ..
  '';

  propagatedBuildInputs = [
    certifi
  ];

  # Requires to setup a cluster
  doCheck = false;

  pythonImportsCheck = [
    "pulsar"
  ];

  meta = with lib; {
    description = "Apache Pulsar Python client library";
    homepage = "https://pulsar.apache.org/docs/next/client-libraries-python/";
    changelog = "https://github.com/apache/pulsar-client-python/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ gaelreyrol ];
  };
}