From 9b883aef3b8bc1006ff0bd1544d71e204fbf7f8e Mon Sep 17 00:00:00 2001 From: Ray Donnelly Date: Tue, 4 Mar 2014 00:49:49 +0000 Subject: [PATCH] qt5-static: Added as WIP for octopi --- mingw-w64-qt5-static/PKGBUILD | 164 ++++++++++++++++++ .../qt-5.0.0-oracle-driver-prompt.patch | 11 ++ ...-5.0.0-use-fbclient-instead-of-gds32.patch | 10 ++ ...-5.1.0-win32-g++-mkspec-optimization.patch | 20 +++ .../qt-5.1.2-static-qmake-conf.patch | 12 ++ .../qt-5.1.x-fix-configure-tests.patch | 16 ++ .../qt-5.1.x-syncqt-fix.patch | 10 ++ .../qt-5.1.x-win_flex-replace.patch | 47 +++++ mingw-w64-qt5-static/qt5-i686.install | 11 ++ mingw-w64-qt5-static/qt5-x86_64.install | 11 ++ 10 files changed, 312 insertions(+) create mode 100644 mingw-w64-qt5-static/PKGBUILD create mode 100644 mingw-w64-qt5-static/qt-5.0.0-oracle-driver-prompt.patch create mode 100644 mingw-w64-qt5-static/qt-5.0.0-use-fbclient-instead-of-gds32.patch create mode 100644 mingw-w64-qt5-static/qt-5.1.0-win32-g++-mkspec-optimization.patch create mode 100644 mingw-w64-qt5-static/qt-5.1.2-static-qmake-conf.patch create mode 100644 mingw-w64-qt5-static/qt-5.1.x-fix-configure-tests.patch create mode 100644 mingw-w64-qt5-static/qt-5.1.x-syncqt-fix.patch create mode 100644 mingw-w64-qt5-static/qt-5.1.x-win_flex-replace.patch create mode 100644 mingw-w64-qt5-static/qt5-i686.install create mode 100644 mingw-w64-qt5-static/qt5-x86_64.install diff --git a/mingw-w64-qt5-static/PKGBUILD b/mingw-w64-qt5-static/PKGBUILD new file mode 100644 index 0000000000..4b272858d9 --- /dev/null +++ b/mingw-w64-qt5-static/PKGBUILD @@ -0,0 +1,164 @@ +# Maintainer: Alexey Pavlov + +_realname=qt5-static +_mingw_suff=mingw-w64-${CARCH} +pkgname="${_mingw_suff}-${_realname}" +pkgver=5.2.1 +pkgrel=1 +arch=('any') +url='http://qt-project.org/' +install=qt5-${CARCH}.install +license=('GPL3' 'LGPL' 'FDL' 'custom') +depends=("${_mingw_suff}-gcc-libs" + "${_mingw_suff}-dbus") +makedepends=("${_mingw_suff}-gcc" + "${_mingw_suff}-postgresql" + "${_mingw_suff}-libmariadbclient" + "${_mingw_suff}-libfbclient" + "${_mingw_suff}-python2" + "${_mingw_suff}-ruby" + "perl" + "gperf" + "m4" + "flex" + "${_mingw_suff}-make" + "${_mingw_suff}-pkg-config") +groups=("${_mingw_suff}-qt" "${_mingw_suff}-qt5") +options=('!strip' 'staticlibs') +_pkgfqn="qt-everywhere-opensource-src-${pkgver}" +source=(#"http://download.qt-project.org/development_releases/qt/5.2/${pkgver}/single/${_pkgfqn}.tar.xz" + http://download.qt-project.org/official_releases/qt/${pkgver%.*}/${pkgver}/single/${_pkgfqn}.tar.xz + qt-5.0.0-oracle-driver-prompt.patch + qt-5.0.0-use-fbclient-instead-of-gds32.patch + qt-5.1.0-win32-g++-mkspec-optimization.patch + qt-5.1.x-fix-configure-tests.patch + qt-5.1.x-syncqt-fix.patch + qt-5.1.x-win_flex-replace.patch + qt-5.1.2-static-qmake-conf.patch) +md5sums=('0c8d2aa45f38be9c3f7c9325eb059d9d' + '10790f1672b5f2b83e5473ad6cd48cd3' + '86899e8f2858c48d4827282c04696b76' + 'd675dbbe15d275c84f2792c75212ace0' + '2488e70329d9bc71f8f4619ddfb8522a' + '2235d876133956a788c393310fa8a526' + 'cc5fdd2eebc8d2d747271de091942336' + 'cf2a44a54921e68a1fa6a7bf33f71b5d') + +prepare() { + cd ${_pkgfqn} + + patch -p1 -i ${srcdir}/qt-5.0.0-oracle-driver-prompt.patch + patch -p1 -i ${srcdir}/qt-5.0.0-use-fbclient-instead-of-gds32.patch + patch -p1 -i ${srcdir}/qt-5.1.0-win32-g++-mkspec-optimization.patch + patch -p1 -i ${srcdir}/qt-5.1.x-syncqt-fix.patch + patch -p1 -i ${srcdir}/qt-5.1.x-win_flex-replace.patch + patch -p1 -i ${srcdir}/qt-5.1.2-static-qmake-conf.patch + + local _optim= + case ${MINGW_CHOST} in + i686*) + _optim="-march=i686 -mtune=core2" + ;; + x86_64*) + _optim="-march=nocona -mtune=core2" + ;; + esac + + sed -i "s|%OPTIMIZE_OPT%|${_optim}|g" qtbase/mkspecs/win32-g++/qmake.conf + sed -i "s|%STATICFLAGS%||g" qtbase/mkspecs/win32-g++/qmake.conf # -static-libstdc++ -static-libgcc + sed -i "s|-O2|${CXXFLAGS}|" qtbase/mkspecs/common/{g++,gcc}-base.conf + sed -i "/^QMAKE_LFLAGS_RPATH/s| -Wl,-rpath,||g" qtbase/mkspecs/common/gcc-base-unix.conf + sed -i "/^QMAKE_LFLAGS\s/s|+=|+= ${LDFLAGS}|g" qtbase/mkspecs/common/gcc-base.conf + + # Use python2 for Python 2.x + #patch -p1 -i "${srcdir}"/use-python2.patch + #sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \ + # -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \ + # $(find . -name '*.py') +} + +build() { + cd ${_pkgfqn} + touch qtbase/.gitignore + #BUILD_WIN=$(pwd -W) + #echo "BUILD_WIN $BUILD_WIN" + + #export QTDIR="${srcdir}"/${_pkgfqn} + #export LD_LIBRARY_PATH="${QTDIR}"/qtbase/lib:"${QTDIR}"/qttools/lib:"${LD_LIBRARY_PATH}" + #export QT_PLUGIN_PATH="${QTDIR}"/qtbase/plugins + + mkdir -p ${pkgdir}${MINGW_PREFIX}/static-qt + pushd ${pkgdir}${MINGW_PREFIX}/static-qt > /dev/null + QTDIR_WIN=$(pwd -W) + echo "QTDIR_WIN $QTDIR_WIN" + popd > /dev/null + + _extra_inc=$(pkg-config --cflags dbus-1 libxml-2.0) + _extra_inc=${_extra_inc//-I/:} + _extra_inc=${_extra_inc// /} + + export INCLUDE="${MINGW_PREFIX}/${MINGW_CHOST}/include:${MINGW_PREFIX}/include:${MINGW_PREFIX}/include/mysql:${MINGW_PREFIX}/include/noX:${_extra_inc}" + export LIB="${MINGW_PREFIX}/${MINGW_CHOST}/lib:${MINGW_PREFIX}/lib" + export CPATH="${MINGW_PREFIX}/${MINGW_CHOST}/include:${MINGW_PREFIX}/include:${MINGW_PREFIX}/include/mysql:${MINGW_PREFIX}/include/noX:${_extra_inc}" + export LIBRARY_PATH="${MINGW_PREFIX}/${MINGW_CHOST}/lib:${MINGW_PREFIX}/lib" + export PATH=${srcdir}/${_pkgfqn}/qtbase/bin:${srcdir}/${_pkgfqn}/qtbase/lib:${PATH} + + /configure.bat \ + -prefix ${QTDIR_WIN} \ + -static \ + -debug-and-release \ + -platform win32-g++ \ + -qt-zlib \ + -qt-pcre \ + -qt-libpng \ + -qt-libjpeg \ + -qt-freetype \ + -opengl desktop \ + -qt-sql-sqlite \ + -no-openssl \ + -opensource \ + -confirm-license \ + -make libs \ + -nomake tools \ + -nomake examples \ + -nomake tests + + ${MINGW_PREFIX}/bin/mingw32-make ${MAKEFLAGS} + + # Fix paths + #find "${QTDIR}" -name Makefile -exec sed -i "s|/usr/lib/qt/bin/qdoc|${QTDIR}/qtbase/bin/qdoc|g" {} + + #find "${QTDIR}" -name Makefile.qmake-docs -exec sed -i "s|/usr/lib/qt/bin/qdoc|${QTDIR}/qtbase/bin/qdoc|g" {} + + #find "${QTDIR}" -name Makefile -exec sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" {} + + #find "${QTDIR}" -name Makefile.qmake-docs -exec sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" {} + + #sed -i "s|/usr/lib/qt/bin/qhelpgenerator|${QTDIR}/qttools/bin/qhelpgenerator|g" qtwebkit/Source/Makefile.api +} + +package() { + + cd ${_pkgfqn} + + export PATH=${pkgdir}${MINGW_PREFIX}/bin:${srcdir}/${_pkgfqn}/qtbase/bin:${srcdir}/${_pkgfqn}/qtbase/lib:${PATH} + + ${MINGW_PREFIX}/bin/mingw32-make ${MAKEFLAGS} install #INSTALL_ROOT="${pkgdir}" + ${MINGW_PREFIX}/bin/mingw32-make ${MAKEFLAGS} docs + ${MINGW_PREFIX}/bin/mingw32-make ${MAKEFLAGS} install_qch_docs + + install -D -m644 LGPL_EXCEPTION.txt \ + "${pkgdir}${MINGW_PREFIX}"/share/licenses/qt5/LGPL_EXCEPTION.txt + + # Remove dll's from lib + rm -f "${pkgdir}${MINGW_PREFIX}/lib"/*.dll + + # Workaround for installing empty .pc files + plain "---> Fix pkgconfig files..." + local _pc_files=( $(find ${srcdir}/${_pkgfqn} -type f -name Qt5*.pc) ) + cp -f ${_pc_files[@]} ${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/ + + # Fix wrong path in prl files + #find "${pkgdir}${MINGW_PREFIX}/lib" -type f -name '*.prl' \ + # -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d;s/\(QMAKE_PRL_LIBS =\).*/\1/' {} \; + + # Fix wrong qmake path in pri file + #sed -i "s|${srcdir}/${_pkgfqn}/qtbase|/usr|" \ + # "${pkgdir}"/usr/lib/qt/mkspecs/modules/qt_lib_bootstrap_private.pri +} diff --git a/mingw-w64-qt5-static/qt-5.0.0-oracle-driver-prompt.patch b/mingw-w64-qt5-static/qt-5.0.0-oracle-driver-prompt.patch new file mode 100644 index 0000000000..85da2460c9 --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.0.0-oracle-driver-prompt.patch @@ -0,0 +1,11 @@ +--- a/qtbase/tools/configure/configureapp.cpp.orig 2012-12-18 22:03:34 +0300 ++++ b/qtbase/tools/configure/configureapp.cpp 2013-01-24 15:51:59 +0300 +@@ -2275,7 +2275,7 @@ + cout << "WARNING: Qt does not support compiling the Oracle database driver with" << endl + << "MinGW, due to lack of such support from Oracle. Consider disabling the" << endl + << "Oracle driver, as the current build will most likely fail." << endl; +- prompt = true; ++ prompt = false; + } + if (dictionary["QMAKESPEC"].endsWith("win32-msvc.net")) { + cout << "WARNING: The makespec win32-msvc.net is deprecated. Consider using" << endl diff --git a/mingw-w64-qt5-static/qt-5.0.0-use-fbclient-instead-of-gds32.patch b/mingw-w64-qt5-static/qt-5.0.0-use-fbclient-instead-of-gds32.patch new file mode 100644 index 0000000000..262a1352e5 --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.0.0-use-fbclient-instead-of-gds32.patch @@ -0,0 +1,10 @@ +--- qt5/qtbase/src/sql/drivers/ibase/qsql_ibase.pri.orig 2012-12-20 23:44:56 +0400 ++++ qt5/qtbase/src/sql/drivers/ibase/qsql_ibase.pri 2012-12-20 23:45:02 +0400 +@@ -5,6 +5,6 @@ + !contains(LIBS, .*gds.*):!contains(LIBS, .*libfb.*):LIBS += -lgds + } else { + !contains(LIBS, .*gds.*):!contains(LIBS, .*fbclient.*) { +- LIBS += -lgds32_ms ++ LIBS += -lfbclient_ms + } + } diff --git a/mingw-w64-qt5-static/qt-5.1.0-win32-g++-mkspec-optimization.patch b/mingw-w64-qt5-static/qt-5.1.0-win32-g++-mkspec-optimization.patch new file mode 100644 index 0000000000..5d4c61b14a --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.1.0-win32-g++-mkspec-optimization.patch @@ -0,0 +1,20 @@ +--- a/qtbase/mkspecs/win32-g++/qmake.conf.orig 2013-01-05 19:39:08 +0400 ++++ b/qtbase/mkspecs/win32-g++/qmake.conf 2013-01-05 19:39:38 +0400 +@@ -25,7 +25,7 @@ + QMAKE_LEXFLAGS = + QMAKE_YACC = byacc + QMAKE_YACCFLAGS = -d +-QMAKE_CFLAGS = -pipe -fno-keep-inline-dllexport ++QMAKE_CFLAGS = %OPTIMIZE_OPT% -pipe -fno-keep-inline-dllexport + QMAKE_CFLAGS_DEPS = -M + QMAKE_CFLAGS_WARN_ON = -Wall -Wextra + QMAKE_CFLAGS_WARN_OFF = -w +@@ -66,7 +66,7 @@ + + QMAKE_LINK = $${CROSS_COMPILE}g++ + QMAKE_LINK_C = $${CROSS_COMPILE}gcc +-QMAKE_LFLAGS = ++QMAKE_LFLAGS = %STATICFLAGS% + QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads + QMAKE_LFLAGS_EXCEPTIONS_OFF = + QMAKE_LFLAGS_RELEASE = -Wl,-s diff --git a/mingw-w64-qt5-static/qt-5.1.2-static-qmake-conf.patch b/mingw-w64-qt5-static/qt-5.1.2-static-qmake-conf.patch new file mode 100644 index 0000000000..6ea66069c3 --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.1.2-static-qmake-conf.patch @@ -0,0 +1,12 @@ +--- qt-stable/qtbase/mkspecs/win32-g++/qmake.conf.orig 2014-03-03 22:44:17.750353500 +0000 ++++ qt-stable/qtbase/mkspecs/win32-g++/qmake.conf 2014-03-03 22:49:17.035471600 +0000 +@@ -111,3 +111,9 @@ + QMAKE_OBJCOPY = $${CROSS_COMPILE}objcopy + QMAKE_NM = $${CROSS_COMPILE}nm -P + load(qt_config) ++ ++# [QT-STATIC-PATCH] - http://qt-project.org/wiki/How-to-build-a-static-Qt-for-Windows-MinGW ++QMAKE_LFLAGS += -static -static-libgcc ++QMAKE_CFLAGS_RELEASE -= -O2 ++QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer ++DEFINES += QT_STATIC_BUILD diff --git a/mingw-w64-qt5-static/qt-5.1.x-fix-configure-tests.patch b/mingw-w64-qt5-static/qt-5.1.x-fix-configure-tests.patch new file mode 100644 index 0000000000..1f406d8b0d --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.1.x-fix-configure-tests.patch @@ -0,0 +1,16 @@ +--- qt-stable/qtbase/config.tests/unix/ibase/ibase.pro.orig 2013-06-07 09:13:54 +0300 ++++ qt-stable/qtbase/config.tests/unix/ibase/ibase.pro 2013-06-07 09:14:13 +0300 +@@ -1,4 +1,4 @@ + SOURCES = ibase.cpp + CONFIG -= qt dylib + mac:CONFIG -= app_bundle +-LIBS += -lgds ++LIBS += -lfbclient_ms +--- qt-stable/qtbase/config.tests/unix/mysql/mysql.pro.orig 2013-06-07 09:14:27 +0300 ++++ qt-stable/qtbase/config.tests/unix/mysql/mysql.pro 2013-06-07 09:14:32 +0300 +@@ -1,4 +1,4 @@ + SOURCES = mysql.cpp + CONFIG -= qt dylib + mac:CONFIG -= app_bundle +-LIBS += -lmysqlclient ++LIBS += -lmysql diff --git a/mingw-w64-qt5-static/qt-5.1.x-syncqt-fix.patch b/mingw-w64-qt5-static/qt-5.1.x-syncqt-fix.patch new file mode 100644 index 0000000000..89fd7e8956 --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.1.x-syncqt-fix.patch @@ -0,0 +1,10 @@ +--- qt-stable/qtbase/bin/syncqt.pl.orig 2013-06-18 09:28:07.034261200 +0000 ++++ qt-stable/qtbase/bin/syncqt.pl 2013-06-18 09:26:30.387962200 +0000 +@@ -210,6 +210,7 @@ + push @ret, $classname if ($classname); + + my $parsable = ""; ++ local $/ = "\n"; + if(open(F, "<$iheader")) { + while() { + my $line = $_; diff --git a/mingw-w64-qt5-static/qt-5.1.x-win_flex-replace.patch b/mingw-w64-qt5-static/qt-5.1.x-win_flex-replace.patch new file mode 100644 index 0000000000..24148757cb --- /dev/null +++ b/mingw-w64-qt5-static/qt-5.1.x-win_flex-replace.patch @@ -0,0 +1,47 @@ +--- qt-stable/qtbase/src/angle/src/compiler/translator_common.pro.orig 2013-06-18 08:49:51.975288500 +0000 ++++ qt-stable/qtbase/src/angle/src/compiler/translator_common.pro 2013-06-18 08:50:06.047321000 +0000 +@@ -92,7 +92,7 @@ + $$ANGLE_DIR/src/third_party/compiler/ArrayBoundsClamper.cpp + + # NOTE: 'win_flex' and 'bison' can be found in qt5/gnuwin32/bin +-flex.commands = $$addGnuPath(win_flex) --noline --nounistd --outfile=${QMAKE_FILE_BASE}_lex.cpp ${QMAKE_FILE_NAME} ++flex.commands = $$addGnuPath(flex) --noline --nounistd --outfile=${QMAKE_FILE_BASE}_lex.cpp ${QMAKE_FILE_NAME} + flex.output = ${QMAKE_FILE_BASE}_lex.cpp + flex.input = FLEX_SOURCES + flex.dependency_type = TYPE_C +--- qt-stable/qtbase/src/angle/src/compiler/preprocessor/preprocessor.pro.orig 2013-06-18 08:50:54.314442500 +0000 ++++ qt-stable/qtbase/src/angle/src/compiler/preprocessor/preprocessor.pro 2013-06-18 08:51:52.606574000 +0000 +@@ -43,7 +43,7 @@ + $$ANGLE_DIR/src/compiler/preprocessor/Token.cpp + + # NOTE: 'win_flex' and 'bison' can be found in qt5/gnuwin32/bin +-flex.commands = $$addGnuPath(win_flex) --noline --nounistd --outfile=${QMAKE_FILE_BASE}.cpp ${QMAKE_FILE_NAME} ++flex.commands = $$addGnuPath(flex) --noline --nounistd --outfile=${QMAKE_FILE_BASE}.cpp ${QMAKE_FILE_NAME} + flex.output = ${QMAKE_FILE_BASE}.cpp + flex.input = FLEX_SOURCES + flex.dependency_type = TYPE_C +--- qt-stable/qtwebkit/Tools/qmake/mkspecs/features/default_pre.prf.orig 2013-06-18 08:52:34.675598000 +0000 ++++ qt-stable/qtwebkit/Tools/qmake/mkspecs/features/default_pre.prf 2013-06-18 08:52:52.752632000 +0000 +@@ -100,7 +100,6 @@ + # A newer version of flex is required on Windows. At the moment the only + # one that appears to provide binaries and is not cygwin is winflex. + FLEX = flex +-win32: FLEX = win_flex + + BIN_EXTENSION = + win32: BIN_EXTENSION = .exe +--- qt-stable/qtwebkit/Tools/Scripts/webkitdirs.pm.orig 2013-06-18 08:55:27.150792500 +0000 ++++ qt-stable/qtwebkit/Tools/Scripts/webkitdirs.pm 2013-06-18 08:57:36.484427000 +0000 +@@ -1545,11 +1545,7 @@ + } + } elsif (isGtk() or isQt() or isWx() or isEfl()) { + my @cmds = qw(bison gperf); +- if (isQt() and isWindows()) { +- push @cmds, "win_flex"; +- } else { +- push @cmds, "flex"; +- } ++ push @cmds, "flex"; + my @missing = (); + my $oldPath = $ENV{PATH}; + if (isQt() and isWindows()) { diff --git a/mingw-w64-qt5-static/qt5-i686.install b/mingw-w64-qt5-static/qt5-i686.install new file mode 100644 index 0000000000..3798b4b33a --- /dev/null +++ b/mingw-w64-qt5-static/qt5-i686.install @@ -0,0 +1,11 @@ +post_install() { + if [ -f "mingw32/bin/qmake.exe" ]; then + pushd mingw32/bin > /dev/null + ./qtbinpatcher --verbose --nobackup + popd > /dev/null + fi +} + +post_upgrade() { + post_install +} diff --git a/mingw-w64-qt5-static/qt5-x86_64.install b/mingw-w64-qt5-static/qt5-x86_64.install new file mode 100644 index 0000000000..ad1d67aa68 --- /dev/null +++ b/mingw-w64-qt5-static/qt5-x86_64.install @@ -0,0 +1,11 @@ +post_install() { + if [ -f "mingw64/bin/qmake.exe" ]; then + pushd mingw64/bin > /dev/null + ./qtbinpatcher --verbose --nobackup + popd > /dev/null + fi +} + +post_upgrade() { + post_install +}