1 |
commit: 34cfb652844698c47cf249073f8025f7f63c650d |
2 |
Author: Aaron Bauman <bman <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 24 22:28:36 2020 +0000 |
4 |
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 24 22:28:36 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34cfb652 |
7 |
|
8 |
net-misc/gns3-gui: bump to version 2.2.8 |
9 |
|
10 |
* Fix all the crazy dep changes |
11 |
* Add upstream patch to remove dev-python/raven dep |
12 |
* Takeover maintainership |
13 |
* Only support py3.7 and py3.8 to minimize conditionals |
14 |
|
15 |
Bug: https://bugs.gentoo.org/688016 |
16 |
Bug: https://bugs.gentoo.org/712964 |
17 |
Bug: https://bugs.gentoo.org/714840 |
18 |
Bug: https://bugs.gentoo.org/718444 |
19 |
Signed-off-by: Aaron Bauman <bman <AT> gentoo.org> |
20 |
|
21 |
net-misc/gns3-gui/Manifest | 1 + |
22 |
net-misc/gns3-gui/files/gns3-gui-rmraven.patch | 182 +++++++++++++++++++++++++ |
23 |
net-misc/gns3-gui/gns3-gui-2.2.8.ebuild | 57 ++++++++ |
24 |
net-misc/gns3-gui/metadata.xml | 10 +- |
25 |
4 files changed, 244 insertions(+), 6 deletions(-) |
26 |
|
27 |
diff --git a/net-misc/gns3-gui/Manifest b/net-misc/gns3-gui/Manifest |
28 |
index 9ed2a75cc61..be61aeab7c4 100644 |
29 |
--- a/net-misc/gns3-gui/Manifest |
30 |
+++ b/net-misc/gns3-gui/Manifest |
31 |
@@ -1 +1,2 @@ |
32 |
DIST gns3-gui-2.1.21.tar.gz 4845512 BLAKE2B 93af250719a0aafe8645926552c61d43152e5a5620d42b4d73cd58d597b3280d11935043771f15cf04e5d116f6740d929e04c27b1af6732d65b7c6e36313ed3c SHA512 b9b03c59064214323fe7375256075c56368747c8cd273bea41791b101ea7d6b877443e81dd57f13faf4b4bdc6de558e98648770de4734b1edd1c82911f2fcb9b |
33 |
+DIST gns3-gui-2.2.8.tar.gz 5237129 BLAKE2B ce72219a1d0201f596c20b0988ab81f280889d3eb4717898da5d1a3c52a248e8f1d020d83b900309e623fadb758e67a91baaac9d61d75e72b96f4144ac5101fb SHA512 28b9f6f16506f206f64831160d95687525b6709d9d0d84623763e46c3c9b2e138e3f12844619bbad00491677818a7e28da4f4ea9358d063c3427db16e62775ca |
34 |
|
35 |
diff --git a/net-misc/gns3-gui/files/gns3-gui-rmraven.patch b/net-misc/gns3-gui/files/gns3-gui-rmraven.patch |
36 |
new file mode 100644 |
37 |
index 00000000000..9a8be4e6249 |
38 |
--- /dev/null |
39 |
+++ b/net-misc/gns3-gui/files/gns3-gui-rmraven.patch |
40 |
@@ -0,0 +1,182 @@ |
41 |
+From 2ea1946c0f83672f5289edcce207a8d2de03cc43 Mon Sep 17 00:00:00 2001 |
42 |
+From: grossmj <grossmj@××××.net> |
43 |
+Date: Tue, 19 May 2020 15:48:53 +0930 |
44 |
+Subject: [PATCH] Replace Raven by Sentry SDK. Fixes |
45 |
+ https://github.com/GNS3/gns3-server/issues/1758 |
46 |
+ |
47 |
+--- |
48 |
+ gns3/crash_report.py | 111 +++++++++++++++++++++++++------------------ |
49 |
+ requirements.txt | 2 +- |
50 |
+ 2 files changed, 66 insertions(+), 47 deletions(-) |
51 |
+ |
52 |
+diff --git a/gns3/crash_report.py b/gns3/crash_report.py |
53 |
+index a6a555fd5..dfbb9fc46 100644 |
54 |
+--- a/gns3/crash_report.py |
55 |
++++ b/gns3/crash_report.py |
56 |
+@@ -23,12 +23,11 @@ |
57 |
+ import distro |
58 |
+ |
59 |
+ try: |
60 |
+- import raven |
61 |
+- from raven.transport.http import HTTPTransport |
62 |
+- RAVEN_AVAILABLE = True |
63 |
++ import sentry_sdk |
64 |
++ SENTRY_SDK_AVAILABLE = True |
65 |
+ except ImportError: |
66 |
+- # raven is not installed with deb package in order to simplify packaging |
67 |
+- RAVEN_AVAILABLE = False |
68 |
++ # Sentry SDK is not installed with deb package in order to simplify packaging |
69 |
++ SENTRY_SDK_AVAILABLE = False |
70 |
+ |
71 |
+ from .utils.get_resource import get_resource |
72 |
+ from .version import __version__, __version_info__ |
73 |
+@@ -69,49 +68,50 @@ def __init__(self): |
74 |
+ sentry_uncaught = logging.getLogger('sentry.errors.uncaught') |
75 |
+ sentry_uncaught.disabled = True |
76 |
+ |
77 |
+- def captureException(self, exception, value, tb): |
78 |
+- from .local_server import LocalServer |
79 |
+- from .local_config import LocalConfig |
80 |
+- from .controller import Controller |
81 |
+- from .compute_manager import ComputeManager |
82 |
+- |
83 |
+- local_server = LocalServer.instance().localServerSettings() |
84 |
+- if local_server["report_errors"]: |
85 |
+- if not RAVEN_AVAILABLE: |
86 |
+- return |
87 |
+- |
88 |
+- if os.path.exists(LocalConfig.instance().runAsRootPath()): |
89 |
+- log.warning("User has run application as root. Crash reports are disabled.") |
90 |
+- sys.exit(1) |
91 |
+- return |
92 |
++ if SENTRY_SDK_AVAILABLE: |
93 |
++ cacert = None |
94 |
++ if hasattr(sys, "frozen"): |
95 |
++ cacert_resource = get_resource("cacert.pem") |
96 |
++ if cacert_resource is not None and os.path.isfile(cacert_resource): |
97 |
++ cacert = cacert_resource |
98 |
++ else: |
99 |
++ log.error("The SSL certificate bundle file '{}' could not be found".format(cacert_resource)) |
100 |
+ |
101 |
+- if os.path.exists(".git"): |
102 |
+- log.warning("A .git directory exist crash report is turn off for developers. Instant exit") |
103 |
+- sys.exit(1) |
104 |
+- return |
105 |
++ sentry_sdk.init(dsn=CrashReport.DSN, |
106 |
++ release=__version__, |
107 |
++ ca_certs=cacert) |
108 |
+ |
109 |
+- if hasattr(exception, "fingerprint"): |
110 |
+- client = raven.Client(CrashReport.DSN, release=__version__, fingerprint=['{{ default }}', exception.fingerprint], transport=HTTPTransport) |
111 |
+- else: |
112 |
+- client = raven.Client(CrashReport.DSN, release=__version__, transport=HTTPTransport) |
113 |
+- context = { |
114 |
++ tags = { |
115 |
+ "os:name": platform.system(), |
116 |
+ "os:release": platform.release(), |
117 |
+ "os:win_32": " ".join(platform.win32_ver()), |
118 |
+ "os:mac": "{} {}".format(platform.mac_ver()[0], platform.mac_ver()[2]), |
119 |
+ "os:linux": " ".join(distro.linux_distribution()), |
120 |
++ |
121 |
++ } |
122 |
++ |
123 |
++ self._add_qt_information(tags) |
124 |
++ |
125 |
++ with sentry_sdk.configure_scope() as scope: |
126 |
++ for key, value in tags.items(): |
127 |
++ scope.set_tag(key, value) |
128 |
++ |
129 |
++ extra_context = { |
130 |
+ "python:version": "{}.{}.{}".format(sys.version_info[0], |
131 |
+ sys.version_info[1], |
132 |
+ sys.version_info[2]), |
133 |
+ "python:bit": struct.calcsize("P") * 8, |
134 |
+ "python:encoding": sys.getdefaultencoding(), |
135 |
+- "python:frozen": "{}".format(hasattr(sys, "frozen")), |
136 |
++ "python:frozen": "{}".format(hasattr(sys, "frozen")) |
137 |
+ } |
138 |
+ |
139 |
+ # extra controller and compute information |
140 |
+- extra_context = {"controller:version": Controller.instance().version(), |
141 |
+- "controller:host": Controller.instance().host(), |
142 |
+- "controller:connected": Controller.instance().connected()} |
143 |
++ from .controller import Controller |
144 |
++ from .compute_manager import ComputeManager |
145 |
++ extra_context["controller:version"] = Controller.instance().version() |
146 |
++ extra_context["controller:host"] = Controller.instance().host() |
147 |
++ extra_context["controller:connected"] = Controller.instance().connected() |
148 |
++ |
149 |
+ for index, compute in enumerate(ComputeManager.instance().computes()): |
150 |
+ extra_context["compute{}:id".format(index)] = compute.id() |
151 |
+ extra_context["compute{}:name".format(index)] = compute.name(), |
152 |
+@@ -120,27 +120,46 @@ def captureException(self, exception, value, tb): |
153 |
+ extra_context["compute{}:platform".format(index)] = compute.capabilities().get("platform") |
154 |
+ extra_context["compute{}:version".format(index)] = compute.capabilities().get("version") |
155 |
+ |
156 |
+- context = self._add_qt_information(context) |
157 |
+- client.tags_context(context) |
158 |
+- client.extra_context(extra_context) |
159 |
++ with sentry_sdk.configure_scope() as scope: |
160 |
++ for key, value in extra_context.items(): |
161 |
++ scope.set_extra(key, value) |
162 |
++ |
163 |
++ def captureException(self, exception, value, tb): |
164 |
++ from .local_server import LocalServer |
165 |
++ from .local_config import LocalConfig |
166 |
++ |
167 |
++ local_server = LocalServer.instance().localServerSettings() |
168 |
++ if local_server["report_errors"]: |
169 |
++ if not SENTRY_SDK_AVAILABLE: |
170 |
++ return |
171 |
++ |
172 |
++ if os.path.exists(LocalConfig.instance().runAsRootPath()): |
173 |
++ log.warning("User is running application as root. Crash reports disabled.") |
174 |
++ sys.exit(1) |
175 |
++ return |
176 |
++ |
177 |
++ if os.path.exists(".git"): |
178 |
++ log.warning("A .git directory exists, crash reporting is turned off for developers.") |
179 |
++ sys.exit(1) |
180 |
++ return |
181 |
++ |
182 |
+ try: |
183 |
+- report = client.captureException((exception, value, tb)) |
184 |
++ sentry_sdk.capture_exception((exception, value, tb)) |
185 |
++ log.info("Crash report sent with event ID: {}".format(sentry_sdk.last_event_id())) |
186 |
+ except Exception as e: |
187 |
+ log.error("Can't send crash report to Sentry: {}".format(e)) |
188 |
+- return |
189 |
+- log.debug("Crash report sent with event ID: {}".format(client.get_ident(report))) |
190 |
+ |
191 |
+- def _add_qt_information(self, context): |
192 |
++ def _add_qt_information(self, tags): |
193 |
++ |
194 |
+ try: |
195 |
+ from .qt import QtCore |
196 |
+ from .qt import sip |
197 |
+ except ImportError: |
198 |
+- return context |
199 |
+- context["psutil:version"] = psutil.__version__ |
200 |
+- context["pyqt:version"] = QtCore.PYQT_VERSION_STR |
201 |
+- context["qt:version"] = QtCore.QT_VERSION_STR |
202 |
+- context["sip:version"] = sip.SIP_VERSION_STR |
203 |
+- return context |
204 |
++ return tags |
205 |
++ tags["pyqt:version"] = QtCore.PYQT_VERSION_STR |
206 |
++ tags["qt:version"] = QtCore.QT_VERSION_STR |
207 |
++ tags["sip:version"] = sip.SIP_VERSION_STR |
208 |
++ return tags |
209 |
+ |
210 |
+ @classmethod |
211 |
+ def instance(cls): |
212 |
+diff --git a/requirements.txt b/requirements.txt |
213 |
+index 99e803f1b..abd6cc7c9 100644 |
214 |
+--- a/requirements.txt |
215 |
++++ b/requirements.txt |
216 |
+@@ -1,5 +1,5 @@ |
217 |
+ jsonschema==3.2.0; python_version >= '3.8' # pyup: ignore |
218 |
+ jsonschema==2.6.0; python_version < '3.8' # pyup: ignore |
219 |
+-raven>=5.23.0 |
220 |
++sentry-sdk>=0.14.4 |
221 |
+ psutil==5.6.6 |
222 |
+ distro>=1.3.0 |
223 |
|
224 |
diff --git a/net-misc/gns3-gui/gns3-gui-2.2.8.ebuild b/net-misc/gns3-gui/gns3-gui-2.2.8.ebuild |
225 |
new file mode 100644 |
226 |
index 00000000000..5494cff0bb3 |
227 |
--- /dev/null |
228 |
+++ b/net-misc/gns3-gui/gns3-gui-2.2.8.ebuild |
229 |
@@ -0,0 +1,57 @@ |
230 |
+# Copyright 1999-2020 Gentoo Authors |
231 |
+# Distributed under the terms of the GNU General Public License v2 |
232 |
+ |
233 |
+EAPI=7 |
234 |
+ |
235 |
+PYTHON_COMPAT=( python3_{7,8} ) |
236 |
+ |
237 |
+inherit distutils-r1 desktop xdg |
238 |
+ |
239 |
+DESCRIPTION="Graphical Network Simulator" |
240 |
+HOMEPAGE="https://www.gns3.net/" |
241 |
+SRC_URI="https://github.com/GNS3/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
242 |
+ |
243 |
+LICENSE="GPL-3+" |
244 |
+SLOT="0" |
245 |
+KEYWORDS="~amd64 ~x86" |
246 |
+ |
247 |
+#net-misc/gns3-server version should always match gns3-gui version |
248 |
+RDEPEND=" |
249 |
+ >=dev-python/distro-1.3.0[${PYTHON_USEDEP}] |
250 |
+ $(python_gen_cond_dep '>=dev-python/jsonschema-3.2.0:=[${PYTHON_USEDEP}]' 'python3_8') |
251 |
+ $(python_gen_cond_dep '<=dev-python/jsonschema-2.6.0:=[${PYTHON_USEDEP}]' 'python3_7') |
252 |
+ >=dev-python/psutil-5.6.0[${PYTHON_USEDEP}] |
253 |
+ >=dev-python/sentry-sdk-0.14.4[${PYTHON_USEDEP}] |
254 |
+ ~net-misc/gns3-server-${PV}[${PYTHON_USEDEP}] |
255 |
+ dev-python/PyQt5[gui,network,svg,websockets,widgets,${PYTHON_USEDEP}] |
256 |
+" |
257 |
+ |
258 |
+DISTUTILS_USE_SETUPTOOLS=bdepend |
259 |
+ |
260 |
+PATCHES=( "${FILESDIR}/gns3-gui-rmraven.patch" ) |
261 |
+ |
262 |
+src_prepare() { |
263 |
+ default |
264 |
+ # newer psutils is fine |
265 |
+ sed -i -e '/psutil==5.6.6/d' requirements.txt || die "fixing requirements failed" |
266 |
+ eapply_user |
267 |
+} |
268 |
+ |
269 |
+python_install_all() { |
270 |
+ distutils-r1_python_install_all |
271 |
+ |
272 |
+ doicon "resources/images/gns3.ico" |
273 |
+ make_desktop_entry "gns3" "GNS3" "gns3.ico" "Utility" |
274 |
+} |
275 |
+ |
276 |
+pkg_postinst() { |
277 |
+ xdg_desktop_database_update |
278 |
+ xdg_mimeinfo_database_update |
279 |
+ xdg_icon_cache_update |
280 |
+} |
281 |
+ |
282 |
+pkg_postrm() { |
283 |
+ xdg_desktop_database_update |
284 |
+ xdg_mimeinfo_database_update |
285 |
+ xdg_icon_cache_update |
286 |
+} |
287 |
|
288 |
diff --git a/net-misc/gns3-gui/metadata.xml b/net-misc/gns3-gui/metadata.xml |
289 |
index 019d76c3361..09439c8762b 100644 |
290 |
--- a/net-misc/gns3-gui/metadata.xml |
291 |
+++ b/net-misc/gns3-gui/metadata.xml |
292 |
@@ -2,14 +2,12 @@ |
293 |
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
294 |
<pkgmetadata> |
295 |
<maintainer type="person"> |
296 |
- <email>onigino@××××××××××.com</email> |
297 |
- <name>Gino McCarty</name> |
298 |
- </maintainer> |
299 |
- <maintainer type="project"> |
300 |
- <email>proxy-maint@g.o</email> |
301 |
- <name>Proxy Maintainers</name> |
302 |
+ <email>bman@g.o</email> |
303 |
+ <name>Aaron Bauman</name> |
304 |
</maintainer> |
305 |
<upstream> |
306 |
<remote-id type="sourceforge">gns-3</remote-id> |
307 |
+ <remote-id type="github">GNS3/gns3-server</remote-id> |
308 |
+ <bugs-to>https://github.com/GNS3/gns3-server/issues</bugs-to> |
309 |
</upstream> |
310 |
</pkgmetadata> |