diff -rupN --no-dereference qhexedit2-0.8.9/example/qhexedit.pro qhexedit2-0.8.9-new/example/qhexedit.pro
--- qhexedit2-0.8.9/example/qhexedit.pro 2020-07-03 17:02:04.000000000 +0200
+++ qhexedit2-0.8.9-new/example/qhexedit.pro 2020-07-05 14:22:39.764729670 +0200
@@ -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 --no-dereference qhexedit2-0.8.9/setup.py qhexedit2-0.8.9-new/setup.py
--- qhexedit2-0.8.9/setup.py 2020-07-03 17:02:04.000000000 +0200
+++ qhexedit2-0.8.9-new/setup.py 2020-07-05 14:22:39.765729671 +0200
@@ -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.9',
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 --no-dereference qhexedit2-0.8.9/src/qhexedit.pro qhexedit2-0.8.9-new/src/qhexedit.pro
--- qhexedit2-0.8.9/src/qhexedit.pro 2020-07-03 17:02:04.000000000 +0200
+++ qhexedit2-0.8.9-new/src/qhexedit.pro 2020-07-05 14:22:39.765729671 +0200
@@ -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