1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchFromGitHub,
6 makePythonPath,
7 pythonOlder,
8 python,
9 click,
10 dbus-python,
11 desktop-notifier,
12 dropbox,
13 fasteners,
14 importlib-metadata,
15 keyring,
16 keyrings-alt,
17 packaging,
18 pathspec,
19 pyro5,
20 requests,
21 rich,
22 rubicon-objc,
23 setuptools,
24 survey,
25 typing-extensions,
26 watchdog,
27 xattr,
28 pytestCheckHook,
29 nixosTests,
30}:
31
32buildPythonPackage rec {
33 pname = "maestral";
34 version = "1.9.4";
35 pyproject = true;
36
37 disabled = pythonOlder "3.8";
38
39 src = fetchFromGitHub {
40 owner = "SamSchott";
41 repo = "maestral";
42 tag = "v${version}";
43 hash = "sha256-akh0COltpUU4Z4kfubg6A7k6W8ICoqVYkmFpMkTC8H8=";
44 };
45
46 build-system = [ setuptools ];
47
48 dependencies = [
49 click
50 desktop-notifier
51 dbus-python
52 dropbox
53 fasteners
54 importlib-metadata
55 keyring
56 keyrings-alt
57 packaging
58 pathspec
59 pyro5
60 requests
61 rich
62 setuptools
63 survey
64 typing-extensions
65 watchdog
66 xattr
67 ]
68 ++ lib.optionals stdenv.hostPlatform.isDarwin [ rubicon-objc ];
69
70 makeWrapperArgs = [
71 # Add the installed directories to the python path so the daemon can find them
72 "--prefix PYTHONPATH : ${makePythonPath dependencies}"
73 "--prefix PYTHONPATH : $out/${python.sitePackages}"
74 ];
75
76 nativeCheckInputs = [ pytestCheckHook ];
77
78 # ModuleNotFoundError: No module named '_watchdog_fsevents'
79 doCheck = !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64);
80
81 preCheck = ''
82 export HOME=$(mktemp -d)
83 '';
84
85 disabledTests = [
86 # We don't want to benchmark
87 "test_performance"
88 # Requires systemd
89 "test_autostart"
90 # Requires network access
91 "test_check_for_updates"
92 # Tries to look at /usr
93 "test_filestatus"
94 "test_path_exists_case_insensitive"
95 "test_cased_path_candidates"
96 # AssertionError
97 "test_locking_multiprocess"
98 # OSError: [Errno 95] Operation not supported
99 "test_move_preserves_xattrs"
100 ]
101 ++ lib.optionals stdenv.hostPlatform.isDarwin [
102 # maetral daemon does not start but worked in real environment
103 "test_catching_non_ignored_events"
104 "test_connection"
105 "test_event_handler"
106 "test_fs_ignore_tree_creation"
107 "test_lifecycle"
108 "test_notify_level"
109 "test_notify_snooze"
110 "test_receiving_events"
111 "test_remote_exceptions"
112 "test_start_already_running"
113 "test_stop"
114 ];
115
116 pythonImportsCheck = [ "maestral" ];
117
118 passthru.tests.maestral = nixosTests.maestral;
119
120 meta = with lib; {
121 description = "Open-source Dropbox client for macOS and Linux";
122 mainProgram = "maestral";
123 homepage = "https://maestral.app";
124 changelog = "https://github.com/samschott/maestral/releases/tag/v${version}";
125 license = licenses.mit;
126 maintainers = with maintainers; [
127 natsukium
128 peterhoeg
129 sfrijters
130 ];
131 };
132}