1 |
commit: 1482e094c60cec18eb2769bc7f7a32a69c643019 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 25 09:16:49 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 25 09:19:50 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1482e094 |
7 |
|
8 |
app-misc/goobook: Patch to use pyxdg rather than xdg |
9 |
|
10 |
Closes: https://bugs.gentoo.org/804076 |
11 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
12 |
|
13 |
app-misc/goobook/files/goobook-3.5.1-pyxdg.patch | 105 +++++++++++++++++++++ |
14 |
...ook-3.5.1-r1.ebuild => goobook-3.5.1-r2.ebuild} | 10 +- |
15 |
2 files changed, 112 insertions(+), 3 deletions(-) |
16 |
|
17 |
diff --git a/app-misc/goobook/files/goobook-3.5.1-pyxdg.patch b/app-misc/goobook/files/goobook-3.5.1-pyxdg.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..e40bc051295 |
20 |
--- /dev/null |
21 |
+++ b/app-misc/goobook/files/goobook-3.5.1-pyxdg.patch |
22 |
@@ -0,0 +1,105 @@ |
23 |
+From 391c081199f9cba5026460fbffba43c03602fa13 Mon Sep 17 00:00:00 2001 |
24 |
+From: Jan Baier <jbaier@××××.cz> |
25 |
+Date: Mon, 22 Mar 2021 15:04:38 +0100 |
26 |
+Subject: [PATCH] Switch from xdg to pyxdg |
27 |
+ |
28 |
+As both of them provides the xdg and cannot be installed at the same |
29 |
+time, pyxdg should be used as it is older, has more features (xdg is a |
30 |
+subset of pyxdg) and is more used. This change should resolve conflicts |
31 |
+like https://github.com/srstevenson/xdg/issues/35 |
32 |
+ |
33 |
+Fixes #96 |
34 |
+--- |
35 |
+ CHANGES.rst | 6 ++++++ |
36 |
+ Pipfile | 2 +- |
37 |
+ goobook/config.py | 16 ++++++++-------- |
38 |
+ setup.py | 4 ++-- |
39 |
+ 4 files changed, 17 insertions(+), 11 deletions(-) |
40 |
+ |
41 |
+diff --git a/goobook/config.py b/goobook/config.py |
42 |
+index c948469..05589b1 100644 |
43 |
+--- a/goobook/config.py |
44 |
++++ b/goobook/config.py |
45 |
+@@ -10,7 +10,7 @@ import configparser |
46 |
+ import logging |
47 |
+ |
48 |
+ import oauth2client.client |
49 |
+-import xdg |
50 |
++from xdg import BaseDirectory |
51 |
+ |
52 |
+ from goobook.storage import Storage |
53 |
+ |
54 |
+@@ -61,8 +61,8 @@ def read_config(config_file=None): |
55 |
+ if config_file: # config file explicitly given on the commandline |
56 |
+ config_file = os.path.expanduser(config_file) |
57 |
+ else: # search for goobookrc in XDG dirs and homedir |
58 |
+- config_files = [dir_ / "goobookrc" for dir_ in [xdg.XDG_CONFIG_HOME] + |
59 |
+- xdg.XDG_CONFIG_DIRS] + [LEGACY_CONFIG_FILE] |
60 |
++ config_files = [dir_ / "goobookrc" for dir_ in [pathlib.Path(BaseDirectory.xdg_config_home)] + |
61 |
++ [pathlib.Path(p) for p in BaseDirectory.xdg_config_dirs]] + [LEGACY_CONFIG_FILE] |
62 |
+ log.debug("config file search path: %s", config_files) |
63 |
+ for config_file_ in config_files: |
64 |
+ if config_file_.exists(): |
65 |
+@@ -93,7 +93,7 @@ def read_config(config_file=None): |
66 |
+ if config.cache_filename: # If explicitly specified in config file |
67 |
+ config.cache_filename = realpath(expanduser(config.cache_filename)) |
68 |
+ else: # search for goobook_cache in XDG dirs and homedir |
69 |
+- cache_files = [xdg.XDG_CACHE_HOME / "goobook_cache", LEGACY_CACHE_FILE] |
70 |
++ cache_files = [pathlib.Path(BaseDirectory.xdg_cache_home) / "goobook_cache", LEGACY_CACHE_FILE] |
71 |
+ log.debug("cache file search path: %s", cache_files) |
72 |
+ for cache_file in cache_files: |
73 |
+ cache_file = cache_file.resolve() |
74 |
+@@ -101,7 +101,7 @@ def read_config(config_file=None): |
75 |
+ log.debug("found cache file: %s", cache_file) |
76 |
+ break |
77 |
+ else: # If there is none, create in XDG_CACHE_HOME |
78 |
+- cache_file = xdg.XDG_CACHE_HOME / "goobook_cache" |
79 |
++ cache_file = pathlib.Path(BaseDirectory.xdg_cache_home) / "goobook_cache" |
80 |
+ log.debug("no cache file found, will use %s", cache_file) |
81 |
+ config.cache_filename = str(cache_file) |
82 |
+ |
83 |
+@@ -110,8 +110,8 @@ def read_config(config_file=None): |
84 |
+ config.oauth_db_filename = realpath(expanduser(config.oauth_db_filename)) |
85 |
+ auth_file = pathlib.Path(config.oauth_db_filename) |
86 |
+ else: # search for goobook_auth.json in XDG dirs and homedir |
87 |
+- auth_files = [dir_ / "goobook_auth.json" for dir_ in [xdg.XDG_DATA_HOME] + |
88 |
+- xdg.XDG_DATA_DIRS] + [LEGACY_AUTH_FILE] |
89 |
++ auth_files = [dir_ / "goobook_auth.json" for dir_ in [pathlib.Path(BaseDirectory.xdg_data_home)] + |
90 |
++ [pathlib.Path(p) for p in BaseDirectory.xdg_data_dirs]] + [LEGACY_AUTH_FILE] |
91 |
+ log.debug("auth file search path: %s", auth_files) |
92 |
+ for auth_file in auth_files: |
93 |
+ auth_file = auth_file.resolve() |
94 |
+@@ -119,7 +119,7 @@ def read_config(config_file=None): |
95 |
+ log.debug("found auth file: %s", auth_file) |
96 |
+ break |
97 |
+ else: # If there is none, create in XDG_DATA_HOME |
98 |
+- auth_file = xdg.XDG_DATA_HOME / "goobook_auth.json" |
99 |
++ auth_file = pathlib.Path(BaseDirectory.xdg_data_home) / "goobook_auth.json" |
100 |
+ log.debug("no auth file found, will use %s", auth_file) |
101 |
+ config.oauth_db_filename = str(auth_file) |
102 |
+ |
103 |
+diff --git a/setup.py b/setup.py |
104 |
+index e2bed5c..4a6c764 100755 |
105 |
+--- a/setup.py |
106 |
++++ b/setup.py |
107 |
+@@ -12,7 +12,7 @@ NEWS = open(os.path.join(HERE, 'CHANGES.rst')).read() |
108 |
+ |
109 |
+ setuptools.setup( |
110 |
+ name='goobook', |
111 |
+- version='3.5.1', |
112 |
++ version='3.6', |
113 |
+ description='Search your google contacts from the command-line or mutt.', |
114 |
+ long_description=README + '\n\n' + NEWS, |
115 |
+ long_description_content_type="text/x-rst", |
116 |
+@@ -39,7 +39,7 @@ setuptools.setup( |
117 |
+ 'google-api-python-client>=1.7.12', |
118 |
+ 'simplejson>=3.16.0', |
119 |
+ 'oauth2client>=1.5.0,<5.0.0dev', |
120 |
+- 'xdg>=4.0.1' |
121 |
++ 'pyxdg>=0.26' |
122 |
+ ], |
123 |
+ extras_require={ |
124 |
+ }, |
125 |
+-- |
126 |
+GitLab |
127 |
+ |
128 |
|
129 |
diff --git a/app-misc/goobook/goobook-3.5.1-r1.ebuild b/app-misc/goobook/goobook-3.5.1-r2.ebuild |
130 |
similarity index 86% |
131 |
rename from app-misc/goobook/goobook-3.5.1-r1.ebuild |
132 |
rename to app-misc/goobook/goobook-3.5.1-r2.ebuild |
133 |
index 6ea38b8a97e..93031a16eb1 100644 |
134 |
--- a/app-misc/goobook/goobook-3.5.1-r1.ebuild |
135 |
+++ b/app-misc/goobook/goobook-3.5.1-r2.ebuild |
136 |
@@ -3,8 +3,7 @@ |
137 |
|
138 |
EAPI=7 |
139 |
|
140 |
-PYTHON_COMPAT=( python3_{7..9} ) |
141 |
-DISTUTILS_USE_SETUPTOOLS=rdepend |
142 |
+PYTHON_COMPAT=( python3_{8..9} ) |
143 |
inherit distutils-r1 readme.gentoo-r1 |
144 |
|
145 |
DESCRIPTION="Access your Google contacts from the command line" |
146 |
@@ -20,7 +19,12 @@ RDEPEND=" |
147 |
>=dev-python/simplejson-3.16.0[${PYTHON_USEDEP}] |
148 |
>=dev-python/oauth2client-1.5.0[${PYTHON_USEDEP}] |
149 |
<dev-python/oauth2client-5[${PYTHON_USEDEP}] |
150 |
- dev-python/xdg[${PYTHON_USEDEP}]" |
151 |
+ dev-python/pyxdg[${PYTHON_USEDEP}]" |
152 |
+ |
153 |
+PATCHES=( |
154 |
+ # https://gitlab.com/goobook/goobook/-/merge_requests/13 |
155 |
+ "${FILESDIR}"/${P}-pyxdg.patch |
156 |
+) |
157 |
|
158 |
DISABLE_AUTOFORMATTING=1 |
159 |
DOC_CONTENTS=" |