nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, python
6, click
7, desktop-notifier
8, dropbox
9, fasteners
10, keyring
11, keyrings-alt
12, packaging
13, pathspec
14, Pyro5
15, requests
16, setuptools
17, sdnotify
18, survey
19, watchdog
20, importlib-metadata
21, pytestCheckHook
22, nixosTests
23}:
24
25buildPythonPackage rec {
26 pname = "maestral";
27 version = "1.5.3";
28 disabled = pythonOlder "3.6";
29
30 src = fetchFromGitHub {
31 owner = "SamSchott";
32 repo = "maestral";
33 rev = "v${version}";
34 sha256 = "sha256-Uo3vcYez2qSq162SSKjoCkwygwR5awzDceIq8/h3dao=";
35 };
36
37 format = "pyproject";
38
39 propagatedBuildInputs = [
40 click
41 desktop-notifier
42 dropbox
43 fasteners
44 keyring
45 keyrings-alt
46 packaging
47 pathspec
48 Pyro5
49 requests
50 setuptools
51 sdnotify
52 survey
53 watchdog
54 ] ++ lib.optionals (pythonOlder "3.8") [
55 importlib-metadata
56 ];
57
58 makeWrapperArgs = [
59 # Add the installed directories to the python path so the daemon can find them
60 "--prefix" "PYTHONPATH" ":" "${lib.concatStringsSep ":" (map (p: p + "/lib/${python.libPrefix}/site-packages") (python.pkgs.requiredPythonModules propagatedBuildInputs))}"
61 "--prefix" "PYTHONPATH" ":" "$out/lib/${python.libPrefix}/site-packages"
62 ];
63
64 checkInputs = [
65 pytestCheckHook
66 ];
67
68 disabledTests = [
69 # We don't want to benchmark
70 "test_performance"
71 # Requires systemd
72 "test_autostart"
73 # Requires network access
74 "test_check_for_updates"
75 # Tries to look at /usr
76 "test_filestatus"
77 "test_path_exists_case_insensitive"
78 "test_cased_path_candidates"
79 ];
80
81 pythonImportsCheck = [ "maestral" ];
82
83 passthru.tests.maestral = nixosTests.maestral;
84
85 meta = with lib; {
86 description = "Open-source Dropbox client for macOS and Linux";
87 license = licenses.mit;
88 maintainers = with maintainers; [ peterhoeg ];
89 platforms = platforms.unix;
90 homepage = "https://maestral.app";
91 };
92}