1{ lib
2, buildPythonPackage
3, fetchFromGitLab
4, pythonOlder
5, docutils
6, installShellFiles
7, poetry-core
8, google-api-python-client
9, simplejson
10, oauth2client
11, setuptools
12, pyxdg
13}:
14
15buildPythonPackage rec {
16 pname = "goobook";
17 version = "3.5.2";
18
19 format = "pyproject";
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitLab {
23 owner = "goobook";
24 repo = "goobook";
25 rev = version;
26 hash = "sha256-gWmeRlte+lP7VP9gbPuMHwhVkx91wQ0GpQFQRLJ29h8=";
27 };
28
29 postPatch = ''
30 substituteInPlace pyproject.toml \
31 --replace 'setuptools = "^62.6.0"' 'setuptools = "*"' \
32 --replace 'google-api-python-client = "^1.7.12"' 'google-api-python-client = "*"' \
33 --replace 'pyxdg = "^0.28"' 'pyxdg = "*"'
34 '';
35
36 nativeBuildInputs = [
37 docutils
38 installShellFiles
39 poetry-core
40 ];
41
42 propagatedBuildInputs = [
43 google-api-python-client
44 simplejson
45 oauth2client
46 setuptools
47 pyxdg
48 ];
49
50 postInstall = ''
51 rst2man goobook.1.rst goobook.1
52 installManPage goobook.1
53 '';
54
55 # has no tests
56 doCheck = false;
57
58 pythonImportsCheck = [ "goobook" ];
59
60 meta = with lib; {
61 description = "Access your Google contacts from the command line";
62 longDescription = ''
63 The purpose of GooBook is to make it possible to use your Google Contacts
64 from the command-line and from MUAs such as Mutt.
65 It can be used from Mutt the same way as abook.
66 '';
67 homepage = "https://pypi.org/project/goobook/";
68 changelog = "https://gitlab.com/goobook/goobook/-/blob/${version}/CHANGES.rst";
69 license = licenses.gpl3;
70 maintainers = with maintainers; [ primeos ];
71 };
72}