[vlc-commits] Contribs: rewrite most of Qt installation

Jean-Baptiste Kempf git at videolan.org
Thu Mar 17 16:25:00 CET 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Mar 17 00:39:37 2016 +0100| [0bb5bf5f141f0f1ca5a9e246078171d4934e4dd8] | committer: Jean-Baptiste Kempf

Contribs: rewrite most of Qt installation

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

 contrib/src/qt/rules.mak |   62 ++++++++++++++++++++--------------------------
 1 file changed, 27 insertions(+), 35 deletions(-)

diff --git a/contrib/src/qt/rules.mak b/contrib/src/qt/rules.mak
index 06211fe..e44f158 100644
--- a/contrib/src/qt/rules.mak
+++ b/contrib/src/qt/rules.mak
@@ -1,4 +1,4 @@
-# qt
+# Qt
 
 QT_VERSION = 5.6.0
 QT_URL := https://download.qt.io/official_releases/qt/5.6/$(QT_VERSION)/submodules/qtbase-opensource-src-$(QT_VERSION).tar.xz
@@ -10,11 +10,9 @@ ifdef HAVE_WIN32
 PKGS += qt
 endif
 
-ifeq ($(call need_pkg,"QtCore QtGui"),)
 ifeq ($(call need_pkg,"Qt5Core Qt5Gui Qt5Widgets"),)
 PKGS_FOUND += qt
 endif
-endif
 
 $(TARBALLS)/qt-$(QT_VERSION).tar.xz:
 	$(call download,$(QT_URL))
@@ -30,43 +28,37 @@ ifdef HAVE_MACOSX
 QT_PLATFORM := -platform darwin-g++
 endif
 ifdef HAVE_WIN32
+QT_SPEC := win32-g++
 QT_PLATFORM := -xplatform win32-g++ -device-option CROSS_COMPILE=$(HOST)-
 endif
 
+QT_CONFIG := -static -release -opensource -confirm-license -no-pkg-config \
+	-no-sql-sqlite -no-gif -qt-libjpeg -no-openssl -no-opengl -no-dbus \
+	-no-qml-debug -no-audio-backend -no-sql-odbc \
+	-no-compile-examples -nomake examples
+
 .qt: qt
-	cd $< && ./configure $(QT_PLATFORM) -static -release -no-sql-sqlite -no-gif -qt-libjpeg -no-openssl -no-opengl -opensource -confirm-license -no-dbus -pkg-config -no-qml-debug
-	cd $< && $(MAKE) sub-src
-	# INSTALLING LIBRARIES
-	for lib in Widgets Gui Core; \
-		do install -D -- $</lib/libQt5$${lib}.a "$(PREFIX)/lib/libQt5$${lib}.a"; \
-	done
-	# INSTALLING PLUGINS
-	install -D -- $</plugins/platforms/libqwindows.a "$(PREFIX)/lib/libqwindows.a"
-	# INSTALLING HEADERS
-	for h in corelib gui widgets; \
-		do (cd $</src/$${h} && find . -type f -name '*.h' -exec install -D -- "{}" "$(PREFIX)/include/qt5/src/$${h}/{}" \;) ; \
-	done
-	for h in Core Gui Widgets; \
-		do (cd $</include/Qt$${h} && find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) -exec install -D -s --strip-program="$(abspath $(SRC)/qt/fix_header.sh)" -- "{}" "$(PREFIX)/include/qt5/Qt$${h}/{}" \;) ; \
-	done
-	mkdir -p "$(PREFIX)/include/qt5/qpa"
-	echo "#include \"../src/gui/kernel/qplatformnativeinterface.h\"" > "$(PREFIX)/include/qt5/qpa/qplatformnativeinterface.h"
-	# INSTALLING PKGCONFIG FILES
-	install -d "$(PREFIX)/lib/pkgconfig"
-	for i in Core Gui Widgets; \
-		do cat $(SRC)/qt/Qt5$${i}.pc.in | sed -e s/@@VERSION@@/$(QT_VERSION)/ | sed -e 's|@@PREFIX@@|$(PREFIX)|' > "$(PREFIX)/lib/pkgconfig/Qt5$${i}.pc"; \
-	done
-	# BUILDING QT BUILD TOOLS
+	cd $< && ./configure $(QT_PLATFORM) $(QT_CONFIG) -prefix $(PREFIX)
+	# Make && Install libraries
+	cd $< && $(MAKE)
+	cd $</src && $(MAKE) sub-corelib-install_subtargets sub-gui-install_subtargets sub-widgets-install_subtargets
+	# Install tools
+	cd $</src && $(MAKE) sub-moc-install_subtargets sub-rcc-install_subtargets sub-uic-install_subtargets
+	# Install plugins
+	cd $</src/plugins && $(MAKE) sub-platforms-install_subtargets
+	mv $(PREFIX)/plugins/platforms/libqwindows.a $(PREFIX)/lib/ && rm -rf $(PREFIX)/plugins
+	# Move includes to match what VLC expects
+	rm -rf $(PREFIX)/include/qt5/ && mkdir $(PREFIX)/include/qt5/ && mv -v $(PREFIX)/include/Q* $(PREFIX)/include/qt5/
+	mkdir $(PREFIX)/include/qt5/QtGui/qpa && cp $(PREFIX)/include/qt5/QtGui/$(QT_VERSION)/QtGui/qpa/qplatformnativeinterface.h $(PREFIX)/include/qt5/QtGui/qpa
+	# Clean Qt mess
+	rm -rf $(PREFIX)/lib/libQt5Bootstrap* $(PREFIX)/lib/*.prl $(PREFIX)/mkspecs
 ifdef HAVE_CROSS_COMPILE
+	# Building Qt build tools for Xcompilation
 	cd $</include/QtCore; ln -sf $(QT_VERSION)/QtCore/private
-	cd $</src/tools; $(MAKE) clean; \
-		for i in bootstrap uic rcc moc; \
-			do (cd $$i; echo $i && ../../../bin/qmake -spec win32-g++ ; $(MAKE) clean; $(MAKE)); \
-		done
-endif
-	# INSTALLING QT BUILD TOOLS
-	install -d "$(PREFIX)/bin/"
-	for i in rcc moc uic; \
-		do cp $</bin/$$i* "$(PREFIX)/bin"; \
+	cd $</qmake; $(MAKE)
+	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); \
 	done
+endif
 	touch $@



More information about the vlc-commits mailing list