Hello community,

here is the log from the commit of package python-poppler-qt4 for 
openSUSE:Factory checked in at 2015-02-16 07:36:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-poppler-qt4 (Old)
 and      /work/SRC/openSUSE:Factory/.python-poppler-qt4.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-poppler-qt4"

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-poppler-qt4/python-poppler-qt4.changes    
2014-04-11 13:42:00.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-poppler-qt4.new/python-poppler-qt4.changes   
    2015-02-16 07:36:31.000000000 +0100
@@ -1,0 +2,6 @@
+Fri Feb 13 22:33:03 UTC 2015 - [email protected]
+
+- Update to 0.18.2:
+  * Support PyQt's "new" build system
+
+-------------------------------------------------------------------

Old:
----
  python-poppler-qt4-0.18.1.tar.gz

New:
----
  python-poppler-qt4-0.18.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-poppler-qt4.spec ++++++
--- /var/tmp/diff_new_pack.F2gQii/_old  2015-02-16 07:36:32.000000000 +0100
+++ /var/tmp/diff_new_pack.F2gQii/_new  2015-02-16 07:36:32.000000000 +0100
@@ -1,9 +1,9 @@
 #
 # spec file for package python-poppler-qt4
 #
+# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
 # Copyright (c) 2011 LISA GmbH, Bingen, Germany.
 # Copyright (c) 2012 Johannes Engel <[email protected]>
-# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,14 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-# norootforbuild
 
 Name:           python-poppler-qt4
 BuildRequires:  libpoppler-qt4-devel
 BuildRequires:  python-qt4-devel
+Summary:        Python binding to poppler-qt4
 License:        LGPL-2.1+
 Group:          Development/Libraries/Python
-Summary:        Python binding to poppler-qt4
-Version:        0.18.1
+Version:        0.18.2
 Release:        0
 Url:            https://github.com/wbsoft/python-poppler-qt4
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ python-poppler-qt4-0.18.1.tar.gz -> python-poppler-qt4-0.18.2.tar.gz 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-poppler-qt4-0.18.1/ChangeLog 
new/python-poppler-qt4-0.18.2/ChangeLog
--- old/python-poppler-qt4-0.18.1/ChangeLog     2014-02-18 09:35:10.000000000 
+0100
+++ new/python-poppler-qt4-0.18.2/ChangeLog     2015-01-09 13:29:37.000000000 
+0100
@@ -1,3 +1,9 @@
+Version 0.18.2 -- January 9th, 2015
+
+* Tested with Python 2.6, 2.7, 3.2, 3.3, 3.4
+* Support PyQt's new build system, contributed by Philipp Lorenz,
+  fixing issue #6
+
 Version 0.18.1 -- February 18th, 2014
 
 * Tested with Python 2.6, 2.7, 3.2, 3.3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-poppler-qt4-0.18.1/poppler-qt4.sip 
new/python-poppler-qt4-0.18.2/poppler-qt4.sip
--- old/python-poppler-qt4-0.18.1/poppler-qt4.sip       2014-02-18 
09:35:10.000000000 +0100
+++ new/python-poppler-qt4-0.18.2/poppler-qt4.sip       2015-01-09 
13:29:37.000000000 +0100
@@ -82,8 +82,6 @@
 %End
 %If(POPPLER_V0_24_0 -)
         ThinLineSolid = 0x00000020,
