1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 cmake,
7 pkg-config,
8 libpulsar,
9 pybind11,
10 certifi,
11}:
12
13buildPythonPackage rec {
14 pname = "pulsar";
15 version = "3.6.1";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "apache";
20 repo = "pulsar-client-python";
21 tag = "v${version}";
22 hash = "sha256-KdPLp0BmZnobU4F6tuMj2DY/ya4QHeGcM/eEAivoXNI=";
23 };
24
25 disabled = pythonOlder "3.7";
26
27 nativeBuildInputs = [
28 cmake
29 pkg-config
30 ];
31
32 buildInputs = [
33 libpulsar
34 pybind11
35 ];
36
37 preBuild = ''
38 make -j$NIX_BUILD_CORES
39 make install
40 cd ..
41 '';
42
43 propagatedBuildInputs = [ certifi ];
44
45 # Requires to setup a cluster
46 doCheck = false;
47
48 pythonImportsCheck = [ "pulsar" ];
49
50 meta = with lib; {
51 description = "Apache Pulsar Python client library";
52 homepage = "https://pulsar.apache.org/docs/next/client-libraries-python/";
53 changelog = "https://github.com/apache/pulsar-client-python/releases/tag/${src.tag}";
54 license = licenses.asl20;
55 maintainers = with maintainers; [ gaelreyrol ];
56 };
57}