[asymptote] use from PIL import foo syntax to support pillow and imaging

Tom Callaway spot at fedoraproject.org
Thu Jan 31 08:37:56 UTC 2013


commit 428ae99588be1a8ba8631da4545f308a9825be47
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Thu Jan 31 03:40:31 2013 -0500

    use from PIL import foo syntax to support pillow and imaging

 asymptote-use-PIL-import.patch |   27 +++++++++++++++++++++++++++
 asymptote.spec                 |    9 ++++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/asymptote-use-PIL-import.patch b/asymptote-use-PIL-import.patch
new file mode 100644
index 0000000..37b4b7e
--- /dev/null
+++ b/asymptote-use-PIL-import.patch
@@ -0,0 +1,27 @@
+--- asymptote-2.21/GUI/xasy2asy.py	
++++ asymptote-2.21/GUI/xasy2asy.py	
+@@ -18,8 +18,8 @@ from tempfile import mkdtemp
+ 
+ # PIL support is now mandatory due to rotations
+ try:
+-  import ImageTk
+-  import Image
++  from PIL import ImageTk
++  from PIL import Image
+ except:
+    pass
+ 
+--- asymptote-2.21/GUI/xasyMainWin.py	
++++ asymptote-2.21/GUI/xasyMainWin.py	
+@@ -40,8 +40,8 @@ from xasyActions import *
+ import string
+ 
+ try:
+-  import ImageTk
+-  import Image
++  from PIL import ImageTk
++  from PIL import Image
+   PILAvailable = True
+ except:
+   PILAvailable = False
+
diff --git a/asymptote.spec b/asymptote.spec
index 4cb45eb..6c78170 100644
--- a/asymptote.spec
+++ b/asymptote.spec
@@ -2,7 +2,7 @@
 
 Name:           asymptote
 Version:        2.21
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Descriptive vector graphics language
 Group:          Applications/Publishing
 License:        LGPLv3+
@@ -12,6 +12,9 @@ Source1:	asy.gif
 Source2:	xasy.desktop
 Source3:	asymptote.sty.204
 Patch0:         asymptote-2.00-settings.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=893790
+# https://sourceforge.net/tracker/?func=detail&aid=3602764&group_id=120000&atid=685683
+Patch1:		asymptote-use-PIL-import.patch
 # This doesn't need to go upstream. We put the info file in the topdir, not a subdir, so we need this fix.
 Patch3:		asymptote-2.08-info-path-fix.patch
 BuildRequires:  ncurses-devel
@@ -94,6 +97,7 @@ package to use %{name} with XEmacs.
 %prep
 %setup -q
 %patch0 -p1 -b .settings
+%patch1 -p1 -b .PIL-fix
 %patch3 -p1 -b .path-fix
 %{__sed} -i 's/\r//' doc/CAD1.asy
 
@@ -208,6 +212,9 @@ fi
 %{_xemacs_sitelispdir}/%{name}/*.el
 
 %changelog
+* Thu Jan 31 2013 Tom Callaway <spot at fedoraproject.org> - 2.21-4
+- use pillow compatible import (from PIL import foo)
+
 * Tue Oct 23 2012 Tom Callaway <spot at fedoraproject.org> - 2.21-3
 - more missing BR, conditionalize texlive hacks
 


More information about the scm-commits mailing list