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