[calibre] PyQt4 0.9.6 build regression in calibre (#887511)

Rex Dieter rdieter at fedoraproject.org
Mon Dec 17 15:48:07 UTC 2012


commit 38e3f7755358b244e6c679b5b148eac0309fb8b4
Author: Rex Dieter <rdieter at math.unl.edu>
Date:   Mon Dec 17 09:48:04 2012 -0600

    PyQt4 0.9.6 build regression in calibre (#887511)

 calibre-pyqt496.patch |   15 +++++++++++++++
 calibre.spec          |   14 +++++++++++---
 2 files changed, 26 insertions(+), 3 deletions(-)
---
diff --git a/calibre-pyqt496.patch b/calibre-pyqt496.patch
new file mode 100644
index 0000000..a995af7
--- /dev/null
+++ b/calibre-pyqt496.patch
@@ -0,0 +1,15 @@
+=== modified file 'src/calibre/gui2/__init__.py'
+--- src/calibre/gui2/__init__.py	2012-11-26 06:10:52 +0000
++++ src/calibre/gui2/__init__.py	2012-12-15 18:45:46 +0000
+@@ -1034,7 +1034,9 @@
+             dat = dat.replace('from widgets import', 'from calibre.gui2.widgets import')
+             dat = dat.replace('from convert.xpath_wizard import',
+                 'from calibre.gui2.convert.xpath_wizard import')
+-            dat = re.compile(r'QtGui.QApplication.translate\(.+?,\s+"(.+?)(?<!\\)",.+?\)', re.DOTALL).sub(r'_("\1")', dat)
++            dat = re.sub(r'^ {4}def _translate\(.+:\s+return.*$', '    pass', dat,
++                         flags=re.M)
++            dat = re.compile(r'(?:QtGui.QApplication.translate|(?<!def )_translate)\(.+?,\s+"(.+?)(?<!\\)",.+?\)', re.DOTALL).sub(r'_("\1")', dat)
+             dat = dat.replace('_("MMM yyyy")', '"MMM yyyy"')
+             dat = pat.sub(sub, dat)
+             dat = dat.replace('from QtWebKit.QWebView import QWebView',
+
diff --git a/calibre.spec b/calibre.spec
index f0c4369..6e253f5 100644
--- a/calibre.spec
+++ b/calibre.spec
@@ -2,7 +2,7 @@
 
 Name:           calibre
 Version:        0.9.9
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        E-book converter and library management
 Group:          Applications/Multimedia
 License:        GPLv3
@@ -20,12 +20,15 @@ Source0:        %{name}-%{version}-nofonts.tar.xz
 Source1:        generate-tarball.sh
 Source2:        calibre-mount-helper
 Patch1:         %{name}-no-update.patch
+# https://bugzilla.redhat.com/887511
+# http://bazaar.launchpad.net/~kovid/calibre/trunk/revision/13885
+Patch2:         calibre-pyqt496.patch
 
 BuildRequires:  python >= 2.6
 BuildRequires:  python-devel >= 2.6
 BuildRequires:  ImageMagick-devel
 BuildRequires:  python-setuptools-devel
-BuildRequires:  qt-devel 
+BuildRequires:  qt4-devel
 BuildRequires:  PyQt4-devel
 BuildRequires:  podofo-devel
 BuildRequires:  desktop-file-utils
@@ -87,6 +90,7 @@ RTF, TXT, PDF and LRS.
 
 # don't check for new upstream version (that's what packagers do)
 %patch1 -p1 -b .no-update
+%patch2 -p0 -b .pyqt496
 
 # dos2unix newline conversion
 %{__sed} -i 's/\r//' src/calibre/web/feeds/recipes/*
@@ -130,7 +134,8 @@ LIBPATH="%{_libdir}" \
 python setup.py install --root=%{buildroot}%{_prefix} \
                         --prefix=%{_prefix} \
                         --libdir=%{_libdir} \
-                        --staging-libdir=%{buildroot}%{_libdir} \
+                        --staging-libdir=%{buildroot}%{_libdir}
+
 # remove shebang from init_calibre.py here because
 # it just got spawned by the install script
 %{__sed} -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/init_calibre.py
@@ -277,6 +282,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %{python_sitelib}/init_calibre.py*
 
 %changelog
+* Mon Dec 17 2012 Rex Dieter <rdieter at fedoraproject.org> 0.9.9-2
+- PyQt4 0.9.6 build regression in calibre (#887511)
+
 * Sun Dec 09 2012 Kevin Fenzi <kevin at scrye.com> 0.9.9-1
 - Update to 0.9.9
 


More information about the scm-commits mailing list