From 759d2a792440aa53403fbe4c8c42726dfe34fafb Mon Sep 17 00:00:00 2001 From: Albert S Date: Tue, 21 Jun 2022 22:10:21 +0200 Subject: [PATCH] Fix builds with quazip 1.X Sigh. quazip changed the lib name, include locations, etc. from version 1. Some distributions only have 0.9. Some only 1.x and so some packages break, so they simply patch it when building the package. Luckily, nothing we use from quazip is affected from an API perspective. So detect if there is quazip1, then use pkg-config to link that, else do it like before. --- cli/cli.pro | 6 ++++++ gui/gui.pro | 10 ++++++++++ shared/odtprocessor.cpp | 4 ++-- shared/shared.pro | 6 +++++- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/cli/cli.pro b/cli/cli.pro index ba42658..e495bf8 100644 --- a/cli/cli.pro +++ b/cli/cli.pro @@ -37,6 +37,12 @@ else:unix: LIBS += -L$$OUT_PWD/../shared/ -lshared LIBS += -luchardet -lpoppler-qt5 -lquazip5 +packagesExist(quazip1-qt5) { + PKGCONFIG += quazip1-qt5 + CONFIG += link_pkgconfig + LIBS -= -lquazip5 +} + INCLUDEPATH += $$PWD/../shared DEPENDPATH += $$PWD/../shared diff --git a/gui/gui.pro b/gui/gui.pro index 7b5b200..e15f982 100644 --- a/gui/gui.pro +++ b/gui/gui.pro @@ -7,7 +7,11 @@ QT += core concurrent gui network greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + CONFIG += c++17 + + + TARGET = looqs-gui TEMPLATE = app @@ -69,6 +73,12 @@ else:unix: LIBS += -L$$OUT_PWD/../shared/ -lshared LIBS += -luchardet -lpoppler-qt5 -lquazip5 +packagesExist(quazip1-qt5) { + PKGCONFIG += quazip1-qt5 + CONFIG += link_pkgconfig + LIBS -= -lquazip5 +} + INCLUDEPATH += $$PWD/../shared DEPENDPATH += $$PWD/../shared diff --git a/shared/odtprocessor.cpp b/shared/odtprocessor.cpp index 9bd61b4..fc2b0f4 100644 --- a/shared/odtprocessor.cpp +++ b/shared/odtprocessor.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "odtprocessor.h" #include "tagstripperprocessor.h" diff --git a/shared/shared.pro b/shared/shared.pro index b2499f4..a1b6f07 100644 --- a/shared/shared.pro +++ b/shared/shared.pro @@ -16,7 +16,11 @@ CONFIG += c++17 INCLUDEPATH += $$PWD/../sandbox/exile.h/ INCLUDEPATH += /usr/include/poppler/qt5/ /usr/include/quazip5 - +# Dirty, we only need the includes here but well this magic works, so... +packagesExist(quazip1-qt5) { + PKGCONFIG += quazip1-qt5 + CONFIG += link_pkgconfig +} # The following define makes your compiler emit warnings if you use # any feature of Qt which has been marked as deprecated (the exact warnings