[vlc-commits] contrib: add qt4

Rafaël Carré git at videolan.org
Tue Nov 8 07:27:27 CET 2011


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Nov  8 01:26:12 2011 -0500| [68ca19470221c8561fdf3de015c857c667c39426] | committer: Rafaël Carré

contrib: add qt4

win64 only for now, win32 support shouldn't be hard to add

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

 contrib/src/qt4/QtCore.pc.in   |   10 ++++
 contrib/src/qt4/QtGui.pc.in    |   10 ++++
 contrib/src/qt4/SHA512SUMS     |    1 +
 contrib/src/qt4/cross-x64.diff |   91 ++++++++++++++++++++++++++++++++++++++++
 contrib/src/qt4/fix_header.sh  |    5 ++
 contrib/src/qt4/rules.mak      |   49 +++++++++++++++++++++
 6 files changed, 166 insertions(+), 0 deletions(-)

diff --git a/contrib/src/qt4/QtCore.pc.in b/contrib/src/qt4/QtCore.pc.in
new file mode 100644
index 0000000..df717770
--- /dev/null
+++ b/contrib/src/qt4/QtCore.pc.in
@@ -0,0 +1,10 @@
+prefix=@@PREFIX@@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include/qt4/QtCore
+
+Name: Qtcore
+Description: Qtcore Library
+Version: @@VERSION@@
+Libs: -Wl,--subsystem,windows -mwindows -L${libdir} -lQtCore -lqcncodecs -lqjpcodecs -lqkrcodecs -lqtwcodecs -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -ladvapi32 -lgdi32 -limm32 -lwsock32
+Cflags:  -I${prefix}/include/qt4 -I${includedir} -DQT_NODLL
diff --git a/contrib/src/qt4/QtGui.pc.in b/contrib/src/qt4/QtGui.pc.in
new file mode 100644
index 0000000..d46603b
--- /dev/null
+++ b/contrib/src/qt4/QtGui.pc.in
@@ -0,0 +1,10 @@
+prefix=@@PREFIX@@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include/qt4/QtGui
+
+Name: Qtgui
+Description: Qtgui Library
+Version: @@VERSION@@
+Libs: -Wl,--subsystem,windows -mwindows -L${libdir} -lqjpeg -lqtaccessiblewidgets -lQtGui -lQtCore -lqcncodecs -lqjpcodecs -lqkrcodecs -lqtwcodecs -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -ladvapi32 -lgdi32 -limm32 -lwsock32
+Cflags: -I${prefix}/include/qt4 -I${includedir} -DQT_NODLL
diff --git a/contrib/src/qt4/SHA512SUMS b/contrib/src/qt4/SHA512SUMS
new file mode 100644
index 0000000..02026d8
--- /dev/null
+++ b/contrib/src/qt4/SHA512SUMS
@@ -0,0 +1 @@
+8dcb7d2e9069205bd80eeecbeb62a6ab727f9e327cbfc03003fe4f1caea364771d3c7e3a12347644aef1c51898680c08693cc76e2950ea8f7487223404b6581c  qt-4.7.4.tar.gz
diff --git a/contrib/src/qt4/cross-x64.diff b/contrib/src/qt4/cross-x64.diff
new file mode 100644
index 0000000..8cc48e7
--- /dev/null
+++ b/contrib/src/qt4/cross-x64.diff
@@ -0,0 +1,91 @@
+--- qt-everywhere-opensource-src-4.7.4/configure.orig	2011-09-28 14:31:35.039958884 -0400
++++ qt-everywhere-opensource-src-4.7.4/configure	2011-09-28 14:31:48.649958702 -0400
+@@ -4568,7 +4568,7 @@
+ }
+ 
+ # build qmake
+-if true; then ###[ '!' -f "$outpath/bin/qmake" ];
++if [ '!' -f "$outpath/bin/qmake" ]; then
+     echo "Creating qmake. Please wait..."
+ 
+     OLD_QCONFIG_H=
+--- qt-everywhere-opensource-src-4.7.4/src/tools/tools.pro.orig	2011-09-28 14:33:24.119957315 -0400
++++ qt-everywhere-opensource-src-4.7.4/src/tools/tools.pro	2011-09-28 14:33:56.619956845 -0400
+@@ -1,11 +1,6 @@
+ TEMPLATE = subdirs
+ 
+-TOOLS_SUBDIRS = src_tools_bootstrap src_tools_moc src_tools_rcc
+-!contains(QT_CONFIG, no-gui): TOOLS_SUBDIRS += src_tools_uic
+-!cross_compile {
+-    contains(QT_CONFIG, qt3support): SRC_SUBDIRS += src_tools_uic3
+-    win32:!wince*: SRC_SUBDIRS += src_tools_idc
+-}
++TOOLS_SUBDIRS = src_tools_bootstrap 
+ 
+ # Set subdir and respective target name
+ src_tools_bootstrap.subdir = $$QT_SOURCE_TREE/src/tools/bootstrap
+--- qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf.orig	2011-09-28 14:32:02.709958498 -0400
++++ qt-everywhere-opensource-src-4.7.4/mkspecs/win32-g++/qmake.conf	2011-09-28 14:36:32.529954583 -0400
+@@ -1,5 +1,5 @@
+ #
+-# qmake configuration for win32-g++
++# qmake configuration for win32-x86_64-w64-mingw32-g++
+ #
+ # Written for MinGW
+ #
+@@ -14,7 +14,7 @@
+ QMAKE_EXT_OBJ           = .o
+ QMAKE_EXT_RES           = _res.o
+ 
+-QMAKE_CC		= gcc
++QMAKE_CC		= x86_64-w64-mingw32-gcc
+ QMAKE_LEX		= flex
+ QMAKE_LEXFLAGS		=
+ QMAKE_YACC		= byacc
+@@ -23,11 +23,11 @@
+ QMAKE_CFLAGS_DEPS	= -M
+ QMAKE_CFLAGS_WARN_ON	= -Wall
+ QMAKE_CFLAGS_WARN_OFF	= -w
+-QMAKE_CFLAGS_RELEASE	= -O2
++QMAKE_CFLAGS_RELEASE	= -O3
+ QMAKE_CFLAGS_DEBUG	= -g
+ QMAKE_CFLAGS_YACC	= -Wno-unused -Wno-parentheses
+ 
+-QMAKE_CXX		= g++
++QMAKE_CXX		= x86_64-w64-mingw32-g++
+ QMAKE_CXXFLAGS		= $$QMAKE_CFLAGS
+ QMAKE_CXXFLAGS_DEPS	= $$QMAKE_CFLAGS_DEPS
+ QMAKE_CXXFLAGS_WARN_ON	= $$QMAKE_CFLAGS_WARN_ON
+@@ -50,8 +50,8 @@
+ QMAKE_RUN_CXX		= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $obj $src
+ QMAKE_RUN_CXX_IMP	= $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+ 
+-QMAKE_LINK		= g++
+-QMAKE_LINK_C		= gcc
++QMAKE_LINK		= x86_64-w64-mingw32-g++
++QMAKE_LINK_C		= x86_64-w64-mingw32-gcc
+ QMAKE_LFLAGS		=
+ QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
+ QMAKE_LFLAGS_EXCEPTIONS_OFF =
+@@ -95,15 +95,15 @@
+     QMAKE_CHK_DIR_EXISTS	= if not exist
+ }
+ 
+-QMAKE_MOC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}moc.exe
+-QMAKE_UIC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}uic.exe
+-QMAKE_IDC		= $$[QT_INSTALL_BINS]$${DIR_SEPARATOR}idc.exe
++QMAKE_MOC		= moc
++QMAKE_UIC		= uic
++QMAKE_IDC		= idc
+ 
+ QMAKE_IDL		= midl
+-QMAKE_LIB		= ar -ru
+-QMAKE_RC		= windres
++QMAKE_LIB		= x86_64-w64-mingw32-ar -ru
++QMAKE_RC		= x86_64-w64-mingw32-windres
+ QMAKE_ZIP		= zip -r -9
+ 
+-QMAKE_STRIP		= strip
++QMAKE_STRIP		= x86_64-w64-mingw32-strip
+ QMAKE_STRIPFLAGS_LIB 	+= --strip-unneeded
+ load(qt_config)
diff --git a/contrib/src/qt4/fix_header.sh b/contrib/src/qt4/fix_header.sh
new file mode 100755
index 0000000..79f7dd9
--- /dev/null
+++ b/contrib/src/qt4/fix_header.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+mv "$1" "$1.tmp"
+sed 's,../../src,../src,' "$1.tmp" > "$1"
+rm -f "$1.tmp"
diff --git a/contrib/src/qt4/rules.mak b/contrib/src/qt4/rules.mak
new file mode 100644
index 0000000..b19c351
--- /dev/null
+++ b/contrib/src/qt4/rules.mak
@@ -0,0 +1,49 @@
+# qt4
+
+QT4_VERSION = 4.7.4
+QT4_URL := http://download.qt.nokia.com/qt/source/qt-everywhere-opensource-src-$(QT4_VERSION).tar.gz
+
+# FIXME : OSX and win32 build
+ifdef HAVE_WIN64
+PKGS += qt4
+endif
+
+ifeq ($(call need_pkg,"QtCore QtGui"),)
+PKGS_FOUND += qt4
+endif
+
+$(TARBALLS)/qt-$(QT4_VERSION).tar.gz:
+	$(call download,$(QT4_URL))
+
+.sum-qt4: qt-$(QT4_VERSION).tar.gz
+
+qt4: qt-$(QT4_VERSION).tar.gz .sum-qt4
+	$(UNPACK)
+	patch -p0 < $(SRC)/qt4/cross-x64.diff # FIXME : add new target, fix/add mingw32 target
+	mv qt-everywhere-opensource-src-4.7.4 $@ && touch $@
+
+.qt4: qt4
+	for i in qmake moc uic rcc; do ln -sf `which $$i` $</bin/; done # FIXME : we probably need the exact same version of those tools on the host
+	cd $< && ./configure -platform win32-g++ -static -release -fast -no-exceptions -no-stl -no-sql-sqlite -no-qt3support -no-gif -no-libmng -qt-libjpeg -no-libtiff -no-qdbus -no-openssl -no-webkit -sse -no-script -no-multimedia -opensource -no-scripttools -no-opengl -no-script -no-scripttools -no-declarative -no-declarative-debug -opensource -no-s60 -host-little-endian -confirm-license
+	cd $< && make sub-src
+	cd $</src/plugins/imageformats/jpeg && make # FIXME
+	# INSTALLING LIBRARIES
+	for lib in QtGui QtCore; \
+		do install -D -- $</lib/lib$${lib}.a "$(PREFIX)/lib/lib$${lib}.a"; \
+	done
+	# INSTALLING PLUGINS
+	install -D -- $</plugins/imageformats/libqjpeg.a "$(PREFIX)/lib/libqjpeg.a"
+	install -D -- $</plugins/accessible/libqtaccessiblewidgets.a "$(PREFIX)/lib/libqtaccessiblewidgets.a"
+	for codec in cn jp kr tw; \
+		do install -D -- $</plugins/codecs/libq$${codec}codecs.a "$(PREFIX)/lib/libq${codec}codecs.a"; \
+	done
+	# INSTALLING CORE HEADERS
+	cd $</src/corelib;    find . -type f -name '*.h' -exec install -D -- "{}" "$(PREFIX)/include/qt4/src/corelib/{}" \;
+	cd $</include/QtCore; find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) -exec install -D -s --strip-program="$(abspath $(SRC)/qt4/fix_header.sh)" -- "{}" "$(PREFIX)/include/qt4/QtCore/{}" \;
+	# INSTALLING GUI HEADERS
+	cd $</src/gui; find . -type f -name '*.h' -exec install -D -- "{}" "$(PREFIX)/include/qt4/src/gui/{}" \;
+	cd $</include/QtGui; find . -maxdepth 1 -type f \( -name '*.h' -o -name 'Q*' \) -exec install -D -s --strip-program="$(abspath $(SRC)/qt4/fix_header.sh)" -- "{}" "$(PREFIX)/include/qt4/QtGui/{}" \;
+	# INSTALLING PKGCONFIG FILES
+	cat $(SRC)/qt4/QtCore.pc.in | sed -e s/@@VERSION@@/$(QT4_VERSION)/ | sed -e 's|@@PREFIX@@|$(PREFIX)|' > "$(PREFIX)/lib/pkgconfig/QtCore.pc"
+	cat $(SRC)/qt4/QtGui.pc.in | sed -e s/@@VERSION@@/$(QT4_VERSION)/ | sed -e 's|@@PREFIX@@|$(PREFIX)|' > "$(PREFIX)/lib/pkgconfig/QtGui.pc"
+	touch $@



More information about the vlc-commits mailing list