diff --git a/no-pygtkcompat.patch b/no-pygtkcompat.patch new file mode 100644 index 0000000..9beb80c --- /dev/null +++ b/no-pygtkcompat.patch @@ -0,0 +1,18 @@ +diff -ur Twisted-18.7.0.orig/src/twisted/internet/gireactor.py Twisted-18.7.0/src/twisted/internet/gireactor.py +--- Twisted-18.7.0.orig/src/twisted/internet/gireactor.py 2018-03-26 10:19:31.000000000 +0200 ++++ Twisted-18.7.0/src/twisted/internet/gireactor.py 2018-10-04 01:41:32.547220235 +0200 +@@ -75,8 +75,12 @@ + # Newer version of gi, so we can try to initialize compatibility layer; if + # real pygtk was already imported we'll get ImportError at this point + # rather than segfault, so unconditional import is fine. +- import gi.pygtkcompat +- gi.pygtkcompat.enable() ++ try: ++ import gi.pygtkcompat ++ except ImportError: ++ pass # This is probably Python 3, with pygtkcompat removed ++ else: ++ gi.pygtkcompat.enable() + # At this point importing gobject will get you gi version, and importing + # e.g. gtk will either fail in non-segfaulty way or use gi version if user + # does gi.pygtkcompat.enable_gtk(). So, no need to prevent imports of diff --git a/python-Twisted.changes b/python-Twisted.changes index ad9cc04..8dee6fc 100644 --- a/python-Twisted.changes +++ b/python-Twisted.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Nov 8 10:28:09 CET 2018 - mcepl@suse.com + +- Add no-pygtkcompat.patch to avoid dependency on Gtk (boo#1110669) + ------------------------------------------------------------------- Thu Nov 1 09:21:03 UTC 2018 - Tomáš Chvátal diff --git a/python-Twisted.spec b/python-Twisted.spec index 772cd55..052b517 100644 --- a/python-Twisted.spec +++ b/python-Twisted.spec @@ -29,6 +29,7 @@ URL: http://twistedmatrix.com/ Source: https://files.pythonhosted.org/packages/source/T/Twisted/%{modname}-%{version}.tar.bz2 Patch1: skip_MultiCast.patch Patch2: openssl111.patch +Patch3: no-pygtkcompat.patch BuildRequires: %{python_module Automat >= 0.3.0} BuildRequires: %{python_module PyHamcrest >= 1.9.0} BuildRequires: %{python_module appdirs >= 1.4.0}