about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/goobook/default.nix
blob: 2f3884aa07ff04384245d2f6dd4055ae0472c686 (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
64
65
66
67
68
69
70
71
72
73
{ lib
, buildPythonPackage
, fetchFromGitLab
, pythonOlder
, docutils
, installShellFiles
, poetry-core
, google-api-python-client
, simplejson
, oauth2client
, setuptools
, pyxdg
}:

buildPythonPackage rec {
  pname = "goobook";
  version = "3.5.2";

  format = "pyproject";
  disabled = pythonOlder "3.7";

  src = fetchFromGitLab {
    owner = "goobook";
    repo = "goobook";
    rev = version;
    hash = "sha256-gWmeRlte+lP7VP9gbPuMHwhVkx91wQ0GpQFQRLJ29h8=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'setuptools = "^62.6.0"' 'setuptools = "*"' \
      --replace 'google-api-python-client = "^1.7.12"' 'google-api-python-client = "*"' \
      --replace 'pyxdg = "^0.28"' 'pyxdg = "*"'
  '';

  nativeBuildInputs = [
    docutils
    installShellFiles
    poetry-core
  ];

  propagatedBuildInputs = [
    google-api-python-client
    simplejson
    oauth2client
    setuptools
    pyxdg
  ];

  postInstall = ''
    rst2man goobook.1.rst goobook.1
    installManPage goobook.1
  '';

  # has no tests
  doCheck = false;

  pythonImportsCheck = [ "goobook" ];

  meta = with lib; {
    description = "Access your Google contacts from the command line";
    mainProgram = "goobook";
    longDescription = ''
      The purpose of GooBook is to make it possible to use your Google Contacts
      from the command-line and from MUAs such as Mutt.
      It can be used from Mutt the same way as abook.
    '';
    homepage = "https://pypi.org/project/goobook/";
    changelog = "https://gitlab.com/goobook/goobook/-/blob/${version}/CHANGES.rst";
    license = licenses.gpl3;
    maintainers = with maintainers; [ primeos ];
  };
}