about summary refs log tree commit diff
path: root/pkgs/tools/backup/s3ql/default.nix
blob: 701fccabe4faead626fe378637917784d1794cab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  lib,
  fetchFromGitHub,
  python3,
  sqlite,
  which,
}:

python3.pkgs.buildPythonApplication rec {
  pname = "s3ql";
  version = "5.1.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "s3ql";
    repo = "s3ql";
    rev = "refs/tags/s3ql-${version}";
    hash = "sha256-8vGW0Kl6hDTY+9mTnm2S659PZ/9gl90d2tXxKIIFimo=";
  };

  build-system = with python3.pkgs; [ setuptools ];

  nativeBuildInputs = [ which ] ++ (with python3.pkgs; [ cython ]);

  propagatedBuildInputs = with python3.pkgs; [
    apsw
    cryptography
    defusedxml
    dugong
    google-auth
    google-auth-oauthlib
    pyfuse3
    requests
    sqlite
    trio
  ];

  nativeCheckInputs = with python3.pkgs; [
    pytest-trio
    pytestCheckHook
  ];

  preBuild = ''
    ${python3.pkgs.python.pythonOnBuildForHost.interpreter} ./setup.py build_cython build_ext --inplace
  '';

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  pythonImportsCheck = [ "s3ql" ];

  pytestFlagsArray = [ "tests/" ];

  meta = with lib; {
    description = "A full-featured file system for online data storage";
    homepage = "https://github.com/s3ql/s3ql/";
    changelog = "https://github.com/s3ql/s3ql/releases/tag/s3ql-${version}";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ rushmorem ];
    platforms = platforms.linux;
  };
}