about summary refs log tree commit diff
path: root/pkgs/development/python-modules/glean-sdk/default.nix
blob: e729d927cdaefaedda2df2a59a9ff0a41b5253f0 (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
{ lib
, buildPythonPackage
, fetchPypi
, rustPlatform
, rustc
, cargo
, setuptools-rust
# build inputs
, cffi
, glean-parser
}:

buildPythonPackage rec {
  pname = "glean-sdk";
  version = "42.2.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "sha256-X2p6KQnEB6ZHdCHGFVEoEMiI+0R2vfGqel+jFKTcx74=";
  };

  patches = [
    # Fix the environment for spawned process
    # https://github.com/mozilla/glean/pull/1542
    ./fix-spawned-process-environment.patch
  ];

  cargoDeps = rustPlatform.fetchCargoTarball {
    inherit src;
    name = "${pname}-${version}";
    sha256 = "sha256-/+rKGPYTLovgjTGL2F/pWzlUy1tY207yuJz3Xdhm1hg=";
  };

  nativeBuildInputs = [
    rustc
    cargo
    setuptools-rust
    rustPlatform.cargoSetupHook
  ];
  propagatedBuildInputs = [
    cffi
    glean-parser
  ];

  pythonImportsCheck = [ "glean" ];

  meta = with lib; {
    description = "Modern cross-platform telemetry client libraries and are a part of the Glean project";
    homepage = "https://mozilla.github.io/glean/book/index.html";
    license = licenses.mpl20;
    maintainers = [ maintainers.kvark ];
  };
}