From a4ebc1d7537626e8469631c90b8037a7611eb44f Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Wed, 1 Nov 2017 18:35:53 +1100 Subject: [PATCH] quazip: various fixups - use standard header - add website - add explicit zlib dependency - build out of source - fix indentation - fix qmake handling of import lib - consolidate patches --- src/quazip-1-fixes.patch | 121 +++++++++++++++++++++++++ src/quazip-1-generate-pkg-config.patch | 64 ------------- src/quazip-2-link-to-lz.patch | 42 --------- src/quazip-3-windows_h.patch | 28 ------ src/quazip.mk | 26 +++--- 5 files changed, 134 insertions(+), 147 deletions(-) create mode 100644 src/quazip-1-fixes.patch delete mode 100644 src/quazip-1-generate-pkg-config.patch delete mode 100644 src/quazip-2-link-to-lz.patch delete mode 100644 src/quazip-3-windows_h.patch diff --git a/src/quazip-1-fixes.patch b/src/quazip-1-fixes.patch new file mode 100644 index 00000000..2622110e --- /dev/null +++ b/src/quazip-1-fixes.patch @@ -0,0 +1,121 @@ +This file is part of MXE. See LICENSE.md for licensing information. + +Contains ad hoc patches for cross building. + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zoltan Gyarmati +Date: Sun, 4 Jun 2017 03:19:59 +0200 +Subject: [PATCH] add pkg-config generation to qmake build + +Sent to upstream: https://sourceforge.net/p/quazip/patches/31/ + +Signed-off-by: Zoltan Gyarmati + +diff --git a/quazip/quazip.pro b/quazip/quazip.pro +index 1111111..2222222 100644 +--- a/quazip/quazip.pro ++++ b/quazip/quazip.pro +@@ -2,6 +2,13 @@ TEMPLATE = lib + CONFIG += qt warn_on + QT -= gui + ++# Creating pkgconfig .pc file ++CONFIG += create_prl no_install_prl create_pc ++ ++QMAKE_PKGCONFIG_PREFIX = $$PREFIX ++QMAKE_PKGCONFIG_INCDIR = $$headers.path ++QMAKE_PKGCONFIG_REQUIRES = Qt5Core ++ + # The ABI version. + + !win32:VERSION = 1.0.0 +@@ -43,6 +50,7 @@ unix:!symbian { + headers.path=$$PREFIX/include/quazip + headers.files=$$HEADERS + target.path=$$PREFIX/lib/$${LIB_ARCH} ++ QMAKE_PKGCONFIG_DESTDIR = pkgconfig + INSTALLS += headers target + + OBJECTS_DIR=.obj +@@ -53,8 +61,21 @@ unix:!symbian { + win32 { + headers.path=$$PREFIX/include/quazip + headers.files=$$HEADERS +- target.path=$$PREFIX/lib + INSTALLS += headers target ++ CONFIG(staticlib){ ++ target.path=$$PREFIX/lib ++ QMAKE_PKGCONFIG_LIBDIR = $$PREFIX/lib/ ++ } else { ++ target.path=$$PREFIX/bin ++ QMAKE_PKGCONFIG_LIBDIR = $$PREFIX/bin/ ++ } ++ ++ ## odd, this path seems to be relative to the ++ ## target.path, so if we install the .dll into ++ ## the 'bin' dir, the .pc will go there as well, ++ ## unless have hack the needed path... ++ ## TODO any nicer solution? ++ QMAKE_PKGCONFIG_DESTDIR = ../lib/pkgconfig + # workaround for qdatetime.h macro bug + DEFINES += NOMINMAX + } + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zoltan Gyarmati +Date: Sun, 4 Jun 2017 03:22:13 +0200 +Subject: [PATCH] add -lz dir for win build + +Signed-off-by: Zoltan Gyarmati + +diff --git a/quazip/quazip.pro b/quazip/quazip.pro +index 1111111..2222222 100644 +--- a/quazip/quazip.pro ++++ b/quazip/quazip.pro +@@ -78,6 +78,8 @@ win32 { + QMAKE_PKGCONFIG_DESTDIR = ../lib/pkgconfig + # workaround for qdatetime.h macro bug + DEFINES += NOMINMAX ++ ++ LIBS += -lz + } + + +diff --git a/qztest/qztest.pro b/qztest/qztest.pro +index 1111111..2222222 100644 +--- a/qztest/qztest.pro ++++ b/qztest/qztest.pro +@@ -40,8 +40,8 @@ testquazipfile.cpp \ + OBJECTS_DIR = .obj + MOC_DIR = .moc + +-win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../quazip/release/ -lquazip +-else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazipd ++win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../quazip/release/ -lquazip -lz ++else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazipd -lz + else:mac:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazip_debug + else:unix: LIBS += -L$$OUT_PWD/../quazip/ -lquazip + + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zoltan Gyarmati +Date: Sat, 3 Jun 2017 11:24:17 +0200 +Subject: [PATCH] use lowercase windows.h + +Sent to upstream: https://sourceforge.net/p/quazip/patches/30/ + +Signed-off-by: Zoltan Gyarmati + +diff --git a/qztest/testjlcompress.cpp b/qztest/testjlcompress.cpp +index 1111111..2222222 100644 +--- a/qztest/testjlcompress.cpp ++++ b/qztest/testjlcompress.cpp +@@ -34,7 +34,7 @@ see quazip/(un)zip.h files for details. Basically it's the zlib license. + #include + + #ifdef Q_OS_WIN +-#include ++#include + #endif + + void TestJlCompress::compressFile_data() diff --git a/src/quazip-1-generate-pkg-config.patch b/src/quazip-1-generate-pkg-config.patch deleted file mode 100644 index 453e7d0d..00000000 --- a/src/quazip-1-generate-pkg-config.patch +++ /dev/null @@ -1,64 +0,0 @@ -From e3280094b66dd3ce8a850d57cf5b148c9ae5f47d Mon Sep 17 00:00:00 2001 -From: Zoltan Gyarmati -Date: Sun, 4 Jun 2017 03:19:59 +0200 -Subject: [PATCH 1/2] add pkg-config generation to qmake build - -Sent to upstream: https://sourceforge.net/p/quazip/patches/31/ - -Signed-off-by: Zoltan Gyarmati ---- - quazip/quazip.pro | 23 ++++++++++++++++++++++- - 1 file changed, 22 insertions(+), 1 deletion(-) - -diff --git a/quazip/quazip.pro b/quazip/quazip.pro -index 3e10f36..eb68954 100644 ---- a/quazip/quazip.pro -+++ b/quazip/quazip.pro -@@ -2,6 +2,13 @@ TEMPLATE = lib - CONFIG += qt warn_on - QT -= gui - -+# Creating pkgconfig .pc file -+CONFIG += create_prl no_install_prl create_pc -+ -+QMAKE_PKGCONFIG_PREFIX = $$PREFIX -+QMAKE_PKGCONFIG_INCDIR = $$headers.path -+QMAKE_PKGCONFIG_REQUIRES = Qt5Core -+ - # The ABI version. - - !win32:VERSION = 1.0.0 -@@ -43,6 +50,7 @@ unix:!symbian { - headers.path=$$PREFIX/include/quazip - headers.files=$$HEADERS - target.path=$$PREFIX/lib/$${LIB_ARCH} -+ QMAKE_PKGCONFIG_DESTDIR = pkgconfig - INSTALLS += headers target - - OBJECTS_DIR=.obj -@@ -53,8 +61,21 @@ unix:!symbian { - win32 { - headers.path=$$PREFIX/include/quazip - headers.files=$$HEADERS -- target.path=$$PREFIX/lib - INSTALLS += headers target -+ CONFIG(staticlib){ -+ target.path=$$PREFIX/lib -+ QMAKE_PKGCONFIG_LIBDIR = $$PREFIX/lib/ -+ } else { -+ target.path=$$PREFIX/bin -+ QMAKE_PKGCONFIG_LIBDIR = $$PREFIX/bin/ -+ } -+ -+ ## odd, this path seems to be relative to the -+ ## target.path, so if we install the .dll into -+ ## the 'bin' dir, the .pc will go there as well, -+ ## unless have hack the needed path... -+ ## TODO any nicer solution? -+ QMAKE_PKGCONFIG_DESTDIR = ../lib/pkgconfig - # workaround for qdatetime.h macro bug - DEFINES += NOMINMAX - } --- -2.11.0 - diff --git a/src/quazip-2-link-to-lz.patch b/src/quazip-2-link-to-lz.patch deleted file mode 100644 index 2b5b529f..00000000 --- a/src/quazip-2-link-to-lz.patch +++ /dev/null @@ -1,42 +0,0 @@ -From cd5a0588c69b9d51382196c0b694f8af68f8daa1 Mon Sep 17 00:00:00 2001 -From: Zoltan Gyarmati -Date: Sun, 4 Jun 2017 03:22:13 +0200 -Subject: [PATCH 2/2] add -lz dir for win build - -Signed-off-by: Zoltan Gyarmati ---- - quazip/quazip.pro | 2 ++ - qztest/qztest.pro | 4 ++-- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/quazip/quazip.pro b/quazip/quazip.pro -index eb68954..ad0f915 100644 ---- a/quazip/quazip.pro -+++ b/quazip/quazip.pro -@@ -78,6 +78,8 @@ win32 { - QMAKE_PKGCONFIG_DESTDIR = ../lib/pkgconfig - # workaround for qdatetime.h macro bug - DEFINES += NOMINMAX -+ -+ LIBS += -lz - } - - -diff --git a/qztest/qztest.pro b/qztest/qztest.pro -index 663aee8..3a9b8e5 100644 ---- a/qztest/qztest.pro -+++ b/qztest/qztest.pro -@@ -40,8 +40,8 @@ testquazipfile.cpp \ - OBJECTS_DIR = .obj - MOC_DIR = .moc - --win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../quazip/release/ -lquazip --else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazipd -+win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../quazip/release/ -lquazip -lz -+else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazipd -lz - else:mac:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../quazip/debug/ -lquazip_debug - else:unix: LIBS += -L$$OUT_PWD/../quazip/ -lquazip - --- -2.11.0 - diff --git a/src/quazip-3-windows_h.patch b/src/quazip-3-windows_h.patch deleted file mode 100644 index c7772ff4..00000000 --- a/src/quazip-3-windows_h.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 25480f98ae0aa82e339ea696669cbf48db642f81 Mon Sep 17 00:00:00 2001 -From: Zoltan Gyarmati -Date: Sat, 3 Jun 2017 11:24:17 +0200 -Subject: [PATCH] use lowercase windows.h - -Sent to upstream: https://sourceforge.net/p/quazip/patches/30/ - -Signed-off-by: Zoltan Gyarmati ---- - qztest/testjlcompress.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/qztest/testjlcompress.cpp b/qztest/testjlcompress.cpp -index 36d6ea3..25c763b 100644 ---- a/qztest/testjlcompress.cpp -+++ b/qztest/testjlcompress.cpp -@@ -34,7 +34,7 @@ see quazip/(un)zip.h files for details. Basically it's the zlib license. - #include - - #ifdef Q_OS_WIN --#include -+#include - #endif - - void TestJlCompress::compressFile_data() --- -2.11.0 - diff --git a/src/quazip.mk b/src/quazip.mk index cecbebe1..cf596526 100644 --- a/src/quazip.mk +++ b/src/quazip.mk @@ -1,13 +1,14 @@ -# This file is part of MXE. -# See index.html for further information. +# This file is part of MXE. See LICENSE.md for licensing information. + PKG := quazip +$(PKG)_WEBSITE := https://sourceforge.net/projects/quazip/ $(PKG)_IGNORE := $(PKG)_VERSION := 0.7.3 $(PKG)_CHECKSUM := 2ad4f354746e8260d46036cde1496c223ec79765041ea28eb920ced015e269b5 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$($(PKG)_VERSION)/$($(PKG)_FILE) -$(PKG)_DEPS := gcc qtbase +$(PKG)_DEPS := gcc qtbase zlib define $(PKG)_UPDATE $(WGET) -q -O- 'http://sourceforge.net/projects/quazip/files/quazip/' | \ @@ -15,20 +16,19 @@ define $(PKG)_UPDATE head -1 endef - define $(PKG)_BUILD - cd '$(1)' && '$(PREFIX)/$(TARGET)/qt5/bin/qmake' \ - $(if $(BUILD_STATIC), CONFIG\+=staticlib) \ - PREFIX=$(PREFIX)/$(TARGET) - $(MAKE) -C '$(1)' -j '$(JOBS)' + cd '$(BUILD_DIR)' && '$(PREFIX)/$(TARGET)/qt5/bin/qmake' '$(SOURCE_DIR)' \ + $(if $(BUILD_STATIC), CONFIG\+=staticlib) \ + PREFIX=$(PREFIX)/$(TARGET) + $(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' $(if $(BUILD_STATIC), \ - echo 'Cflags.private: -DQUAZIP_STATIC' >> $(1)/quazip/lib/pkgconfig/quazip.pc) - $(MAKE) -C '$(1)' -j 1 install + echo 'Cflags.private: -DQUAZIP_STATIC' >> $(BUILD_DIR)/quazip/lib/pkgconfig/quazip.pc) + $(MAKE) -C '$(BUILD_DIR)' -j 1 install - # qmake insists to install the static .a - # even when building shared lib + # qmake misnames and installs import lib to bin $(if $(BUILD_SHARED), \ - rm -f $(PREFIX)/$(TARGET)/bin/libquazip.a) + mv -f $(PREFIX)/$(TARGET)/bin/libquazip.a \ + $(PREFIX)/$(TARGET)/lib/libquazip.dll.a) '$(TARGET)-g++' \ -W -Wall -Werror -std=c++11 -pedantic \