2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
cargo,
|
|
|
|
cffi,
|
|
|
|
fetchPypi,
|
|
|
|
glean-parser,
|
|
|
|
iso8601,
|
|
|
|
lmdb,
|
|
|
|
pkg-config,
|
|
|
|
pytest-localserver,
|
|
|
|
pytestCheckHook,
|
|
|
|
python,
|
|
|
|
pythonOlder,
|
|
|
|
rustc,
|
|
|
|
rustPlatform,
|
|
|
|
semver,
|
|
|
|
setuptools-rust,
|
2021-12-06 16:07:01 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "glean-sdk";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "52.7.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-sLjdGHiS7Co/oA9gQyAFkD14tAYjmwjWcPr4CRrzw/0=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src;
|
|
|
|
name = "${pname}-${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-5TlgWcLmjklxhtDbB0aRF71iIRTJwetFj1Jii1DGdvU=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cargo
|
2023-07-15 17:15:38 +00:00
|
|
|
pkg-config
|
2022-03-30 09:31:56 +00:00
|
|
|
rustc
|
2021-12-06 16:07:01 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
2022-03-30 09:31:56 +00:00
|
|
|
setuptools-rust
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
2022-03-30 09:31:56 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ lmdb ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
cffi
|
|
|
|
glean-parser
|
2022-03-30 09:31:56 +00:00
|
|
|
iso8601
|
2022-09-30 11:47:45 +00:00
|
|
|
semver
|
2021-12-06 16:07:01 +00:00
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-03-30 09:31:56 +00:00
|
|
|
pytest-localserver
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
disabledTests = [
|
|
|
|
# RuntimeError: No ping received.
|
|
|
|
"test_client_activity_api"
|
2023-05-24 13:37:59 +00:00
|
|
|
"test_flipping_upload_enabled_respects_order_of_events"
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
postInstallCheck = lib.optionalString stdenv.hostPlatform.isElf ''
|
2023-07-15 17:15:38 +00:00
|
|
|
readelf -a $out/${python.sitePackages}/glean/libglean_ffi.so | grep -F 'Shared library: [liblmdb.so'
|
|
|
|
'';
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "glean" ];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2022-03-30 09:31:56 +00:00
|
|
|
description = "Telemetry client libraries and are a part of the Glean project";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://mozilla.github.io/glean/book/index.html";
|
|
|
|
license = licenses.mpl20;
|
2023-02-02 18:25:31 +00:00
|
|
|
maintainers = with maintainers; [ melling ];
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|