Package: taurus
Version: 3.0.0-1
Severity: serious

inkscape ask a few question during the build.
It means that it stop the build -> FTBFS

now we use imagemagick as fallback



-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-486
Locale: LANG=fr_CA.UTF-8, LC_CTYPE=fr_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <pi...@debian.org>
Date: Fri, 18 Jan 2013 21:20:39 +0100
Subject: upstream fix for the FTBFS due to image conversion

---
 setup.py |   24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/setup.py b/setup.py
index c3afb89..92d570a 100644
--- a/setup.py
+++ b/setup.py
@@ -585,7 +585,6 @@ if sphinx:
         def run(self):
             self.resource_dir = abspath('lib', 'taurus', 'qt', 'qtgui', 'resource')
             self.taurus = os.path.join(self.resource_dir, 'taurus.png')
-            import PyQt4.Qt
             orig_dir = os.path.abspath(os.curdir)
             os.chdir(self.resource_dir)
             
@@ -699,13 +698,13 @@ if sphinx:
 
     class build_doc(BuildDoc):
         user_options = BuildDoc.user_options + \
-                     [('use-inkscape', None, 
-                       "Use inkscape for building the icon catalog (useful if QApplication cannot be used when building, but requires inkscape)")]
-        boolean_options = BuildDoc.boolean_options + ['use-inkscape']
+                     [('external-img-tools', None, 
+                       "Use external tools for converting the icon catalog (useful if QApplication cannot be used while building, but requires inkscape and imagemagick)")]
+        boolean_options = BuildDoc.boolean_options + ['external-img-tools']
         
         def initialize_options (self):
             BuildDoc.initialize_options(self)
-            self.use_inkscape = False
+            self.external_img_tools = False
         
         def has_doc_api(self):
             return True
@@ -757,20 +756,20 @@ if sphinx:
             # copy the tango icons to the build directory of documentation
             target = os.path.join(build_dir, 'devel')
             
-            if not self.use_inkscape:
+            if not self.external_img_tools:
                 import PyQt4.Qt
                 if PyQt4.Qt.qApp.instance() is None:
                     self.app = PyQt4.Qt.QApplication([])
             
             print("\tBuilding PNGs for icon catalog")   
-            os.path.walk(resource, svg_to_png, (resource, target, self.use_inkscape))
+            os.path.walk(resource, svg_to_png, (resource, target, self.external_img_tools))
             return
     
     cmdclass['build_doc'] = build_doc
 
 def svg_to_png(arg, dirname, fnames):
-    resource, target, use_inkscape = arg
-    if not use_inkscape:
+    resource, target, external_img_tools = arg
+    if not external_img_tools:
         import PyQt4.Qt
     relpath = os.path.relpath(dirname, start=resource)
     path = os.path.join(target, relpath)
@@ -783,9 +782,12 @@ def svg_to_png(arg, dirname, fnames):
             target_fname = fbase + ".png"
             full_target_fname = os.path.join(path, target_fname)
             if not os.path.isfile(full_target_fname):
-                if use_inkscape:
-                    cmd = "inkscape -z -e '%s' -w 24 '%s' > /dev/null"%(full_target_fname, full_source_fname)
+                if external_img_tools:
+                    cmd = "inkscape -z '%s' -e '%s' -w 24 >/dev/null 2>/dev/null"%(full_source_fname, full_target_fname)
                     ok = not(os.system(cmd))
+                    if not ok:
+                        cmd = "convert -resize 24 '%s' '%s' >/dev/null 2>/dev/null"%(full_source_fname, full_target_fname)
+                        ok = not(os.system(cmd))
                 else:
                     pixmap = PyQt4.Qt.QPixmap(full_source_fname)
                     pix = pixmap.scaledToWidth(24, PyQt4.Qt.Qt.SmoothTransformation)

Reply via email to