1{ lib
2, stdenv
3, fetchFromGitHub
4, buildPythonPackage
5, rustPlatform
6, pkg-config
7, rustfmt
8, setuptools-rust
9, openssl
10, Security
11, msgpack
12}:
13
14buildPythonPackage rec {
15 pname = "etebase";
16 version = "0.31.2";
17
18 src = fetchFromGitHub {
19 owner = "etesync";
20 repo = "etebase-py";
21 rev = "v${version}";
22 hash = "sha256-enGmfXW8eV6FgdHfJqXr1orAsGbxDz9xUY6T706sf5U=";
23 };
24
25 cargoDeps = rustPlatform.fetchCargoTarball {
26 inherit src;
27 name = "${pname}-${version}";
28 hash = "sha256-4eJvFf6aY+DYkrYgam5Ok9941PX4uQOmtRznEY0+1TE=";
29 };
30
31 format = "pyproject";
32
33 nativeBuildInputs = [
34 pkg-config
35 rustfmt
36 setuptools-rust
37 ] ++ (with rustPlatform; [
38 cargoSetupHook
39 rust.cargo
40 rust.rustc
41 ]);
42
43 buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
44
45 propagatedBuildInputs = [
46 msgpack
47 ];
48
49 postPatch = ''
50 # Use system OpenSSL, which gets security updates.
51 substituteInPlace Cargo.toml \
52 --replace ', features = ["vendored"]' ""
53 '';
54
55 pythonImportsCheck = [ "etebase" ];
56
57
58 meta = with lib; {
59 homepage = "https://www.etebase.com/";
60 description = "A Python client library for Etebase";
61 license = licenses.bsd3;
62 maintainers = with maintainers; [ _3699n ];
63 };
64}