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