-%End
-%If(POPPLER_V0_24_0 -)
         ThinLineShape = 0x00000040,
 %End
     };
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/python-poppler-qt4-0.18.1/setup.py 
new/python-poppler-qt4-0.18.2/setup.py
--- old/python-poppler-qt4-0.18.1/setup.py      2014-02-18 09:35:10.000000000 
+0100
+++ new/python-poppler-qt4-0.18.2/setup.py      2015-01-09 13:29:37.000000000 
+0100
@@ -2,11 +2,14 @@
 
 project = dict(
     name = 'python-poppler-qt4',
-    version = '0.18.1',
+    version = '0.18.2',
     description = 'A Python binding to Poppler-Qt4',
-    long_description = \
-        'A Python binding to Poppler-Qt4 that aims for ' \
-        'completeness and for being actively maintained.',
+    long_description = (
+        'A Python binding to Poppler-Qt4 that aims for '
+        'completeness and for being actively maintained. '
+        'Using this module you can access the contents of PDF files '
+        'inside PyQt4 applications.'
+    ),
     maintainer = 'Wilbert Berendsen',
     maintainer_email = '[email protected]',
     url = 'https://github.com/wbsoft/python-poppler-qt4',
@@ -53,14 +56,6 @@
     pass
 ### end
 
-import PyQt4.pyqtconfig
-config = PyQt4.pyqtconfig.Configuration()
-
-pyqt_sip_dir = config.pyqt_sip_dir
-pyqt_sip_flags = config.pyqt_sip_flags
-qt_inc_dir = config.qt_inc_dir
-
-
 def pkg_config(package, attrs=None, include_only=False):
     """parse the output of pkg-config for a package.
     
@@ -104,17 +99,8 @@
         return tuple(map(int, re.findall(r'\d+', output)))
     except OSError:
         sys.stderr.write("Can't determine version of %s\n" % package)
-        
-
-ext_args = {
-    'include_dirs': [
-        qt_inc_dir,
-        os.path.join(qt_inc_dir, 'QtCore'),
-        os.path.join(qt_inc_dir, 'QtGui'),
-        os.path.join(qt_inc_dir, 'QtXml'),
-    ],
-}
 
+ext_args = {}
 pkg_config('poppler-qt4', ext_args)
 
 if 'libraries' not in ext_args:
@@ -128,17 +114,108 @@
     
     user_options = build_ext_base.user_options + [
         ('poppler-version=', None, "version of the poppler library"),
+        ('qmake-bin=', None, "Path to qmake binary"),
+        ('qt-include-dir=', None, "Path to Qt headers"),
+        ('pyqt-sip-dir=', None, "Path to PyQt's SIP files"),
+        ('pyqt-sip-flags=', None, "SIP flags used to generate PyQt bindings")
     ]
     
     def initialize_options (self):
         build_ext_base.initialize_options(self)
         self.poppler_version = None
 
+        self.qmake_bin = 'qmake'
+
+        self.qt_include_dir = None
+        self.pyqt_sip_dir = None
+        self.pyqt_sip_flags = None
+
     def finalize_options (self):
         build_ext_base.finalize_options(self)
+
+        if not self.qt_include_dir:
+            self.qt_include_dir = self.__find_qt_include_dir()
+
+        if not self.pyqt_sip_dir:
+            self.pyqt_sip_dir = self.__find_pyqt_sip_dir()
+
+        if not self.pyqt_sip_flags:
+            self.pyqt_sip_flags = self.__find_pyqt_sip_flags()
+
+        if not self.qt_include_dir:
+            raise SystemExit('Could not find Qt4 headers. '
+                             'Please specify via --qt-include-dir=')
+
+        if not self.pyqt_sip_dir:
+            raise SystemExit('Could not find PyQt SIP files. '
+                             'Please specify containing directory via '
+                             '--pyqt-sip-dir=')
+
+        if not self.pyqt_sip_flags:
+            raise SystemExit('Could not find PyQt SIP flags. '
+                             'Please specify via --pyqt-sip-flags=')
+
+        self.include_dirs += (self.qt_include_dir,
+                              os.path.join(self.qt_include_dir, 'QtCore'),
+                              os.path.join(self.qt_include_dir, 'QtGui'),
+                              os.path.join(self.qt_include_dir, 'QtXml'))
+
         if self.poppler_version is not None:
             self.poppler_version = tuple(map(int, re.findall(r'\d+', 
self.poppler_version)))
 
+    def __find_qt_include_dir(self):
+        if self.pyqtconfig:
+            return self.pyqtconfig.qt_inc_dir
+
+        try:
+            qt_version = subprocess.check_output([self.qmake_bin,
+                                                  '-query',
+                                                  'QT_VERSION'])
+            qt_version = qt_version.strip().decode("ascii")
+        except (OSError, subprocess.CalledProcessError) as e:
+            raise SystemExit('Failed to determine Qt version (%s).' % e)
+
+        if not qt_version.startswith("4."):
+            raise SystemExit('Unsupported Qt version (%s). '
+                             'Try specifying the path to qmake manually via '
+                             '--qmake-bin=' % qt_version)
+
+        try:
+            result =  subprocess.check_output([self.qmake_bin,
+                                               '-query',
+                                               'QT_INSTALL_HEADERS'])
+            return result.strip().decode(sys.getfilesystemencoding())
+        except (OSError, subprocess.CalledProcessError) as e:
+            raise SystemExit('Failed to determine location of Qt headers 
(%s).' % e)
+
+    def __find_pyqt_sip_dir(self):
+        if self.pyqtconfig:
+            return self.pyqtconfig.pyqt_sip_dir
+
+        import sipconfig
+
+        return os.path.join(sipconfig.Configuration().default_sip_dir, 'PyQt4')
+
+    def __find_pyqt_sip_flags(self):
+        if self.pyqtconfig:
+            return self.pyqtconfig.pyqt_sip_flags
+
+        from PyQt4 import QtCore
+
+        return QtCore.PYQT_CONFIGURATION.get('sip_flags', '')
+
+    @property
+    def pyqtconfig(self):
+        if not hasattr(self, '_pyqtconfig'):
+            try:
+                from PyQt4 import pyqtconfig
+
+                self._pyqtconfig = pyqtconfig.Configuration()
+            except ImportError:
+                self._pyqtconfig = None
+
+        return self._pyqtconfig
+
     def _sip_compile(self, sip_bin, source, sbf):
         
         # Disable features if older poppler-qt4 version is found.
@@ -173,8 +250,8 @@
         cmd += [
             "-c", self.build_temp,
             "-b", sbf,
-            "-I", pyqt_sip_dir]             # find the PyQt4 stuff
-        cmd += shlex.split(pyqt_sip_flags)  # use same SIP flags as for PyQt4
+            "-I", self.pyqt_sip_dir]             # find the PyQt4 stuff
+        cmd += shlex.split(self.pyqt_sip_flags)  # use same SIP flags as for 
PyQt4
         cmd.append(source)
         self.spawn(cmd)
 

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to