[vlc-commits] Contribs: add support for QtSVG for Qt

Pierre Lamot git at videolan.org
Fri Oct 13 00:01:38 CEST 2017


vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Sep 29 10:25:03 2017 +0200| [189ca8feb6c784101a879895e8ad7cd793a0f16c] | committer: Jean-Baptiste Kempf

Contribs: add support for QtSVG for Qt

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=189ca8feb6c784101a879895e8ad7cd793a0f16c
---

 contrib/src/qt/rules.mak                           |  3 +-
 .../0001-Force-the-usage-of-QtZlib-header.patch    | 29 ++++++++++++++++++
 contrib/src/qtsvg/SHA512SUMS                       |  1 +
 contrib/src/qtsvg/rules.mak                        | 34 ++++++++++++++++++++++
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 3a3ff05c3b..d8b2196f57 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -60,7 +60,7 @@ endif
 	mkdir -p $(PREFIX)/include/QtGui/qpa
 	cp $(PREFIX)/include/QtGui/$(QT_VERSION)/QtGui/qpa/qplatformnativeinterface.h $(PREFIX)/include/QtGui/qpa
 	# Clean Qt mess
-	rm -rf $(PREFIX)/lib/libQt5Bootstrap* $(PREFIX)/lib/*.prl $(PREFIX)/mkspecs
+	rm -rf $(PREFIX)/lib/libQt5Bootstrap*
 	# Fix .pc files to remove debug version (d)
 	cd $(PREFIX)/lib/pkgconfig; for i in Qt5Core.pc Qt5Gui.pc Qt5Widgets.pc; do sed -i -e 's/d\.a/.a/g' -e 's/d $$/ /' $$i; done
 	# Fix Qt5Gui.pc file to include qwindows (QWindowsIntegrationPlugin) and Qt5Platform Support
@@ -69,6 +69,7 @@ ifdef HAVE_CROSS_COMPILE
 	# Building Qt build tools for Xcompilation
 	cd $</include/QtCore; ln -sf $(QT_VERSION)/QtCore/private
 	cd $</qmake; $(MAKE)
+	cd $<; $(MAKE) install_qmake install_mkspecs
 	cd $</src/tools; \
 	for i in bootstrap uic rcc moc; \
 		do (cd $$i; echo $$i && ../../../bin/qmake -spec $(QT_SPEC) && $(MAKE) clean && $(MAKE) CC=$(HOST)-gcc CXX=$(HOST)-g++ LINKER=$(HOST)-g++ && $(MAKE) install); \
diff --git a/contrib/src/qtsvg/0001-Force-the-usage-of-QtZlib-header.patch b/contrib/src/qtsvg/0001-Force-the-usage-of-QtZlib-header.patch
new file mode 100644
index 0000000000..701b36c264
--- /dev/null
+++ b/contrib/src/qtsvg/0001-Force-the-usage-of-QtZlib-header.patch
@@ -0,0 +1,29 @@
+From ed55cab9836d8ed9a4738c795855b0b2af6fa6b9 Mon Sep 17 00:00:00 2001
+From: Pierre Lamot <pierre at videolabs.io>
+Date: Thu, 21 Sep 2017 12:05:15 +0200
+Subject: [PATCH] Force the usage of QtZlib header
+
+  qmake adds -I$(PREFIX)/include before adding
+  -I$(PREFIX)/include/QtZlib in its path while cross
+  compiling which ends up using the definition from the
+  system zlib while linking to QtZlib
+---
+ src/svg/qsvgtinydocument.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/svg/qsvgtinydocument.cpp b/src/svg/qsvgtinydocument.cpp
+index cc0fd5d..450c2d1 100644
+--- a/src/svg/qsvgtinydocument.cpp
++++ b/src/svg/qsvgtinydocument.cpp
+@@ -45,7 +45,7 @@
+ #include "qdebug.h"
+ 
+ #ifndef QT_NO_COMPRESS
+-#include <zlib.h>
++#include <QtZlib/zlib.h>
+ #endif
+ 
+ QT_BEGIN_NAMESPACE
+-- 
+2.14.1
+
diff --git a/contrib/src/qtsvg/SHA512SUMS b/contrib/src/qtsvg/SHA512SUMS
new file mode 100644
index 0000000000..0edeff3a5e
--- /dev/null
+++ b/contrib/src/qtsvg/SHA512SUMS
@@ -0,0 +1 @@
+ff78a75d0452de56dfe5b33f64d611c9e75e1a46c2ca168f9d3467ef3bb32f17ef256b45df275ed45bc2215d31dbf321d9cacb3f428096354041481276683958  qtsvg-5.6.2.tar.xz
diff --git a/contrib/src/qtsvg/rules.mak b/contrib/src/qtsvg/rules.mak
new file mode 100644
index 0000000000..924f6efca7
--- /dev/null
+++ b/contrib/src/qtsvg/rules.mak
@@ -0,0 +1,34 @@
+# Qt
+
+QTSVG_VERSION := 5.6.2
+QTSVG_URL := https://download.qt.io/official_releases/qt/5.6/$(QTSVG_VERSION)/submodules/qtsvg-opensource-src-$(QTSVG_VERSION).tar.xz
+
+DEPS_qtsvg += qt $(DEPS_qt)
+
+ifeq ($(call need_pkg,"Qt5Svg"),)
+PKGS_FOUND += qtsvg
+endif
+
+$(TARBALLS)/qtsvg-$(QTSVG_VERSION).tar.xz:
+	$(call download,$(QTSVG_URL))
+
+.sum-qtsvg: qtsvg-$(QTSVG_VERSION).tar.xz
+
+qtsvg: qtsvg-$(QTSVG_VERSION).tar.xz .sum-qtsvg
+	$(UNPACK)
+	mv qtsvg-opensource-src-$(QTSVG_VERSION) qtsvg-$(QTSVG_VERSION)
+	$(APPLY) $(SRC)/qtsvg/0001-Force-the-usage-of-QtZlib-header.patch
+	$(MOVE)
+
+.qtsvg: qtsvg
+	cd $< && $(PREFIX)/bin/qmake
+	# Make && Install libraries
+	cd $< && $(MAKE)
+	cd $</src && $(MAKE) sub-plugins-install_subtargets sub-svg-install_subtargets
+	mv $(PREFIX)/plugins/iconengines/libqsvgicon.a $(PREFIX)/lib/
+	mv $(PREFIX)/plugins/imageformats/libqsvg.a $(PREFIX)/lib/
+	cd $(PREFIX)/lib/pkgconfig; sed -i \
+		-e 's/d\.a/.a/g' \
+		-e 's/-lQt\([^ ]*\)d/-lQt\1/g' \
+		-e '/Libs:/  s/$$/ -lqsvg -lqsvgicon/ ' \
+		Qt5Svg.pc



More information about the vlc-commits mailing list