Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
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 fetchpatch, 29 pytestCheckHook, 30 nixosTests, 31}: 32 33buildPythonPackage rec { 34 pname = "maestral"; 35 version = "1.9.4"; 36 pyproject = true; 37 38 disabled = pythonOlder "3.8"; 39 40 src = fetchFromGitHub { 41 owner = "SamSchott"; 42 repo = "maestral"; 43 rev = "refs/tags/v${version}"; 44 hash = "sha256-akh0COltpUU4Z4kfubg6A7k6W8ICoqVYkmFpMkTC8H8="; 45 }; 46 47 build-system = [ setuptools ]; 48 49 dependencies = [ 50 click 51 desktop-notifier 52 dbus-python 53 dropbox 54 fasteners 55 importlib-metadata 56 keyring 57 keyrings-alt 58 packaging 59 pathspec 60 pyro5 61 requests 62 rich 63 setuptools 64 survey 65 typing-extensions 66 watchdog 67 xattr 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 [ 87 # We don't want to benchmark 88 "test_performance" 89 # Requires systemd 90 "test_autostart" 91 # Requires network access 92 "test_check_for_updates" 93 # Tries to look at /usr 94 "test_filestatus" 95 "test_path_exists_case_insensitive" 96 "test_cased_path_candidates" 97 # AssertionError 98 "test_locking_multiprocess" 99 # OSError: [Errno 95] Operation not supported 100 "test_move_preserves_xattrs" 101 ] 102 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 103 # maetral daemon does not start but worked in real environment 104 "test_catching_non_ignored_events" 105 "test_connection" 106 "test_event_handler" 107 "test_fs_ignore_tree_creation" 108 "test_lifecycle" 109 "test_notify_level" 110 "test_notify_snooze" 111 "test_receiving_events" 112 "test_remote_exceptions" 113 "test_start_already_running" 114 "test_stop" 115 ]; 116 117 pythonImportsCheck = [ "maestral" ]; 118 119 passthru.tests.maestral = nixosTests.maestral; 120 121 meta = with lib; { 122 description = "Open-source Dropbox client for macOS and Linux"; 123 mainProgram = "maestral"; 124 homepage = "https://maestral.app"; 125 changelog = "https://github.com/samschott/maestral/releases/tag/v${version}"; 126 license = licenses.mit; 127 maintainers = with maintainers; [ 128 natsukium 129 peterhoeg 130 sfrijters 131 ]; 132 }; 133}