Blob Blame History Raw
diff -rupN qhexedit2-0.8.2/example/qhexedit.pro qhexedit2-0.8.2-new/example/qhexedit.pro
--- qhexedit2-0.8.2/example/qhexedit.pro	2016-12-19 22:27:42.000000000 +0100
+++ qhexedit2-0.8.2-new/example/qhexedit.pro	2016-12-20 13:15:14.069802610 +0100
@@ -3,9 +3,6 @@ greaterThan(QT_MAJOR_VERSION, 4): QT +=
 HEADERS = \
     mainwindow.h \
     optionsdialog.h \
-    ../src/qhexedit.h \
-    ../src/chunks.h \
-    ../src/commands.h \
     searchdialog.h
 
 
@@ -13,11 +10,10 @@ SOURCES = \
     main.cpp \
     mainwindow.cpp \
     optionsdialog.cpp \
-    ../src/qhexedit.cpp \
-    ../src/chunks.cpp \
-    ../src/commands.cpp \
     searchdialog.cpp
 
+LIBS = -L../build-lib-qt5 -lqhexedit-qt5
+
 RESOURCES = \
     qhexedit.qrc
 
diff -rupN qhexedit2-0.8.2/setup.py qhexedit2-0.8.2-new/setup.py
--- qhexedit2-0.8.2/setup.py	2016-12-19 22:27:42.000000000 +0100
+++ qhexedit2-0.8.2-new/setup.py	2016-12-20 13:26:44.367639265 +0100
@@ -11,11 +11,12 @@ import sipconfig
 cfg = sipconfig.Configuration()
 pyqt_sip_dir = cfg.default_sip_dir
 
-try:
-    import PyQt5
+if os.environ.get('USE_QT5'):
     PyQt_Version = 'PyQt5'
-except:
+    libsuffix = "-qt5"
+else:
     PyQt_Version = 'PyQt4'
+    libsuffix = ""
 
 
 include_dirs = ['src']
@@ -44,6 +45,8 @@ class build_pyqt_ext(sipdistutils.build_
         sipdistutils.build_ext.finalize_options(self)
         self.sip_opts = self.sip_opts + PYQT_CONFIGURATION['sip_flags'].split()
         self.sip_opts.append('-I%s/%s' % (pyqt_sip_dir, PyQt_Version))
+        # Temporary workaround for python3-qt5 installing sip files in wrong folder
+        self.sip_opts.append('-I%s/%s' % ("/usr/share/sip", PyQt_Version))
         if self.required is not None:
             self.required = True
 
@@ -98,31 +101,34 @@ if cfg.qt_framework:
                                       lib + ".framework", "Headers")]
 else:
     if PyQt_Version == 'PyQt5':
-        for qt_inc_dir in ('/usr/include/qt', '/usr/include/x86_64-linux-gnu/qt5'):
+        for qt_inc_dir in ('/usr/include/qt5',):
             include_dirs.append(qt_inc_dir)
             include_dirs += [os.path.join(qt_inc_dir, lib) for lib in qt_libs]
         libraries = ["Qt5" + lib[2:] for lib in qt_libs]
+        library_dirs = ["build-lib-qt5"]
+        libraries.append("qhexedit-qt5")
     else:
-        for qt_inc_dir in ('/usr/include/qt', '/usr/include/qt4'):
+        for qt_inc_dir in ('/usr/include/',):
             include_dirs.append(qt_inc_dir)
             include_dirs += [os.path.join(qt_inc_dir, lib) for lib in qt_libs]
         libraries = ["Qt" + lib[2:] for lib in qt_libs]
-
-libraries.append("qhexedit")
+        library_dirs = ["build-lib-qt4"]
+        libraries.append("qhexedit")
 
 dirname = os.path.dirname(__file__)
 
 setup(
-    name='QHexEdit',
+    name='QHexEdit' + libsuffix,
     version='0.8.3',
     ext_modules=[
         Extension(
-            "qhexedit",
+            "qhexedit" + libsuffix,
             sources=[
                 os.path.join(dirname, "src/qhexedit.sip"),
             ],
             include_dirs=include_dirs,
             libraries=libraries,
+            library_dirs=library_dirs,
         )
     ],
     cmdclass={"build_ext": build_pyqt_ext},
diff -rupN qhexedit2-0.8.2/src/qhexedit.pro qhexedit2-0.8.2-new/src/qhexedit.pro
--- qhexedit2-0.8.2/src/qhexedit.pro	2016-12-19 22:27:42.000000000 +0100
+++ qhexedit2-0.8.2-new/src/qhexedit.pro	2016-12-20 13:20:17.164367089 +0100
@@ -1,5 +1,6 @@
 
 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+equals(QT_MAJOR_VERSION, 5): QTSUFFIX = -qt5
 
 QT += core gui
 TEMPLATE = lib
@@ -19,9 +20,4 @@ SOURCES = \
     chunks.cpp \
     commands.cpp
 
-Release:TARGET = qhexedit
-Debug:TARGET = qhexeditd
-
-
-unix:DESTDIR = /usr/lib
-win32:DESTDIR = ../lib
+TARGET      = qhexedit$$QTSUFFIX