From e3c6174f21b6cccb2417a4ef4e53f66d1801449d Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Tue, 24 Nov 2015 09:23:27 +0100 Subject: [PATCH 01/13] Fiw Show/Hide application window on Windows --- Gui/Gui.h | 7 +------ Gui/Gui10.cpp | 14 ++++++++++---- Gui/GuiPrivate.cpp | 2 -- Gui/GuiPrivate.h | 2 -- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Gui/Gui.h b/Gui/Gui.h index a254bd5c68..4cb8fdbb79 100644 --- a/Gui/Gui.h +++ b/Gui/Gui.h @@ -606,9 +606,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON void setLastKeyPressVisitedClickFocus(bool visited); -#ifdef __NATRON_WIN32__ void setApplicationConsoleActionVisible(bool visible); -#endif Q_SIGNALS: @@ -737,12 +735,9 @@ public Q_SLOTS: void onRenderProgressDialogFinished(); void onFocusChanged(QWidget* old, QWidget*); - -#ifdef __NATRON_WIN32__ void onShowApplicationConsoleActionTriggered(); - -#endif + private: diff --git a/Gui/Gui10.cpp b/Gui/Gui10.cpp index 4c2f25856d..06f3044bdd 100644 --- a/Gui/Gui10.cpp +++ b/Gui/Gui10.cpp @@ -360,26 +360,32 @@ Gui::updateLastPluginDirectory(const QString & str) _imp->_lastPluginDir = str; } -#ifdef __NATRON_WIN32__ void Gui::onShowApplicationConsoleActionTriggered() { + setApplicationConsoleActionVisible(!_imp->applicationConsoleVisible); } void Gui::setApplicationConsoleActionVisible(bool visible) { +#ifdef __NATRON_WIN32__ + if (visible == _imp->applicationConsoleVisible) { return; } _imp->applicationConsoleVisible = visible; HWND hWnd = GetConsoleWindow(); if (hWnd) { - ShowWindow(hWnd, _imp->applicationConsoleVisible ? SW_SHOW : SW_HIDE ); + if (_imp->applicationConsoleVisible) { + ShowWindow(hWnd, SW_HIDE); + } else { + ShowWindow(hWnd, SW_SHOWNORMAL); + } + } - -} #endif +} diff --git a/Gui/GuiPrivate.cpp b/Gui/GuiPrivate.cpp index 2e4a85306f..3f837affca 100644 --- a/Gui/GuiPrivate.cpp +++ b/Gui/GuiPrivate.cpp @@ -255,9 +255,7 @@ GuiPrivate::GuiPrivate(GuiAppInstance* app, , currentPanelFocusEventRecursion(0) , keyPressEventHasVisitedFocusWidget(false) , wasLaskUserSeekDuringPlayback(false) -#ifdef __NATRON_WIN32__ , applicationConsoleVisible(true) -#endif { } diff --git a/Gui/GuiPrivate.h b/Gui/GuiPrivate.h index 5c08022f22..6b9e201084 100644 --- a/Gui/GuiPrivate.h +++ b/Gui/GuiPrivate.h @@ -281,9 +281,7 @@ struct GuiPrivate bool wasLaskUserSeekDuringPlayback; -#ifdef __NATRON_WIN32__ bool applicationConsoleVisible; -#endif GuiPrivate(GuiAppInstance* app, Gui* gui); From e764f0b4dce4ff995ab46d096381ae56bf0451e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 24 Nov 2015 11:24:44 +0100 Subject: [PATCH 02/13] osx: add qt patch --- INSTALL_OSX.md | 32 ++++++++++- .../files/patch-qthread-stacksize.diff | 56 +++++++++++++++++++ 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-qthread-stacksize.diff diff --git a/INSTALL_OSX.md b/INSTALL_OSX.md index 77251140c3..709dc99e4e 100644 --- a/INSTALL_OSX.md +++ b/INSTALL_OSX.md @@ -75,7 +75,37 @@ also set the correct value for the pkg-config path (you can also put this in your .bash_profile): export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig:/usr/local/opt/cairo/lib/pkgconfig - + +### Installing a patched Qt to avoid stack overflows + + curl -O https://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz + tar zxvf qt-everywhere-opensource-src-4.8.7.tar.gz + cd qt-everywhere-opensource-src-4.8.7 + curl -O https://raw.githubusercontent.com/Homebrew/patches/480b7142c4e2ae07de6028f672695eb927a34875/qt/el-capitan.patch + patch -p1 < el-capitan.patch + patch -p0 < /path/to/source/Natron/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qthread-stacksize.diff + +Then, configure using: + + ./configure -prefix /opt/qt4 -system-zlib -qt-libtiff -qt-libpng -qt-libjpeg -confirm-license -opensource -nomake demos -nomake examples -nomake docs -cocoa -fast -release + +On OS X >= 10.9 add `-platform unsupported/macx-clang-libc++` + +Os OS X < 10.9, to compile with clang add `-platform unsupported/macx-clang` + +To use another openssl than the system (mainly for security reasons), add `-openssl-linked -I /usr/local/Cellar/openssl/1.0.2d_1/include -L /usr/local/Cellar/openssl/1.0.2d_1/lib` (where the path is changed to your openssl installation). + +To compile universal binaries, add `-arch x86_64 -arch x86` + +Then, compile using: + + make + +And install (after making sure `/opt/qt4` is user-writable) using: + + make install + + ###Download OpenColorIO-Configs In the past, OCIO configs were a submodule, though due to the size of the repository, we have chosen instead diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qthread-stacksize.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qthread-stacksize.diff new file mode 100644 index 0000000000..b39fb01a25 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qthread-stacksize.diff @@ -0,0 +1,56 @@ +--- src/corelib/thread/qthread_unix.cpp.orig 2015-11-23 19:05:40.000000000 +0100 ++++ src/corelib/thread/qthread_unix.cpp 2015-11-24 11:22:31.000000000 +0100 +@@ -79,6 +79,7 @@ + #endif + + #if defined(Q_OS_MAC) ++#include // getrlimit/setrlimit + # ifdef qDebug + # define old_qDebug qDebug + # undef qDebug +@@ -649,6 +650,45 @@ + #endif // QT_HAS_THREAD_PRIORITY_SCHEDULING + + ++#if defined(Q_OS_MAC) && !defined(Q_OS_IOS) ++ if (d->stackSize == 0) { ++ // Fix the default (too small) stack size for threads on OS X, ++ // which also affects the thread pool. ++ // See also: ++ // https://bugreports.qt.io/browse/QTBUG-2568 ++ // This fix can also be found in Chromium: ++ // https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186 ++ ++ // The Mac OS X default for a pthread stack size is 512kB. ++ // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses ++ // DEFAULT_STACK_SIZE for this purpose. ++ // ++ // 512kB isn't quite generous enough for some deeply recursive threads that ++ // otherwise request the default stack size by specifying 0. Here, adopt ++ // glibc's behavior as on Linux, which is to use the current stack size ++ // limit (ulimit -s) as the default stack size. See ++ // glibc-2.11.1/nptl/nptl-init.c's __pthread_initialize_minimal_internal. To ++ // avoid setting the limit below the Mac OS X default or the minimum usable ++ // stack size, these values are also considered. If any of these values ++ // can't be determined, or if stack size is unlimited (ulimit -s unlimited), ++ // stack_size is left at 0 to get the system default. ++ // ++ // Mac OS X normally only applies ulimit -s to the main thread stack. On ++ // contemporary OS X and Linux systems alike, this value is generally 8MB ++ // or in that neighborhood. ++ size_t default_stack_size = 0; ++ struct rlimit stack_rlimit; ++ if (pthread_attr_getstacksize(&attr, &default_stack_size) == 0 && ++ getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 && ++ stack_rlimit.rlim_cur != RLIM_INFINITY) { ++ default_stack_size = ++ std::max(std::max(default_stack_size, ++ static_cast(PTHREAD_STACK_MIN)), ++ static_cast(stack_rlimit.rlim_cur)); ++ } ++ d->stackSize = default_stack_size; ++ } ++#endif + if (d->stackSize > 0) { + #if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0) + int code = pthread_attr_setstacksize(&attr, d->stackSize); From 77bdb07917d0fd53d03f82a2e314156361be6061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 24 Nov 2015 11:42:32 +0100 Subject: [PATCH 03/13] Cache: missing include --- Engine/Cache.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Engine/Cache.h b/Engine/Cache.h index a79345c0bb..a16927a5e6 100644 --- a/Engine/Cache.h +++ b/Engine/Cache.h @@ -38,6 +38,7 @@ #include "Global/MemoryInfo.h" GCC_DIAG_OFF(deprecated) #include +#include #include #include #include From 5135d6a44cc6f12f22a93da22a3bea64a5422472 Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Tue, 24 Nov 2015 12:26:38 +0100 Subject: [PATCH 04/13] osx: patch qt4-mac --- tools/MacOSX/ports/aqua/qt4-mac/Portfile | 1093 +++++++++++++++++ tools/MacOSX/ports/aqua/qt4-mac/Portfile.orig | 1090 ++++++++++++++++ .../MacOSX/ports/aqua/qt4-mac/Portfile.patch | 21 + .../MacOSX/ports/aqua/qt4-mac/files/c++11.prf | 3 + .../ports/aqua/qt4-mac/files/c++11/c++11.test | 21 + .../aqua/qt4-mac/files/c++11/c++11_test.cpp | 12 + .../ports/aqua/qt4-mac/files/cpath/cpath.test | 34 + .../aqua/qt4-mac/files/cpath/cpath_test.c | 8 + .../aqua/qt4-mac/files/cpath/cpath_test.h | 1 + .../qt4-mac/files/fconstant_cfstrings.test | 26 + .../files/library_path/library_path.test | 41 + .../files/library_path/library_path_lib.c | 1 + .../files/library_path/library_path_lib.h | 1 + .../files/library_path/library_path_test.c | 6 + .../qt4-mac/files/objc_block/objc_block.test | 21 + .../files/objc_block/objc_block_test.m | 10 + .../aqua/qt4-mac/files/objective_cxx.prf | 18 + .../qt4-mac/files/patch-QtHelp_10.4_only.diff | 145 +++ .../patch-config.tests_unix_compile.test.diff | 11 + .../patch-config.tests_unix_precomp.test.diff | 22 + .../aqua/qt4-mac/files/patch-configure.diff | 353 ++++++ .../ports/aqua/qt4-mac/files/patch-cxx11.diff | 594 +++++++++ .../aqua/qt4-mac/files/patch-darwin-g++.diff | 20 + .../patch-mkspecs_common_g++-base.conf.diff | 26 + .../patch-mkspecs_common_g++-macx.conf.diff | 25 + .../files/patch-mkspecs_common_mac.conf.diff | 23 + .../patch-mkspecs_darwin-g++_qmake.conf.diff | 158 +++ .../files/patch-mkspecs_features_moc.prf.diff | 18 + .../files/patch-mkspecs_features_qt.prf.diff | 62 + ...tch-mkspecs_features_qt_functions.prf.diff | 204 +++ .../patch-mkspecs_features_uitools.prf.diff | 29 + .../patch-mkspecs_macx-g++_qmake.conf.diff | 11 + .../files/patch-mkspecs_objective_cxx.diff | 166 +++ ...h-qmake_generators_unix_unixmakke.cpp.diff | 108 ++ .../qt4-mac/files/patch-qmake_option.h.diff | 10 + .../files/patch-qmake_project.cpp.diff | 37 + .../files/patch-qmake_property.cpp.diff | 19 + .../qt4-mac/files/patch-qmake_qmake.pri.diff | 11 + ...t_Source_WebCore_plugins_PluginView.h.diff | 12 + ..._WebCore_plugins_mac_PluginViewMac.mm.diff | 13 + .../files/patch-src_corelib_corelib.pro.diff | 11 + ...h-src_corelib_global_qlibraryinfo.cpp.diff | 25 + ...tch-src_corelib_global_qlibraryinfo.h.diff | 10 + ...atch-src_corelib_io_qprocess_unix.cpp.diff | 16 + ...c_corelib_tools_qelapsedtimer-mac.cpp.diff | 11 + ...ch-src_gui_dialogs_qfiledialog_mac.mm.diff | 18 + .../patch-src_gui_kernel_qcursor_mac.mm.diff | 17 + ...tch-src_gui_painting_qpaintengine_mac.diff | 106 ++ .../qt4-mac/files/patch-src_qbase.pri.diff | 30 + .../files/patch-src_qt_install.pri.diff | 16 + ...tch-src_tools_bootstrap_bootstrap.pro.diff | 11 + ...lib_fulltextsearch_fulltextsearch.pro.diff | 14 + .../patch-tools_assistant_lib_lib.pro.diff | 26 + ...s_designer_src_components_lib_lib.pro.diff | 44 + .../patch-tools_designer_src_lib_lib.pro.diff | 55 + ...ools_designer_src_uitools_uitools.pro.diff | 88 ++ ...ools_macdeployqt_macdeployqt_main.cpp.diff | 11 + ...h-tools_macdeployqt_shared_shared.cpp.diff | 11 + .../aqua/qt4-mac/files/split_sources.prf | 52 + 59 files changed, 5056 insertions(+) create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/Portfile create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/Portfile.orig create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/Portfile.patch create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/c++11.prf create mode 100755 tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11.test create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11_test.cpp create mode 100755 tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath.test create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.c create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.h create mode 100755 tools/MacOSX/ports/aqua/qt4-mac/files/fconstant_cfstrings.test create mode 100755 tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path.test create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.c create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.h create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_test.c create mode 100755 tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block.test create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block_test.m create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/objective_cxx.prf create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-configure.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-cxx11.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-darwin-g++.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_option.h.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_project.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_property.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qbase.pri.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qt_install.pri.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff create mode 100644 tools/MacOSX/ports/aqua/qt4-mac/files/split_sources.prf diff --git a/tools/MacOSX/ports/aqua/qt4-mac/Portfile b/tools/MacOSX/ports/aqua/qt4-mac/Portfile new file mode 100644 index 0000000000..ea3477b1de --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/Portfile @@ -0,0 +1,1093 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id: Portfile 141286 2015-10-14 17:53:19Z michaelld@macports.org $ + +PortSystem 1.0 + +# use the qt4 group; set 'building_qt4' so that the portgroup +# does not include certain parts +set building_qt4 1 +PortGroup qt4 1.0 +PortGroup xcodeversion 1.0 +PortGroup compiler_blacklist_versions 1.0 + +name qt4-mac +# qt4-mac-devel is "replaced_by" this port, +# so this port cannot conflict with it. +#conflicts qt3 qt3-mac qt4-mac-devel +conflicts qt3 qt3-mac qt5-mac +version 4.8.7 +revision 102 +set branch [join [lrange [split ${version} .] 0 1] .] + +categories aqua +platforms macosx +maintainers michaelld openmaintainer +license {LGPL-2.1 GPL-3} + +homepage http://www.qt.io/ +description Qt Tool Kit +long_description Qt Tool Kit: A cross-platform framework \ + (headers, data, and libraries) for writing \ + cross-platform GUI-based applications. + +distname qt-everywhere-opensource-src-${version} + +master_sites http://download.qt.io/official_releases/qt/${branch}/${version}/ + +checksums rmd160 afb5e5a99388e6429faca59cb5000054feffd166 \ + sha256 e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0 + +minimum_xcodeversions {8 2.5} + +depends_lib-append port:zlib \ + path:bin/dbus-daemon:dbus \ + path:lib/libssl.dylib:openssl \ + port:tiff \ + port:libpng \ + port:libmng \ + port:jpeg + +# find a way to specify the OS MINOR version. For OSX 10.X, this +# value will be X. The type is this variable is integer, so we can +# use "==" and so forth for comparison. + +global MINOR +set MINOR "" + +# hopefully the MACOSX_DEPLOYMENT_TARGET exists and is set by now. if +# not, last resort (which is not desirable) is to use the os.version. + +if {${macosx_deployment_target} ne ""} { + set MINOR [lindex [split ${macosx_deployment_target} "."] 1] +} else { + set MINOR [expr [lindex [split ${os.version} "."] 0] - 4] +} + +############################################### +# Patches are used to both fix compiling on various OS versions, and +# to enhance the functionality of QMake and its build files. Some of +# these patches are 2-stage: use a file here, and the replace an +# @VARIABLE@ in post-patch. There are LOTS of patches, because Qt is +# a large, complicated system. + +# (0) Fix the testing script to properly handle both +universal as +# well as the native arch for both CXX and CC compiling; also make +# sure it does not create a Mac app bundle. + +patchfiles-append patch-config.tests_unix_compile.test.diff + +# (1) Test for Precompiled-headers support (a) requires a C++ +# compiler, but configure calls it, by default, with a C compiler; +# thus, enable testing using the C compiler. (b) to work with ccache, +# if used. + +patchfiles-append patch-config.tests_unix_precomp.test.diff + +# (2) fix 'configure' script: (a) to allow easy replacement of arch +# type(s). (b) to find the correct QMAKE CXX compiler by removing +# possibilities that include the character "$". (c) to declare, use, +# and set QT_INSTALL_FRAMEWORKS and QMAKE_FRAMEWORKDIR_QT, both here +# and in the resulting .qmake.cache files. (d) to allow easy +# replacement of MACOSX_DEPLOYMENT_TARGET: build for just the user's +# current OS. (e) add hooks for C++11 testing. + +patchfiles-append patch-configure.diff + +# (3) (a) Tweak various scripts to allow easy replacement of +# MACOSX_DEPLOYMENT_TARGET: build for just the user's current OS. +# (b) Assign initial OBJECTIVE_CXXFLAGS. + +patchfiles-append patch-mkspecs_common_g++-macx.conf.diff + +# (4) (a) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build +# for just the user's current OS; (b) allow QMake to use 'ccache' via, +# e.g., "qmake && make CCACHE=ccache". + +patchfiles-append patch-mkspecs_common_mac.conf.diff + +# (5) Place the -I path for local moc-created headers -before- +# all other -I paths. + +patchfiles-append patch-mkspecs_features_moc.prf.diff + +# (6) Remove Qt's LIBDIR and INCDIR from various QMake internal +# variables, since they are already included in the user-supplied +# LIBS and INCLUDEPATH. + +patchfiles-append patch-mkspecs_features_qt.prf.diff + +# (7) (a) Change placement of Qt's LIBDIR and INCDIR, to always be +# after those supplied by the user's QMake (.pro) files. By the time +# QMake gets to the patched function, it is creating the Makefile +# parts to find Qt's headers and libraries, so moving these paths to +# this location should always work. (b) If the library is QtWebKit, +# and the build is library (no-framework), universal, and debug, then +# the linkage is just -lQtWebKit, not -lQtWebKit_debug because the +# debug library for 32-bit system cannot be created (too large). + +patchfiles-append patch-mkspecs_features_qt_functions.prf.diff + +# (8) (a) Change "gcc" and "g++" to @'s for replacement in +# post-patch; (b) add hooks for C++11. + +patchfiles-append patch-mkspecs_common_g++-base.conf.diff + +# (9) Add default QMake variables for Objective C++. + +patchfiles-append patch-mkspecs_objective_cxx.diff + +# (10) Add "absolute_library_soname" to the default CONFIG variables, +# so that when a DYLIB is created, if "target.path" is set for it then +# that path is prepended to its "install_name". + +patchfiles-append patch-mkspecs_macx-g++_qmake.conf.diff + +# (11) Add QT_INSTALL_FRAMEWORKS and related variables to QMake, to +# provide a default variable for the location of QMake installed +# frameworks. + +patchfiles-append \ + patch-qmake_option.h.diff \ + patch-qmake_property.cpp.diff \ + patch-src_corelib_global_qlibraryinfo.cpp.diff \ + patch-src_corelib_global_qlibraryinfo.h.diff + +# (12) In QMake, disable default MKSPECS and FEATURES path +# concatinations if the shell environment variable QMAKE_NO_DEFAULTS +# is set (to anything); we use this variable in this portfile to make +# sure only internal paths (to the build) are searched by QMake. + +patchfiles-append patch-qmake_project.cpp.diff + +# (13) In QMake: (a) enable correct "-framework foo,bar" parsing as +# specified by Apple's LD; (b) disable "/Library/Frameworks" as a +# default search path; use "PREFIX/Library/Frameworks" and replace +# PREFIX in post-patch. Also set "PREFIX/lib" as a default library +# search path. + +patchfiles-append patch-qmake_generators_unix_unixmakke.cpp.diff + +# (14) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build for +# just the user's current OS. + +patchfiles-append \ + patch-qmake_qmake.pri.diff \ + patch-src_tools_bootstrap_bootstrap.pro.diff + +# (15) fix use of CARBON, found on PPC64; does not hurt others + +patchfiles-append \ + patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff \ + patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff + +# (16) Use the "target.path" for libdir for core libraries instead of +# the standard QT_INSTALL_LIBS; allows us to set for library or +# framework elsewhere and have the install still work here. + +patchfiles-append patch-src_qbase.pri.diff + +# (17) (a) Disable explicit disabling of framework or static install; +# i.e., install as a framework if that mode is selected, and as +# library otherwise. (b) If installing as framework, use the new +# QT_INSTALL_FRAMEWORKS directory; otherwise, use the old +# QT_INSTALL_LIBS; (c) Get PKGCONFIG dependencies correct, hopefully; +# (d) create and install .pc, .la, and .prl library description files, +# including basic path replacement into DESTDIR; we couple this with a +# post-patch to get the correct install location. + +patchfiles-append \ + patch-src_qt_install.pri.diff \ + patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff \ + patch-tools_assistant_lib_lib.pro.diff \ + patch-tools_designer_src_components_lib_lib.pro.diff \ + patch-tools_designer_src_lib_lib.pro.diff \ + patch-tools_designer_src_uitools_uitools.pro.diff \ + patch-mkspecs_features_uitools.prf.diff + +# (18) fix 'macdeployqt' to look for the correct plugins location by +# default. This is paired with a "reinplace" in post-patch + +patchfiles-append \ + patch-tools_macdeployqt_macdeployqt_main.cpp.diff + +# (19) Under 10.4 only: patch QMake build files using just "-lQtHelp" +# to do "-lQtHelp -lQtCLucene -lQtNetwork -lQtWebKit" instead. For +# some reason 10.5+ "knows" that how to do this correctly. + +platform darwin { + if {${MINOR} == 4} { + patchfiles-append patch-QtHelp_10.4_only.diff + } +} + +# (20) fix the Mac timer's use of "mach_timebase_info" + +patchfiles-append \ + patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff + +# (21) Under 10.8 and 10.9: Patch to fix corelib linking + +platform darwin { + if {${MINOR} >= 8} { + patchfiles-append patch-src_corelib_corelib.pro.diff + } +} + +# (22) fix Framework directory in MacDeployQt tool + +patchfiles-append \ + patch-tools_macdeployqt_shared_shared.cpp.diff + +# (23) remove ColorSync usage from qpaintengine. + +# This patch allows for building using the 10.11 SDK, and is also +# backward compatible with prior OS versions since it just removes API +# usage but does not otherwise add any. This patch does roughly the +# same thing as that from Qt5 commit b06304e16: +# http://code.qt.io/cgit/qt/qtbase.git/commit/?id=b06304e164ba47351fa292662c1e6383c081b5ca + +patchfiles-append \ + patch-src_gui_painting_qpaintengine_mac.diff + +# (24) fix qcursor_mac; already committed upstream; see also: +# https://trac.macports.org/ticket/48516 +# http://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa/qcocoacursor.mm?id=02ea0235216beef390e9868ff770c7a54d70db83 +# https://developer.apple.com/library/prerelease/mac/documentation/Carbon/Reference/QuartzEventServicesRef/#//apple_ref/c/func/CGEventCreateMouseEvent + +patchfiles-append \ + patch-src_gui_kernel_qcursor_mac.mm.diff + +# (25) avoid zombie processes; see also: +# https://trac.macports.org/ticket/46608 +# https://codereview.qt-project.org/#/c/61294/ +# approved but abandoned. + +patchfiles-append \ + patch-src_corelib_io_qprocess_unix.cpp.diff + +# (26) fix build on Leopard; see also: +# https://trac.macports.org/ticket/43746 + +patchfiles-append \ + patch-src_gui_dialogs_qfiledialog_mac.mm.diff + +# fix default thread stack size +patchfiles-append patch-qthread-stacksize.diff + +# error out if trying to build on a new OSX version (> 10.11). + +platform darwin { + if {${MINOR} > 11} { + # This project needs to be updated to build with clang++ against libc++ + depends_lib + depends_run + pre-fetch { + ui_error "$name does not currently build on OSX later than 10.11 'El Capitan'." + error "unsupported platform" + } + } +} + +############################################### + +# disable CCACHE for now (ticket #34856) + +configure.ccache no + +# find a way to specify the SDK to use; Qt will use the 10.4u by +# default which won't work on 10.6 since it is not supported. Allow +# the user to specify the SDK if desired. + +global SDK +set SDK ${configure.sdkroot} +if {${SDK} eq ""} { + # set SDK version depending on OS version + set sdk_version "" + if {${MINOR} == 4} { + # OSX 10.4 requires an additional 'u' + set sdk_version "10.4u" + } else { + set sdk_version "10.${MINOR}" + } + if {[vercmp ${xcodeversion} 4.3] < 0} { + set SDK ${developer_dir}/SDKs/MacOSX${sdk_version}.sdk + } else { + set SDK ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${sdk_version}.sdk + } +} + +post-patch { + # set ARCHES in configure (per the third patchfile above), for + # building QMake. join any 2 or more arch entries with the GCC + # arch flag (join does not effect a single entry). first "-arch" + # is already in place in the 'configure' script (since there has + # to be at least 1 arch). + + set ARCHES "" + if {[variant_exists universal] && [variant_isset universal]} { + set ARCHES [join ${universal_archs} " -arch "] + } else { + set ARCHES ${build_arch} + } + reinplace "s|@ARCHES@|${ARCHES}|g" ${worksrcpath}/configure + + # set MACOSX_DEPLOYMENT_TARGET version in various places. These + # were all patched in (2) above, and can be easily changed or + # overridden by the user in a project-local qmake .pro script. + + set TARGET "10.${MINOR}" + foreach fixfile {configure mkspecs/common/g++-macx.conf \ + mkspecs/common/mac.conf qmake/qmake.pri \ + src/tools/bootstrap/bootstrap.pro } { + reinplace "s|@MACOSX_DEPLOYMENT_TARGET@|${TARGET}|g" \ + ${worksrcpath}/${fixfile} + } + + # Ensure that correct C/C++ compilers are used. + + reinplace "s|@CXX@|${configure.cxx}|" \ + ${worksrcpath}/mkspecs/common/g++-base.conf + reinplace "s|@CC@|${configure.cc}|" \ + ${worksrcpath}/mkspecs/common/g++-base.conf + + # fix 'macdeployqt' to look for the correct + # plugins location by default. + + reinplace "s,@QT_PLUGINS_DIR@,${qt_plugins_dir},g" \ + ${worksrcpath}/tools/macdeployqt/macdeployqt/main.cpp + + # fix PREFIX in QMake makefile generator + + reinplace "s,@PREFIX@,${qt_dir},g" \ + ${worksrcpath}/qmake/generators/unix/unixmake.cpp + + # if no debug, then do not even build debug code + + if {![variant_isset debug]} { + foreach fixfile { src/qbase.pri \ + src/3rdparty/webkit/Source/WebKit.pri \ + src/imports/qimportbase.pri \ + src/plugins/qpluginbase.pri \ + tools/designer/src/components/lib/lib.pro \ + tools/designer/src/lib/lib.pro \ + tools/designer/src/plugins/activeqt/activeqt.pro \ + tools/designer/src/plugins/plugins.pri \ + tools/designer/src/uitools/uitools.pro \ + src/3rdparty/webkit/Source/WebKit/qt/declarative/declarative.pro } { + reinplace "/+=/s@debug_and_release@@g" \ + ${worksrcpath}/${fixfile} + } + } + + # copy C++11 files into place, if that variant is set + + if {[variant_isset cxx11]} { + copy ${filespath}/c++11.prf ${worksrcpath}/mkspecs/features + copy ${filespath}/c++11 ${worksrcpath}/config.tests/mac + } + + # copy Objective C / CXX files into place + + copy ${filespath}/objective_cxx.prf \ + ${worksrcpath}/mkspecs/features/mac + copy ${filespath}/split_sources.prf \ + ${worksrcpath}/mkspecs/features/mac + + # copy extra compiler tests into place; these are patched into the + # configure script to the area before qmake is built. If any + # fail, configure will fail quickly. + + copy ${filespath}/fconstant_cfstrings.test \ + ${worksrcpath}/config.tests/mac + copy ${filespath}/objc_block \ + ${worksrcpath}/config.tests/mac + copy ${filespath}/cpath \ + ${worksrcpath}/config.tests/mac + copy ${filespath}/library_path \ + ${worksrcpath}/config.tests/mac +} + +# Block various compilers: +# +# * The build process requires -Xarch, -fconstant-cfstring, and +# Objective-C(++) blocks (^), which are not supported with vanilla GCC +# as installed by MacPorts but are supported by all versions of CLANG +# (both MacPorts' and Apple's). +# +# * Some older versions of CLANG do not honor the CPATH +# environment variables, which is required for compiling +# this port when using MacPorts. The versions seem to be: MacPorts +# CLANG 2.9 or earlier, and Apple CLANG 318.0.58 or older. +# +# * Some older versions of CLANG do not honor the LIBRARY_PATH +# environment variables, which is required for compiling +# this port when using MacPorts. The versions seem to be: MacPorts +# CLANG 3.0 or earlier, and Apple CLANG 318.0.61 or older. +# +# * qt4-creator-mac fails to build with GCC <= 4.0. +# +# See also: +# < http://llvm.org/bugs/show_bug.cgi?id=8971 >, +# < https://trac.macports.org/ticket/30271 >, +# < https://trac.macports.org/ticket/31076 >, +# < https://trac.macports.org/ticket/31638 >, +# < https://trac.macports.org/ticket/37868 >, and +# < https://trac.macports.org/ticket/40422 >. +# +# NOTE: qt4-mac augments the standard Qt4 configure script with +# pre-qmake-build tests for CPATH, LIBRARY_PATH, -Xarch, +# -fconstant-cfstring, Objective-C(++) blocks, and, if requested, +# C++11. The script will error out quickly if the compiler does not +# seem to provide support for any one of these properties, no matter +# this blacklist. +# + +compiler.blacklist-append { clang <= 318.0.61 } \ + gcc-3.3 *gcc-4.0 macports-gcc* + +# --prefix is not recognized + +configure.pre_args-delete --prefix=${prefix} + +# --disable-dependency-tracking is not recognized + +configure.universal_args-delete --disable-dependency-tracking + +# clear all arch-oriented flags since somehow they impact how qmake is +# created, which in turn messes up LDFLAGS in most created Makefiles. + +configure.ld_archflags +configure.cc_archflags +configure.cxx_archflags +configure.universal_ldflags +configure.universal_cflags +configure.universal_cxxflags +configure.universal_cppflags +configure.march +configure.mtune + +# Use compiler.cpath and compiler.library_path for all -I and -L +# entries, so-as to avoid conflicts with already-installed headers and +# libraries (giving preference to internal-to-this-port first). CPATH +# is used instead of -I to avoid conflicts with other ports. +# +# See also: +# < https://trac.macports.org/ticket/15219 >, +# < https://trac.macports.org/ticket/18723 >, and +# < https://trac.macports.org/ticket/25321 >. + +# set the default paths to include those for SQLITE3 and DBUS-1 + +set header_path [ list ${prefix}/include/dbus-1.0 \ + ${prefix}/lib/dbus-1.0/include \ + ${prefix}/include ] + +set library_path [ list ${prefix}/lib ] + +# -dbus-linked prevends qt4 from trying to dynamically load libdbus-1, +# which it is not able to find in ${prefix}. +# +# -openssl-linked ensures that the MacPorts openssl is used. +# +# -framework ensures that this port is installed as frameworks +# (collections of {library, headers, resources}); in +# post-destroot, link headers and libraries from the frameworks +# into non-framework locations as if "-no-framework" were +# specified. Some dependent projects will not work properly if Qt +# is installed as libraries by default, thus make it so #1. +# +# -no-phonon ensures that Qt does not install the 3rd-parth Phonon +# port or its backend to QuickTime 7; Phonon is now installed via +# the 'phonon' port, which is more up to date than that provided +# by Qt. + +configure.args \ + -v \ + -confirm-license \ + -opensource \ + -prefix ${qt_dir} \ + -bindir ${qt_bins_dir} \ + -libdir ${qt_libs_dir} \ + -docdir ${qt_docs_dir} \ + -headerdir ${qt_includes_dir} \ + -plugindir ${qt_plugins_dir} \ + -importdir ${qt_imports_dir} \ + -datadir ${qt_data_dir} \ + -translationdir ${qt_translations_dir} \ + -sysconfdir ${qt_sysconf_dir} \ + -examplesdir ${qt_examples_dir} \ + -demosdir ${qt_demos_dir} \ + -openssl-linked \ + -dbus-linked \ + -fast \ + -optimized-qmake \ + -no-pch \ + -framework \ + -no-phonon \ + -no-phonon-backend + +# Stop configure script from searching for SQL Drivers +# not available from MacPorts. + +foreach driver {db2 ibase oci tds} { + configure.args-append -no-sql-${driver} +} + +# Disable all remaining SQL Drivers. These are available via the +# ports qt4-mac-*-plugin. + +foreach driver {mysql odbc psql sqlite sqlite2} { + configure.args-append -no-sql-${driver} +} + +pre-configure { + + # use the corrected CPATH and LIBRARY_PATH for build + + compiler.cpath [join ${header_path} :] + compiler.library_path [join ${library_path} :] + + # for 10.4 or 10.5 32-bit PPC, build as Carbon only, not Cocoa + + if {${MINOR} == 4} { + + configure.args-append -carbon + + # required linking flags? + + configure.ldflags-append -lcrypto -ldbus-1 -ljpeg -llcms \ + -lssl -lz + + } elseif {${MINOR} == 5 && + [llength ${qt_arch_types}] == 1 && + [lsearch -exact ${qt_arch_types} ppc] == 0} { + + configure.args-append -carbon + + } + + # set the arch type(s) to use, in Qt-speak + + configure.args-append -arch \"${qt_arch_types}\" + + # check to see if not compiling for the native machine hardware + # (e.g., compiling for just i386 but CPU is x86_64); optimization + # of QMake does not work in this circumstance. + + if {[lsearch -exact ${qt_arch_types} ${os.arch}] == -1} { + + # not building for native arch: disable optimizing qmake + configure.args-delete -optimized-qmake + + } elseif {${MINOR} == 6 && + [llength ${qt_arch_types}] == 1 && + [lsearch -exact ${qt_arch_types} x86] == 0} { + + # disable qmake optimization on 10.6 32-bit + configure.args-delete -optimized-qmake + + } + + # set the SDK, if it was found and exists + + if {[file exists ${SDK}]} { + configure.args-append -sdk ${SDK} + } + + # set which pkg-config to use + + configure.env-append PKG_CONFIG=${prefix}/bin/pkg-config + + # set which stdlib to use; clang only + if {[string match *clang* ${configure.compiler}]} { + configure.env-append QMAKE_STDLIB="-stdlib=${configure.cxx_stdlib}" + configure.ldflags-append -stdlib=${configure.cxx_stdlib} + } +} + +post-configure { + + # Remove any '-I' and '-L' string from the *FLAGS for SQLITE, + # DBUS, ODBC, and OPENSSL, so that what remains are just non-I/L + # flags; these paths are in compiler.cpath and + # compiler.library_path. The header and library paths for all the + # other variants are not used by 'configure', and are already + # included in the compiler.cpath and compiler.library_path + # . during the 'build' stage, 'make' will rebuild the Makefiles + # that depend on any of these changed files. These patches are + # sufficient to make sure local (to this build) paths are searched + # first, and then system paths last (via the compiler.X settings). + # Ideally, 'qmake' -- either via its mkspecs files or the + # project's build files -- would distinguish between "local" and + # "system" includes & libraries. + + # SQLITE + reinplace "/SQLITE/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/SQLITE/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + + # DBUS + reinplace "/DBUS/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/DBUS/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + + # OPENSSL + reinplace "/OPENSSL/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/OPENSSL/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + + # ODBC + reinplace "/ODBC/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/ODBC/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache +} + +pre-build { + # use the corrected CPATH and LIBRARY_PATH for build + compiler.cpath [join ${header_path} :] + compiler.library_path [join ${library_path} :] +} + +# do not use DESTDIR directly in the destroot command; Qt uses DISTDIR +# internally for other purposes, and instead uses INSTALL_ROOT for the +# additional install root prefix. + +destroot.post_args + +post-destroot { + + # shortcuts to destroot directories + + set dr_qt ${destroot}${qt_dir} + set dr_qt_libs_dir ${destroot}${qt_libs_dir} + set dr_qt_includes_dir ${destroot}${qt_includes_dir} + set dr_qt_data_dir ${destroot}${qt_data_dir} + set dr_qt_docs_dir ${destroot}${qt_docs_dir} + set dr_qt_apps_dir ${destroot}${qt_apps_dir} + set dr_qt_bins_dir ${destroot}${qt_bins_dir} + set dr_qt_frameworks_dir ${destroot}${qt_frameworks_dir} + + # create all needed destroot directories that don't already exist + + xinstall -m 755 -d ${dr_qt_libs_dir} + xinstall -m 755 -d ${dr_qt_includes_dir} + xinstall -m 755 -d ${dr_qt_data_dir} + xinstall -m 755 -d ${dr_qt_docs_dir} + xinstall -m 755 -d ${dr_qt_apps_dir} + + # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to + # ${qt_dir}\${prefix} ("\" means 'take away'). Cannot use + # "find -E" since it is not necessarily portable. + + regsub ${prefix} ${worksrcpath} "" from_dir + regsub ${prefix} ${qt_dir} "" to_dir + foreach fixfile [exec find ${dr_qt} -name "*.pc"] { + reinplace "s|${from_dir}|${to_dir}|g" ${fixfile} + } + foreach fixfile [exec find ${dr_qt} -name "*.prl"] { + reinplace "s|${from_dir}|${to_dir}|g" ${fixfile} + } + + # fix .pc files + + foreach fixfile [exec find ${dr_qt} -name "*.pc"] { + + # remove Libs.private; they can mess up linking + + reinplace "/Libs\.private/d" ${fixfile} + + # use ${qt_dir} correctly; + # in the .pc file, this will be ${prefix} + + reinplace "s|${qt_dir}/|\${prefix}/|g" ${fixfile} + + # fix libdir + + reinplace "/libdir=/s|Library/Frameworks|lib|" ${fixfile} + + # fix Libs: to use -L instead of -F + + reinplace "/Libs:/s|-F|-L|" ${fixfile} + + # fix Libs: to use -lQt* instead of "-framework Qt*" + # depends on whether for release or debug + + set fn [lindex [split ${fixfile} /] end] + + if {[lsearch -regexp ${fn} debug] == 0} { + + # debug; need to add that string to all Qt dependency libraries + reinplace "/Libs:/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|" \ + ${fixfile} + + } else { + + # no debug; just replace + reinplace "/Libs:/s|-framework Qt|-lQt|" ${fixfile} + + } + } + + # move .pc files from ${qt_frameworks_dir}/pkgconfig to + # ${qt_pkg_config_dir} + + file delete -force ${destroot}${qt_pkg_config_dir} + move ${dr_qt_frameworks_dir}/pkgconfig ${dr_qt_libs_dir} + + # move .la files from ${qt_frameworks_dir} to ${qt_libs_dir} + + foreach laf [glob ${dr_qt_frameworks_dir}/*.la] { + move ${laf} ${dr_qt_libs_dir} + } + + # remove -L entries from .prl and .la files + + foreach fixfile [exec find ${dr_qt} -name "*.prl"] { + reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile} + } + foreach fixfile [exec find ${dr_qt} -name "*.la"] { + reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile} + } + + # remove redundant -F entries from .prl and .la files + + foreach fixfile [exec find ${dr_qt} -name "*.prl"] { + reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \ + ${fixfile} + reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile} + reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \ + ${fixfile} + } + foreach fixfile [exec find ${dr_qt} -name "*.la"] { + reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \ + ${fixfile} + reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile} + reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \ + ${fixfile} + } + + # get Qt's version numbers + + set qt_vers [split ${version} "."] + set qt_major [lindex ${qt_vers} 0] + set qt_minor [lindex ${qt_vers} 1] + set qt_patch [lindex ${qt_vers} 2] + + # link includes and libraries for each actual installed framework + + foreach fixfile [exec find ${dr_qt_frameworks_dir} \ + -name "*.framework" | \ + sed -e "s@${destroot}@@g"] { + + set tf_full [strsed ${fixfile} {s@\\.framework@@}] + set tf [strsed ${tf_full} {g@.*\/@@}] + + # special for QtWebKit entries + + set t_minor ${qt_minor} + set is_QtWebKit 0 + if {[string compare ${tf} QtWebKit] == 0} { + set t_minor 9 + set is_QtWebKit 1 + } + + # link headers into ${qt_includes_dir}, removing directories + # if they are already there first + + set inc_file ${dr_qt_includes_dir}/${tf} + if {[file exists ${inc_file}]} { + file delete -force ${inc_file} + } + ln -s ${tf_full}.framework/Headers ${inc_file} + + # link libraries into ${qt_libs_dir}, all 4 number variants + + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib + + # copy .prl file, then correct it for library usage + + copy ${destroot}${tf_full}.framework/${tf}.prl ${dr_qt_libs_dir}/lib${tf}.prl + + # fix TARGET in .prl file + + reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}.prl + + # fix PRL_LIBS -F -> -L in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.prl + + # fix "-framework Qt*" -> "-lQt*" in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-framework Qt|-lQt|g" \ + ${dr_qt_libs_dir}/lib${tf}.prl + + # fix up .la files to work with ${prefix}/lib entries + + # rename .la file + + move ${dr_qt_libs_dir}/${tf}.la ${dr_qt_libs_dir}/lib${tf}.la + + # fix "name that we can dlopen" in .la file + + reinplace "s|dlname=''|dlname='lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib'|" ${dr_qt_libs_dir}/lib${tf}.la + + # fix "names of this library" in .la file + + reinplace "s|library_names='\[^'\]*'|library_names='lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib lib${tf}.${qt_major}.${t_minor}.dylib lib${tf}.${qt_major}.dylib lib${tf}.dylib'|" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # fix "name of the static archive"; there is none in .la file + + reinplace "s|old_library='\[^'\]*'|old_library=''|" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # fix "libraries that this one depends upon" in .la file + + reinplace "/dependency_libs/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s|-framework Qt|-lQt|g" \ + ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s| ${worksrcpath}\[^ \]*||g" \ + ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s| -lwebcore||" \ + ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s| -ljscore||" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # fix "directory that this library needs to be installed in" in .la file + + reinplace "/libdir/s|${qt_frameworks_dir}|${qt_libs_dir}|" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # deal with debug files + + if {[variant_isset debug]} { + + # but not if QtWebKit and +universal, since that one does + # not exist (the 32-bit version of the debug library is + # larger than fits into the 32-bit filespace). + + if {[variant_isset debug] && ${is_QtWebKit}} { + continue + } + + # link libraries into ${qt_libs_dir}, all 4 number variants + + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.dylib + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.dylib + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.dylib + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib + + # copy .prl file, then correct it for library usage + + copy ${destroot}${tf_full}.framework/${tf}_debug.prl ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix TARGET in .prl file + + reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix PRL_LIBS -F -> -L in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix "-framework Qt*" -> "-lQt*_debug" in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix up .la files to work with ${prefix}/lib entries + + # rename .la file + + move ${dr_qt_libs_dir}/${tf}_debug.la \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "name that we can dlopen" in .la file + + reinplace "s|dlname=''|dlname='lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib'|" ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "names of this library" in .la file + + reinplace "s|library_names='\[^'\]*'|library_names='lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib lib${tf}_debug.${qt_major}.${t_minor}.dylib lib${tf}_debug.${qt_major}.dylib lib${tf}_debug.dylib'|" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "name of the static archive"; there is none in .la file + + reinplace "s|old_library='\[^'\]*'|old_library=''|" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "libraries that this one depends upon" in .la file + + reinplace "/dependency_libs/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s| ${worksrcpath}\[^ \]*||g" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s| -lwebcored||" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s| -ljscored||" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "directory that this library needs to be installed in" in .la file + + reinplace "/libdir/s|${qt_frameworks_dir}|${qt_libs_dir}|" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + } + } + + # Install documentation. + + xinstall -m 644 -W ${worksrcpath} \ + INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \ + LICENSE.GPL3 LICENSE.LGPL README \ + ${dr_qt_docs_dir} + + # Install private headers needed by QtCreator + + foreach {src_dir include_dir} \ + {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} { + set dest_dir ${dr_qt_frameworks_dir}/${include_dir}.framework/Headers/private + xinstall -m 755 -d ${dest_dir} + set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"] + eval xinstall -m 644 [split ${files}] ${dest_dir} + } + + # Move .apps into the applications_dir, and link each .apps' + # executable back into ${qt_bins_dir} + + foreach app [glob ${dr_qt_bins_dir}/*.app] { + + # remove the leading stuff + + set app [lindex [split ${app} /] end] + + # move the .app + + move ${dr_qt_bins_dir}/${app} ${dr_qt_apps_dir} + + # link the app's executable back + + set texe [strsed ${app} {g@\.app@@}] + ln -s ${qt_apps_dir}/${app}/Contents/MacOS/${texe} \ + ${dr_qt_bins_dir} + + } + + # move tests to ${qt_data_dir} + + move ${dr_qt}/tests/qt4 ${dr_qt_data_dir}/tests + + # install ${qt_includes_dir}/Qt if not already and it exists in + # the build, for support of legacy projects + + if {![file exists ${dr_qt_includes_dir}/Qt] && + [file exists ${worksrcpath}/include/Qt]} { + + # copy the Qt headers directory + + copy ${worksrcpath}/include/Qt ${dr_qt_includes_dir} + + } + + # link in Resource to ${qt_libs_dir} + + ln -s ${qt_frameworks_dir}/QtGui.framework/Resources \ + ${dr_qt_libs_dir} + +} + +variant odbc description {Enable iODBC SQL Driver} { + depends_lib-append port:libiodbc + configure.args-delete -no-sql-odbc + configure.args-append -plugin-sql-odbc +} + +variant raster description {Use raster graphics system by default} { + configure.args-append -graphicssystem raster +} + +variant demos description {Build demos} {} + +if {![variant_isset demos]} { + configure.args-append -nomake demos +} + +variant examples description {Build examples} {} + +if {![variant_isset examples]} { + configure.args-append -nomake examples +} + +variant debug description {Build both release and debug library} {} + +if {[variant_isset debug]} { + configure.args-append -debug-and-release -declarative-debug +} else { + configure.args-append -release -no-declarative-debug +} + +variant openvg description {Build with support for OpenVG} { + + depends_lib-append port:mesa + + pre-configure { + + # set OpenVG arg, for both testing and building + + configure.env-append QMAKE_OPENVG_ARG=-lOpenVG + + } +} + +variant cxx11 description {Add library support for C++11 (EXPERIMENTAL; does not work with libc++)} { + + # Block compilers that do not support C++11. This variant seems to + # work with MacPorts' clang 3.0 or newer and Apple clang newer + # than 318.0.58 (but, not that version, which is already blocked). + + compiler.blacklist-append \ + apple-gcc-4.2 gcc-4.2 llvm-gcc-4.2 + + pre-fetch { + + # This variant does not work with Clang libc++ + + if {[info exists configure.cxx_stdlib] && + ${configure.cxx_stdlib} eq "libc++" && + [string match *clang* ${configure.cxx}]} { + + ui_msg "\nERROR: C++11 support for Qt4 is not available when using Clang and libc++.\n" + error "unsupported platform for C++11 support" + + } + } + + pre-extract { + + ui_msg "\nWARNING: You have enabled C++11 support for Qt4, which is EXPERIMENTAL. Qt's libraries and applications (not including QMake) will be compiled using C++11. That said, C++11 will NOT be enabled by default when using QMake. You can enable C++11 by specifying, e.g. \'CONFIG += c++11\', in any QMake build file.\n" + + } + + # patches for C++11 only + + patchfiles-append patch-cxx11.diff + + # have configure test for C++11; our hooks + # will error out if C++11 is not found. + + configure.args-append -c++11 + +} + +post-activate { + ui_msg "NOTE: Qt database plugins for mysql55, postgresql91, and sqlite2 are NOT installed by this port\; they are installed by qt4-mac-*-plugin instead." +} + +livecheck.type regex +livecheck.url http://download.qt.io/official_releases/qt/${branch}/ +livecheck.regex >(\[0-9.\]+)/< diff --git a/tools/MacOSX/ports/aqua/qt4-mac/Portfile.orig b/tools/MacOSX/ports/aqua/qt4-mac/Portfile.orig new file mode 100644 index 0000000000..a5b65d688b --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/Portfile.orig @@ -0,0 +1,1090 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 +# $Id: Portfile 141286 2015-10-14 17:53:19Z michaelld@macports.org $ + +PortSystem 1.0 + +# use the qt4 group; set 'building_qt4' so that the portgroup +# does not include certain parts +set building_qt4 1 +PortGroup qt4 1.0 +PortGroup xcodeversion 1.0 +PortGroup compiler_blacklist_versions 1.0 + +name qt4-mac +# qt4-mac-devel is "replaced_by" this port, +# so this port cannot conflict with it. +#conflicts qt3 qt3-mac qt4-mac-devel +conflicts qt3 qt3-mac qt5-mac +version 4.8.7 +revision 2 +set branch [join [lrange [split ${version} .] 0 1] .] + +categories aqua +platforms macosx +maintainers michaelld openmaintainer +license {LGPL-2.1 GPL-3} + +homepage http://www.qt.io/ +description Qt Tool Kit +long_description Qt Tool Kit: A cross-platform framework \ + (headers, data, and libraries) for writing \ + cross-platform GUI-based applications. + +distname qt-everywhere-opensource-src-${version} + +master_sites http://download.qt.io/official_releases/qt/${branch}/${version}/ + +checksums rmd160 afb5e5a99388e6429faca59cb5000054feffd166 \ + sha256 e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0 + +minimum_xcodeversions {8 2.5} + +depends_lib-append port:zlib \ + path:bin/dbus-daemon:dbus \ + path:lib/libssl.dylib:openssl \ + port:tiff \ + port:libpng \ + port:libmng \ + port:jpeg + +# find a way to specify the OS MINOR version. For OSX 10.X, this +# value will be X. The type is this variable is integer, so we can +# use "==" and so forth for comparison. + +global MINOR +set MINOR "" + +# hopefully the MACOSX_DEPLOYMENT_TARGET exists and is set by now. if +# not, last resort (which is not desirable) is to use the os.version. + +if {${macosx_deployment_target} ne ""} { + set MINOR [lindex [split ${macosx_deployment_target} "."] 1] +} else { + set MINOR [expr [lindex [split ${os.version} "."] 0] - 4] +} + +############################################### +# Patches are used to both fix compiling on various OS versions, and +# to enhance the functionality of QMake and its build files. Some of +# these patches are 2-stage: use a file here, and the replace an +# @VARIABLE@ in post-patch. There are LOTS of patches, because Qt is +# a large, complicated system. + +# (0) Fix the testing script to properly handle both +universal as +# well as the native arch for both CXX and CC compiling; also make +# sure it does not create a Mac app bundle. + +patchfiles-append patch-config.tests_unix_compile.test.diff + +# (1) Test for Precompiled-headers support (a) requires a C++ +# compiler, but configure calls it, by default, with a C compiler; +# thus, enable testing using the C compiler. (b) to work with ccache, +# if used. + +patchfiles-append patch-config.tests_unix_precomp.test.diff + +# (2) fix 'configure' script: (a) to allow easy replacement of arch +# type(s). (b) to find the correct QMAKE CXX compiler by removing +# possibilities that include the character "$". (c) to declare, use, +# and set QT_INSTALL_FRAMEWORKS and QMAKE_FRAMEWORKDIR_QT, both here +# and in the resulting .qmake.cache files. (d) to allow easy +# replacement of MACOSX_DEPLOYMENT_TARGET: build for just the user's +# current OS. (e) add hooks for C++11 testing. + +patchfiles-append patch-configure.diff + +# (3) (a) Tweak various scripts to allow easy replacement of +# MACOSX_DEPLOYMENT_TARGET: build for just the user's current OS. +# (b) Assign initial OBJECTIVE_CXXFLAGS. + +patchfiles-append patch-mkspecs_common_g++-macx.conf.diff + +# (4) (a) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build +# for just the user's current OS; (b) allow QMake to use 'ccache' via, +# e.g., "qmake && make CCACHE=ccache". + +patchfiles-append patch-mkspecs_common_mac.conf.diff + +# (5) Place the -I path for local moc-created headers -before- +# all other -I paths. + +patchfiles-append patch-mkspecs_features_moc.prf.diff + +# (6) Remove Qt's LIBDIR and INCDIR from various QMake internal +# variables, since they are already included in the user-supplied +# LIBS and INCLUDEPATH. + +patchfiles-append patch-mkspecs_features_qt.prf.diff + +# (7) (a) Change placement of Qt's LIBDIR and INCDIR, to always be +# after those supplied by the user's QMake (.pro) files. By the time +# QMake gets to the patched function, it is creating the Makefile +# parts to find Qt's headers and libraries, so moving these paths to +# this location should always work. (b) If the library is QtWebKit, +# and the build is library (no-framework), universal, and debug, then +# the linkage is just -lQtWebKit, not -lQtWebKit_debug because the +# debug library for 32-bit system cannot be created (too large). + +patchfiles-append patch-mkspecs_features_qt_functions.prf.diff + +# (8) (a) Change "gcc" and "g++" to @'s for replacement in +# post-patch; (b) add hooks for C++11. + +patchfiles-append patch-mkspecs_common_g++-base.conf.diff + +# (9) Add default QMake variables for Objective C++. + +patchfiles-append patch-mkspecs_objective_cxx.diff + +# (10) Add "absolute_library_soname" to the default CONFIG variables, +# so that when a DYLIB is created, if "target.path" is set for it then +# that path is prepended to its "install_name". + +patchfiles-append patch-mkspecs_macx-g++_qmake.conf.diff + +# (11) Add QT_INSTALL_FRAMEWORKS and related variables to QMake, to +# provide a default variable for the location of QMake installed +# frameworks. + +patchfiles-append \ + patch-qmake_option.h.diff \ + patch-qmake_property.cpp.diff \ + patch-src_corelib_global_qlibraryinfo.cpp.diff \ + patch-src_corelib_global_qlibraryinfo.h.diff + +# (12) In QMake, disable default MKSPECS and FEATURES path +# concatinations if the shell environment variable QMAKE_NO_DEFAULTS +# is set (to anything); we use this variable in this portfile to make +# sure only internal paths (to the build) are searched by QMake. + +patchfiles-append patch-qmake_project.cpp.diff + +# (13) In QMake: (a) enable correct "-framework foo,bar" parsing as +# specified by Apple's LD; (b) disable "/Library/Frameworks" as a +# default search path; use "PREFIX/Library/Frameworks" and replace +# PREFIX in post-patch. Also set "PREFIX/lib" as a default library +# search path. + +patchfiles-append patch-qmake_generators_unix_unixmakke.cpp.diff + +# (14) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build for +# just the user's current OS. + +patchfiles-append \ + patch-qmake_qmake.pri.diff \ + patch-src_tools_bootstrap_bootstrap.pro.diff + +# (15) fix use of CARBON, found on PPC64; does not hurt others + +patchfiles-append \ + patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff \ + patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff + +# (16) Use the "target.path" for libdir for core libraries instead of +# the standard QT_INSTALL_LIBS; allows us to set for library or +# framework elsewhere and have the install still work here. + +patchfiles-append patch-src_qbase.pri.diff + +# (17) (a) Disable explicit disabling of framework or static install; +# i.e., install as a framework if that mode is selected, and as +# library otherwise. (b) If installing as framework, use the new +# QT_INSTALL_FRAMEWORKS directory; otherwise, use the old +# QT_INSTALL_LIBS; (c) Get PKGCONFIG dependencies correct, hopefully; +# (d) create and install .pc, .la, and .prl library description files, +# including basic path replacement into DESTDIR; we couple this with a +# post-patch to get the correct install location. + +patchfiles-append \ + patch-src_qt_install.pri.diff \ + patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff \ + patch-tools_assistant_lib_lib.pro.diff \ + patch-tools_designer_src_components_lib_lib.pro.diff \ + patch-tools_designer_src_lib_lib.pro.diff \ + patch-tools_designer_src_uitools_uitools.pro.diff \ + patch-mkspecs_features_uitools.prf.diff + +# (18) fix 'macdeployqt' to look for the correct plugins location by +# default. This is paired with a "reinplace" in post-patch + +patchfiles-append \ + patch-tools_macdeployqt_macdeployqt_main.cpp.diff + +# (19) Under 10.4 only: patch QMake build files using just "-lQtHelp" +# to do "-lQtHelp -lQtCLucene -lQtNetwork -lQtWebKit" instead. For +# some reason 10.5+ "knows" that how to do this correctly. + +platform darwin { + if {${MINOR} == 4} { + patchfiles-append patch-QtHelp_10.4_only.diff + } +} + +# (20) fix the Mac timer's use of "mach_timebase_info" + +patchfiles-append \ + patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff + +# (21) Under 10.8 and 10.9: Patch to fix corelib linking + +platform darwin { + if {${MINOR} >= 8} { + patchfiles-append patch-src_corelib_corelib.pro.diff + } +} + +# (22) fix Framework directory in MacDeployQt tool + +patchfiles-append \ + patch-tools_macdeployqt_shared_shared.cpp.diff + +# (23) remove ColorSync usage from qpaintengine. + +# This patch allows for building using the 10.11 SDK, and is also +# backward compatible with prior OS versions since it just removes API +# usage but does not otherwise add any. This patch does roughly the +# same thing as that from Qt5 commit b06304e16: +# http://code.qt.io/cgit/qt/qtbase.git/commit/?id=b06304e164ba47351fa292662c1e6383c081b5ca + +patchfiles-append \ + patch-src_gui_painting_qpaintengine_mac.diff + +# (24) fix qcursor_mac; already committed upstream; see also: +# https://trac.macports.org/ticket/48516 +# http://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa/qcocoacursor.mm?id=02ea0235216beef390e9868ff770c7a54d70db83 +# https://developer.apple.com/library/prerelease/mac/documentation/Carbon/Reference/QuartzEventServicesRef/#//apple_ref/c/func/CGEventCreateMouseEvent + +patchfiles-append \ + patch-src_gui_kernel_qcursor_mac.mm.diff + +# (25) avoid zombie processes; see also: +# https://trac.macports.org/ticket/46608 +# https://codereview.qt-project.org/#/c/61294/ +# approved but abandoned. + +patchfiles-append \ + patch-src_corelib_io_qprocess_unix.cpp.diff + +# (26) fix build on Leopard; see also: +# https://trac.macports.org/ticket/43746 + +patchfiles-append \ + patch-src_gui_dialogs_qfiledialog_mac.mm.diff + +# error out if trying to build on a new OSX version (> 10.11). + +platform darwin { + if {${MINOR} > 11} { + # This project needs to be updated to build with clang++ against libc++ + depends_lib + depends_run + pre-fetch { + ui_error "$name does not currently build on OSX later than 10.11 'El Capitan'." + error "unsupported platform" + } + } +} + +############################################### + +# disable CCACHE for now (ticket #34856) + +configure.ccache no + +# find a way to specify the SDK to use; Qt will use the 10.4u by +# default which won't work on 10.6 since it is not supported. Allow +# the user to specify the SDK if desired. + +global SDK +set SDK ${configure.sdkroot} +if {${SDK} eq ""} { + # set SDK version depending on OS version + set sdk_version "" + if {${MINOR} == 4} { + # OSX 10.4 requires an additional 'u' + set sdk_version "10.4u" + } else { + set sdk_version "10.${MINOR}" + } + if {[vercmp ${xcodeversion} 4.3] < 0} { + set SDK ${developer_dir}/SDKs/MacOSX${sdk_version}.sdk + } else { + set SDK ${developer_dir}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${sdk_version}.sdk + } +} + +post-patch { + # set ARCHES in configure (per the third patchfile above), for + # building QMake. join any 2 or more arch entries with the GCC + # arch flag (join does not effect a single entry). first "-arch" + # is already in place in the 'configure' script (since there has + # to be at least 1 arch). + + set ARCHES "" + if {[variant_exists universal] && [variant_isset universal]} { + set ARCHES [join ${universal_archs} " -arch "] + } else { + set ARCHES ${build_arch} + } + reinplace "s|@ARCHES@|${ARCHES}|g" ${worksrcpath}/configure + + # set MACOSX_DEPLOYMENT_TARGET version in various places. These + # were all patched in (2) above, and can be easily changed or + # overridden by the user in a project-local qmake .pro script. + + set TARGET "10.${MINOR}" + foreach fixfile {configure mkspecs/common/g++-macx.conf \ + mkspecs/common/mac.conf qmake/qmake.pri \ + src/tools/bootstrap/bootstrap.pro } { + reinplace "s|@MACOSX_DEPLOYMENT_TARGET@|${TARGET}|g" \ + ${worksrcpath}/${fixfile} + } + + # Ensure that correct C/C++ compilers are used. + + reinplace "s|@CXX@|${configure.cxx}|" \ + ${worksrcpath}/mkspecs/common/g++-base.conf + reinplace "s|@CC@|${configure.cc}|" \ + ${worksrcpath}/mkspecs/common/g++-base.conf + + # fix 'macdeployqt' to look for the correct + # plugins location by default. + + reinplace "s,@QT_PLUGINS_DIR@,${qt_plugins_dir},g" \ + ${worksrcpath}/tools/macdeployqt/macdeployqt/main.cpp + + # fix PREFIX in QMake makefile generator + + reinplace "s,@PREFIX@,${qt_dir},g" \ + ${worksrcpath}/qmake/generators/unix/unixmake.cpp + + # if no debug, then do not even build debug code + + if {![variant_isset debug]} { + foreach fixfile { src/qbase.pri \ + src/3rdparty/webkit/Source/WebKit.pri \ + src/imports/qimportbase.pri \ + src/plugins/qpluginbase.pri \ + tools/designer/src/components/lib/lib.pro \ + tools/designer/src/lib/lib.pro \ + tools/designer/src/plugins/activeqt/activeqt.pro \ + tools/designer/src/plugins/plugins.pri \ + tools/designer/src/uitools/uitools.pro \ + src/3rdparty/webkit/Source/WebKit/qt/declarative/declarative.pro } { + reinplace "/+=/s@debug_and_release@@g" \ + ${worksrcpath}/${fixfile} + } + } + + # copy C++11 files into place, if that variant is set + + if {[variant_isset cxx11]} { + copy ${filespath}/c++11.prf ${worksrcpath}/mkspecs/features + copy ${filespath}/c++11 ${worksrcpath}/config.tests/mac + } + + # copy Objective C / CXX files into place + + copy ${filespath}/objective_cxx.prf \ + ${worksrcpath}/mkspecs/features/mac + copy ${filespath}/split_sources.prf \ + ${worksrcpath}/mkspecs/features/mac + + # copy extra compiler tests into place; these are patched into the + # configure script to the area before qmake is built. If any + # fail, configure will fail quickly. + + copy ${filespath}/fconstant_cfstrings.test \ + ${worksrcpath}/config.tests/mac + copy ${filespath}/objc_block \ + ${worksrcpath}/config.tests/mac + copy ${filespath}/cpath \ + ${worksrcpath}/config.tests/mac + copy ${filespath}/library_path \ + ${worksrcpath}/config.tests/mac +} + +# Block various compilers: +# +# * The build process requires -Xarch, -fconstant-cfstring, and +# Objective-C(++) blocks (^), which are not supported with vanilla GCC +# as installed by MacPorts but are supported by all versions of CLANG +# (both MacPorts' and Apple's). +# +# * Some older versions of CLANG do not honor the CPATH +# environment variables, which is required for compiling +# this port when using MacPorts. The versions seem to be: MacPorts +# CLANG 2.9 or earlier, and Apple CLANG 318.0.58 or older. +# +# * Some older versions of CLANG do not honor the LIBRARY_PATH +# environment variables, which is required for compiling +# this port when using MacPorts. The versions seem to be: MacPorts +# CLANG 3.0 or earlier, and Apple CLANG 318.0.61 or older. +# +# * qt4-creator-mac fails to build with GCC <= 4.0. +# +# See also: +# < http://llvm.org/bugs/show_bug.cgi?id=8971 >, +# < https://trac.macports.org/ticket/30271 >, +# < https://trac.macports.org/ticket/31076 >, +# < https://trac.macports.org/ticket/31638 >, +# < https://trac.macports.org/ticket/37868 >, and +# < https://trac.macports.org/ticket/40422 >. +# +# NOTE: qt4-mac augments the standard Qt4 configure script with +# pre-qmake-build tests for CPATH, LIBRARY_PATH, -Xarch, +# -fconstant-cfstring, Objective-C(++) blocks, and, if requested, +# C++11. The script will error out quickly if the compiler does not +# seem to provide support for any one of these properties, no matter +# this blacklist. +# + +compiler.blacklist-append { clang <= 318.0.61 } \ + gcc-3.3 *gcc-4.0 macports-gcc* + +# --prefix is not recognized + +configure.pre_args-delete --prefix=${prefix} + +# --disable-dependency-tracking is not recognized + +configure.universal_args-delete --disable-dependency-tracking + +# clear all arch-oriented flags since somehow they impact how qmake is +# created, which in turn messes up LDFLAGS in most created Makefiles. + +configure.ld_archflags +configure.cc_archflags +configure.cxx_archflags +configure.universal_ldflags +configure.universal_cflags +configure.universal_cxxflags +configure.universal_cppflags +configure.march +configure.mtune + +# Use compiler.cpath and compiler.library_path for all -I and -L +# entries, so-as to avoid conflicts with already-installed headers and +# libraries (giving preference to internal-to-this-port first). CPATH +# is used instead of -I to avoid conflicts with other ports. +# +# See also: +# < https://trac.macports.org/ticket/15219 >, +# < https://trac.macports.org/ticket/18723 >, and +# < https://trac.macports.org/ticket/25321 >. + +# set the default paths to include those for SQLITE3 and DBUS-1 + +set header_path [ list ${prefix}/include/dbus-1.0 \ + ${prefix}/lib/dbus-1.0/include \ + ${prefix}/include ] + +set library_path [ list ${prefix}/lib ] + +# -dbus-linked prevends qt4 from trying to dynamically load libdbus-1, +# which it is not able to find in ${prefix}. +# +# -openssl-linked ensures that the MacPorts openssl is used. +# +# -framework ensures that this port is installed as frameworks +# (collections of {library, headers, resources}); in +# post-destroot, link headers and libraries from the frameworks +# into non-framework locations as if "-no-framework" were +# specified. Some dependent projects will not work properly if Qt +# is installed as libraries by default, thus make it so #1. +# +# -no-phonon ensures that Qt does not install the 3rd-parth Phonon +# port or its backend to QuickTime 7; Phonon is now installed via +# the 'phonon' port, which is more up to date than that provided +# by Qt. + +configure.args \ + -v \ + -confirm-license \ + -opensource \ + -prefix ${qt_dir} \ + -bindir ${qt_bins_dir} \ + -libdir ${qt_libs_dir} \ + -docdir ${qt_docs_dir} \ + -headerdir ${qt_includes_dir} \ + -plugindir ${qt_plugins_dir} \ + -importdir ${qt_imports_dir} \ + -datadir ${qt_data_dir} \ + -translationdir ${qt_translations_dir} \ + -sysconfdir ${qt_sysconf_dir} \ + -examplesdir ${qt_examples_dir} \ + -demosdir ${qt_demos_dir} \ + -openssl-linked \ + -dbus-linked \ + -fast \ + -optimized-qmake \ + -no-pch \ + -framework \ + -no-phonon \ + -no-phonon-backend + +# Stop configure script from searching for SQL Drivers +# not available from MacPorts. + +foreach driver {db2 ibase oci tds} { + configure.args-append -no-sql-${driver} +} + +# Disable all remaining SQL Drivers. These are available via the +# ports qt4-mac-*-plugin. + +foreach driver {mysql odbc psql sqlite sqlite2} { + configure.args-append -no-sql-${driver} +} + +pre-configure { + + # use the corrected CPATH and LIBRARY_PATH for build + + compiler.cpath [join ${header_path} :] + compiler.library_path [join ${library_path} :] + + # for 10.4 or 10.5 32-bit PPC, build as Carbon only, not Cocoa + + if {${MINOR} == 4} { + + configure.args-append -carbon + + # required linking flags? + + configure.ldflags-append -lcrypto -ldbus-1 -ljpeg -llcms \ + -lssl -lz + + } elseif {${MINOR} == 5 && + [llength ${qt_arch_types}] == 1 && + [lsearch -exact ${qt_arch_types} ppc] == 0} { + + configure.args-append -carbon + + } + + # set the arch type(s) to use, in Qt-speak + + configure.args-append -arch \"${qt_arch_types}\" + + # check to see if not compiling for the native machine hardware + # (e.g., compiling for just i386 but CPU is x86_64); optimization + # of QMake does not work in this circumstance. + + if {[lsearch -exact ${qt_arch_types} ${os.arch}] == -1} { + + # not building for native arch: disable optimizing qmake + configure.args-delete -optimized-qmake + + } elseif {${MINOR} == 6 && + [llength ${qt_arch_types}] == 1 && + [lsearch -exact ${qt_arch_types} x86] == 0} { + + # disable qmake optimization on 10.6 32-bit + configure.args-delete -optimized-qmake + + } + + # set the SDK, if it was found and exists + + if {[file exists ${SDK}]} { + configure.args-append -sdk ${SDK} + } + + # set which pkg-config to use + + configure.env-append PKG_CONFIG=${prefix}/bin/pkg-config + + # set which stdlib to use; clang only + if {[string match *clang* ${configure.compiler}]} { + configure.env-append QMAKE_STDLIB="-stdlib=${configure.cxx_stdlib}" + configure.ldflags-append -stdlib=${configure.cxx_stdlib} + } +} + +post-configure { + + # Remove any '-I' and '-L' string from the *FLAGS for SQLITE, + # DBUS, ODBC, and OPENSSL, so that what remains are just non-I/L + # flags; these paths are in compiler.cpath and + # compiler.library_path. The header and library paths for all the + # other variants are not used by 'configure', and are already + # included in the compiler.cpath and compiler.library_path + # . during the 'build' stage, 'make' will rebuild the Makefiles + # that depend on any of these changed files. These patches are + # sufficient to make sure local (to this build) paths are searched + # first, and then system paths last (via the compiler.X settings). + # Ideally, 'qmake' -- either via its mkspecs files or the + # project's build files -- would distinguish between "local" and + # "system" includes & libraries. + + # SQLITE + reinplace "/SQLITE/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/SQLITE/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + + # DBUS + reinplace "/DBUS/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/DBUS/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + + # OPENSSL + reinplace "/OPENSSL/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/OPENSSL/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + + # ODBC + reinplace "/ODBC/s@-I${prefix}/\[^ \]*include\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache + reinplace "/ODBC/s@-L${prefix}/\[^ \]*lib\[^ \]*@@g" \ + ${worksrcpath}/.qmake.cache +} + +pre-build { + # use the corrected CPATH and LIBRARY_PATH for build + compiler.cpath [join ${header_path} :] + compiler.library_path [join ${library_path} :] +} + +# do not use DESTDIR directly in the destroot command; Qt uses DISTDIR +# internally for other purposes, and instead uses INSTALL_ROOT for the +# additional install root prefix. + +destroot.post_args + +post-destroot { + + # shortcuts to destroot directories + + set dr_qt ${destroot}${qt_dir} + set dr_qt_libs_dir ${destroot}${qt_libs_dir} + set dr_qt_includes_dir ${destroot}${qt_includes_dir} + set dr_qt_data_dir ${destroot}${qt_data_dir} + set dr_qt_docs_dir ${destroot}${qt_docs_dir} + set dr_qt_apps_dir ${destroot}${qt_apps_dir} + set dr_qt_bins_dir ${destroot}${qt_bins_dir} + set dr_qt_frameworks_dir ${destroot}${qt_frameworks_dir} + + # create all needed destroot directories that don't already exist + + xinstall -m 755 -d ${dr_qt_libs_dir} + xinstall -m 755 -d ${dr_qt_includes_dir} + xinstall -m 755 -d ${dr_qt_data_dir} + xinstall -m 755 -d ${dr_qt_docs_dir} + xinstall -m 755 -d ${dr_qt_apps_dir} + + # Fix .pc and .prl files by changing ${worksrcpath}\${prefix} to + # ${qt_dir}\${prefix} ("\" means 'take away'). Cannot use + # "find -E" since it is not necessarily portable. + + regsub ${prefix} ${worksrcpath} "" from_dir + regsub ${prefix} ${qt_dir} "" to_dir + foreach fixfile [exec find ${dr_qt} -name "*.pc"] { + reinplace "s|${from_dir}|${to_dir}|g" ${fixfile} + } + foreach fixfile [exec find ${dr_qt} -name "*.prl"] { + reinplace "s|${from_dir}|${to_dir}|g" ${fixfile} + } + + # fix .pc files + + foreach fixfile [exec find ${dr_qt} -name "*.pc"] { + + # remove Libs.private; they can mess up linking + + reinplace "/Libs\.private/d" ${fixfile} + + # use ${qt_dir} correctly; + # in the .pc file, this will be ${prefix} + + reinplace "s|${qt_dir}/|\${prefix}/|g" ${fixfile} + + # fix libdir + + reinplace "/libdir=/s|Library/Frameworks|lib|" ${fixfile} + + # fix Libs: to use -L instead of -F + + reinplace "/Libs:/s|-F|-L|" ${fixfile} + + # fix Libs: to use -lQt* instead of "-framework Qt*" + # depends on whether for release or debug + + set fn [lindex [split ${fixfile} /] end] + + if {[lsearch -regexp ${fn} debug] == 0} { + + # debug; need to add that string to all Qt dependency libraries + reinplace "/Libs:/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|" \ + ${fixfile} + + } else { + + # no debug; just replace + reinplace "/Libs:/s|-framework Qt|-lQt|" ${fixfile} + + } + } + + # move .pc files from ${qt_frameworks_dir}/pkgconfig to + # ${qt_pkg_config_dir} + + file delete -force ${destroot}${qt_pkg_config_dir} + move ${dr_qt_frameworks_dir}/pkgconfig ${dr_qt_libs_dir} + + # move .la files from ${qt_frameworks_dir} to ${qt_libs_dir} + + foreach laf [glob ${dr_qt_frameworks_dir}/*.la] { + move ${laf} ${dr_qt_libs_dir} + } + + # remove -L entries from .prl and .la files + + foreach fixfile [exec find ${dr_qt} -name "*.prl"] { + reinplace "/QMAKE_PRL_LIBS/s|-L\[^ \]*||g" ${fixfile} + } + foreach fixfile [exec find ${dr_qt} -name "*.la"] { + reinplace "/dependency_libs/s|-L\[^ \]*||g" ${fixfile} + } + + # remove redundant -F entries from .prl and .la files + + foreach fixfile [exec find ${dr_qt} -name "*.prl"] { + reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*|FREPLACEME|1" \ + ${fixfile} + reinplace "/QMAKE_PRL_LIBS/s|-F\[^ \]*||g" ${fixfile} + reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \ + ${fixfile} + } + foreach fixfile [exec find ${dr_qt} -name "*.la"] { + reinplace "/dependency_libs/s|-F\[^ \]*|FREPLACEME|1" \ + ${fixfile} + reinplace "/dependency_libs/s|-F\[^ \]*||g" ${fixfile} + reinplace "s|FREPLACEME|-F${prefix}/Library/Frameworks|1" \ + ${fixfile} + } + + # get Qt's version numbers + + set qt_vers [split ${version} "."] + set qt_major [lindex ${qt_vers} 0] + set qt_minor [lindex ${qt_vers} 1] + set qt_patch [lindex ${qt_vers} 2] + + # link includes and libraries for each actual installed framework + + foreach fixfile [exec find ${dr_qt_frameworks_dir} \ + -name "*.framework" | \ + sed -e "s@${destroot}@@g"] { + + set tf_full [strsed ${fixfile} {s@\\.framework@@}] + set tf [strsed ${tf_full} {g@.*\/@@}] + + # special for QtWebKit entries + + set t_minor ${qt_minor} + set is_QtWebKit 0 + if {[string compare ${tf} QtWebKit] == 0} { + set t_minor 9 + set is_QtWebKit 1 + } + + # link headers into ${qt_includes_dir}, removing directories + # if they are already there first + + set inc_file ${dr_qt_includes_dir}/${tf} + if {[file exists ${inc_file}]} { + file delete -force ${inc_file} + } + ln -s ${tf_full}.framework/Headers ${inc_file} + + # link libraries into ${qt_libs_dir}, all 4 number variants + + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib + ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib + + # copy .prl file, then correct it for library usage + + copy ${destroot}${tf_full}.framework/${tf}.prl ${dr_qt_libs_dir}/lib${tf}.prl + + # fix TARGET in .prl file + + reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}.prl + + # fix PRL_LIBS -F -> -L in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.prl + + # fix "-framework Qt*" -> "-lQt*" in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-framework Qt|-lQt|g" \ + ${dr_qt_libs_dir}/lib${tf}.prl + + # fix up .la files to work with ${prefix}/lib entries + + # rename .la file + + move ${dr_qt_libs_dir}/${tf}.la ${dr_qt_libs_dir}/lib${tf}.la + + # fix "name that we can dlopen" in .la file + + reinplace "s|dlname=''|dlname='lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib'|" ${dr_qt_libs_dir}/lib${tf}.la + + # fix "names of this library" in .la file + + reinplace "s|library_names='\[^'\]*'|library_names='lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib lib${tf}.${qt_major}.${t_minor}.dylib lib${tf}.${qt_major}.dylib lib${tf}.dylib'|" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # fix "name of the static archive"; there is none in .la file + + reinplace "s|old_library='\[^'\]*'|old_library=''|" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # fix "libraries that this one depends upon" in .la file + + reinplace "/dependency_libs/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s|-framework Qt|-lQt|g" \ + ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s| ${worksrcpath}\[^ \]*||g" \ + ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s| -lwebcore||" \ + ${dr_qt_libs_dir}/lib${tf}.la + reinplace "/dependency_libs/s| -ljscore||" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # fix "directory that this library needs to be installed in" in .la file + + reinplace "/libdir/s|${qt_frameworks_dir}|${qt_libs_dir}|" \ + ${dr_qt_libs_dir}/lib${tf}.la + + # deal with debug files + + if {[variant_isset debug]} { + + # but not if QtWebKit and +universal, since that one does + # not exist (the 32-bit version of the debug library is + # larger than fits into the 32-bit filespace). + + if {[variant_isset debug] && ${is_QtWebKit}} { + continue + } + + # link libraries into ${qt_libs_dir}, all 4 number variants + + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.dylib + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.dylib + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.dylib + ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib + + # copy .prl file, then correct it for library usage + + copy ${destroot}${tf_full}.framework/${tf}_debug.prl ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix TARGET in .prl file + + reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix PRL_LIBS -F -> -L in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix "-framework Qt*" -> "-lQt*_debug" in .prl file + + reinplace "/QMAKE_PRL_LIBS/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.prl + + # fix up .la files to work with ${prefix}/lib entries + + # rename .la file + + move ${dr_qt_libs_dir}/${tf}_debug.la \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "name that we can dlopen" in .la file + + reinplace "s|dlname=''|dlname='lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib'|" ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "names of this library" in .la file + + reinplace "s|library_names='\[^'\]*'|library_names='lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib lib${tf}_debug.${qt_major}.${t_minor}.dylib lib${tf}_debug.${qt_major}.dylib lib${tf}_debug.dylib'|" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "name of the static archive"; there is none in .la file + + reinplace "s|old_library='\[^'\]*'|old_library=''|" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "libraries that this one depends upon" in .la file + + reinplace "/dependency_libs/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s| ${worksrcpath}\[^ \]*||g" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s| -lwebcored||" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + reinplace "/dependency_libs/s| -ljscored||" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + # fix "directory that this library needs to be installed in" in .la file + + reinplace "/libdir/s|${qt_frameworks_dir}|${qt_libs_dir}|" \ + ${dr_qt_libs_dir}/lib${tf}_debug.la + + } + } + + # Install documentation. + + xinstall -m 644 -W ${worksrcpath} \ + INSTALL LGPL_EXCEPTION.txt LICENSE.FDL \ + LICENSE.GPL3 LICENSE.LGPL README \ + ${dr_qt_docs_dir} + + # Install private headers needed by QtCreator + + foreach {src_dir include_dir} \ + {corelib QtCore gui QtGui script QtScript declarative QtDeclarative} { + set dest_dir ${dr_qt_frameworks_dir}/${include_dir}.framework/Headers/private + xinstall -m 755 -d ${dest_dir} + set files [exec find ${worksrcpath}/src/${src_dir} -type f -name "*_p.h"] + eval xinstall -m 644 [split ${files}] ${dest_dir} + } + + # Move .apps into the applications_dir, and link each .apps' + # executable back into ${qt_bins_dir} + + foreach app [glob ${dr_qt_bins_dir}/*.app] { + + # remove the leading stuff + + set app [lindex [split ${app} /] end] + + # move the .app + + move ${dr_qt_bins_dir}/${app} ${dr_qt_apps_dir} + + # link the app's executable back + + set texe [strsed ${app} {g@\.app@@}] + ln -s ${qt_apps_dir}/${app}/Contents/MacOS/${texe} \ + ${dr_qt_bins_dir} + + } + + # move tests to ${qt_data_dir} + + move ${dr_qt}/tests/qt4 ${dr_qt_data_dir}/tests + + # install ${qt_includes_dir}/Qt if not already and it exists in + # the build, for support of legacy projects + + if {![file exists ${dr_qt_includes_dir}/Qt] && + [file exists ${worksrcpath}/include/Qt]} { + + # copy the Qt headers directory + + copy ${worksrcpath}/include/Qt ${dr_qt_includes_dir} + + } + + # link in Resource to ${qt_libs_dir} + + ln -s ${qt_frameworks_dir}/QtGui.framework/Resources \ + ${dr_qt_libs_dir} + +} + +variant odbc description {Enable iODBC SQL Driver} { + depends_lib-append port:libiodbc + configure.args-delete -no-sql-odbc + configure.args-append -plugin-sql-odbc +} + +variant raster description {Use raster graphics system by default} { + configure.args-append -graphicssystem raster +} + +variant demos description {Build demos} {} + +if {![variant_isset demos]} { + configure.args-append -nomake demos +} + +variant examples description {Build examples} {} + +if {![variant_isset examples]} { + configure.args-append -nomake examples +} + +variant debug description {Build both release and debug library} {} + +if {[variant_isset debug]} { + configure.args-append -debug-and-release -declarative-debug +} else { + configure.args-append -release -no-declarative-debug +} + +variant openvg description {Build with support for OpenVG} { + + depends_lib-append port:mesa + + pre-configure { + + # set OpenVG arg, for both testing and building + + configure.env-append QMAKE_OPENVG_ARG=-lOpenVG + + } +} + +variant cxx11 description {Add library support for C++11 (EXPERIMENTAL; does not work with libc++)} { + + # Block compilers that do not support C++11. This variant seems to + # work with MacPorts' clang 3.0 or newer and Apple clang newer + # than 318.0.58 (but, not that version, which is already blocked). + + compiler.blacklist-append \ + apple-gcc-4.2 gcc-4.2 llvm-gcc-4.2 + + pre-fetch { + + # This variant does not work with Clang libc++ + + if {[info exists configure.cxx_stdlib] && + ${configure.cxx_stdlib} eq "libc++" && + [string match *clang* ${configure.cxx}]} { + + ui_msg "\nERROR: C++11 support for Qt4 is not available when using Clang and libc++.\n" + error "unsupported platform for C++11 support" + + } + } + + pre-extract { + + ui_msg "\nWARNING: You have enabled C++11 support for Qt4, which is EXPERIMENTAL. Qt's libraries and applications (not including QMake) will be compiled using C++11. That said, C++11 will NOT be enabled by default when using QMake. You can enable C++11 by specifying, e.g. \'CONFIG += c++11\', in any QMake build file.\n" + + } + + # patches for C++11 only + + patchfiles-append patch-cxx11.diff + + # have configure test for C++11; our hooks + # will error out if C++11 is not found. + + configure.args-append -c++11 + +} + +post-activate { + ui_msg "NOTE: Qt database plugins for mysql55, postgresql91, and sqlite2 are NOT installed by this port\; they are installed by qt4-mac-*-plugin instead." +} + +livecheck.type regex +livecheck.url http://download.qt.io/official_releases/qt/${branch}/ +livecheck.regex >(\[0-9.\]+)/< diff --git a/tools/MacOSX/ports/aqua/qt4-mac/Portfile.patch b/tools/MacOSX/ports/aqua/qt4-mac/Portfile.patch new file mode 100644 index 0000000000..994ee89f74 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/Portfile.patch @@ -0,0 +1,21 @@ +--- Portfile.orig 2015-11-24 12:21:32.000000000 +0100 ++++ Portfile 2015-11-24 12:22:39.000000000 +0100 +@@ -16,7 +16,7 @@ + #conflicts qt3 qt3-mac qt4-mac-devel + conflicts qt3 qt3-mac qt5-mac + version 4.8.7 +-revision 2 ++revision 102 + set branch [join [lrange [split ${version} .] 0 1] .] + + categories aqua +@@ -271,6 +271,9 @@ + patchfiles-append \ + patch-src_gui_dialogs_qfiledialog_mac.mm.diff + ++# fix default thread stack size ++patchfiles-append patch-qthread-stacksize.diff ++ + # error out if trying to build on a new OSX version (> 10.11). + + platform darwin { diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/c++11.prf b/tools/MacOSX/ports/aqua/qt4-mac/files/c++11.prf new file mode 100644 index 0000000000..a6509d97e2 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/c++11.prf @@ -0,0 +1,3 @@ +QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_CXX11 +QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_CXX11 +QMAKE_LFLAGS += $$QMAKE_LFLAGS_CXX11 diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11.test b/tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11.test new file mode 100755 index 0000000000..fd39829cca --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11.test @@ -0,0 +1,21 @@ +#!/bin/sh + +CXX11_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +cd $3 + +if "$COMPILER" -std=c++11 -c c++11_test.cpp 2>/dev/null 1>&2; then + CXX11_SUPPORT=yes +fi +rm -f c++11_test.o + +if [ "$CXX11_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "C++11 support not detected" + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "C++11 support detected" + exit 1 +fi diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11_test.cpp b/tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11_test.cpp new file mode 100644 index 0000000000..6f134e6fae --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/c++11/c++11_test.cpp @@ -0,0 +1,12 @@ +// from Qt 5.0 + +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +#else +# error "__cplusplus must be >= 201103L, or __GXX_EXPERIMENTAL_CXX0X__ must be defined" +#endif + +constexpr int get_five() {return 5;} + +int some_value[get_five() + 7]; + +int main(int, char **) { return 0; } diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath.test b/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath.test new file mode 100755 index 0000000000..c6da16d7c9 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath.test @@ -0,0 +1,34 @@ +#!/bin/sh + +CPATH_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +done=no +cd $3 +unset CPATH + +# (1) do the test, without CPATH; should fail +if "$COMPILER" -nostdinc -c cpath_test.c 2>/dev/null 1>&2; then + echo "Compile seems to work even with CPATH not set; assuming CPATH does not work" + done=0 +else + # (2) do the test, with CPATH set; should pass + export CPATH=. + if "$COMPILER" -nostdinc -c cpath_test.c 2>/dev/null 1>&2; then + CPATH_SUPPORT=yes + fi +fi +rm -f cpath_test.o + +# if done above, assume it works and exit +[ "$done" != "no" ] && exit $done + +if [ "$CPATH_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "CPATH support not detected" + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "CPATH support detected" + exit 1 +fi diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.c b/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.c new file mode 100644 index 0000000000..421000c67b --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.c @@ -0,0 +1,8 @@ +#include + +int test_cpath = 1; + +int main (void) { + (void) test_cpath; + return (0); +} diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.h b/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.h new file mode 100644 index 0000000000..9ebc53a122 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/cpath/cpath_test.h @@ -0,0 +1 @@ +extern int test_cpath; diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/fconstant_cfstrings.test b/tools/MacOSX/ports/aqua/qt4-mac/files/fconstant_cfstrings.test new file mode 100755 index 0000000000..d3ce4dc5ed --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/fconstant_cfstrings.test @@ -0,0 +1,26 @@ +#!/bin/sh + +FCONSTANT_CFSTRINGS_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +cd $3 +touch fconstant_cfstrings.c + +if "$COMPILER" -fconstant-cfstrings -c fconstant_cfstrings.c 2>/dev/null 1>&2; then + if "$COMPILER" -fconstant-cfstrings -c fconstant_cfstrings.c 2>&1 | grep "unrecognized" >/dev/null ; then + true + else + FCONSTANT_CFSTRINGS_SUPPORT=yes + fi +fi +rm -f fconstant_cfstrings.c fconstant_cfstrings.o + +if [ "$FCONSTANT_CFSTRINGS_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "compiler flag -fconstant-cfstrings support not detected" + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "compiler flag -fconstant-cfstrings support detected" + exit 1 +fi diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path.test b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path.test new file mode 100755 index 0000000000..9c3486a38b --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path.test @@ -0,0 +1,41 @@ +#!/bin/sh + +LIBRARY_PATH_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +done=no +cd $3 +unset LIBRARY_PATH + +# (1) make the library +if "$COMPILER" -dynamiclib -o library_path_lib.dylib library_path_lib.c 2>/dev/null 1>&2; then + # (2) do the test, without LIBRARY_PATH; should fail + if "$COMPILER" -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib 2>/dev/null 1>&2; then + echo "Compile seems to work even with LIBRARY_PATH not set; assuming LIBRARY_PATH does not work" + done=0 + else + # (3) do the test, with LIBRARY_PATH set; should pass + export LIBRARY_PATH=. + if "$COMPILER" -nostdinc -I. -o library_path_test library_path_test.c -lrary_path_lib 2>/dev/null 1>&2; then + LIBRARY_PATH_SUPPORT=yes + fi + fi + rm -f library_path_test.o library_path_test +else + echo "Unable to compile library; please fix this issue" + done=0 +fi +rm -f library_path_lib.dylib library_path_lib.o + +# if done above, assume it works and exit +[ "$done" != "no" ] && exit $done + +if [ "$LIBRARY_PATH_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "LIBRARY_PATH support not detected" + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "LIBRARY_PATH support detected" + exit 1 +fi diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.c b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.c new file mode 100644 index 0000000000..9a19658a90 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.c @@ -0,0 +1 @@ +int test_cpath; diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.h b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.h new file mode 100644 index 0000000000..9ebc53a122 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_lib.h @@ -0,0 +1 @@ +extern int test_cpath; diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_test.c b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_test.c new file mode 100644 index 0000000000..73379c81a5 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/library_path/library_path_test.c @@ -0,0 +1,6 @@ +#include + +int main (void) { + test_cpath = 1; + return (0); +} diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block.test b/tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block.test new file mode 100755 index 0000000000..e2dcff9284 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block.test @@ -0,0 +1,21 @@ +#!/bin/sh + +OBJC_BLOCK_SUPPORT=no +COMPILER=$1 +VERBOSE=$2 +WORKDIR=$3 + +cd $3 + +if "$COMPILER" -c objc_block_test.m 2>/dev/null 1>&2; then + OBJC_BLOCK_SUPPORT=yes +fi +rm -f objc_block_test.o + +if [ "$OBJC_BLOCK_SUPPORT" != "yes" ]; then + [ "$VERBOSE" = "yes" ] && echo "Objective-C block (^) support not detected" + exit 0 +else + [ "$VERBOSE" = "yes" ] && echo "Objective-C block (^) support detected" + exit 1 +fi diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block_test.m b/tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block_test.m new file mode 100644 index 0000000000..2b0ea34692 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/objc_block/objc_block_test.m @@ -0,0 +1,10 @@ +double (^multiplyTwoValues)(double, double) = + ^(double firstValue, double secondValue) { + return firstValue * secondValue; +}; + +int main () { + double result = multiplyTwoValues(2,4); + (void) result; + return (0); +} diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/objective_cxx.prf b/tools/MacOSX/ports/aqua/qt4-mac/files/objective_cxx.prf new file mode 100644 index 0000000000..3a89947ab9 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/objective_cxx.prf @@ -0,0 +1,18 @@ +# Add compiler directives for Objective C++ (.mm) only +# +# OBJECTIVE_CXX_SOURCES has already been set in "split_sources" + +isEmpty(QMAKE_OBJECTIVE_CXX):QMAKE_OBJECTIVE_CXX = $$QMAKE_CXX + +OBJECTIVE_CXX_OBJECTS_DIR = $$OBJECTS_DIR +isEmpty(OBJECTIVE_CXX_OBJECTS_DIR):OBJECTIVE_CXX_OBJECTS_DIR = . +isEmpty(QMAKE_EXT_OBJECTIVE_CXX):QMAKE_EXT_OBJECTIVE_CXX = .mm + +objective_cxx.dependency_type = TYPE_C +objective_cxx.variables = QMAKE_OBJECTIVE_CXXFLAGS +objective_cxx.commands = $$QMAKE_OBJECTIVE_CXX -c $(QMAKE_COMP_QMAKE_OBJECTIVE_CXXFLAGS) $(DEFINES) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} +objective_cxx.output = $$OBJECTIVE_CXX_OBJECTS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} +objective_cxx.input = OBJECTIVE_CXX_SOURCES +objective_cxx.name = Compile ${QMAKE_FILE_IN} +silent:objective_cxx.commands = @echo objective-cxx ${QMAKE_FILE_IN} && $$objective_cxx.commands +QMAKE_EXTRA_COMPILERS += objective_cxx diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff new file mode 100644 index 0000000000..0725e11d33 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff @@ -0,0 +1,145 @@ +--- tools/assistant/tools/assistant/assistant.pro.orig 2011-01-10 09:05:05.000000000 -0500 ++++ tools/assistant/tools/assistant/assistant.pro 2011-01-10 09:05:55.000000000 -0500 +@@ -120,3 +120,30 @@ + DEFINES += USE_STATIC_SQLITE_PLUGIN + } + } ++ ++qclucene = QtCLucene$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qclucene = $${qclucene}_debug ++ win32:qclucene = $${qclucene}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene ++LIBS_PRIVATE += -l$$qclucene ++ ++qcnetwork = QtNetwork$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcnetwork = $${qcnetwork}_debug ++ win32:qcnetwork = $${qcnetwork}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork ++LIBS_PRIVATE += -l$$qcnetwork ++ ++qcwebkit = QtWebKit$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcwebkit = $${qcwebkit}_debug ++ win32:qcwebkit = $${qcwebkit}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit ++LIBS_PRIVATE += -l$$qcwebkit ++ ++ ++ +--- tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro.orig 2011-01-10 09:05:05.000000000 -0500 ++++ tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro 2011-01-10 09:05:55.000000000 -0500 +@@ -19,3 +19,27 @@ + ../shared/collectionconfiguration.cpp + HEADERS += ../shared/helpgenerator.h \ + ../shared/collectionconfiguration.h ++ ++qclucene = QtCLucene$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qclucene = $${qclucene}_debug ++ win32:qclucene = $${qclucene}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene ++LIBS_PRIVATE += -l$$qclucene ++ ++qcnetwork = QtNetwork$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcnetwork = $${qcnetwork}_debug ++ win32:qcnetwork = $${qcnetwork}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork ++LIBS_PRIVATE += -l$$qcnetwork ++ ++qcwebkit = QtWebKit$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcwebkit = $${qcwebkit}_debug ++ win32:qcwebkit = $${qcwebkit}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit ++LIBS_PRIVATE += -l$$qcwebkit +--- tools/assistant/tools/qhelpconverter/qhelpconverter.pro.orig 2011-01-10 09:05:05.000000000 -0500 ++++ tools/assistant/tools/qhelpconverter/qhelpconverter.pro 2011-01-10 09:05:55.000000000 -0500 +@@ -49,3 +49,27 @@ + outputpage.ui + + RESOURCES += qhelpconverter.qrc ++ ++qclucene = QtCLucene$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qclucene = $${qclucene}_debug ++ win32:qclucene = $${qclucene}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene ++LIBS_PRIVATE += -l$$qclucene ++ ++qcnetwork = QtNetwork$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcnetwork = $${qcnetwork}_debug ++ win32:qcnetwork = $${qcnetwork}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork ++LIBS_PRIVATE += -l$$qcnetwork ++ ++qcwebkit = QtWebKit$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcwebkit = $${qcwebkit}_debug ++ win32:qcwebkit = $${qcwebkit}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit ++LIBS_PRIVATE += -l$$qcwebkit +--- tools/assistant/tools/qhelpgenerator/qhelpgenerator.pro.orig 2011-01-10 09:05:05.000000000 -0500 ++++ tools/assistant/tools/qhelpgenerator/qhelpgenerator.pro 2011-01-10 09:05:55.000000000 -0500 +@@ -17,3 +17,27 @@ + main.cpp + + HEADERS += ../shared/helpgenerator.h ++ ++qclucene = QtCLucene$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qclucene = $${qclucene}_debug ++ win32:qclucene = $${qclucene}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene ++LIBS_PRIVATE += -l$$qclucene ++ ++qcnetwork = QtNetwork$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcnetwork = $${qcnetwork}_debug ++ win32:qcnetwork = $${qcnetwork}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork ++LIBS_PRIVATE += -l$$qcnetwork ++ ++qcwebkit = QtWebKit$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcwebkit = $${qcwebkit}_debug ++ win32:qcwebkit = $${qcwebkit}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit ++LIBS_PRIVATE += -l$$qcwebkit +--- tools/designer/src/plugins/qwebview/qwebview.pro.orig 2011-01-10 09:05:05.000000000 -0500 ++++ tools/designer/src/plugins/qwebview/qwebview.pro 2011-01-10 09:05:55.000000000 -0500 +@@ -13,3 +13,19 @@ + SOURCES += qwebview_plugin.cpp + HEADERS += qwebview_plugin.h + RESOURCES += qwebview_plugin.qrc ++ ++qcnetwork = QtNetwork$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcnetwork = $${qcnetwork}_debug ++ win32:qcnetwork = $${qcnetwork}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcnetwork ++LIBS_PRIVATE += -l$$qcnetwork ++ ++qcwebkit = QtWebKit$${QT_LIBINFIX} ++if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ mac:qcwebkit = $${qcwebkit}_debug ++ win32:qcwebkit = $${qcwebkit}d ++} ++linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qcwebkit ++LIBS_PRIVATE += -l$$qcwebkit diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff new file mode 100644 index 0000000000..cce49b1660 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff @@ -0,0 +1,11 @@ +--- config.tests/unix/compile.test.orig 2013-07-06 14:39:26.000000000 -0400 ++++ config.tests/unix/compile.test 2013-07-06 14:39:44.000000000 -0400 +@@ -73,7 +73,7 @@ + rm -f "$EXE" "${EXE}.exe" + + echo "QT_BUILD_TREE = $OUTDIR" > "$OUTDIR/$TEST/.qmake.cache" +-"$OUTDIR/bin/qmake" -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" ++"$OUTDIR/bin/qmake" -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release app_bundle" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CFLAGS*=$CXXFLAGS" "QMAKE_CFLAGS+=$MAC_ARCH_CXXFLAGS" "QMAKE_OBJECTIVE_CFLAGS*=$CXXFLAGS" "QMAKE_OBJECTIVE_CFLAGS+=$MAC_ARCH_CXXFLAGS" "QMAKE_OBJECTIVE_CXXFLAGS*=$CXXFLAGS" "QMAKE_OBJECTIVE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile" + + if [ "$VERBOSE" = "yes" ]; then + $MAKE diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff new file mode 100644 index 0000000000..d4ec6b08e4 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff @@ -0,0 +1,22 @@ +--- config.tests/unix/precomp.test.orig 2012-04-23 14:49:04.000000000 -0400 ++++ config.tests/unix/precomp.test 2012-04-17 14:38:16.000000000 -0400 +@@ -4,7 +4,7 @@ + COMPILER=$1 + VERBOSE=$2 + +-case "$COMPILER" in ++case $COMPILER in + icpc) + cat >header.h </dev/null` in ++*g++*|c++|*qcc*|*gcc*|cc) ++ case `$COMPILER -dumpversion 2>/dev/null` in + 3.*) + ;; + *) diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-configure.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-configure.diff new file mode 100644 index 0000000000..0c8d0a53ba --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-configure.diff @@ -0,0 +1,353 @@ +--- configure.orig 2015-05-07 10:14:56.000000000 -0400 ++++ configure 2015-05-30 14:45:11.000000000 -0400 +@@ -925,12 +925,14 @@ + CFG_ICU=auto + CFG_SYSTEM_PROXIES=no + CFG_SLOG2=auto ++CFG_CXX11=no + + # initalize variables used for installation + QT_INSTALL_PREFIX= + QT_INSTALL_DOCS= + QT_INSTALL_HEADERS= + QT_INSTALL_LIBS= ++QT_INSTALL_FRAMEWORKS= + QT_INSTALL_BINS= + QT_INSTALL_PLUGINS= + QT_INSTALL_IMPORTS= +@@ -1144,7 +1146,7 @@ + VAL=no + ;; + #Qt style yes options +- -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu) ++ -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu|-c++11) + VAR=`echo $1 | sed "s,^-\(.*\),\1,"` + VAL=yes + ;; +@@ -1402,6 +1404,9 @@ + libdir) + QT_INSTALL_LIBS="$VAL" + ;; ++ frameworkdir) ++ QT_INSTALL_FRAMEWORKS="$VAL" ++ ;; + qtnamespace) + QT_NAMESPACE="$VAL" + ;; +@@ -2519,6 +2524,13 @@ + UNKNOWN_OPT=yes + fi + ;; ++ c++11) ++ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then ++ CFG_CXX11="$VAL" ++ else ++ UNKNOWN_OPT=yes ++ fi ++ ;; + system-proxies) + if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then + CFG_SYSTEM_PROXIES="$VAL" +@@ -3460,6 +3472,53 @@ + CFG_MAC_XARCH=no + fi + ++# detect required support for CPATH ++if "$mactests/cpath/cpath.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests/cpath" ; then ++ echo >&2 "error: The compiler ($TEST_COMPILER) does not seem to support the CPATH environment variable, which is required to compile qt4-mac using MacPorts when compiling on Mac OS X." ++ exit 1 ++fi ++ ++# detect required support for LIBRARY_PATH ++if "$mactests/library_path/library_path.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests/library_path" ; then ++ echo >&2 "error: The compiler ($TEST_COMPILER) does not seem to support the LIBRARY_PATH environment variable, which is required to compile qt4-mac using MacPorts when compiling on Mac OS X." ++ exit 1 ++fi ++ ++# detect required support for -fconstant-cfstrings ++if "$mactests/fconstant_cfstrings.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then ++ echo >&2 "error: The compiler ($TEST_COMPILER) does not seem to support the -fconstant-cfstrings flag, which is used extensively by the Qt build system when compiling on Mac OS X." ++ exit 1 ++fi ++ ++# detect required support for Objective-C blocks (^) on the mac, ++# but only on 10.6 ("uname -r" == 10.X) and newer ++case "$UNAME_SYSTEM:$UNAME_RELEASE" in ++ Darwin:[0-9].*) ++ ;; ++ Darwin*) ++ if "$mactests/objc_block/objc_block.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests/objc_block" ; then ++ echo >&2 "error: The compiler ($TEST_COMPILER) does not seem to support the Objective-C blocks (^), which are used by Qt when compiling on Mac OS X 10.6 and newer." ++ exit 1 ++ fi ++ ;; ++ *) ++ ;; ++esac ++ ++# Detect C++11 support, only if requested ++if [ "$CFG_CXX11" = "yes" ]; then ++ if "$mactests/c++11/c++11.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests/c++11" ; then ++ echo >&2 "error: C++11 support was requested, but the compiler ($TEST_COMPILER) does not seem to support C++11." ++ exit 1 ++ fi ++fi ++ ++# detect required support for -Xarch ++if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then ++ echo >&2 "error: The compiler ($TEST_COMPILER) does not seem to support the -Xarch flag, which is used extensively by the Qt build system when compiling on Mac OS X." ++ exit 1 ++fi ++ + #auto-detect DWARF2 on the mac + if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_DWARF2" = "auto" ]; then + if "$mactests/dwarf2.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" $MAC_CONFIG_TEST_COMMANDLINE; then +@@ -3469,15 +3528,6 @@ + fi + fi + +-# auto-detect support for -Xarch on the mac +-if [ "$PLATFORM_MAC" = "yes" ] && [ "$CFG_MAC_XARCH" = "auto" ]; then +- if "$mactests/xarch.test" "$TEST_COMPILER" "$OPT_VERBOSE" "$mactests" ; then +- CFG_MAC_XARCH=no +- else +- CFG_MAC_XARCH=yes +- fi +-fi +- + # don't autodetect support for separate debug info on objcopy when + # cross-compiling as lots of toolchains seems to have problems with this + if [ "$QT_CROSS_COMPILE" = "yes" ] && [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then +@@ -3704,6 +3754,19 @@ + fi + QT_INSTALL_LIBS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_LIBS"` + ++ #frameworks ++ if [ -z "$QT_INSTALL_FRAMEWORKS" ]; then #default ++ if [ "$CFG_PREFIX_INSTALL" = "no" ]; then ++ if [ "$PLATFORM_MAC" = "yes" ]; then ++ if [ "$CFG_FRAMEWORK" = "yes" ]; then ++ QT_INSTALL_FRAMEWORKS="/Libraries/Frameworks" ++ fi ++ fi ++ fi ++ [ -z "$QT_INSTALL_FRAMEWORKS" ] && QT_INSTALL_FRAMEWORKS="$QT_INSTALL_PREFIX/Library/Frameworks" #fallback ++ fi ++ QT_INSTALL_FRAMEWORKS=`"$relpath/config.tests/unix/makeabs" "$QT_INSTALL_FRAMEWORKS"` ++ + #bins + if [ -z "$QT_INSTALL_BINS" ]; then #default + if [ "$CFG_PREFIX_INSTALL" = "no" ]; then +@@ -4772,6 +4835,7 @@ + DOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_INSTALL_DOCS"` + HEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_INSTALL_HEADERS"` + LIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_INSTALL_LIBS"` ++FRAMEWORKS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_frameworkspath=$QT_INSTALL_FRAMEWORKS"` + BINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_INSTALL_BINS"` + PLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_INSTALL_PLUGINS"` + IMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_INSTALL_IMPORTS"` +@@ -4797,6 +4861,7 @@ + HOSTDOCUMENTATION_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_docspath=$QT_HOST_PREFIX/doc"` + HOSTHEADERS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_hdrspath=$QT_HOST_PREFIX/include"` + HOSTLIBRARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_libspath=$QT_HOST_PREFIX/lib"` ++ HOSTFRAMEWORKS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_frameworkspath=$QT_HOST_PREFIX/Library/Frameworks"` + HOSTBINARIES_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_binspath=$QT_HOST_PREFIX/bin"` + HOSTPLUGINS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_plugpath=$QT_HOST_PREFIX/plugins"` + HOSTIMPORTS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_impspath=$QT_HOST_PREFIX/IMPORTS"` +@@ -4814,6 +4879,7 @@ + static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR"; + static const char qt_configure_headers_path_str [256 + 12] = "$HOSTHEADERS_PATH_STR"; + static const char qt_configure_libraries_path_str [256 + 12] = "$HOSTLIBRARIES_PATH_STR"; ++static const char qt_configure_frameworks_path_str [256 + 12] = "$HOSTFRAMEWORKS_PATH_STR"; + static const char qt_configure_binaries_path_str [256 + 12] = "$HOSTBINARIES_PATH_STR"; + static const char qt_configure_plugins_path_str [256 + 12] = "$HOSTPLUGINS_PATH_STR"; + static const char qt_configure_imports_path_str [256 + 12] = "$HOSTIMPORTS_PATH_STR"; +@@ -4832,6 +4898,7 @@ + static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR"; + static const char qt_configure_headers_path_str [256 + 12] = "$HEADERS_PATH_STR"; + static const char qt_configure_libraries_path_str [256 + 12] = "$LIBRARIES_PATH_STR"; ++static const char qt_configure_frameworks_path_str [256 + 18] = "$FRAMEWORKS_PATH_STR"; + static const char qt_configure_binaries_path_str [256 + 12] = "$BINARIES_PATH_STR"; + static const char qt_configure_plugins_path_str [256 + 12] = "$PLUGINS_PATH_STR"; + static const char qt_configure_imports_path_str [256 + 12] = "$IMPORTS_PATH_STR"; +@@ -4857,6 +4924,7 @@ + #define QT_CONFIGURE_DOCUMENTATION_PATH qt_configure_documentation_path_str + 12; + #define QT_CONFIGURE_HEADERS_PATH qt_configure_headers_path_str + 12; + #define QT_CONFIGURE_LIBRARIES_PATH qt_configure_libraries_path_str + 12; ++#define QT_CONFIGURE_FRAMEWORKS_PATH qt_configure_frameworks_path_str + 18; + #define QT_CONFIGURE_BINARIES_PATH qt_configure_binaries_path_str + 12; + #define QT_CONFIGURE_PLUGINS_PATH qt_configure_plugins_path_str + 12; + #define QT_CONFIGURE_IMPORTS_PATH qt_configure_imports_path_str + 12; +@@ -4969,7 +5037,7 @@ + EXTRA_OBJS= + EXTRA_SRCS= + EXTRA_CFLAGS="\$(QMAKE_CFLAGS)" +- EXTRA_CXXFLAGS="\$(QMAKE_CXXFLAGS)" ++ EXTRA_CXXFLAGS="$QMAKE_STDLIB \$(QMAKE_CXXFLAGS)" + EXTRA_LFLAGS="\$(QMAKE_LFLAGS)" + + if [ "$PLATFORM" = "irix-cc" ] || [ "$PLATFORM" = "irix-cc-64" ]; then +@@ -5013,8 +5081,8 @@ + # Avoid overriding the default configuration settings when building with clang/libc++ + ;; + *) +- # For all other configurations require a minimum of 10.5 +- echo "export MACOSX_DEPLOYMENT_TARGET = 10.5" >> "$mkfile" ++ # For all other configurations require a minimum of @MACOSX_DEPLOYMENT_TARGET@ ++ echo "export MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@" >> "$mkfile" + ;; + esac + +@@ -5025,20 +5093,11 @@ + EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)" + EXTRA_OBJS="qsettings_mac.o qcore_mac.o" + EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\"" +- if echo "$CFG_MAC_ARCHS" | grep x86 > /dev/null 2>&1; then # matches both x86 and x86_64 +- X86_CFLAGS="-arch i386" +- X86_LFLAGS="-arch i386" +- EXTRA_CFLAGS="$X86_CFLAGS $EXTRA_CFLAGS" +- EXTRA_CXXFLAGS="$X86_CFLAGS $EXTRA_CXXFLAGS" +- EXTRA_LFLAGS="$EXTRA_LFLAGS $X86_LFLAGS" +- fi +- if echo "$CFG_MAC_ARCHS" | grep ppc > /dev/null 2>&1; then # matches both ppc and ppc64 +- PPC_CFLAGS="-arch ppc" +- PPC_LFLAGS="-arch ppc" +- EXTRA_CFLAGS="$PPC_CFLAGS $EXTRA_CFLAGS" +- EXTRA_CXXFLAGS="$PPC_CFLAGS $EXTRA_CXXFLAGS" +- EXTRA_LFLAGS="$EXTRA_LFLAGS $PPC_LFLAGS" +- fi ++ ARCH_CFLAGS="-arch @ARCHES@" ++ ARCH_LFLAGS="-arch @ARCHES@" ++ EXTRA_CFLAGS="$ARCH_CFLAGS $EXTRA_CFLAGS" ++ EXTRA_CXXFLAGS="$ARCH_CFLAGS $EXTRA_CXXFLAGS" ++ EXTRA_LFLAGS="$EXTRA_LFLAGS $ARCH_LFLAGS" + if [ '!' -z "$CFG_SDK" ]; then + echo "SDK_LFLAGS =-Wl,-syslibroot,$CFG_SDK" >>"$mkfile" + echo "SDK_CFLAGS =-isysroot $CFG_SDK" >>"$mkfile" +@@ -7002,7 +7061,7 @@ + + # detect OpenVG support + if [ "$CFG_OPENVG" != "no" ] && [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then +- if compileTest "unix/openvg" "OpenVG"; then ++ if compileTest "unix/openvg" "OpenVG" $QMAKE_OPENVG_ARG; then + if [ "$CFG_OPENVG" = "auto" ]; then + CFG_OPENVG=yes + fi +@@ -7033,7 +7092,7 @@ + CFG_OPENVG=no + fi + fi +- if [ "$CFG_OPENVG" = "yes" ] && compileTest "unix/shivavg" "ShivaVG" $CONFIG_ARG; then ++ if [ "$CFG_OPENVG" = "yes" ] && compileTest "unix/shivavg" "ShivaVG" $QMAKE_OPENVG_ARG; then + CFG_OPENVG_SHIVA=yes + fi + fi +@@ -7224,19 +7283,7 @@ + + # set the global Mac deployment target. This is overridden on an arch-by-arch basis + # in some cases, see code further down +-case "$PLATFORM,$CFG_MAC_COCOA" in +-*macx-clang-libc++,yes) +- # Avoid overriding the default configuration setting when building with clang/libc++ +- ;; +-macx*,yes) +- # Cocoa +- QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.5 +- ;; +-macx*,no) +- # gcc, Carbon +- QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET 10.4 +- ;; +-esac ++QMakeVar set QMAKE_MACOSX_DEPLOYMENT_TARGET @MACOSX_DEPLOYMENT_TARGET@ + + # disable Qt 3 support on VxWorks, Symbian and INTEGRITY + case "$XPLATFORM" in +@@ -7515,6 +7562,10 @@ + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GUI" + fi + ++if [ "$CFG_CXX11" = "yes" ]; then ++ QT_CONFIG="$QT_CONFIG c++11" ++ QMAKE_CONFIG="$QMAKE_CONFIG c++11" ++fi + + if [ "x$PLATFORM_MAC" = "xyes" ] && [ "$XPLATFORM_MINGW" != "yes" ] && [ "$XPLATFORM_SYMBIAN" != "yes" ]; then + #On Mac we implicitly link against libz, so we +@@ -7986,28 +8037,32 @@ + ;; + *) + if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then +- QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" +- QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" +- QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=10.4" +- QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=10.4" ++ QMakeVar add QMAKE_CFLAGS "-Xarch_i386 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_CXXFLAGS "-Xarch_i386 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_LFLAGS "-Xarch_i386 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CXXFLAGS_X86 "-arch i386 -Xarch_i386 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" + fi + if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then +- QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=10.4" +- QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=10.4" +- QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=10.4" +- QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=10.4" ++ QMakeVar add QMAKE_CFLAGS "-Xarch_ppc -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_LFLAGS "-Xarch_ppc -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CXXFLAGS_PPC "-arch ppc -Xarch_ppc -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" + fi + if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then +- QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5" ++ QMakeVar add QMAKE_CFLAGS "-Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_CXXFLAGS "-Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_LFLAGS "-Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CXXFLAGS_X86_64 "-arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" + fi + if echo "$CFG_MAC_ARCHS" | grep '\' > /dev/null 2>&1; then +- QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=10.5" +- QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=10.5" ++ QMakeVar add QMAKE_CFLAGS "-Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_CXXFLAGS "-Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_LFLAGS "-Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" ++ QMakeVar add QMAKE_OBJECTIVE_CXXFLAGS_PPC_64 "-arch ppc64 -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@" + fi + ;; + esac +@@ -8772,6 +8827,7 @@ + QMAKE_RCC = \$\$QT_BUILD_TREE/bin/rcc + QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp + QMAKE_INCDIR_QT = \$\$QT_BUILD_TREE/include ++QMAKE_FRAMEWORKDIR_QT = \$\$QT_BUILD_TREE/Library/Frameworks + QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib + + EOF +@@ -8810,6 +8866,11 @@ + echo "DEFINES *= QT_EDITION=QT_EDITION_DESKTOP" >> "$CACHEFILE.tmp" + fi + ++#dump in the OPENVG_LIBS info ++if [ "$CFG_OPENVG" = "yes" ]; then ++ echo "QMAKE_LIBS_OPENVG = $QMAKE_OPENVG_ARG" >> "$CACHEFILE.tmp" ++fi ++ + #dump in the OPENSSL_LIBS info + if [ '!' -z "$OPENSSL_LIBS" ]; then + echo "OPENSSL_LIBS = $OPENSSL_LIBS" >> "$CACHEFILE.tmp" +@@ -8969,6 +9030,7 @@ + else + echo "Debug .................. $CFG_DEBUG" + fi ++echo "C++11 support .......... $CFG_CXX11" + echo "Qt 3 compatibility ..... $CFG_QT3SUPPORT" + [ "$CFG_DBUS" = "no" ] && echo "QtDBus module .......... no" + [ "$CFG_DBUS" = "yes" ] && echo "QtDBus module .......... yes (run-time)" diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-cxx11.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-cxx11.diff new file mode 100644 index 0000000000..83a2f7d13e --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-cxx11.diff @@ -0,0 +1,594 @@ +--- src/gui/kernel/qcursor_mac.mm.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/gui/kernel/qcursor_mac.mm 2013-01-22 16:05:57.000000000 -0500 +@@ -367,7 +367,7 @@ + type = QCursorData::TYPE_ImageCursor; + curs.cp.my_cursor = true; + QPixmap bmCopy = QPixmap::fromImage(finalCursor); +- NSPoint hotSpot = { hx, hy }; ++ NSPoint hotSpot = { (CGFloat) hx, (CGFloat) hy }; + nsimage = static_cast(qt_mac_create_nsimage(bmCopy)); + curs.cp.nscursor = [[NSCursor alloc] initWithImage:nsimage hotSpot: hotSpot]; + [nsimage release]; +@@ -377,7 +377,7 @@ + { + type = QCursorData::TYPE_ImageCursor; + curs.cp.my_cursor = true; +- NSPoint hotSpot = { hx, hy }; ++ NSPoint hotSpot = { (CGFloat) hx, (CGFloat) hy }; + NSImage *nsimage; + nsimage = static_cast(qt_mac_create_nsimage(pixmap)); + curs.cp.nscursor = [[NSCursor alloc] initWithImage:nsimage hotSpot: hotSpot]; +--- src/gui/kernel/qcocoaview_mac.mm.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/gui/kernel/qcocoaview_mac.mm 2013-01-22 16:05:57.000000000 -0500 +@@ -1352,7 +1352,7 @@ + // Save supported actions: + [theView setSupportedActions: qt_mac_mapDropActions(dragPrivate()->possible_actions)]; + QPoint pointInView = [theView qt_qwidget]->mapFromGlobal(dndParams->globalPoint); +- NSPoint imageLoc = {pointInView.x() - hotspot.x(), pointInView.y() + pix.height() - hotspot.y()}; ++ NSPoint imageLoc = {(CGFloat)(pointInView.x() - hotspot.x()), (CGFloat)(pointInView.y() + pix.height() - hotspot.y())}; + NSSize mouseOffset = {0.0, 0.0}; + NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; + dragPrivate()->executed_action = Qt::ActionMask; +--- src/gui/kernel/qt_cocoa_helpers_mac.mm.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/gui/kernel/qt_cocoa_helpers_mac.mm 2013-01-22 16:05:57.000000000 -0500 +@@ -459,17 +459,17 @@ + { + NSEvent *proximityEvent = static_cast(tabletEvent); + // simply construct a Carbon proximity record and handle it all in one spot. +- TabletProximityRec carbonProximityRec = { [proximityEvent vendorID], +- [proximityEvent tabletID], +- [proximityEvent pointingDeviceID], +- [proximityEvent deviceID], +- [proximityEvent systemTabletID], +- [proximityEvent vendorPointingDeviceType], +- [proximityEvent pointingDeviceSerialNumber], ++ TabletProximityRec carbonProximityRec = {(UInt16) [proximityEvent vendorID], ++ (UInt16) [proximityEvent tabletID], ++ (UInt16) [proximityEvent pointingDeviceID], ++ (UInt16) [proximityEvent deviceID], ++ (UInt16) [proximityEvent systemTabletID], ++ (UInt16) [proximityEvent vendorPointingDeviceType], ++ (UInt32) [proximityEvent pointingDeviceSerialNumber], + [proximityEvent uniqueID], +- [proximityEvent capabilityMask], +- [proximityEvent pointingDeviceType], +- [proximityEvent isEnteringProximity] }; ++ (UInt32) [proximityEvent capabilityMask], ++ (UInt8) [proximityEvent pointingDeviceType], ++ (UInt8) [proximityEvent isEnteringProximity] }; + qt_dispatchTabletProximityEvent(carbonProximityRec); + } + #endif // QT_MAC_USE_COCOA +--- src/gui/accessible/qaccessible_mac.mm.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/gui/accessible/qaccessible_mac.mm 2013-01-22 16:05:57.000000000 -0500 +@@ -266,129 +266,129 @@ + int qt; + QAXRoleType mac; + bool settable; +-} text_bindings[][10] = { ++} text_bindings[][3] = { + { { QAccessible::MenuItem, QAXMenuItemRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::MenuBar, QAXMenuBarRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ScrollBar, QAXScrollBarRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Grip, QAXGrowAreaRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Window, QAXWindowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Dialog, QAXWindowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::AlertMessage, QAXWindowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ToolTip, QAXWindowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::HelpBalloon, QAXWindowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::PopupMenu, QAXMenuRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Application, QAXApplicationRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Pane, QAXGroupRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Grouping, QAXGroupRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Separator, QAXSplitterRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ToolBar, QAXToolbarRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::PageTab, QAXRadioButtonRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ButtonMenu, QAXMenuButtonRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ButtonDropDown, QAXPopUpButtonRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::SpinBox, QAXIncrementorRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Slider, QAXSliderRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ProgressBar, QAXProgressIndicatorRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ComboBox, QAXPopUpButtonRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::RadioButton, QAXRadioButtonRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::CheckBox, QAXCheckBoxRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::StaticText, QAXStaticTextRole, false }, + { QAccessible::Name, QAXValueAttribute, false }, + { -1, 0, false } + }, + { { QAccessible::Table, QAXTableRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::StatusBar, QAXStaticTextRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Column, QAXColumnRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ColumnHeader, QAXColumnRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Row, QAXRowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::RowHeader, QAXRowRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Cell, QAXTextFieldRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::PushButton, QAXButtonRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::EditableText, QAXTextFieldRole, true }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Link, QAXTextFieldRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Indicator, QAXValueIndicatorRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Splitter, QAXSplitGroupRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::List, QAXListRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::ListItem, QAXStaticTextRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, + { { QAccessible::Cell, QAXStaticTextRole, false }, +- { -1, 0, false } ++ { -1, 0, false }, { -1, 0, false } + }, +- { { -1, 0, false } } ++ { { -1, 0, false }, { -1, 0, false }, { -1, 0, false } } + }; + + class QAInterface; +--- src/gui/styles/qmacstyle_mac.mm.orig 2013-01-22 19:50:08.000000000 -0500 ++++ src/gui/styles/qmacstyle_mac.mm 2013-01-22 19:55:50.000000000 -0500 +@@ -3466,8 +3466,8 @@ + tti.version = qt_mac_hitheme_version; + tti.state = tds; + QColor textColor = btn->palette.buttonText().color(); +- CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), +- textColor.blueF(), textColor.alphaF() }; ++ CGFloat colorComp[] = { CGFloat(textColor.redF()), CGFloat(textColor.greenF()), ++ CGFloat(textColor.blueF()), CGFloat(textColor.alphaF()) }; + CGContextSetFillColorSpace(cg, QCoreGraphicsPaintEngine::macGenericColorSpace()); + CGContextSetFillColor(cg, colorComp); + tti.fontID = themeId; +@@ -3708,8 +3708,8 @@ + tti.version = qt_mac_hitheme_version; + tti.state = tds; + QColor textColor = myTab.palette.windowText().color(); +- CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), +- textColor.blueF(), textColor.alphaF() }; ++ CGFloat colorComp[] = { CGFloat(textColor.redF()), CGFloat(textColor.greenF()), ++ CGFloat(textColor.blueF()), CGFloat(textColor.alphaF()) }; + CGContextSetFillColorSpace(cg, QCoreGraphicsPaintEngine::macGenericColorSpace()); + CGContextSetFillColor(cg, colorComp); + switch (d->aquaSizeConstrain(opt, w)) { +@@ -3898,8 +3898,8 @@ + CGContextSetShouldAntialias(cg, true); + CGContextSetShouldSmoothFonts(cg, true); + QColor textColor = p->pen().color(); +- CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), +- textColor.blueF(), textColor.alphaF() }; ++ CGFloat colorComp[] = { CGFloat(textColor.redF()), CGFloat(textColor.greenF()), ++ CGFloat(textColor.blueF()), CGFloat(textColor.alphaF()) }; + CGContextSetFillColorSpace(cg, QCoreGraphicsPaintEngine::macGenericColorSpace()); + CGContextSetFillColor(cg, colorComp); + HIThemeTextInfo tti; +@@ -5034,8 +5034,8 @@ + tti.version = qt_mac_hitheme_version; + tti.state = tds; + QColor textColor = groupBox->palette.windowText().color(); +- CGFloat colorComp[] = { textColor.redF(), textColor.greenF(), +- textColor.blueF(), textColor.alphaF() }; ++ CGFloat colorComp[] = { CGFloat(textColor.redF()), CGFloat(textColor.greenF()), ++ CGFloat(textColor.blueF()), CGFloat(textColor.alphaF()) }; + CGContextSetFillColorSpace(cg, QCoreGraphicsPaintEngine::macGenericColorSpace()); + CGContextSetFillColor(cg, colorComp); + tti.fontID = checkable ? kThemeSystemFont : kThemeSmallSystemFont; +--- src/gui/text/qtextdocument_p.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/gui/text/qtextdocument_p.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -63,7 +63,15 @@ + // The VxWorks DIAB compiler crashes when initializing the anonymouse union with { a7 } + #if !defined(Q_CC_DIAB) + # define QT_INIT_TEXTUNDOCOMMAND(c, a1, a2, a3, a4, a5, a6, a7, a8) \ +- QTextUndoCommand c = { a1, a2, 0, 0, quint8(a3), a4, quint32(a5), quint32(a6), { int(a7) }, quint32(a8) } ++ QTextUndoCommand c; \ ++ c.command = a1; \ ++ c.block_part = a2; \ ++ c.operation = a3; \ ++ c.format = a4; \ ++ c.strPos = a5; \ ++ c.pos = a6; \ ++ c.length = a7; \ ++ c.revision = a8; + #else + # define QT_INIT_TEXTUNDOCOMMAND(c, a1, a2, a3, a4, a5, a6, a7, a8) \ + QTextUndoCommand c = { a1, a2, 0, 0, a3, a4, a5, a6 }; c.blockFormat = a7; c.revision = a8 +--- src/gui/widgets/qdialogbuttonbox.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/gui/widgets/qdialogbuttonbox.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -212,7 +212,7 @@ + return QDialogButtonBox::InvalidRole; + } + +-static const uint layouts[2][5][14] = ++static const UInt32 layouts[2][5][14] = + { + // Qt::Horizontal + { +@@ -407,7 +407,7 @@ + tmpPolicy = 4; // Mac modeless + } + +- const uint *currentLayout = layouts[orientation == Qt::Vertical][tmpPolicy]; ++ const UInt32 *currentLayout = layouts[orientation == Qt::Vertical][tmpPolicy]; + + if (center) + buttonLayout->addStretch(); +@@ -415,7 +415,7 @@ + QList acceptRoleList = buttonLists[AcceptRole]; + + while (*currentLayout != EOL) { +- int role = (*currentLayout & ~Reverse); ++ UInt32 role = (*currentLayout & ~Reverse); + bool reverse = (*currentLayout & Reverse); + + switch (role) { +--- src/qt3support/other/q3dragobject.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/qt3support/other/q3dragobject.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -1495,9 +1495,9 @@ + + void Q3ColorDrag::setColor(const QColor &col) + { +- short r = (col.red() << 8) | col.red(); +- short g = (col.green() << 8) | col.green(); +- short b = (col.blue() << 8) | col.blue(); ++ ushort r = (col.red() << 8) | col.red(); ++ ushort g = (col.green() << 8) | col.green(); ++ ushort b = (col.blue() << 8) | col.blue(); + + // make sure we transmit data in network order + r = htons(r); +--- src/openvg/qpaintengine_vg.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/openvg/qpaintengine_vg.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -971,23 +971,23 @@ + yRadius = qMin(yRadius, rect.height() / 2); + + VGfloat pts[] = { +- x1 + xRadius, y1, // MoveTo +- x2 - xRadius, y1, // LineTo +- x2 - (1 - KAPPA) * xRadius, y1, // CurveTo +- x2, y1 + (1 - KAPPA) * yRadius, +- x2, y1 + yRadius, +- x2, y2 - yRadius, // LineTo +- x2, y2 - (1 - KAPPA) * yRadius, // CurveTo +- x2 - (1 - KAPPA) * xRadius, y2, +- x2 - xRadius, y2, +- x1 + xRadius, y2, // LineTo +- x1 + (1 - KAPPA) * xRadius, y2, // CurveTo +- x1, y2 - (1 - KAPPA) * yRadius, +- x1, y2 - yRadius, +- x1, y1 + yRadius, // LineTo +- x1, y1 + (1 - KAPPA) * yRadius, // CurveTo +- x1 + (1 - KAPPA) * xRadius, y1, +- x1 + xRadius, y1 ++ VGfloat(x1 + xRadius), VGfloat(y1), // MoveTo ++ VGfloat(x2 - xRadius), VGfloat(y1), // LineTo ++ VGfloat(x2 - (1 - KAPPA) * xRadius), VGfloat(y1), // CurveTo ++ VGfloat(x2), VGfloat(y1 + (1 - KAPPA) * yRadius), ++ VGfloat(x2), VGfloat(y1 + yRadius), ++ VGfloat(x2), VGfloat(y2 - yRadius), // LineTo ++ VGfloat(x2), VGfloat(y2 - (1 - KAPPA) * yRadius), // CurveTo ++ VGfloat(x2 - (1 - KAPPA) * xRadius), VGfloat(y2), ++ VGfloat(x2 - xRadius), VGfloat(y2), ++ VGfloat(x1 + xRadius), VGfloat(y2), // LineTo ++ VGfloat(x1 + (1 - KAPPA) * xRadius), VGfloat(y2), // CurveTo ++ VGfloat(x1), VGfloat(y2 - (1 - KAPPA) * yRadius), ++ VGfloat(x1), VGfloat(y2 - yRadius), ++ VGfloat(x1), VGfloat(y1 + yRadius), // LineTo ++ VGfloat(x1), VGfloat(y1 + (1 - KAPPA) * yRadius), // CurveTo ++ VGfloat(x1 + (1 - KAPPA) * xRadius), VGfloat(y1), ++ VGfloat(x1 + xRadius), VGfloat(y1) + }; + + #if !defined(QVG_NO_MODIFY_PATH) +@@ -3207,7 +3207,7 @@ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, +- 0.0f, 0.0f, 0.0f, d->opacity, ++ 0.0f, 0.0f, 0.0f, VGfloat(d->opacity), + 0.0f, 0.0f, 0.0f, 0.0f + }; + VGImage tileWithOpacity = VG_INVALID_HANDLE; +--- src/openvg/qpixmapdata_vg.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/openvg/qpixmapdata_vg.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -421,7 +421,7 @@ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, +- 0.0f, 0.0f, 0.0f, opacity, ++ 0.0f, 0.0f, 0.0f, VGfloat(opacity), + 0.0f, 0.0f, 0.0f, 0.0f + }; + vgColorMatrix(vgImageOpacity, vgImage, matrix); +--- src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h 2013-01-22 16:05:57.000000000 -0500 +@@ -176,7 +176,7 @@ + // Node::emitCode assumes that dst, if provided, is either a local or a referenced temporary. + ASSERT(!dst || dst == ignoredResult() || !dst->isTemporary() || dst->refCount()); + if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { +- LineInfo info = { instructions().size(), n->lineNo() }; ++ LineInfo info = { uint32_t(instructions().size()), int32_t(n->lineNo()) }; + m_codeBlock->addLineInfo(info); + } + if (m_emitNodeDepth >= s_maxEmitNodeDepth) +@@ -195,7 +195,7 @@ + void emitNodeInConditionContext(ExpressionNode* n, Label* trueTarget, Label* falseTarget, bool fallThroughMeansTrue) + { + if (!m_codeBlock->numberOfLineInfos() || m_codeBlock->lastLineInfo().lineNumber != n->lineNo()) { +- LineInfo info = { instructions().size(), n->lineNo() }; ++ LineInfo info = { uint32_t(instructions().size()), int32_t(n->lineNo()) }; + m_codeBlock->addLineInfo(info); + } + if (m_emitNodeDepth >= s_maxEmitNodeDepth) +--- src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -1835,7 +1835,7 @@ + RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end) + { + #if ENABLE(JIT) +- HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth, CodeLocationLabel() }; ++ HandlerInfo info = { uint32_t(start->bind(0, 0)), uint32_t(end->bind(0, 0)), uint32_t(instructions().size()), uint32_t(m_dynamicScopeDepth + m_baseScopeDepth), CodeLocationLabel() }; + #else + HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth }; + #endif +@@ -1889,7 +1889,7 @@ + + void BytecodeGenerator::beginSwitch(RegisterID* scrutineeRegister, SwitchInfo::SwitchType type) + { +- SwitchInfo info = { instructions().size(), type }; ++ SwitchInfo info = { uint32_t(instructions().size()), type }; + switch (type) { + case SwitchInfo::SwitchImmediate: + emitOpcode(op_switch_imm); +--- src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -195,7 +195,7 @@ + UString::Rep::empty().hash(); + return &UString::Rep::empty(); + } +- UCharBuffer buf = {s, length}; ++ UCharBuffer buf = {s, (unsigned int) length}; + pair::iterator, bool> addResult = globalData->identifierTable->add(buf); + + // If the string is newly-translated, then we need to adopt it. +--- src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSONObject.cpp.orig 2014-05-01 10:03:45.000000000 -0400 ++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSONObject.cpp 2014-05-01 10:06:59.000000000 -0400 +@@ -320,7 +320,7 @@ + default: + static const char hexDigits[] = "0123456789abcdef"; + UChar ch = data[i]; +- UChar hex[] = { '\\', 'u', hexDigits[(ch >> 12) & 0xF], hexDigits[(ch >> 8) & 0xF], hexDigits[(ch >> 4) & 0xF], hexDigits[ch & 0xF] }; ++ UChar hex[] = { '\\', 'u', (UChar) hexDigits[(ch >> 12) & 0xF], (UChar) hexDigits[(ch >> 8) & 0xF], (UChar) hexDigits[(ch >> 4) & 0xF], (UChar) hexDigits[ch & 0xF] }; + builder.append(hex, sizeof(hex) / sizeof(UChar)); + break; + } +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h.orig 2014-04-10 14:37:11.000000000 -0400 ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h 2014-05-01 10:22:02.000000000 -0400 +@@ -31,16 +31,22 @@ + // nullptr_t type and nullptr object. They are defined in the same namespaces they + // would be in compiler and library that had the support. + +-#ifndef __has_feature +- #define __has_feature(feature) 0 +-#endif ++#if (__cplusplus >= 201103L) || defined(__GXX_EXPERIMENTAL_CXX0X__) ++ ++#include + +-#if __has_feature(cxx_nullptr) || (GCC_VERSION_AT_LEAST(4, 6, 0) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && _MSC_VER >= 1600 && !COMPILER(INTEL)) || defined(_LIBCPP_VERSION) ++// libstdc++ supports nullptr_t starting with gcc 4.6. ++#if defined(__GLIBCXX__) && __GLIBCXX__ < 20110325 ++namespace std { ++typedef decltype(nullptr) nullptr_t; ++} ++#endif + + #define HAVE_NULLPTR 1 + + #else + ++#warning "reverting to non NULLPTR" + namespace std { + class nullptr_t { }; + } +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -301,7 +301,7 @@ + if (!length) + return StringImpl::empty(); + +- UCharBuffer buffer = { s, length }; ++ UCharBuffer buffer = { s, (unsigned int) length }; + return addToStringTable(buffer); + } + +--- src/3rdparty/webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -2058,7 +2058,7 @@ + { + m_usesExceptions = true; + #if ENABLE(JIT) +- HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth, CodeLocationLabel() }; ++ HandlerInfo info = { uint32_t(start->bind(0, 0)), uint32_t(end->bind(0, 0)), uint32_t(instructions().size()), uint32_t(m_dynamicScopeDepth + m_baseScopeDepth), CodeLocationLabel() }; + #else + HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth }; + #endif +@@ -2107,7 +2107,7 @@ + + void BytecodeGenerator::beginSwitch(RegisterID* scrutineeRegister, SwitchInfo::SwitchType type) + { +- SwitchInfo info = { instructions().size(), type }; ++ SwitchInfo info = { uint32_t(instructions().size()), type }; + switch (type) { + case SwitchInfo::SwitchImmediate: + emitOpcode(op_switch_imm); +--- src/3rdparty/webkit/Source/JavaScriptCore/runtime/Identifier.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/Identifier.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -222,7 +222,7 @@ + } + if (!length) + return StringImpl::empty(); +- UCharBuffer buf = {s, length}; ++ UCharBuffer buf = {s, (unsigned int) length}; + pair::iterator, bool> addResult = globalData->identifierTable->add(buf); + + // If the string is newly-translated, then we need to adopt it. +--- src/3rdparty/webkit/Source/JavaScriptCore/runtime/StringPrototype.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/StringPrototype.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -463,7 +463,7 @@ + } + + size_t matchEnd = matchPos + matchLen; +- int ovector[2] = { matchPos, matchEnd }; ++ int ovector[2] = { int (matchPos), int (matchEnd) }; + return JSValue::encode(jsString(exec, source.substringSharingImpl(0, matchPos), substituteBackreferences(replacementString, source, ovector, 0), source.substringSharingImpl(matchEnd))); + } + +--- src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSONObject.cpp.orig 2014-05-01 10:33:20.000000000 -0400 ++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSONObject.cpp 2014-05-01 10:34:03.000000000 -0400 +@@ -335,7 +335,7 @@ + default: + static const char hexDigits[] = "0123456789abcdef"; + UChar ch = data[i]; +- UChar hex[] = { '\\', 'u', hexDigits[(ch >> 12) & 0xF], hexDigits[(ch >> 8) & 0xF], hexDigits[(ch >> 4) & 0xF], hexDigits[ch & 0xF] }; ++ UChar hex[] = { '\\', 'u', (UChar) hexDigits[(ch >> 12) & 0xF], (UChar) hexDigits[(ch >> 8) & 0xF], (UChar) hexDigits[(ch >> 4) & 0xF], (UChar) hexDigits[ch & 0xF] }; + builder.append(hex, WTF_ARRAY_LENGTH(hex)); + break; + } +--- src/3rdparty/webkit/Source/WebCore/dom/DocumentMarkerController.cpp.orig 2013-01-22 16:04:44.000000000 -0500 ++++ src/3rdparty/webkit/Source/WebCore/dom/DocumentMarkerController.cpp 2013-01-22 16:05:57.000000000 -0500 +@@ -59,7 +59,7 @@ + for (TextIterator markedText(range); !markedText.atEnd(); markedText.advance()) { + RefPtr textPiece = markedText.range(); + int exception = 0; +- DocumentMarker marker = {type, textPiece->startOffset(exception), textPiece->endOffset(exception), description, false}; ++ DocumentMarker marker = {type, (unsigned int) textPiece->startOffset(exception), (unsigned int) textPiece->endOffset(exception), description, false}; + addMarker(textPiece->startContainer(exception), marker); + } + } +--- src/3rdparty/webkit/Source/WebCore/dom/Element.cpp.orig 2014-05-01 10:46:05.000000000 -0400 ++++ src/3rdparty/webkit/Source/WebCore/dom/Element.cpp 2014-05-01 10:52:18.000000000 -0400 +@@ -1080,7 +1080,7 @@ + { + // Ref currentStyle in case it would otherwise be deleted when setRenderStyle() is called. + RefPtr currentStyle(renderStyle()); +- bool hasParentStyle = parentNodeForRenderingAndStyle() ? parentNodeForRenderingAndStyle()->renderStyle() : false; ++ bool hasParentStyle = parentNodeForRenderingAndStyle() ? (parentNodeForRenderingAndStyle()->renderStyle() != NULL) : false; + bool hasDirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByDirectAdjacentRules(); + bool hasIndirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByForwardPositionalRules(); + +--- src/plugins/accessible/widgets/itemviews.cpp.orig 2014-05-01 12:08:45.000000000 -0400 ++++ src/plugins/accessible/widgets/itemviews.cpp 2014-05-01 12:28:22.000000000 -0400 +@@ -393,7 +393,7 @@ + QModelIndex index = view()->model()->index(0, column, view()->rootIndex()); + if (!index.isValid() || view()->selectionMode() & QAbstractItemView::NoSelection) + return false; +- view()->selectionModel()->select(index, QItemSelectionModel::Columns & QItemSelectionModel::Deselect); ++ view()->selectionModel()->select(index, QItemSelectionModel::SelectionFlags(QItemSelectionModel::Columns & QItemSelectionModel::Deselect)); + return true; + } + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-darwin-g++.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-darwin-g++.diff new file mode 100644 index 0000000000..44a92ccb1b --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-darwin-g++.diff @@ -0,0 +1,20 @@ +--- configure_orig 2010-10-13 21:13:01.000000000 -0400 ++++ configure 2010-10-13 21:15:36.000000000 -0400 +@@ -4558,7 +4558,7 @@ + EXTRA_LFLAGS="\$(QMAKE_LFLAGS_RPATH)\"$rpath\" $EXTRA_LFLAGS" + done + fi +- if [ "$PLATFORM_MAC" = "yes" ]; then ++ if [ "$PLATFORM_MAC" = "yes" -o "$PLATFORM" = "darwin-g++" ]; then + echo "export MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@" >> "$mkfile" + echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile" + echo "CARBON_CFLAGS =-fconstant-cfstrings" >>"$mkfile" +@@ -6739,7 +6730,7 @@ + [ '!' -z "$L_FLAGS" ] && QMakeVar add QMAKE_LIBDIR_FLAGS "$L_FLAGS" + [ '!' -z "$l_FLAGS" ] && QMakeVar add LIBS "$l_FLAGS" + +-if [ "$PLATFORM_MAC" = "yes" ]; then ++if [ "$PLATFORM_MAC" = "yes" -o "$PLATFORM" = "darwin-g++" ]; then + if [ "$CFG_RPATH" = "yes" ]; then + QMAKE_CONFIG="$QMAKE_CONFIG absolute_library_soname" + fi diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff new file mode 100644 index 0000000000..fb1748b4cd --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff @@ -0,0 +1,26 @@ +--- mkspecs/common/g++-base.conf.orig 2013-01-22 16:04:48.000000000 -0500 ++++ mkspecs/common/g++-base.conf 2013-01-23 20:54:44.000000000 -0500 +@@ -8,14 +8,14 @@ + # you can use the manual test in tests/manual/mkspecs. + # + +-QMAKE_CC = gcc ++QMAKE_CC = @CC@ + + QMAKE_LINK_C = $$QMAKE_CC + QMAKE_LINK_C_SHLIB = $$QMAKE_CC + + QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += -O2 -g + +-QMAKE_CXX = g++ ++QMAKE_CXX = @CXX@ + + QMAKE_LINK = $$QMAKE_CXX + QMAKE_LINK_SHLIB = $$QMAKE_CXX +@@ -28,3 +28,6 @@ + QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE} + QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} + QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE ++ ++QMAKE_CXXFLAGS_CXX11 = -std=c++11 ++QMAKE_LFLAGS_CXX11 = diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff new file mode 100644 index 0000000000..fd5dd3178b --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff @@ -0,0 +1,25 @@ +--- mkspecs/common/g++-macx.conf.orig 2013-01-22 16:04:48.000000000 -0500 ++++ mkspecs/common/g++-macx.conf 2013-01-23 20:55:09.000000000 -0500 +@@ -16,16 +16,20 @@ + + QMAKE_LFLAGS_STATIC_LIB += -all_load + +-QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=10.5 +-QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=10.5 ++QMAKE_CFLAGS_X86_64 += -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_CFLAGS_PPC_64 += -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ + + QMAKE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 + QMAKE_CXXFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 + QMAKE_OBJECTIVE_CFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 + QMAKE_OBJECTIVE_CFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 ++QMAKE_OBJECTIVE_CXXFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 ++QMAKE_OBJECTIVE_CXXFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 + QMAKE_LFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 + QMAKE_LFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 + ++QMAKE_OBJECTIVE_CXXFLAGS_CXX11 = $$QMAKE_CXXFLAGS_CXX11 ++ + QMAKE_OBJCFLAGS_PRECOMPILE = -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} + QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE + QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff new file mode 100644 index 0000000000..bb53f11407 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff @@ -0,0 +1,23 @@ +--- mkspecs/common/mac.conf.orig 2012-08-14 15:49:12.000000000 -0400 ++++ mkspecs/common/mac.conf 2012-08-14 15:49:25.000000000 -0400 +@@ -9,6 +9,7 @@ + QMAKE_LIBDIR = + QMAKE_INCDIR_QT = $$[QT_INSTALL_HEADERS] + QMAKE_LIBDIR_QT = $$[QT_INSTALL_LIBS] ++QMAKE_FRAMEWORKDIR_QT = $$[QT_INSTALL_FRAMEWORKS] + QMAKE_INCDIR_OPENGL = /System/Library/Frameworks/OpenGL.framework/Headers \ + /System/Library/Frameworks/AGL.framework/Headers/ + +@@ -38,7 +39,11 @@ + QMAKE_DEL_DIR = rmdir + QMAKE_CHK_DIR_EXISTS = test -d + QMAKE_MKDIR = mkdir -p +-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 # overridden to 10.5 for Cocoa on the compiler command line ++QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@ + ++# allow CC and CXX to use CCACHE; ++# use "make CCACHE=ccache" when building ++QMAKE_CC = $(CCACHE) $$QMAKE_CC ++QMAKE_CXX = $(CCACHE) $$QMAKE_CXX + + include(unix.conf) diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff new file mode 100644 index 0000000000..d8828a56dd --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff @@ -0,0 +1,158 @@ +--- mkspecs/darwin-g++/qmake.conf.orig 2010-10-04 16:26:47.000000000 -0400 ++++ mkspecs/darwin-g++/qmake.conf 2010-10-04 16:59:03.000000000 -0400 +@@ -1,21 +1,22 @@ + # + # qmake configuration for darwin-g++ + # +-# Written for Qt/X11 on Darwin and XFree86 ++# Written for Qt/X11 on Darwin only + # + + MAKEFILE_GENERATOR = UNIX + TARGET_PLATFORM = macx + TEMPLATE = app +-CONFIG += qt warn_on release link_prl native_precompiled_headers ++CONFIG += qt warn_on release incremental global_init_link_order lib_version_first plugin_no_soname link_prl + QT += core gui + DEFINES += __USE_WS_X11__ + ++QMAKE_COMPILER_DEFINES += __APPLE__ __GNUC__ ++QMAKE_RESOURCE = /Developer/Tools/Rez ++QMAKE_FIX_RPATH = install_name_tool -id ++QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@ ++ + QMAKE_CC = cc +-QMAKE_LEX = flex +-QMAKE_LEXFLAGS = +-QMAKE_YACC = yacc +-QMAKE_YACCFLAGS = -d + QMAKE_CFLAGS = -pipe + QMAKE_CFLAGS_DEPS = -M + QMAKE_CFLAGS_WARN_ON = -Wall -W +@@ -24,12 +25,16 @@ + QMAKE_CFLAGS_DEBUG = -g + QMAKE_CFLAGS_SHLIB = -fPIC + QMAKE_CFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_SHLIB +-QMAKE_EXTENSION_SHLIB = dylib +-QMAKE_EXTENSION_PLUGIN = so ++#QMAKE_EXTENSION_SHLIB = dylib ++#QMAKE_EXTENSION_PLUGIN = so + QMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses + QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden +-QMAKE_CFLAGS_THREAD = +-QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} ++QMAKE_CFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_CFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_CFLAGS_PPC += -arch ppc ++QMAKE_CFLAGS_X86 += -arch i386 ++QMAKE_CFLAGS_DWARF2 += -gdwarf-2 ++QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} + QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE} + + QMAKE_CXX = c++ +@@ -43,7 +48,48 @@ + QMAKE_CXXFLAGS_STATIC_LIB = $$QMAKE_CFLAGS_STATIC_LIB + QMAKE_CXXFLAGS_YACC = $$QMAKE_CFLAGS_YACC + QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden +-QMAKE_CXXFLAGS_THREAD = ++QMAKE_CXXFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_CXXFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_CXXFLAGS_PPC += -arch ppc ++QMAKE_CXXFLAGS_X86 += -arch i386 ++QMAKE_CXXFLAGS_DWARF2 += $$QMAKE_CFLAGS_DWARF2 ++QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} ++QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE ++ ++QMAKE_OBJECTIVE_CFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_OBJECTIVE_CFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_OBJECTIVE_CFLAGS_PPC += -arch ppc ++QMAKE_OBJECTIVE_CFLAGS_X86 += -arch i386 ++QMAKE_OBJCFLAGS_PRECOMPILE += -x objective-c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} ++QMAKE_OBJCFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE ++ ++QMAKE_OBJCXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} ++QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE ++ ++QMAKE_PCH_OUTPUT_EXT = .gch ++ ++QMAKE_LINK = $$QMAKE_CXX ++QMAKE_LINK_SHLIB = $$QMAKE_CXX ++QMAKE_LINK_C = $$QMAKE_CC ++QMAKE_LINK_C_SHLIB = $$QMAKE_CC ++QMAKE_LFLAGS += -headerpad_max_install_names ++QMAKE_LFLAGS_RELEASE += ++QMAKE_LFLAGS_DEBUG += ++QMAKE_LFLAGS_APP += ++QMAKE_LFLAGS_SHLIB += -dynamiclib -single_module ++QMAKE_LFLAGS_PLUGIN += $$QMAKE_LFLAGS_SHLIB ++QMAKE_LFLAGS_THREAD += ++QMAKE_LFLAGS_INCREMENTAL+= -undefined suppress -flat_namespace ++QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} ++QMAKE_LFLAGS_PPC_64 += -arch ppc64 -Xarch_ppc64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_LFLAGS_X86_64 += -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=@MACOSX_DEPLOYMENT_TARGET@ ++QMAKE_LFLAGS_PPC += -arch ppc ++QMAKE_LFLAGS_X86 += -arch i386 ++QMAKE_LFLAGS_VERSION += -current_version$${LITERAL_WHITESPACE} ++QMAKE_LFLAGS_COMPAT_VERSION += -compatibility_version$${LITERAL_WHITESPACE} ++# -all_load requred to make Objective-C categories work in static builds. ++QMAKE_LFLAGS_STATIC_LIB += -all_load ++QMAKE_LFLAGS_RPATH += + + QMAKE_INCDIR = + QMAKE_LIBDIR = +@@ -54,29 +100,11 @@ + QMAKE_INCDIR_OPENGL = /usr/X11R6/include + QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib + +-QMAKE_LINK = c++ +-QMAKE_LINK_SHLIB = c++ +-QMAKE_LFLAGS += -headerpad_max_install_names +-QMAKE_LFLAGS = +-QMAKE_LFLAGS_RELEASE = +-QMAKE_LFLAGS_DEBUG = +-QMAKE_LFLAGS_APP = -prebind +-QMAKE_LFLAGS_SHLIB = -prebind -dynamiclib -single_module +-QMAKE_LFLAGS_PLUGIN = -prebind -bundle +-QMAKE_LFLAGS_THREAD = +-QMAKE_LFLAGS_SONAME += -install_name$${LITERAL_WHITESPACE} +- +-QMAKE_LFLAGS_VERSION = -current_version$${LITERAL_WHITESPACE} +-QMAKE_LFLAGS_COMPAT_VERSION = -compatibility_version$${LITERAL_WHITESPACE} +- +-QMAKE_LFLAGS_RPATH = +- + QMAKE_LIBS_DYNLOAD = + QMAKE_LIBS_X11 = -lXext -lX11 -lm + QMAKE_LIBS_X11SM = -lSM -lICE + QMAKE_LIBS_OPENGL = -lGLU -lGL + QMAKE_LIBS_OPENGL_QT = -lGL +-QMAKE_LIBS_THREAD = + + QMAKE_MOC = $$[QT_INSTALL_BINS]/moc + QMAKE_UIC = $$[QT_INSTALL_BINS]/uic +@@ -88,19 +116,19 @@ + QMAKE_TAR = tar -cf + QMAKE_GZIP = gzip -9f + ++QMAKE_LEX = flex ++QMAKE_LEXFLAGS = ++QMAKE_YACC = yacc ++QMAKE_YACCFLAGS = -d ++ + QMAKE_COPY = cp -f + QMAKE_COPY_FILE = $$QMAKE_COPY +-QMAKE_COPY_DIR = $$QMAKE_COPY -r ++QMAKE_COPY_DIR = $$QMAKE_COPY -R + QMAKE_MOVE = mv -f + QMAKE_DEL_FILE = rm -f + QMAKE_DEL_DIR = rmdir + QMAKE_CHK_DIR_EXISTS = test -d + QMAKE_MKDIR = mkdir -p + +-QMAKE_PCH_OUTPUT_EXT = .gch +- +-QMAKE_CXXFLAGS_PRECOMPILE += -x objective-c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT} +-QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE +- + include(../common/unix.conf) + load(qt_config) diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff new file mode 100644 index 0000000000..69620a3dae --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff @@ -0,0 +1,18 @@ +--- mkspecs/features/moc.prf.orig 2012-04-24 08:27:50.000000000 -0400 ++++ mkspecs/features/moc.prf 2012-04-24 08:27:55.000000000 -0400 +@@ -83,8 +83,13 @@ + #make sure we can include these files + moc_dir_short = $$MOC_DIR + contains(QMAKE_HOST.os,Windows):moc_dir_short ~= s,^.:,/, +-contains(moc_dir_short, ^[/\\\\].*):INCLUDEPATH += $$MOC_DIR +-else:INCLUDEPATH += $$OUT_PWD/$$MOC_DIR ++ ++# order the local moc path -before- the others, since its headers ++# should -always be found locally so we want that path first. ++contains(moc_dir_short, ^[/\\\\].*):INCLUDEPATH = $$MOC_DIR $$INCLUDEPATH ++else:INCLUDEPATH = $$OUT_PWD/$$MOC_DIR $$INCLUDEPATH ++ ++# message(MOC_DIR is $$MOC_DIR) + + # Backwards compatibility: Make shadow builds with default MOC_DIR work + # if the user did not add the source dir explicitly. diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff new file mode 100644 index 0000000000..eee91d7627 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff @@ -0,0 +1,62 @@ +--- mkspecs/features/qt.prf.orig 2013-07-06 14:28:19.000000000 -0400 ++++ mkspecs/features/qt.prf 2013-07-06 14:28:33.000000000 -0400 +@@ -145,7 +145,15 @@ + #specific module settings + !isEmpty(QT_BUILD_TREE):QMAKE_LIBDIR = $$QT_BUILD_TREE/lib $$QMAKE_LIBDIR #as above, prepending prevents us from picking up "stale" libs + QMAKE_LIBDIR += $$QMAKE_LIBDIR_QT ++ + for(QTLIB, $$list($$lower($$unique(QT)))) { ++ ++# message(qt: 'LIBS' qt before $$QTLIB is '$${LIBS}') ++# message(qt: 'INCLUDEPATH' qt before $$QTLIB is '$${INCLUDEPATH}') ++# message(qt: 'QMAKE_LFLAGS' qt before $$QTLIB is '$${QMAKE_LFLAGS}') ++# message(qt: 'QMAKE_CFLAGS' qt before $$QTLIB is '$${QMAKE_CFLAGS}') ++# message(qt: 'QMAKE_CXXFLAGS' qt before $$QTLIB is '$${QMAKE_CXXFLAGS}') ++ + unset(qlib_style) + !qt_debug:!qt_release { + CONFIG(debug, debug|release):qlib_style = debug +@@ -206,8 +214,43 @@ + qtAddLibrary($$qlib) + } + } ++# message(qt: 'LIBS' qt after $$QTLIB is '$${LIBS}') ++# message(qt: 'INCLUDEPATH' qt after $$QTLIB is '$${INCLUDEPATH}') ++# message(qt: 'QMAKE_LFLAGS' qt after $$QTLIB is '$${QMAKE_LFLAGS}') ++# message(qt: 'QMAKE_CFLAGS' qt after $$QTLIB is '$${QMAKE_CFLAGS}') ++# message(qt: 'QMAKE_CXXFLAGS' qt after $$QTLIB is '$${QMAKE_CXXFLAGS}') ++} ++ ++# remove Qt's libdir from various flags; it is already part of LIBS, ++# and should be used only to find Qt's libraries. Qt puts LIBDIR ++# before all other paths, so it is critical that this variable not ++# contain anything questionable. ++QMAKE_LIBDIR -= $$QMAKE_LIBDIR_QT ++QMAKE_LFLAGS -= -L$$QMAKE_LIBDIR_QT ++!isEqual($$QMAKE_LIBDIR_QT, $$[QT_INSTALL_PREFIX]/lib) { ++ QMAKE_LFLAGS -= -L$$[QT_INSTALL_PREFIX]/lib ++} ++ ++# remove Qt's incdir from various flags; it is already part of ++# INCLUDEPATH. C*FLAGS come before the INCPATH build from ++# INCLUDEPATH, so they should never have this -I in it (or, reall, any ++# other -I but instead just remove the the obvious choices) ++QMAKE_CFLAGS -= -I$$QMAKE_INCDIR_QT ++QMAKE_CXXFLAGS -= -I$$QMAKE_INCDIR_QT ++QMAKE_OBJECTIVE_CFLAGS -= -I$$QMAKE_INCDIR_QT ++QMAKE_OBJECTIVE_CXXFLAGS -= -I$$QMAKE_INCDIR_QT ++!isEqual($$QMAKE_INCDIR_QT, $$[QT_INSTALL_PREFIX]/include) { ++ QMAKE_CFLAGS -= -I$$[QT_INSTALL_PREFIX]/include ++ QMAKE_CXXFLAGS -= -I$$[QT_INSTALL_PREFIX]/include ++ QMAKE_OBJECTIVE_CFLAGS -= -I$$[QT_INSTALL_PREFIX]/include ++ QMAKE_OBJECTIVE_CXXFLAGS -= -I$$[QT_INSTALL_PREFIX]/include + } + ++#message(qt: QMAKE_CFLAGS at end is $${QMAKE_CFLAGS}) ++#message(qt: QMAKE_CXXFLAGS at end is $${QMAKE_CXXFLAGS}) ++#message(qt: QMAKE_OBJECTIVE_CFLAGS at end is $${QMAKE_OBJECTIVE_CFLAGS}) ++#message(qt: QMAKE_OBJECTIVE_CXXFLAGS at end is $${QMAKE_OBJECTIVE_CXXFLAGS}) ++ + qt_compat { + !qt_compat_no_warning:QTDIR_build:warning(***USE of COMPAT inside of QTDIR!**) #just for us + INCLUDEPATH *= $$QMAKE_INCDIR_QT/Qt diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff new file mode 100644 index 0000000000..01854980e5 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff @@ -0,0 +1,204 @@ +--- mkspecs/features/qt_functions.prf.orig 2013-02-11 08:39:31.000000000 -0500 ++++ mkspecs/features/qt_functions.prf 2013-02-12 10:57:03.000000000 -0500 +@@ -16,35 +16,108 @@ + } + + defineTest(qtAddLibrary) { ++# message(qtAddLibrary: 'LIBS' before $$1 is '$${LIBS}') ++# message(qtAddLibrary: 'INCLUDEPATH' before $$1 is '$${INCLUDEPATH}') ++# message(qtAddLibrary: 'QMAKE_LFLAGS' before $$1 is '$${QMAKE_LFLAGS}') ++ ++ # reorder the includes path: user, this library, Qt headers ++ INCLUDEPATH -= $$QMAKE_INCDIR_QT + INCLUDEPATH -= $$QMAKE_INCDIR_QT/$$1 +- INCLUDEPATH = $$QMAKE_INCDIR_QT/$$1 $$INCLUDEPATH ++ INCLUDEPATH += $$QMAKE_INCDIR_QT/$$1 $$QMAKE_INCDIR_QT ++ ++ # first time through, append the path for Qt's installed libraries: ++ # -after- all of the other necessary libraries and paths ++ ++ mac:!static:contains(QT_CONFIG, qt_framework) { ++ isEmpty(QMAKE_FRAMEWORKDIR_QT) { ++ !contains(LIBS,-F$$[QT_INSTALL_PREFIX]/Library/Frameworks) { ++ LIBS = $$LIBS -F$$[QT_INSTALL_PREFIX]/Library/Frameworks ++ } ++ } else { ++ !contains(LIBS,-F$$QMAKE_FRAMEWORKDIR_QT) { ++ LIBS = $$LIBS -F$$QMAKE_FRAMEWORKDIR_QT ++ } ++ } ++ isEmpty(QMAKE_LIBDIR_QT) { ++ !contains(LIBS,-F$$[QT_INSTALL_PREFIX]/lib) { ++ LIBS = $$LIBS -F$$[QT_INSTALL_PREFIX]/lib ++ } ++ } else { ++ !contains(LIBS,-F$$QMAKE_LIBDIR_QT) { ++ LIBS = $$LIBS -F$$QMAKE_LIBDIR_QT ++ } ++ } ++ } ++ isEmpty(QMAKE_LIBDIR_QT) { ++ !contains(LIBS,-L$$[QT_INSTALL_PREFIX]/lib) { ++ LIBS = $$LIBS -L$$[QT_INSTALL_PREFIX]/lib ++ } ++ } else { ++ !contains(LIBS,-L$$QMAKE_LIBDIR_QT) { ++ LIBS = $$LIBS -L$$QMAKE_LIBDIR_QT ++ } ++ } + + LIB_NAME = $$1 + unset(LINKAGE) +- mac { +- CONFIG(qt_framework, qt_framework|qt_no_framework) { #forced +- QMAKE_FRAMEWORKPATH *= $${QMAKE_LIBDIR_QT} +- FRAMEWORK_INCLUDE = $$QMAKE_LIBDIR_QT/$${LIB_NAME}.framework/Headers +- !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { +- INCLUDEPATH -= $$FRAMEWORK_INCLUDE +- INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH +- } +- LINKAGE = -framework $${LIB_NAME}$${QT_LIBINFIX} +- } else:!qt_no_framework { #detection +- for(frmwrk_dir, $$list($$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH) /Library/Frameworks)) { +- exists($${frmwrk_dir}/$${LIB_NAME}.framework) { +- QMAKE_FRAMEWORKPATH *= $${frmwrk_dir} ++ ++ # see if the framework, and exists in the current known paths ++ ++ # add LIBS entries QMAKE_FRAMEWORKPATH, as appropriate ++ ++ all_frmwrks = $$find(LIBS, -F.*) $$find(QMAKE_LFLAGS, -F.*) ++# message(qtAddLibrary: all frameworks is $$all_frmwrks) ++ ++ for(frmwrk_dir, all_frmwrks) { ++ ++# message(qtAddLibrary: this frmwrk_dir is $$frmwrk_dir) ++ tfp = $$frmwrk_dir ++ tfp ~= s,-F,, ++ QMAKE_FRAMEWORKPATH *= $$tfp ++# message(qtAddLibrary: this frmwrk_path is $$tfp) ++ ++ } ++ ++ mac:!qt_no_framework { ++ for(frmwrk_dir, $$list($$QMAKE_FRAMEWORKPATH $$QMAKE_FRAMEWORKDIR_QT $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR $$(DYLD_FRAMEWORK_PATH))) { ++ ++# message(qtAddLibrary: looking for framework $$LIB_NAME in directory $$frmwrk_dir) ++ exists($${frmwrk_dir}/$${LIB_NAME}.framework) { ++ ++ message(qtAddLibrary: found framework $$LIB_NAME in directory $$frmwrk_dir) + FRAMEWORK_INCLUDE = $$frmwrk_dir/$${LIB_NAME}.framework/Headers + !qt_no_framework_direct_includes:exists($$FRAMEWORK_INCLUDE) { + INCLUDEPATH -= $$FRAMEWORK_INCLUDE + INCLUDEPATH = $$FRAMEWORK_INCLUDE $$INCLUDEPATH + } + LINKAGE = -framework $${LIB_NAME} ++ ++# Apple's ld has provided "-framework name,option" since at least ++# 10.4, allowing linking with a framework's option name if it exists ++# -- but defaulting to the basic name if it exists (and if neither ++# exists, then generating an error). All GCC, LLVM, CLANG, and Apple ++# compilers available in Xcode or MacPorts back to 10.4 seem to parse ++# this feature correctly when compiling, as well as pass it through to ++# Apple's ld. Apple used to provide debug kernel frameworks and ++# libraries that could be used by setting the shell environment variable: ++# DYLD_IMAGE_SUFFIX=_debug ++# but Apple hasn't done so since 10.6, and does not look to be doing ++# so any time soon. Hence, the below use of the optional framework ++# name is really the best way to link to and use debug frameworks. For ++# QtWebKit, which has no debug version, only the main library will ++# ever be found and used. ++ ++ if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { ++ LINKAGE = $${LINKAGE},_debug ++ } + break() ++ + } +- } +- } ++ } + } ++ ++ # special for symbian ++ + symbian { + isEqual(LIB_NAME, QtCore) { + #workaround for dependency from f32file.h on e32svr.h which has moved location in symbian3 +@@ -70,10 +143,56 @@ + export(TARGET.EPOCHEAPSIZE) + export(TARGET.CAPABILITY) + } ++ + isEmpty(LINKAGE) { ++ ++ # not a framework or symbian ++ # see if the library exists in the current known paths ++ ++ # add LIBS entries QMAKE_LIBPATH, as appropriate ++ ++ all_libs = $$find(LIBS, -L.*) $$find(QMAKE_LFLAGS, -L.*) ++# message(qtAddLibrary: all library paths is $$all_libs) ++ ++ for(lib_dir, all_libs) { ++ ++# message(qtAddLibrary: this lib_dir is $$lib_dir) ++ tlp = $$lib_dir ++ tlp ~= s,-L,, ++ QMAKE_LIBPATH *= $$tlp ++# message(qtAddLibrary: this lib_path is $$tlp) ++ ++ } ++ ++ for(lib_dir, $$list($$QMAKE_LIBPATH $$QMAKE_LIBDIR_QT $$QMAKE_LIBDIR)) { ++ ++# message(qtAddLibrary: looking for library $${LIB_NAME}$${QT_LIBINFIX} in directory $$lib_dir) ++ exists($${lib_dir}/lib$${LIB_NAME}$${QT_LIBINFIX}.*) { ++ ++ message(qtAddLibrary: found library $${LIB_NAME}$${QT_LIBINFIX} in directory $$lib_dir) ++ LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX} ++ break() ++ ++ } ++ } ++ } ++ ++ isEmpty(LINKAGE) { ++ ++ message(WARNING: Could not find library or framework $$LIB_NAME in the current known search directories; assuming a default library.) ++ + if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { + win32:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}d +- mac:LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug ++ # special for mac: cannot build QtWebKit as debug, ++ # no-framework, and universal. If things got here, ++ # then this is no-framwork; just take care of the rest. ++ mac { ++ contains(QT_CONFIG, x86):contains(QT_CONFIG, x86_64):isEqual(LIB_NAME, QtWebKit) { ++ LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX} ++ } else { ++ LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX}_debug ++ } ++ } + } + isEmpty(LINKAGE):LINKAGE = -l$${LIB_NAME}$${QT_LIBINFIX} + } +@@ -83,9 +202,13 @@ + QMAKE_LFLAGS *= --lsb-shared-libs=$${LIB_NAME}$${QT_LIBINFIX} + } + LIBS += $$LINKAGE ++# message(qtAddLibrary: 'LIBS' after $$1 is now '$${LIBS}') ++# message(qtAddLibrary: 'INCLUDEPATH' after $$1 is now '$${INCLUDEPATH}') ++# message(qtAddLibrary: 'QMAKE_LFLAGS' after $$1 is now '$${QMAKE_LFLAGS}') + export(LIBS) + export(INCLUDEPATH) + export(QMAKE_FRAMEWORKPATH) ++ export(QMAKE_LIBPATH) + export(QMAKE_LFLAGS) + return(true) + } +@@ -119,4 +242,3 @@ + + return(true) + } +- diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff new file mode 100644 index 0000000000..05f8a70929 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff @@ -0,0 +1,29 @@ +--- mkspecs/features/uitools.prf.orig 2012-04-26 11:40:22.000000000 -0400 ++++ mkspecs/features/uitools.prf 2012-04-26 11:42:42.000000000 -0400 +@@ -2,13 +2,21 @@ + qt:load(qt) + + # Include the correct version of the UiLoader library +-symbian: QTUITOOLS_LINKAGE = -lQtUiTools.lib +-else: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX} + +-CONFIG(debug, debug|release) { +- mac: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX}_debug +- win32: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX}d ++#mac frameworks, for both debug and release ++mac:!static:contains(QT_CONFIG, qt_framework) { ++ QTUITOOLS_LINKAGE = -framework QtUiTools ++} else { ++ ++ symbian: QTUITOOLS_LINKAGE = -lQtUiTools.lib ++ else: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX} ++ ++ CONFIG(debug, debug|release) { ++ mac: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX}_debug ++ win32: QTUITOOLS_LINKAGE = -lQtUiTools$${QT_LIBINFIX}d ++ } + } ++ + LIBS += $$QTUITOOLS_LINKAGE + + INCLUDEPATH = $$QMAKE_INCDIR_QT/QtUiTools $$INCLUDEPATH diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff new file mode 100644 index 0000000000..3bc4275532 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff @@ -0,0 +1,11 @@ +--- mkspecs/macx-g++/qmake.conf.orig 2012-04-23 14:49:04.000000000 -0400 ++++ mkspecs/macx-g++/qmake.conf 2012-04-17 14:38:16.000000000 -0400 +@@ -9,7 +9,7 @@ + MAKEFILE_GENERATOR = UNIX + TARGET_PLATFORM = macx + TEMPLATE = app +-CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl ++CONFIG += qt warn_on release app_bundle incremental global_init_link_order lib_version_first plugin_no_soname link_prl absolute_library_soname + QT += core gui + QMAKE_INCREMENTAL_STYLE = sublib + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff new file mode 100644 index 0000000000..3f27a78ce7 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff @@ -0,0 +1,166 @@ +--- mkspecs/common/gcc-base-macx.conf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/common/gcc-base-macx.conf 2013-01-24 08:25:21.000000000 -0500 +@@ -29,12 +29,23 @@ + QMAKE_OBJECTIVE_CFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF + QMAKE_OBJECTIVE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG + QMAKE_OBJECTIVE_CFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE +-QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS ++QMAKE_OBJECTIVE_CFLAGS_HIDESYMS = $$QMAKE_CFLAGS_HIDESYMS + QMAKE_OBJECTIVE_CFLAGS_X86 = $$QMAKE_CFLAGS_X86 + QMAKE_OBJECTIVE_CFLAGS_X86_64 = $$QMAKE_CFLAGS_X86_64 + QMAKE_OBJECTIVE_CFLAGS_PPC = $$QMAKE_CFLAGS_PPC + QMAKE_OBJECTIVE_CFLAGS_PPC_64 = $$QMAKE_CFLAGS_PPC_64 + ++QMAKE_OBJECTIVE_CXXFLAGS = $$QMAKE_CXXFLAGS ++QMAKE_OBJECTIVE_CXXFLAGS_WARN_ON = $$QMAKE_CXXFLAGS_WARN_ON ++QMAKE_OBJECTIVE_CXXFLAGS_WARN_OFF = $$QMAKE_CXXFLAGS_WARN_OFF ++QMAKE_OBJECTIVE_CXXFLAGS_DEBUG = $$QMAKE_CXXFLAGS_DEBUG ++QMAKE_OBJECTIVE_CXXFLAGS_RELEASE = $$QMAKE_CXXFLAGS_RELEASE ++QMAKE_OBJECTIVE_CXXFLAGS_HIDESYMS = $$QMAKE_CXXFLAGS_HIDESYMS ++QMAKE_OBJECTIVE_CXXFLAGS_X86 = $$QMAKE_CXXFLAGS_X86 ++QMAKE_OBJECTIVE_CXXFLAGS_X86_64 = $$QMAKE_CXXFLAGS_X86_64 ++QMAKE_OBJECTIVE_CXXFLAGS_PPC = $$QMAKE_CXXFLAGS_PPC ++QMAKE_OBJECTIVE_CXXFLAGS_PPC_64 = $$QMAKE_CXXFLAGS_PPC_64 ++ + QMAKE_LFLAGS_X86 += $$QMAKE_CFLAGS_X86 + QMAKE_LFLAGS_X86_64 += $$QMAKE_CFLAGS_X86_64 + QMAKE_LFLAGS_PPC += $$QMAKE_CFLAGS_PPC +--- mkspecs/features/debug.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/debug.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -3,6 +3,7 @@ + QMAKE_CFLAGS += $$QMAKE_CFLAGS_DEBUG + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_DEBUG + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_DEBUG ++QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_DEBUG + QMAKE_LFLAGS += $$QMAKE_LFLAGS_DEBUG + QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_DEBUG + !debug_and_release:fix_output_dirs:fixExclusiveOutputDirs(debug, release) +--- mkspecs/features/mac/default_post.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/default_post.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -1,5 +1,5 @@ + load(default_post) +-!no_objective_c:CONFIG += objective_c ++!no_objective_c:CONFIG += split_sources objective_c objective_cxx + + # Pick a suitable default architecture for qmake-based applications. + # If the Qt package contains one of x86 and x86_64, pick that one. If it +--- mkspecs/features/mac/objective_c.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/objective_c.prf 2013-01-24 09:48:39.000000000 -0500 +@@ -1,23 +1,18 @@ +- +-for(source, SOURCES) { +- contains(source,.*\\.mm?$) { +- warning(Objective-C source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES) +- SOURCES -= $$source +- OBJECTIVE_SOURCES += $$source +- } +-} ++# Add compiler directives for Objective C (.m) only ++# ++# OBJECTIVE_C_SOURCES has already been set in "split_sources" + + isEmpty(QMAKE_OBJECTIVE_CC):QMAKE_OBJECTIVE_CC = $$QMAKE_CC + + OBJECTIVE_C_OBJECTS_DIR = $$OBJECTS_DIR + isEmpty(OBJECTIVE_C_OBJECTS_DIR):OBJECTIVE_C_OBJECTS_DIR = . +-isEmpty(QMAKE_EXT_OBJECTIVE_C):QMAKE_EXT_OBJECTIVE_C = .mm .m ++isEmpty(QMAKE_EXT_OBJECTIVE_C):QMAKE_EXT_OBJECTIVE_C = .m + + objective_c.dependency_type = TYPE_C + objective_c.variables = QMAKE_OBJECTIVE_CFLAGS +-objective_c.commands = $$QMAKE_OBJECTIVE_CC -c $(QMAKE_COMP_QMAKE_OBJECTIVE_CFLAGS) $(DEFINES) $(INCPATH) ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} ++objective_c.commands = $$QMAKE_OBJECTIVE_CC -c $(QMAKE_COMP_QMAKE_OBJECTIVE_CFLAGS) $(DEFINES) $(INCPATH) -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} + objective_c.output = $$OBJECTIVE_C_OBJECTS_DIR/${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)} +-objective_c.input = OBJECTIVE_SOURCES ++objective_c.input = OBJECTIVE_C_SOURCES + objective_c.name = Compile ${QMAKE_FILE_IN} + silent:objective_c.commands = @echo objective-c ${QMAKE_FILE_IN} && $$objective_c.commands + QMAKE_EXTRA_COMPILERS += objective_c +--- mkspecs/features/mac/ppc.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/ppc.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,6 +2,7 @@ + } else { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_PPC + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_PPC ++ QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_PPC + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_PPC + QMAKE_LFLAGS += $$QMAKE_LFLAGS_PPC + } +--- mkspecs/features/mac/ppc64.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/ppc64.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,6 +2,7 @@ + } else { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_PPC_64 + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_PPC_64 ++ QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_PPC_64 + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_PPC_64 + QMAKE_LFLAGS += $$QMAKE_LFLAGS_PPC_64 + } +--- mkspecs/features/mac/sdk.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/sdk.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,6 +2,7 @@ + !macx-xcode:!macx-pbuilder { + QMAKE_CFLAGS += -isysroot $$QMAKE_MAC_SDK + QMAKE_OBJECTIVE_CFLAGS += -isysroot $$QMAKE_MAC_SDK ++ QMAKE_OBJECTIVE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK + QMAKE_CXXFLAGS += -isysroot $$QMAKE_MAC_SDK + QMAKE_LFLAGS += -Wl,-syslibroot,$$QMAKE_MAC_SDK + } +--- mkspecs/features/mac/x86.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/x86.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,6 +2,7 @@ + } else { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_X86 + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_X86 ++ QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_X86 + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_X86 + QMAKE_LFLAGS += $$QMAKE_LFLAGS_X86 + } +--- mkspecs/features/mac/x86_64.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/mac/x86_64.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,6 +2,7 @@ + } else { + QMAKE_CFLAGS += $$QMAKE_CFLAGS_X86_64 + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_X86_64 ++ QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_X86_64 + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_X86_64 + QMAKE_LFLAGS += $$QMAKE_LFLAGS_X86_64 + } +--- mkspecs/features/release.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/release.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,6 +2,7 @@ + QMAKE_CFLAGS += $$QMAKE_CFLAGS_RELEASE + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_RELEASE + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_RELEASE ++QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_RELEASE + QMAKE_LFLAGS += $$QMAKE_LFLAGS_RELEASE + QMAKE_LIBFLAGS += $$QMAKE_LIBFLAGS_RELEASE +-!debug_and_release:fix_output_dirs:fixExclusiveOutputDirs(release, debug) +\ No newline at end of file ++!debug_and_release:fix_output_dirs:fixExclusiveOutputDirs(release, debug) +--- mkspecs/features/unix/hide_symbols.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/unix/hide_symbols.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -1,4 +1,5 @@ + QMAKE_CFLAGS += $$QMAKE_CFLAGS_HIDESYMS + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_HIDESYMS + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_HIDESYMS ++QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_HIDESYMS + QMAKE_LFLAGS += $$QMAKE_LFLAGS_HIDESYMS +--- mkspecs/features/warn_off.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/warn_off.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -1,4 +1,5 @@ + CONFIG -= warn_on + QMAKE_CFLAGS += $$QMAKE_CFLAGS_WARN_OFF + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_WARN_OFF +-QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_OFF +\ No newline at end of file ++QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_OFF ++QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_WARN_OFF +--- mkspecs/features/warn_on.prf.orig 2013-01-24 08:20:57.000000000 -0500 ++++ mkspecs/features/warn_on.prf 2013-01-24 08:25:21.000000000 -0500 +@@ -2,4 +2,4 @@ + QMAKE_CFLAGS += $$QMAKE_CFLAGS_WARN_ON + QMAKE_CXXFLAGS += $$QMAKE_CXXFLAGS_WARN_ON + QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_OBJECTIVE_CFLAGS_WARN_ON +- ++QMAKE_OBJECTIVE_CXXFLAGS += $$QMAKE_OBJECTIVE_CXXFLAGS_WARN_ON diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff new file mode 100644 index 0000000000..1a93310061 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff @@ -0,0 +1,108 @@ +--- qmake/generators/unix/unixmake.cpp.orig 2013-02-24 21:46:23.000000000 -0500 ++++ qmake/generators/unix/unixmake.cpp 2013-02-25 11:40:24.000000000 -0500 +@@ -472,8 +472,9 @@ + UnixMakefileGenerator::findLibraries() + { + QList libdirs, frameworkdirs; ++ frameworkdirs.append(QMakeLocalFileName("@PREFIX@/Library/Frameworks")); + frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); +- frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); ++ libdirs.append(QMakeLocalFileName("@PREFIX@/lib")); + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", QString() }; + for(int i = 0; !lflags[i].isNull(); i++) { + QStringList &l = project->values(lflags[i]); +@@ -583,7 +584,9 @@ + UnixMakefileGenerator::processPrlFiles() + { + QList libdirs, frameworkdirs; ++ frameworkdirs.append(QMakeLocalFileName("@PREFIX@/Library/Frameworks")); + frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); ++ libdirs.append(QMakeLocalFileName("@PREFIX@/lib")); + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; + for(int i = 0; !lflags[i].isNull(); i++) { + QStringList &l = project->values(lflags[i]); +@@ -627,13 +630,78 @@ + else + opt = l.at(++lit); + opt = opt.trimmed(); +- const QList dirs = frameworkdirs + libdirs; +- for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { ++ ++ // See if this framework is specified as ++ // "foo,bar", which to Apple's LD means to look ++ // for "foo" with the addition "bar" first in all ++ // paths, then if not found do the same for just ++ // "foo". Tricky looking for "," but not "\," ++ ++#if 0 ++ warn_msg(WarnLogic, "out before: '%s'\n", opt.toLatin1().constData()); ++#endif ++ int num_cs = 0; ++ int loc_1 = -1; ++ int loc = opt.indexOf(","); ++ bool found = false; ++ while (!found && (loc != -1)) { ++ found = (loc == 0); ++ if (!found) { ++ found = (opt[loc-1] != '\\'); ++ } ++ if (found) { ++ if (loc_1 == -1) { ++ loc_1 = loc; ++ } ++ ++num_cs; ++ } else { ++ loc = opt.indexOf(",", loc); ++ } ++ } ++#if 0 ++ warn_msg(WarnLogic, "found == %s, loc == %d\n", ++ (found ? "true" : "false"), loc); ++#endif ++ if (found) { ++ // split into name and extension ++ if (num_cs > 1) { ++ warn_msg(WarnLogic, "When parsing -framework '%s', found more than one ',' in the name. Assuming the first ',' is used to delineate between the framework name and the optional extension.\n", opt.toLatin1().constData()); ++ } ++ QString ext = opt.mid(loc_1+1); ++ opt = opt.left(loc_1); ++ found = false; ++ const QList dirs = frameworkdirs + libdirs; ++ for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { ++ QString prl = dirs[dep_i].local() + "/" + opt + ".framework/" + opt + ext + Option::prl_ext; ++#if 0 ++ warn_msg(WarnLogic, "Looking for PRL '%s'\n", prl.toLatin1().constData()); ++#endif ++ if(processPrlFile(prl)) { ++#if 0 ++ warn_msg(WarnLogic, "Found PRL for framework '%s' with optional extension '%s': '%s'\n", opt.toLatin1().constData(), ext.toLatin1().constData(), prl.toLatin1().constData()); ++#endif ++ found = true; ++ break; ++ } ++ } ++ } ++ // if not found yet, try the primary name ++ if (!found) { ++ const QList dirs = frameworkdirs + libdirs; ++ for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { + QString prl = dirs[dep_i].local() + "/" + opt + ".framework/" + opt + Option::prl_ext; +- if(processPrlFile(prl)) +- break; +- } +- } ++#if 0 ++ warn_msg(WarnLogic, "Looking for PRL '%s'\n", prl.toLatin1().constData()); ++#endif ++ if(processPrlFile(prl)) { ++#if 0 ++ warn_msg(WarnLogic, "Found PRL for framework '%s': '%s'\n", opt.toLatin1().constData(), prl.toLatin1().constData()); ++#endif ++ break; ++ } ++ } ++ } ++ } + } else if(!opt.isNull()) { + QString lib = opt; + processPrlFile(lib); diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_option.h.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_option.h.diff new file mode 100644 index 0000000000..b8e49f88a4 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_option.h.diff @@ -0,0 +1,10 @@ +--- qmake/option.h.orig 2012-04-23 14:49:04.000000000 -0400 ++++ qmake/option.h 2012-04-20 23:03:15.000000000 -0400 +@@ -214,6 +214,7 @@ + DocumentationPath, + HeadersPath, + LibrariesPath, ++ FrameworksPath, + BinariesPath, + PluginsPath, + DataPath, diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_project.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_project.cpp.diff new file mode 100644 index 0000000000..5f8a4e6bd9 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_project.cpp.diff @@ -0,0 +1,37 @@ +--- qmake/project.cpp.orig 2012-04-23 14:49:04.000000000 -0400 ++++ qmake/project.cpp 2012-04-17 14:38:16.000000000 -0400 +@@ -596,14 +596,17 @@ + } + } + } +- for(QStringList::Iterator concat_it = concat.begin(); +- concat_it != concat.end(); ++concat_it) ++ QByteArray qmake_no_defaults = qgetenv("QMAKE_NO_DEFAULTS"); ++ if (qmake_no_defaults.isNull()) { ++ for(QStringList::Iterator concat_it = concat.begin(); ++ concat_it != concat.end(); ++concat_it) + feature_roots << (QLibraryInfo::location(QLibraryInfo::PrefixPath) + + mkspecs_concat + (*concat_it)); +- for(QStringList::Iterator concat_it = concat.begin(); +- concat_it != concat.end(); ++concat_it) ++ for(QStringList::Iterator concat_it = concat.begin(); ++ concat_it != concat.end(); ++concat_it) + feature_roots << (QLibraryInfo::location(QLibraryInfo::DataPath) + + mkspecs_concat + (*concat_it)); ++ } + return feature_roots; + } + +@@ -617,8 +620,10 @@ + for(QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it) + ret << ((*it) + concat); + } +- ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat; +- ++ QByteArray qmake_no_defaults = qgetenv("QMAKE_NO_DEFAULTS"); ++ if (qmake_no_defaults.isNull()) { ++ ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat; ++ } + return ret; + } + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_property.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_property.cpp.diff new file mode 100644 index 0000000000..e8e87ebf26 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_property.cpp.diff @@ -0,0 +1,19 @@ +--- qmake/property.cpp.orig 2012-04-23 14:49:04.000000000 -0400 ++++ qmake/property.cpp 2012-04-20 22:56:47.000000000 -0400 +@@ -91,6 +91,8 @@ + return QLibraryInfo::location(QLibraryInfo::HeadersPath); + else if(v == "QT_INSTALL_LIBS") + return QLibraryInfo::location(QLibraryInfo::LibrariesPath); ++ else if(v == "QT_INSTALL_FRAMEWORKS") ++ return QLibraryInfo::location(QLibraryInfo::FrameworksPath); + else if(v == "QT_INSTALL_BINS") + return QLibraryInfo::location(QLibraryInfo::BinariesPath); + else if(v == "QT_INSTALL_PLUGINS") +@@ -198,6 +200,7 @@ + specialProps.append("QT_INSTALL_DOCS"); + specialProps.append("QT_INSTALL_HEADERS"); + specialProps.append("QT_INSTALL_LIBS"); ++ specialProps.append("QT_INSTALL_FRAMEWORKS"); + specialProps.append("QT_INSTALL_BINS"); + specialProps.append("QT_INSTALL_PLUGINS"); + specialProps.append("QT_INSTALL_IMPORTS"); diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff new file mode 100644 index 0000000000..b868b904c5 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff @@ -0,0 +1,11 @@ +--- qmake/qmake.pri.orig 2014-04-10 14:37:13.000000000 -0400 ++++ qmake/qmake.pri 2014-05-01 08:39:42.000000000 -0400 +@@ -135,7 +135,7 @@ + SOURCES += qfilesystemengine_unix.cpp qfilesystemiterator_unix.cpp qfsfileengine_unix.cpp + mac { + SOURCES += qcore_mac.cpp qsettings_mac.cpp +- QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 #enables weak linking for 10.4 (exported) ++ QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@ + LIBS += -framework ApplicationServices + } + } else:win32 { diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff new file mode 100644 index 0000000000..138f429d53 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff @@ -0,0 +1,12 @@ +--- src/3rdparty/webkit/Source/WebCore/plugins/PluginView.h.orig 2012-04-23 14:49:04.000000000 -0400 ++++ src/3rdparty/webkit/Source/WebCore/plugins/PluginView.h 2012-04-23 14:51:28.000000000 -0400 +@@ -411,7 +411,9 @@ + + Point m_lastMousePos; + void setNPWindowIfNeeded(); ++#ifndef NP_NO_CARBON + void nullEventTimerFired(Timer*); ++#endif + Point globalMousePosForPlugin() const; + Point mousePosForPlugin(MouseEvent* event = 0) const; + #endif diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff new file mode 100644 index 0000000000..d7df5f22cd --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff @@ -0,0 +1,13 @@ +--- src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginViewMac.mm.orig 2012-04-23 14:49:04.000000000 -0400 ++++ src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginViewMac.mm 2012-04-23 14:51:28.000000000 -0400 +@@ -233,8 +233,10 @@ + setNPWindowIfNeeded(); + + // TODO: Implement null timer throttling depending on plugin activation ++#ifndef NP_NO_CARBON + m_nullEventTimer = adoptPtr(new Timer(this, &PluginView::nullEventTimerFired)); + m_nullEventTimer->startRepeating(0.02); ++#endif + + m_lastMousePos.h = m_lastMousePos.v = 0; + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff new file mode 100644 index 0000000000..b9c302547b --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff @@ -0,0 +1,11 @@ +--- src/corelib/corelib.pro.orig 2012-09-17 15:22:14.000000000 -0400 ++++ src/corelib/corelib.pro 2012-09-17 15:22:22.000000000 -0400 +@@ -25,7 +25,7 @@ + LIBS_PRIVATE += -framework CoreServices -framework Security + } + } else:mac|darwin { +- LIBS_PRIVATE += -framework CoreFoundation -framework Security ++ LIBS_PRIVATE += -framework CoreFoundation -framework Security -framework Foundation + } + mac:lib_bundle:DEFINES += QT_NO_DEBUG_PLUGIN_CHECK + win32:DEFINES-=QT_NO_CAST_TO_ASCII diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff new file mode 100644 index 0000000000..0e34feeb60 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff @@ -0,0 +1,25 @@ +--- src/corelib/global/qlibraryinfo.cpp.orig 2012-04-23 14:49:04.000000000 -0400 ++++ src/corelib/global/qlibraryinfo.cpp 2012-04-20 22:59:34.000000000 -0400 +@@ -262,6 +262,11 @@ + path = QT_CONFIGURE_LIBRARIES_PATH; + break; + #endif ++#ifdef QT_CONFIGURE_FRAMEWORKS_PATH ++ case FrameworksPath: ++ path = QT_CONFIGURE_FRAMEWORKS_PATH; ++ break; ++#endif + #ifdef QT_CONFIGURE_BINARIES_PATH + case BinariesPath: + path = QT_CONFIGURE_BINARIES_PATH; +@@ -327,6 +332,10 @@ + key = QLatin1String("Libraries"); + defaultValue = QLatin1String("lib"); + break; ++ case FrameworksPath: ++ key = QLatin1String("Frameworks"); ++ defaultValue = QLatin1String("Library/Frameworks"); ++ break; + case BinariesPath: + key = QLatin1String("Binaries"); + defaultValue = QLatin1String("bin"); diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff new file mode 100644 index 0000000000..d600213519 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff @@ -0,0 +1,10 @@ +--- src/corelib/global/qlibraryinfo.h.orig 2012-04-23 14:49:04.000000000 -0400 ++++ src/corelib/global/qlibraryinfo.h 2012-04-20 22:56:57.000000000 -0400 +@@ -70,6 +70,7 @@ + DocumentationPath, + HeadersPath, + LibrariesPath, ++ FrameworksPath, + BinariesPath, + PluginsPath, + DataPath, diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff new file mode 100644 index 0000000000..d9dce5b801 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff @@ -0,0 +1,16 @@ +--- src/corelib/io/qprocess_unix.cpp.orig 2015-10-14 13:02:18.000000000 -0400 ++++ src/corelib/io/qprocess_unix.cpp 2015-10-14 13:02:43.000000000 -0400 +@@ -1302,11 +1302,11 @@ + + // read a byte from the death pipe + char c; +- qt_safe_read(deathPipe[0], &c, 1); ++ qint64 readcount = qt_safe_read(deathPipe[0], &c, 1); + + // check if our process is dead + int exitStatus; +- if (qt_safe_waitpid(pid_t(pid), &exitStatus, WNOHANG) > 0) { ++ if (qt_safe_waitpid(pid_t(pid), &exitStatus, readcount > 0 ? WNOHANG : 0) > 0) { + processManager()->remove(q); + crashed = !WIFEXITED(exitStatus); + exitCode = WEXITSTATUS(exitStatus); diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff new file mode 100644 index 0000000000..5946e869a7 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff @@ -0,0 +1,11 @@ +--- src/corelib/tools/qelapsedtimer_mac.cpp.orig 2011-09-12 08:49:29.000000000 +0200 ++++ src/corelib/tools/qelapsedtimer_mac.cpp 2012-02-02 21:30:46.000000000 +0100 +@@ -62,7 +62,7 @@ + { + if (info.denom == 0) + mach_timebase_info(&info); +- qint64 nsecs = cpuTime * info.numer / info.denom; ++ qint64 nsecs = (qint64)(((double) cpuTime) * ((double) info.numer) / ((double) info.denom)); + return nsecs; + } + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff new file mode 100644 index 0000000000..31c956298c --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff @@ -0,0 +1,18 @@ +--- src/gui/dialogs/qfiledialog_mac.mm.orig 2015-05-07 10:14:43.000000000 -0400 ++++ src/gui/dialogs/qfiledialog_mac.mm 2015-10-14 12:02:40.000000000 -0400 +@@ -297,6 +297,7 @@ + CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, (CFStringRef)filename, kCFURLPOSIXPathStyle, isDir); + CFBooleanRef isHidden; + Boolean errorOrHidden = false; ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 + if (!CFURLCopyResourcePropertyForKey(url, kCFURLIsHiddenKey, &isHidden, NULL)) { + errorOrHidden = true; + } else { +@@ -304,6 +305,7 @@ + errorOrHidden = true; + CFRelease(isHidden); + } ++#endif + CFRelease(url); + return errorOrHidden; + #else diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff new file mode 100644 index 0000000000..4a02c36aa6 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff @@ -0,0 +1,17 @@ +--- src/gui/kernel/qcursor_mac.mm.orig ++++ src/gui/kernel/qcursor_mac.mm +@@ -319,9 +319,11 @@ + pos.x = x; + pos.y = y; + +- CGEventRef e = CGEventCreateMouseEvent(0, kCGEventMouseMoved, pos, 0); +- CGEventPost(kCGHIDEventTap, e); +- CFRelease(e); ++ CGEventRef e = CGEventCreateMouseEvent(NULL, kCGEventMouseMoved, pos, kCGMouseButtonLeft); ++ if (e != NULL) { ++ CGEventPost(kCGHIDEventTap, e); ++ CFRelease(e); ++ } + #else + CGWarpMouseCursorPosition(CGPointMake(x, y)); + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff new file mode 100644 index 0000000000..fc20d5d7ab --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff @@ -0,0 +1,106 @@ +--- src/gui/painting/qpaintengine_mac.cpp.orig ++++ src/gui/painting/qpaintengine_mac.cpp +@@ -289,7 +289,7 @@ static CGMutablePathRef qt_mac_compose_path(const QPainterPath &p, float off=0) + } + + CGColorSpaceRef QCoreGraphicsPaintEngine::m_genericColorSpace = 0; +-QHash QCoreGraphicsPaintEngine::m_displayColorSpaceHash; // window -> color space ++QHash QCoreGraphicsPaintEngine::m_displayColorSpaceHash; + bool QCoreGraphicsPaintEngine::m_postRoutineRegistered = false; + + CGColorSpaceRef QCoreGraphicsPaintEngine::macGenericColorSpace() +@@ -318,48 +318,31 @@ CGColorSpaceRef QCoreGraphicsPaintEngine::macGenericColorSpace() + + CGColorSpaceRef QCoreGraphicsPaintEngine::macDisplayColorSpace(const QWidget *widget) + { +- // The color space depends on which screen the widget's window is on. +- // widget == 0 is a spacial case where we use the main display. +- QWidget *window = widget ? widget->window() : 0; ++ CGColorSpaceRef colorSpace; + +- // Check for cached color space and return if found. +- if (m_displayColorSpaceHash.contains(window)) +- return m_displayColorSpaceHash.value(window); +- +- // Find which display the window is on. + CGDirectDisplayID displayID; +- if (window == 0) { ++ if (widget == 0) { + displayID = CGMainDisplayID(); + } else { +- const QRect &qrect = window->geometry(); ++ const QRect &qrect = widget->window()->geometry(); + CGRect rect = CGRectMake(qrect.x(), qrect.y(), qrect.width(), qrect.height()); + CGDisplayCount throwAway; + CGDisplayErr dErr = CGGetDisplaysWithRect(rect, 1, &displayID, &throwAway); + if (dErr != kCGErrorSuccess) +- displayID = CGMainDisplayID(); +- } +- +- // Get the color space from the display profile. +- CGColorSpaceRef colorSpace = 0; +- CMProfileRef displayProfile = 0; +- CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, &displayProfile); +- if (err == noErr) { +- colorSpace = CGColorSpaceCreateWithPlatformColorSpace(displayProfile); +- CMCloseProfile(displayProfile); ++ return macDisplayColorSpace(0); // fall back on main display + } ++ if ((colorSpace = m_displayColorSpaceHash.value(displayID))) ++ return colorSpace; + +- // Fallback: use generic DeviceRGB ++ colorSpace = CGDisplayCopyColorSpace(displayID); + if (colorSpace == 0) + colorSpace = CGColorSpaceCreateDeviceRGB(); + +- // Install cleanup routines ++ m_displayColorSpaceHash.insert(displayID, colorSpace); + if (!m_postRoutineRegistered) { + m_postRoutineRegistered = true; + qAddPostRoutine(QCoreGraphicsPaintEngine::cleanUpMacColorSpaces); + } +- +- // Cache and return. +- m_displayColorSpaceHash.insert(window, colorSpace); + return colorSpace; + } + +@@ -369,7 +352,7 @@ void QCoreGraphicsPaintEngine::cleanUpMacColorSpaces() + CFRelease(m_genericColorSpace); + m_genericColorSpace = 0; + } +- QHash::const_iterator it = m_displayColorSpaceHash.constBegin(); ++ QHash::const_iterator it = m_displayColorSpaceHash.constBegin(); + while (it != m_displayColorSpaceHash.constEnd()) { + if (it.value()) + CFRelease(it.value()); +@@ -1069,7 +1052,16 @@ void QCoreGraphicsPaintEngine::cleanup() + + void QCoreGraphicsPaintEngine::clearColorSpace(QWidget* w) + { +- m_displayColorSpaceHash.remove(w); ++ CGDirectDisplayID displayID = CGMainDisplayID(); ++ if (w != 0) { ++ const QRect &qrect = w->window()->geometry(); ++ CGRect rect = CGRectMake(qrect.x(), qrect.y(), qrect.width(), qrect.height()); ++ CGDisplayCount throwAway; ++ CGDisplayErr dErr = CGGetDisplaysWithRect(rect, 1, &displayID, &throwAway); ++ if (dErr != kCGErrorSuccess) ++ displayID = CGMainDisplayID(); ++ } ++ m_displayColorSpaceHash.remove(displayID); + } + + CGContextRef +--- src/gui/painting/qpaintengine_mac_p.h.orig ++++ src/gui/painting/qpaintengine_mac_p.h +@@ -135,7 +135,7 @@ protected: + private: + static bool m_postRoutineRegistered; + static CGColorSpaceRef m_genericColorSpace; +- static QHash m_displayColorSpaceHash; // window -> color space ++ static QHash m_displayColorSpaceHash; + static void cleanUpMacColorSpaces(); + Q_DISABLE_COPY(QCoreGraphicsPaintEngine) + }; diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qbase.pri.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qbase.pri.diff new file mode 100644 index 0000000000..d065ce61e0 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qbase.pri.diff @@ -0,0 +1,30 @@ +--- src/qbase.pri.orig 2012-04-23 14:49:04.000000000 -0400 ++++ src/qbase.pri 2012-04-18 22:49:14.000000000 -0400 +@@ -137,14 +137,14 @@ + + unix|win32-g++*:!symbian { + CONFIG += create_pc +- QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] ++ QMAKE_PKGCONFIG_LIBDIR = $$target.path + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig + include_replace.match = $$QMAKE_INCDIR_QT + include_replace.replace = $$[QT_INSTALL_HEADERS] + lib_replace.match = $$QMAKE_LIBDIR_QT +- lib_replace.replace = $$[QT_INSTALL_LIBS] ++ lib_replace.replace = $$target.path + prefix_replace.match = $$QT_BUILD_TREE + prefix_replace.replace = $$[QT_INSTALL_PREFIX] + QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace +@@ -152,8 +152,8 @@ + + unix:!symbian { + CONFIG += create_libtool explicitlib +- QMAKE_LIBTOOL_LIBDIR = $$[QT_INSTALL_LIBS] +- QMAKE_PRL_LIBDIR = $$[QT_INSTALL_LIBS] ++ QMAKE_LIBTOOL_LIBDIR = $$target.path ++ QMAKE_PRL_LIBDIR = $$target.path + QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace + QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace + } diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qt_install.pri.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qt_install.pri.diff new file mode 100644 index 0000000000..55815ba0ee --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_qt_install.pri.diff @@ -0,0 +1,16 @@ +--- src/qt_install.pri.orig 2012-04-23 14:49:04.000000000 -0400 ++++ src/qt_install.pri 2012-04-20 23:50:49.000000000 -0400 +@@ -3,7 +3,12 @@ + dlltarget.path=$$[QT_INSTALL_BINS] + INSTALLS += dlltarget + } +-target.path=$$[QT_INSTALL_LIBS] ++# install mac frameworks differently than libraries ++mac:!static:contains(QT_CONFIG, qt_framework) { ++ target.path=$$[QT_INSTALL_FRAMEWORKS] ++} else { ++ target.path=$$[QT_INSTALL_LIBS] ++} + INSTALLS += target + + #headers diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff new file mode 100644 index 0000000000..8f250f4aad --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff @@ -0,0 +1,11 @@ +--- src/tools/bootstrap/bootstrap.pro.orig 2015-05-07 10:14:44.000000000 -0400 ++++ src/tools/bootstrap/bootstrap.pro 2015-05-30 13:30:53.000000000 -0400 +@@ -103,7 +103,7 @@ + else:win32:SOURCES += ../../corelib/tools/qlocale_win.cpp + + macx: { +- QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 #enables weak linking for 10.4 (exported) ++ QMAKE_MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@ + SOURCES += ../../corelib/kernel/qcore_mac.cpp + LIBS += -framework CoreServices -framework ApplicationServices + } diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff new file mode 100644 index 0000000000..b8057c58db --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff @@ -0,0 +1,14 @@ +--- tools/assistant/lib/fulltextsearch/fulltextsearch.pro.orig 2012-04-23 14:49:04.000000000 -0400 ++++ tools/assistant/lib/fulltextsearch/fulltextsearch.pro 2012-04-23 12:29:24.000000000 -0400 +@@ -6,9 +6,9 @@ + mac:!static:contains(QT_CONFIG, qt_framework) { + CONFIG(debug, debug|release) { + !build_pass:CONFIG += build_all +- } ++ } + } +-QT_CONFIG -= qt_framework ++# QT_CONFIG -= qt_framework + QT -= gui + TEMPLATE = lib + TARGET = QtCLucene diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff new file mode 100644 index 0000000000..9e62ef85a8 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff @@ -0,0 +1,26 @@ +--- tools/assistant/lib/lib.pro.orig 2012-03-14 10:01:12.000000000 -0400 ++++ tools/assistant/lib/lib.pro 2012-04-25 12:32:49.000000000 -0400 +@@ -12,16 +12,15 @@ + application \ + framework. + DEFINES -= QT_ASCII_CAST_WARNINGS +-qclucene = QtCLucene$${QT_LIBINFIX} +-if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { +- mac:qclucene = $${qclucene}_debug +- win32:qclucene = $${qclucene}d +-} +-linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene ++ ++qtAddLibrary(QtCLucene) ++ + unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ + QtSql \ +- QtXml +-LIBS_PRIVATE += -l$$qclucene ++ QtGui \ ++ QtCore \ ++ QtCLucene ++ + RESOURCES += helpsystem.qrc + SOURCES += qhelpenginecore.cpp \ + qhelpengine.cpp \ diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff new file mode 100644 index 0000000000..e814560371 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff @@ -0,0 +1,44 @@ +--- tools/designer/src/components/lib/lib.pro.orig 2012-04-23 14:49:04.000000000 -0400 ++++ tools/designer/src/components/lib/lib.pro 2012-04-22 14:42:03.000000000 -0400 +@@ -64,12 +64,38 @@ + include(../../sharedcomponents.pri) + include(../component.pri) + +-unix|win32-g++* { +- QMAKE_PKGCONFIG_REQUIRES = QtCore QtDesigner QtGui QtXml ++# install mac frameworks differently than libraries ++mac:!static:contains(QT_CONFIG, qt_framework) { ++ target.path=$$[QT_INSTALL_FRAMEWORKS] ++} else { ++ target.path=$$[QT_INSTALL_LIBS] ++} ++ ++unix|win32-g++*:!symbian { ++ CONFIG += create_pc ++ QMAKE_PKGCONFIG_LIBDIR = $$target.path ++ QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET ++ QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] ++ QMAKE_PKGCONFIG_DESTDIR = pkgconfig ++ QMAKE_PKGCONFIG_REQUIRES += QtCore QtDesigner QtXml + contains(QT_CONFIG, script): QMAKE_PKGCONFIG_REQUIRES += QtScript ++ include_replace.match = $$QMAKE_INCDIR_QT ++ include_replace.replace = $$[QT_INSTALL_HEADERS] ++ lib_replace.match = $$QMAKE_LIBDIR_QT ++ lib_replace.replace = $$target.path ++ prefix_replace.match = $$QT_BUILD_TREE ++ prefix_replace.replace = $$[QT_INSTALL_PREFIX] ++ QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace ++} ++ ++unix:!symbian { ++ CONFIG += create_libtool explicitlib ++ QMAKE_LIBTOOL_LIBDIR = $$target.path ++ QMAKE_PRL_LIBDIR = $$target.path ++ QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace ++ QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace + } + +-target.path=$$[QT_INSTALL_LIBS] + INSTALLS += target + win32 { + dlltarget.path=$$[QT_INSTALL_BINS] diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff new file mode 100644 index 0000000000..dbdf210c2e --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff @@ -0,0 +1,55 @@ +--- tools/designer/src/lib/lib.pro.orig 2012-04-23 14:49:04.000000000 -0400 ++++ tools/designer/src/lib/lib.pro 2012-04-22 14:41:19.000000000 -0400 +@@ -13,8 +13,6 @@ + VERSION=$${QT_MAJOR_VERSION}.$${QT_MINOR_VERSION}.$${QT_PATCH_VERSION} + } + +-unix|win32-g++*:QMAKE_PKGCONFIG_REQUIRES += QtXml +- + include(../../../../src/qt_targets.pri) + QMAKE_TARGET_PRODUCT = Designer + QMAKE_TARGET_DESCRIPTION = Graphical user interface designer. +@@ -63,13 +61,42 @@ + include(../sharedcomponents.pri) + include(../components/component.pri) + +-target.path=$$[QT_INSTALL_LIBS] ++# install mac frameworks differently than libraries ++mac:!static:contains(QT_CONFIG, qt_framework) { ++ target.path=$$[QT_INSTALL_FRAMEWORKS] ++} else { ++ target.path=$$[QT_INSTALL_LIBS] ++} + INSTALLS += target + win32 { + dlltarget.path=$$[QT_INSTALL_BINS] + INSTALLS += dlltarget + } + ++unix|win32-g++*:!symbian { ++ CONFIG += create_pc ++ QMAKE_PKGCONFIG_LIBDIR = $$target.path ++ QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET ++ QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] ++ QMAKE_PKGCONFIG_DESTDIR = pkgconfig ++ QMAKE_PKGCONFIG_REQUIRES += QtCore QtGui QtXml ++ contains(QT_CONFIG, script): QMAKE_PKGCONFIG_REQUIRES += QtScript ++ include_replace.match = $$QMAKE_INCDIR_QT ++ include_replace.replace = $$[QT_INSTALL_HEADERS] ++ lib_replace.match = $$QMAKE_LIBDIR_QT ++ lib_replace.replace = $$target.path ++ prefix_replace.match = $$QT_BUILD_TREE ++ prefix_replace.replace = $$[QT_INSTALL_PREFIX] ++ QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace ++} ++ ++unix:!symbian { ++ CONFIG += create_libtool explicitlib ++ QMAKE_LIBTOOL_LIBDIR = $$target.path ++ QMAKE_PRL_LIBDIR = $$target.path ++ QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace ++ QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace ++} + + qt_install_headers { + designer_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff new file mode 100644 index 0000000000..debcf7467e --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff @@ -0,0 +1,88 @@ +--- tools/designer/src/uitools/uitools.pro.orig 2012-03-14 10:01:12.000000000 -0400 ++++ tools/designer/src/uitools/uitools.pro 2012-04-25 14:57:29.000000000 -0400 +@@ -1,7 +1,7 @@ + TEMPLATE = lib + TARGET = QtUiTools + QT += xml +-CONFIG += qt staticlib ++CONFIG += qt qt_install_headers + DESTDIR = ../../../../lib + DLLDESTDIR = ../../../../bin + +@@ -28,20 +28,68 @@ + SOURCES += quiloader.cpp + + include($$QT_BUILD_TREE/include/QtUiTools/headers.pri, "", true) +-quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES +-quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools +-INSTALLS += quitools_headers + +-target.path=$$[QT_INSTALL_LIBS] ++#mac frameworks ++mac:!static:contains(QT_CONFIG, qt_framework) { ++ #QMAKE_FRAMEWORK_VERSION = 4.0 ++ CONFIG += lib_bundle qt_no_framework_direct_includes qt_framework ++ CONFIG(debug, debug|release) { ++ !build_pass:CONFIG += debug_and_release build_all ++ } else { #release ++ !debug_and_release|build_pass { ++ CONFIG -= qt_install_headers #no need to install these as well ++ FRAMEWORK_HEADERS.version = Versions ++ FRAMEWORK_HEADERS.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES ++ FRAMEWORK_HEADERS.path = Headers ++ } ++ QMAKE_BUNDLE_DATA += FRAMEWORK_HEADERS ++ } ++} ++ ++mac { ++ CONFIG += explicitlib ++ macx-g++ { ++ QMAKE_CFLAGS += -fconstant-cfstrings ++ QMAKE_CXXFLAGS += -fconstant-cfstrings ++ } ++} ++ ++# install mac frameworks differently than libraries ++mac:!static:contains(QT_CONFIG, qt_framework) { ++ target.path=$$[QT_INSTALL_FRAMEWORKS] ++} else { ++ target.path=$$[QT_INSTALL_LIBS] ++} + INSTALLS += target + +-unix|win32-g++* { +- CONFIG += create_pc +- QMAKE_PKGCONFIG_LIBDIR = $$[QT_INSTALL_LIBS] ++unix|win32-g++*:!symbian { ++ CONFIG += create_pc ++ QMAKE_PKGCONFIG_LIBDIR = $$target.path + QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS]/$$TARGET + QMAKE_PKGCONFIG_CFLAGS = -I$$[QT_INSTALL_HEADERS] + QMAKE_PKGCONFIG_DESTDIR = pkgconfig +- QMAKE_PKGCONFIG_REQUIRES += QtXml ++ QMAKE_PKGCONFIG_REQUIRES += QtXml QtCore QtGui ++ include_replace.match = $$QMAKE_INCDIR_QT ++ include_replace.replace = $$[QT_INSTALL_HEADERS] ++ lib_replace.match = $$QMAKE_LIBDIR_QT ++ lib_replace.replace = $$target.path ++ prefix_replace.match = $$QT_BUILD_TREE ++ prefix_replace.replace = $$[QT_INSTALL_PREFIX] ++ QMAKE_PKGCONFIG_INSTALL_REPLACE += include_replace lib_replace prefix_replace ++} ++ ++unix:!symbian { ++ CONFIG += create_libtool explicitlib ++ QMAKE_LIBTOOL_LIBDIR = $$target.path ++ QMAKE_PRL_LIBDIR = $$target.path ++ QMAKE_PRL_INSTALL_REPLACE += include_replace lib_replace ++ QMAKE_LIBTOOL_INSTALL_REPLACE += include_replace lib_replace ++} ++ ++qt_install_headers { ++ quitools_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.HEADER_CLASSES ++ quitools_headers.path = $$[QT_INSTALL_HEADERS]/QtUiTools ++ INSTALLS += quitools_headers + } + + TARGET = $$qtLibraryTarget($$TARGET$$QT_LIBINFIX) #do this towards the end diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff new file mode 100644 index 0000000000..7350ee83f4 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff @@ -0,0 +1,11 @@ +--- tools/macdeployqt/macdeployqt/main.cpp.orig 2012-04-23 14:49:04.000000000 -0400 ++++ tools/macdeployqt/macdeployqt/main.cpp 2012-04-17 14:38:16.000000000 -0400 +@@ -127,7 +127,7 @@ + + if (plugins) { + if (deploymentInfo.qtPath.isEmpty()) +- deploymentInfo.pluginPath = "/Developer/Applications/Qt/plugins"; // Assume binary package. ++ deploymentInfo.pluginPath = "@QT_PLUGINS_DIR@"; // Assume binary package. + else + deploymentInfo.pluginPath = deploymentInfo.qtPath + "/plugins"; + diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff new file mode 100644 index 0000000000..6aa620b684 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff @@ -0,0 +1,11 @@ +--- tools/macdeployqt/shared/shared.cpp.orig 2012-08-12 19:01:35.000000000 -0400 ++++ tools/macdeployqt/shared/shared.cpp 2012-08-12 19:01:55.000000000 -0400 +@@ -141,7 +141,7 @@ + state = DylibName; + continue; + } else if (part < parts.count() && parts.at(part).endsWith(".framework")) { +- info.installName += "/" + (qtPath + "lib/").simplified(); ++ info.installName += "/" + (qtPath + "Frameworks/").simplified(); + info.frameworkDirectory = info.installName; + state = FrameworkName; + continue; diff --git a/tools/MacOSX/ports/aqua/qt4-mac/files/split_sources.prf b/tools/MacOSX/ports/aqua/qt4-mac/files/split_sources.prf new file mode 100644 index 0000000000..7851cf6129 --- /dev/null +++ b/tools/MacOSX/ports/aqua/qt4-mac/files/split_sources.prf @@ -0,0 +1,52 @@ +# move Obective C and C++ files from SOURCES to OBJECTIVE_SOURCES + +for(source, SOURCES) { + contains(source,.*\\.m$) { + warning(Objective-C source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES) + SOURCES -= $$source + OBJECTIVE_SOURCES += $$source + } else { + contains(source,.*\\.mm$) { + warning(Objective-C++ source \'$$source\' found in SOURCES but should be in OBJECTIVE_SOURCES) + SOURCES -= $$source + OBJECTIVE_SOURCES += $$source + } + } +} + +# move C and C++ files from OBJECTIVE_SOURCES to SOURCES + +for(source, OBJECTIVE_SOURCES) { + contains(source,.*\\.c$) { + warning(C source \'$$source\' found in SOURCES but should be in SOURCES) + OBJECTIVE_SOURCES -= $$source + SOURCES += $$source + } else { + contains(source,.*\\.cc$) { + warning(C++ source \'$$source\' found in SOURCES but should be in SOURCES) + OBJECTIVE_SOURCES -= $$source + SOURCES += $$source + } else { + contains(source,.*\\.cpp$) { + warning(C++ source \'$$source\' found in SOURCES but should be in SOURCES) + OBJECTIVE_SOURCES -= $$source + SOURCES += $$source + } + } + } +} + +# split Objective C and C++ sources into their own variables + +for(source, OBJECTIVE_SOURCES) { + contains(source,.*\\.mm$) { + OBJECTIVE_CXX_SOURCES += $$source + } else { + contains(source,.*\\.m$) { + OBJECTIVE_C_SOURCES += $$source + } else { + warning(Source \'$$source\' was found in OBJECTIVE_SOURCES but its file extension is not a typical objective C (\'.m\') or C++ (\'.mm\') extension; assuming Objective C.) + OBJECTIVE_C_SOURCES += $$source + } + } +} From c59ffadd9bb8749ac31548618e01f80a61b132a7 Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Tue, 24 Nov 2015 18:39:45 +0100 Subject: [PATCH 05/13] Group from selection : small enhancement: create all inputs corresponding to inputs of the selected nodes inputs --- Engine/AppInstance.cpp | 2 +- Gui/NodeGraph.h | 3 +- Gui/NodeGraph45.cpp | 11 ++-- Gui/NodeGraphUndoRedo.cpp | 130 +++++++++++++++++++++++++++++++++++++- 4 files changed, 137 insertions(+), 9 deletions(-) diff --git a/Engine/AppInstance.cpp b/Engine/AppInstance.cpp index 10fb1e07ac..6061aed682 100644 --- a/Engine/AppInstance.cpp +++ b/Engine/AppInstance.cpp @@ -994,7 +994,7 @@ AppInstance::createNodeInternal(const QString & pluginID, Natron::removeFileExtension(moduleName); setGroupLabelIDAndVersion(node, modulePath, moduleName); } - } else if (!requestedByLoad && !_imp->_creatingGroup) { + } else if (!requestedByLoad && !_imp->_creatingGroup && userEdited) { //if the node is a group and we're not loading the project, create one input and one output NodePtr input,output; diff --git a/Gui/NodeGraph.h b/Gui/NodeGraph.h index 9a4942bf65..3d8b9f2729 100644 --- a/Gui/NodeGraph.h +++ b/Gui/NodeGraph.h @@ -155,7 +155,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool areOptionalInputsAutoHidden() const; void copyNodesAndCreateInGroup(const std::list >& nodes, - const boost::shared_ptr& group); + const boost::shared_ptr& group, + std::list > >& createdNodes); virtual void onNodesCleared() OVERRIDE FINAL; diff --git a/Gui/NodeGraph45.cpp b/Gui/NodeGraph45.cpp index 3004f754f1..26204696d5 100644 --- a/Gui/NodeGraph45.cpp +++ b/Gui/NodeGraph45.cpp @@ -644,7 +644,8 @@ NodeGraph::onGroupScriptNameChanged(const QString& /*name*/) void NodeGraph::copyNodesAndCreateInGroup(const std::list >& nodes, - const boost::shared_ptr& group) + const boost::shared_ptr& group, + std::list > >& createdNodes) { { CreatingNodeTreeFlag_RAII createNodeTree(getGui()->getApp()); @@ -652,18 +653,18 @@ NodeGraph::copyNodesAndCreateInGroup(const std::list NodeClipBoard clipboard; _imp->copyNodesInternal(nodes,clipboard); - std::list > > newNodes; std::list >::const_iterator itOther = clipboard.nodes.begin(); for (std::list >::const_iterator it = clipboard.nodesUI.begin(); it != clipboard.nodesUI.end(); ++it, ++itOther) { boost::shared_ptr node = _imp->pasteNode( **itOther,**it,QPointF(0,0),group,std::string(), false); - newNodes.push_back(std::make_pair((*itOther)->getNodeScriptName(),node)); + createdNodes.push_back(std::make_pair((*itOther)->getNodeScriptName(),node)); } - assert( clipboard.nodes.size() == newNodes.size() ); + assert( clipboard.nodes.size() == createdNodes.size() ); ///Now that all nodes have been duplicated, try to restore nodes connections - _imp->restoreConnections(clipboard.nodes, newNodes); + _imp->restoreConnections(clipboard.nodes, createdNodes); } + getGui()->getApp()->getProject()->forceComputeInputDependentDataOnAllTrees(); } diff --git a/Gui/NodeGraphUndoRedo.cpp b/Gui/NodeGraphUndoRedo.cpp index 87448bc1fc..c8acc0d8a3 100644 --- a/Gui/NodeGraphUndoRedo.cpp +++ b/Gui/NodeGraphUndoRedo.cpp @@ -1495,7 +1495,6 @@ GroupFromSelectionCommand::GroupFromSelectionCommand(NodeGraph* graph,const Node , _isRedone(false) { - NodeGuiList selection = nodes; for (NodeGuiList::const_iterator it = nodes.begin(); it != nodes.end(); ++it) { _originalNodes.push_back(*it); } @@ -1517,7 +1516,134 @@ GroupFromSelectionCommand::GroupFromSelectionCommand(NodeGraph* graph,const Node assert(container_i); _group = boost::dynamic_pointer_cast(container_i); assert(_group.lock()); - _graph->copyNodesAndCreateInGroup(selection,isGrp); + + std::list > > newNodes; + _graph->copyNodesAndCreateInGroup(nodes,isGrp,newNodes); + + NodeList internalNewNodes; + for (std::list > >::iterator it = newNodes.begin(); it!=newNodes.end(); ++it) { + internalNewNodes.push_back(it->second->getNode()); + } + + std::list trees; + Natron::Project::extractTreesFromNodes(internalNewNodes, trees); + + bool hasCreatedOutput = false; + + int inputNb = 0; + for (std::list::iterator it = trees.begin(); it!= trees.end(); ++it) { + for (std::list::iterator it2 = it->inputs.begin(); it2 != it->inputs.end(); ++it2) { + + ///Find the equivalent node in the original nodes and see which inputs we need to create + + NodeGuiPtr foundOriginalNode; + for (NodeGuiList::const_iterator it3 = nodes.begin(); it3 != nodes.end(); ++it3) { + if ((*it3)->getNode()->getScriptName_mt_safe() == it2->node->getScriptName_mt_safe()) { + foundOriginalNode = *it3; + break; + } + } + assert(foundOriginalNode); + + NodePtr originalNodeInternal = foundOriginalNode->getNode(); + const std::vector& originalNodeInputs = originalNodeInternal->getInputs(); + for (std::size_t i = 0; i < originalNodeInputs.size(); ++i) { + if (originalNodeInputs[i]) { + + //Create an input node corresponding to this input + CreateNodeArgs args(PLUGINID_NATRON_INPUT, + std::string(), + -1, + -1, + true, // autoconnect + INT_MIN, + INT_MIN, + false, //<< don't push an undo command + true, + true, + QString(), + CreateNodeArgs::DefaultValuesList(), + isGrp); + NodePtr input = _graph->getGui()->getApp()->createNode(args); + assert(input); + std::string inputLabel = originalNodeInternal->getLabel() + '_' + originalNodeInternal->getInputLabel(i); + input->setLabel(inputLabel); + + double offsetX,offsetY; + { + double inputX,inputY; + originalNodeInputs[i]->getPosition(&inputX, &inputY); + double originalX,originalY; + foundOriginalNode->getPosition(&originalX, &originalY); + offsetX = inputX - originalX; + offsetY = inputY - originalY; + } + + double thisInputX,thisInputY; + it2->node->getPosition(&thisInputX, &thisInputY); + + thisInputX += offsetX; + thisInputY += offsetY; + + input->setPosition(thisInputX, thisInputY); + + it2->node->connectInput(input, i); + + containerNode->connectInput(originalNodeInputs[i], inputNb); + + ++inputNb; + + } + } // for all node's inputs + } // for all inputs in the tree + + //Create only a single output + if (!hasCreatedOutput) { + NodeGuiPtr foundOriginalNode; + for (NodeGuiList::const_iterator it3 = nodes.begin(); it3 != nodes.end(); ++it3) { + if ((*it3)->getNode()->getScriptName_mt_safe() == it->output.node->getScriptName_mt_safe()) { + foundOriginalNode = *it3; + break; + } + } + assert(foundOriginalNode); + + CreateNodeArgs args(PLUGINID_NATRON_OUTPUT, + std::string(), + -1, + -1, + false, //< don't autoconnect + INT_MIN, + INT_MIN, + false, //<< don't push an undo command + true, + true, + QString(), + CreateNodeArgs::DefaultValuesList(), + isGrp); + NodePtr output = graph->getGui()->getApp()->createNode(args); + output->setScriptName("Output"); + assert(output); + + double thisNodeX,thisNodeY; + it->output.node->getPosition(&thisNodeX, &thisNodeY); + double thisNodeW,thisNodeH; + it->output.node->getSize(&thisNodeW, &thisNodeH); + + thisNodeY += thisNodeH * 2; + + output->setPosition(thisNodeX, thisNodeY); + + output->connectInput(it->output.node, 0); + + ///Todo: Connect all outputs of the original node to the new Group + + + hasCreatedOutput = true; + + } + } // for all trees + } From f11b206397e081750216c71028f08f064de47d65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 24 Nov 2015 23:00:17 +0100 Subject: [PATCH 06/13] fix warning --- Gui/Gui10.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gui/Gui10.cpp b/Gui/Gui10.cpp index 06f3044bdd..eadce849d0 100644 --- a/Gui/Gui10.cpp +++ b/Gui/Gui10.cpp @@ -372,7 +372,6 @@ void Gui::setApplicationConsoleActionVisible(bool visible) { #ifdef __NATRON_WIN32__ - if (visible == _imp->applicationConsoleVisible) { return; } @@ -386,6 +385,8 @@ Gui::setApplicationConsoleActionVisible(bool visible) } } +#else + Q_UNUSED(visible) #endif } From 2b0cd6c410cd056288bf1df4f403f501bf028908 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Tue, 24 Nov 2015 23:00:29 +0100 Subject: [PATCH 07/13] osx: update build instructions --- INSTALL_OSX.md | 59 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/INSTALL_OSX.md b/INSTALL_OSX.md index 709dc99e4e..d633a0ef83 100644 --- a/INSTALL_OSX.md +++ b/INSTALL_OSX.md @@ -31,6 +31,21 @@ You need an up to date macports version. Just download it and install it from +Patch the qt recipe to fix the stack overflow issue (see the [homebrew FAQ](https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md) if you wonder what that means): + + brew edit qt4 + +and before the line that starts with `head`, add the following code: + + patch :p0 do + url "https://bugreports.qt.io/secure/attachment/52520/patch-qthread-stacksize.diff" + sha256 "477630235eb5ee34ed04e33f156625d1724da290e7a66b745611fb49d17f1347" + end + + Install libraries: brew tap homebrew/python brew tap homebrew/science - brew install qt expat cairo glew + brew install --build-from-source qt + brew install expat cairo glew brew install pyside To install the openfx-io and openfx-misc sets of plugin, you also need the following: @@ -78,24 +114,23 @@ this in your .bash_profile): ### Installing a patched Qt to avoid stack overflows - curl -O https://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz + + wget https://download.qt.io/official_releases/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz tar zxvf qt-everywhere-opensource-src-4.8.7.tar.gz cd qt-everywhere-opensource-src-4.8.7 - curl -O https://raw.githubusercontent.com/Homebrew/patches/480b7142c4e2ae07de6028f672695eb927a34875/qt/el-capitan.patch + wget https://raw.githubusercontent.com/Homebrew/patches/480b7142c4e2ae07de6028f672695eb927a34875/qt/el-capitan.patch patch -p1 < el-capitan.patch - patch -p0 < /path/to/source/Natron/tools/MacOSX/ports/aqua/qt4-mac/files/patch-qthread-stacksize.diff + wget https://bugreports.qt.io/secure/attachment/52520/patch-qthread-stacksize.diff + patch -p0 < patch-qthread-stacksize.diff Then, configure using: - ./configure -prefix /opt/qt4 -system-zlib -qt-libtiff -qt-libpng -qt-libjpeg -confirm-license -opensource -nomake demos -nomake examples -nomake docs -cocoa -fast -release - -On OS X >= 10.9 add `-platform unsupported/macx-clang-libc++` - -Os OS X < 10.9, to compile with clang add `-platform unsupported/macx-clang` - -To use another openssl than the system (mainly for security reasons), add `-openssl-linked -I /usr/local/Cellar/openssl/1.0.2d_1/include -L /usr/local/Cellar/openssl/1.0.2d_1/lib` (where the path is changed to your openssl installation). + ./configure -prefix /opt/qt4 -pch -system-zlib -qt-libtiff -qt-libpng -qt-libjpeg -confirm-license -opensource -nomake demos -nomake examples -nomake docs -cocoa -fast -release -To compile universal binaries, add `-arch x86_64 -arch x86` +* On OS X >= 10.9 add `-platform unsupported/macx-clang-libc++` +* On OS X < 10.9, to compile with clang add `-platform unsupported/macx-clang` +* If compiling with gcc/g++, make sure that `g++ --version`refers to Apple's gcc >= 4.2 or clang >= 318.0.61 +* To use another openssl than the system (mainly for security reasons), add `-openssl-linked -I /usr/local/Cellar/openssl/1.0.2d_1/include -L /usr/local/Cellar/openssl/1.0.2d_1/lib` (where the path is changed to your openssl installation). Then, compile using: From 5f7b5d11567aeeeb6b390561814ea531361bda46 Mon Sep 17 00:00:00 2001 From: MrKepzie Date: Tue, 24 Nov 2015 23:39:12 +0100 Subject: [PATCH 08/13] ManageUserParams: keep expressions when editing a knob which has other knobs connected to it through expressions --- Global/GitVersion.h | 2 +- Gui/AddKnobDialog.cpp | 43 ++++++++------- Gui/KnobGui.cpp | 9 ++-- Gui/KnobGui.h | 2 +- Gui/ManageUserParamsDialog.cpp | 97 ++++++++++++++++------------------ 5 files changed, 78 insertions(+), 75 deletions(-) diff --git a/Global/GitVersion.h b/Global/GitVersion.h index 23261b3b98..b92be02849 100644 --- a/Global/GitVersion.h +++ b/Global/GitVersion.h @@ -1,5 +1,5 @@ #ifndef NATRON_GITVERSION_H_ #define NATRON_GITVERSION_H_ #define GIT_BRANCH "workshop" -#define GIT_COMMIT "1f3d6cc37991806edea42c1050af52bb8ee4203f" +#define GIT_COMMIT "fca6a02dcdd3ef503ceed0f7e5abb204c5e6a164" #endif diff --git a/Gui/AddKnobDialog.cpp b/Gui/AddKnobDialog.cpp index cc00e59e35..c44861433f 100644 --- a/Gui/AddKnobDialog.cpp +++ b/Gui/AddKnobDialog.cpp @@ -1428,10 +1428,12 @@ AddKnobDialog::onOkClicked() ///If the knob was in a group, we need to place it at the same index int oldIndexInGroup = -1; + std::string oldKnobScriptName; std::vector > expressions; std::map,std::vector > > listenersExpressions; if (_imp->knob) { + oldKnobScriptName = _imp->knob->getName(); oldParentPage = _imp->knob->getTopLevelPage(); index = getChoiceIndexFromKnobType(_imp->knob.get()); @@ -1525,33 +1527,36 @@ AddKnobDialog::onOkClicked() _imp->knob->clone(_imp->originalKnobSerialization->getKnob().get()); } //Recover expressions - if (!expressions.empty()) { - try { - for (std::size_t i = 0 ; i < expressions.size(); ++i) { - if (!expressions[i].first.empty()) { - _imp->knob->setExpression(i, expressions[i].first, expressions[i].second); - } + try { + for (std::size_t i = 0 ; i < expressions.size(); ++i) { + if (!expressions[i].first.empty()) { + _imp->knob->setExpression(i, expressions[i].first, expressions[i].second); } - } catch (...) { - } + } catch (...) { + } + //Recover listeners expressions - if (!listenersExpressions.empty()) { - - for (std::map,std::vector > >::iterator it = listenersExpressions.begin(); - it != listenersExpressions.end(); ++it) { - assert(it->first->getDimension() == (int)it->second.size()); - for (int i = 0; i < it->first->getDimension(); ++i) { - try { - it->first->setExpression(i, it->second[i].first, it->second[i].second); - } catch (...) { - + for (std::map,std::vector > >::iterator it = listenersExpressions.begin();it != listenersExpressions.end(); ++it) { + assert(it->first->getDimension() == (int)it->second.size()); + for (int i = 0; i < it->first->getDimension(); ++i) { + try { + std::string expr; + if (oldKnobScriptName != _imp->knob->getName()) { + //Change in expressions the script-name + QString estr(it->second[i].first.c_str()); + estr.replace(oldKnobScriptName.c_str(), _imp->knob->getName().c_str()); + expr = estr.toStdString(); + } else { + expr = it->second[i].first; } + it->first->setExpression(i, expr, it->second[i].second); + } catch (...) { + } } - } } diff --git a/Gui/KnobGui.cpp b/Gui/KnobGui.cpp index 9217a91b15..ef05ace1c5 100644 --- a/Gui/KnobGui.cpp +++ b/Gui/KnobGui.cpp @@ -607,7 +607,7 @@ KnobGui::createAnimationMenu(QMenu* menu,int dimension) } // if (isAppKnob) } // createAnimationMenu -void +boost::shared_ptr KnobGui::createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpression) { ///find-out to which node that master knob belongs to @@ -624,7 +624,7 @@ KnobGui::createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpressio "Continue anyway ?").toStdString(),false, Natron::StandardButtons(Natron::eStandardButtonOk | Natron::eStandardButtonCancel)); if (rep != Natron::eStandardButtonYes) { - return; + return boost::shared_ptr(); } } } @@ -633,7 +633,7 @@ KnobGui::createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpressio EffectInstance* isEffect = dynamic_cast(holder); assert(isEffect); if (!isEffect) { - return; + return boost::shared_ptr(); } KnobBool* isBool = dynamic_cast(knob.get()); @@ -739,7 +739,7 @@ KnobGui::createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpressio output = newKnob; } if (!output) { - return; + return boost::shared_ptr(); } output->cloneDefaultValues(knob.get()); @@ -784,4 +784,5 @@ KnobGui::createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpressio } effect->refreshKnobs(); holder->getApp()->triggerAutoSave(); + return output; } diff --git a/Gui/KnobGui.h b/Gui/KnobGui.h index 712bfc32b5..3d661a2a77 100644 --- a/Gui/KnobGui.h +++ b/Gui/KnobGui.h @@ -264,7 +264,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON **/ bool isSecretRecursive() const; - void createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpression); + boost::shared_ptr createDuplicateOnNode(Natron::EffectInstance* effect,bool linkExpression); static bool shouldSliderBeVisible(int sliderMin, int sliderMax) diff --git a/Gui/ManageUserParamsDialog.cpp b/Gui/ManageUserParamsDialog.cpp index 49cc2026aa..1da3acbc38 100644 --- a/Gui/ManageUserParamsDialog.cpp +++ b/Gui/ManageUserParamsDialog.cpp @@ -102,6 +102,8 @@ struct ManageUserParamsDialogPrivate void initializeKnobs(const std::vector >& knobs,QTreeWidgetItem* parent,std::list& markedKnobs); void rebuildUserPages(); + + void onKnobAddedInternal(const boost::shared_ptr& knob); }; ManageUserParamsDialog::ManageUserParamsDialog(DockablePanel* panel,QWidget* parent) @@ -266,7 +268,8 @@ ManageUserParamsDialog::onPickClicked() assert(nodeGui); NodePtr node = nodeGui->getNode(); assert(node); - selectedKnob->createDuplicateOnNode(node->getLiveInstance(), useExpr); + boost::shared_ptr duplicate = selectedKnob->createDuplicateOnNode(node->getLiveInstance(), useExpr); + _imp->onKnobAddedInternal(duplicate); } } @@ -277,46 +280,53 @@ ManageUserParamsDialog::onAddClicked() if (dialog.exec()) { //Ensure the user page knob exists boost::shared_ptr userPageKnob = _imp->panel->getUserPageKnob(); - + (void)userPageKnob; boost::shared_ptr knob = dialog.getKnob(); - QTreeWidgetItem* parent = 0; - - boost::shared_ptr parentKnob = knob->getParentKnob(); - if (parentKnob) { - for (std::list::iterator it = _imp->items.begin(); it != _imp->items.end(); ++it) { - if (it->knob.get() == parentKnob.get()) { - parent = it->item; - break; - } + _imp->onKnobAddedInternal(knob); + } +} + +void +ManageUserParamsDialogPrivate::onKnobAddedInternal(const boost::shared_ptr& knob) +{ + QTreeWidgetItem* parent = 0; + + boost::shared_ptr parentKnob = knob->getParentKnob(); + if (parentKnob) { + for (std::list::iterator it = items.begin(); it != items.end(); ++it) { + if (it->knob.get() == parentKnob.get()) { + parent = it->item; + break; } } - if (!parent) { - KnobPage* isPage = dynamic_cast(knob.get()); - if (!isPage) { - //Default to user page - for (std::list::iterator it = _imp->items.begin(); it != _imp->items.end(); ++it) { - if (it->item->text(0) == QString(NATRON_USER_MANAGED_KNOBS_PAGE)) { - parent = it->item; - break; - } + } + if (!parent) { + KnobPage* isPage = dynamic_cast(knob.get()); + if (!isPage) { + //Default to user page + for (std::list::iterator it = items.begin(); it != items.end(); ++it) { + if (it->item->text(0) == QString(NATRON_USER_MANAGED_KNOBS_PAGE)) { + parent = it->item; + break; } } - - } - TreeItem i; - i.knob = knob; - i.item = new QTreeWidgetItem; - if (parent) { - parent->addChild(i.item); - parent->setExpanded(true); - } else { - _imp->tree->addTopLevelItem(i.item); } - i.item->setText(0, knob->getName().c_str()); - _imp->items.push_back(i); + } - _imp->rebuildUserPages(); - _imp->panel->getGui()->getApp()->triggerAutoSave(); + TreeItem i; + i.knob = knob; + i.item = new QTreeWidgetItem; + if (parent) { + parent->addChild(i.item); + parent->setExpanded(true); + } else { + tree->addTopLevelItem(i.item); + } + i.item->setText(0, knob->getName().c_str()); + items.push_back(i); + + rebuildUserPages(); + panel->getGui()->getApp()->triggerAutoSave(); } void @@ -350,24 +360,11 @@ ManageUserParamsDialog::onEditClickedInternal(const QList &sel for (int i = 0; i < selection.size(); ++i) { for (std::list::iterator it = _imp->items.begin(); it != _imp->items.end(); ++it) { if (it->item == selection[i]) { - - std::list > listeners; - it->knob->getListeners(listeners); - if (!listeners.empty()) { - Natron::StandardButtonEnum rep = Natron::questionDialog(tr("Edit parameter").toStdString(), - tr("This parameter has one or several " - "parameters from which other parameters " - "of the project rely on through expressions " - "or links. Editing this parameter may " - "remove these expressions if the script-name is changed.\n" - "Do you want to continue?").toStdString(), false); - if (rep == Natron::eStandardButtonNo) { - return; - } - } - + AddKnobDialog dialog(_imp->panel,it->knob,this); if (dialog.exec()) { + + it->knob = dialog.getKnob(); it->item->setText(0, it->knob->getName().c_str()); _imp->rebuildUserPages(); From a5f237098be740cff79c1024c1ced60fde3b9f40 Mon Sep 17 00:00:00 2001 From: MrKepzie Date: Tue, 24 Nov 2015 23:40:18 +0100 Subject: [PATCH 09/13] LineEdit: do not accept event when return is pressed --- Global/GitVersion.h | 2 +- Gui/LineEdit.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Global/GitVersion.h b/Global/GitVersion.h index b92be02849..2d6c803b95 100644 --- a/Global/GitVersion.h +++ b/Global/GitVersion.h @@ -1,5 +1,5 @@ #ifndef NATRON_GITVERSION_H_ #define NATRON_GITVERSION_H_ #define GIT_BRANCH "workshop" -#define GIT_COMMIT "fca6a02dcdd3ef503ceed0f7e5abb204c5e6a164" +#define GIT_COMMIT "a8425d708613f8a9723767be421132f42ae06e16" #endif diff --git a/Gui/LineEdit.cpp b/Gui/LineEdit.cpp index fd8e0ee914..c245ced789 100644 --- a/Gui/LineEdit.cpp +++ b/Gui/LineEdit.cpp @@ -144,11 +144,7 @@ void LineEdit::keyPressEvent(QKeyEvent* e) { QLineEdit::keyPressEvent(e); - if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { - ///Return and enter emit editingFinished() in parent implementation but do not accept the shortcut either - e->accept(); - return; - } else if (e->matches(QKeySequence::Paste)) { + if (e->matches(QKeySequence::Paste)) { Q_EMIT textPasted(); } } From 0f6445e24de61e8bb39da177c08ed26b3388476c Mon Sep 17 00:00:00 2001 From: MrKepzie Date: Tue, 24 Nov 2015 23:49:03 +0100 Subject: [PATCH 10/13] NodeGraph: Hide cache size by default, Edge: deactivate anti-aliasing --- Global/GitVersion.h | 2 +- Gui/Edge.cpp | 1 + Gui/NodeGraph.cpp | 1 + Gui/NodeGraphPrivate.cpp | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Global/GitVersion.h b/Global/GitVersion.h index 2d6c803b95..d48d661a7a 100644 --- a/Global/GitVersion.h +++ b/Global/GitVersion.h @@ -1,5 +1,5 @@ #ifndef NATRON_GITVERSION_H_ #define NATRON_GITVERSION_H_ #define GIT_BRANCH "workshop" -#define GIT_COMMIT "a8425d708613f8a9723767be421132f42ae06e16" +#define GIT_COMMIT "234397dbb3c2fec0bee53f3f543747c7c8344a11" #endif diff --git a/Gui/Edge.cpp b/Gui/Edge.cpp index a630d6e8af..a4bc2e507f 100644 --- a/Gui/Edge.cpp +++ b/Gui/Edge.cpp @@ -702,6 +702,7 @@ Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*options*/, QWidget * /*parent*/) { + painter->setRenderHint(QPainter::Antialiasing, false); QPen myPen = pen(); boost::shared_ptr dst = _imp->dest.lock(); diff --git a/Gui/NodeGraph.cpp b/Gui/NodeGraph.cpp index b8107a5c00..16592700b6 100644 --- a/Gui/NodeGraph.cpp +++ b/Gui/NodeGraph.cpp @@ -131,6 +131,7 @@ NodeGraph::NodeGraph(Gui* gui, scene->addItem(_imp->_cacheSizeText); _imp->_cacheSizeText->setFlag(QGraphicsItem::ItemIgnoresTransformations); _imp->_cacheSizeText->setBrush( QColor(200,200,200) ); + _imp->_cacheSizeText->setVisible(false); QObject::connect( &_imp->_refreshCacheTextTimer,SIGNAL( timeout() ),this,SLOT( updateCacheSizeText() ) ); _imp->_refreshCacheTextTimer.start(NATRON_CACHE_SIZE_TEXT_REFRESH_INTERVAL_MS); diff --git a/Gui/NodeGraphPrivate.cpp b/Gui/NodeGraphPrivate.cpp index 5a562dfc70..202ecc1633 100644 --- a/Gui/NodeGraphPrivate.cpp +++ b/Gui/NodeGraphPrivate.cpp @@ -63,7 +63,7 @@ NodeGraphPrivate::NodeGraphPrivate(NodeGraph* p, , _root(NULL) , _nodeRoot(NULL) , _cacheSizeText(NULL) -, cacheSizeHidden(false) +, cacheSizeHidden(true) , _refreshCacheTextTimer() , _navigator(NULL) , _undoStack(NULL) From d637f14eb20aba4ccc9ef30436c68c81ee0fcc53 Mon Sep 17 00:00:00 2001 From: MrKepzie Date: Tue, 24 Nov 2015 23:58:17 +0100 Subject: [PATCH 11/13] Deactivate AA for LinKArrow too --- Global/GitVersion.h | 2 +- Gui/Edge.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Global/GitVersion.h b/Global/GitVersion.h index d48d661a7a..07699b5fe6 100644 --- a/Global/GitVersion.h +++ b/Global/GitVersion.h @@ -1,5 +1,5 @@ #ifndef NATRON_GITVERSION_H_ #define NATRON_GITVERSION_H_ #define GIT_BRANCH "workshop" -#define GIT_COMMIT "234397dbb3c2fec0bee53f3f543747c7c8344a11" +#define GIT_COMMIT "73b487d9735c583a5312c8f9dd087d1ffedc3f26" #endif diff --git a/Gui/Edge.cpp b/Gui/Edge.cpp index a4bc2e507f..654d514c0f 100644 --- a/Gui/Edge.cpp +++ b/Gui/Edge.cpp @@ -876,6 +876,7 @@ LinkArrow::paint(QPainter *painter, const QStyleOptionGraphicsItem* /*options*/, QWidget* /*parent*/) { + painter->setRenderHint(QPainter::Antialiasing, false); QPen myPen = pen(); myPen.setColor(_renderColor); From 8882cf202f82a1688c96731009f775f7268be713 Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Wed, 25 Nov 2015 09:04:56 +0100 Subject: [PATCH 12/13] Add AntiAliasing setting --- Engine/Settings.cpp | 12 ++++++++++++ Engine/Settings.h | 3 +++ Gui/BackDropGui.cpp | 8 +++++++- Gui/Edge.cpp | 5 ++++- Gui/NodeGraphTextItem.cpp | 13 +++++++++++-- Gui/NodeGui.cpp | 10 ++++++++-- 6 files changed, 45 insertions(+), 6 deletions(-) diff --git a/Engine/Settings.cpp b/Engine/Settings.cpp index 3a9908cbcb..d5b41c658a 100644 --- a/Engine/Settings.cpp +++ b/Engine/Settings.cpp @@ -900,6 +900,11 @@ Settings::initializeKnobsNodeGraph() _usePluginIconsInNodeGraph->setAnimationEnabled(false); _nodegraphTab->addKnob(_usePluginIconsInNodeGraph); + _useAntiAliasing = Natron::createKnob(this, "Anti-Aliasing"); + _useAntiAliasing->setHintToolTip("When checked, the node graph will be painted using anti-aliasing. Unchecking it may increase performances."); + _useAntiAliasing->setAnimationEnabled(false); + _nodegraphTab->addKnob(_useAntiAliasing); + _defaultNodeColor = Natron::createKnob(this, "Default node color",3); _defaultNodeColor->setName("defaultNodeColor"); @@ -1370,6 +1375,7 @@ Settings::setDefaultValues() setCachingLabels(); _autoTurbo->setDefaultValue(false); _usePluginIconsInNodeGraph->setDefaultValue(true); + _useAntiAliasing->setDefaultValue(false); _defaultNodeColor->setDefaultValue(0.7,0); _defaultNodeColor->setDefaultValue(0.7,1); _defaultNodeColor->setDefaultValue(0.7,2); @@ -3076,6 +3082,12 @@ Settings::isPluginIconActivatedOnNodeGraph() const } +bool +Settings::isNodeGraphAntiAliasingEnabled() const +{ + return _useAntiAliasing->getValue(); +} + void Settings::getSunkenColor(double* r,double* g,double* b) const { diff --git a/Engine/Settings.h b/Engine/Settings.h index 63b1262784..13d50fbf84 100644 --- a/Engine/Settings.h +++ b/Engine/Settings.h @@ -300,6 +300,8 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON bool isPluginIconActivatedOnNodeGraph() const; + bool isNodeGraphAntiAliasingEnabled() const; + void getSunkenColor(double* r,double* g,double* b) const; void getBaseColor(double* r,double* g,double* b) const; void getRaisedColor(double* r,double* g,double* b) const; @@ -456,6 +458,7 @@ GCC_DIAG_SUGGEST_OVERRIDE_ON boost::shared_ptr _hideOptionalInputsAutomatically; boost::shared_ptr _useInputAForMergeAutoConnect; boost::shared_ptr _usePluginIconsInNodeGraph; + boost::shared_ptr _useAntiAliasing; boost::shared_ptr _defaultNodeColor; boost::shared_ptr _defaultBackdropColor; boost::shared_ptr _defaultGeneratorColor; diff --git a/Gui/BackDropGui.cpp b/Gui/BackDropGui.cpp index e889a3b3ca..114282fd61 100644 --- a/Gui/BackDropGui.cpp +++ b/Gui/BackDropGui.cpp @@ -37,7 +37,9 @@ CLANG_DIAG_ON(uninitialized) #include "Engine/KnobTypes.h" #include "Engine/Node.h" #include "Engine/BackDrop.h" +#include "Engine/Settings.h" +#include "Gui/GuiApplicationManager.h" #include "Gui/KnobGuiString.h" #include "Gui/NodeGraphTextItem.h" @@ -166,7 +168,11 @@ BackDropGuiPrivate::refreshLabelText(int nameHeight,const QString &text) QColor color; if (!text.isEmpty()) { KnobGuiString::parseFont(textLabel, &f, &color); - f.setStyleStrategy(QFont::NoAntialias); + + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + f.setStyleStrategy(QFont::NoAntialias); + } label->setFont(f); } diff --git a/Gui/Edge.cpp b/Gui/Edge.cpp index a630d6e8af..98819405d6 100644 --- a/Gui/Edge.cpp +++ b/Gui/Edge.cpp @@ -142,7 +142,10 @@ EdgePrivate::initLabel() txt.setRgbF(Natron::clamp(r,0.,1.),Natron::clamp(g,0.,1.), Natron::clamp(b,0.,1.)); label->setBrush(txt); QFont f = qApp->font(); - f.setStyleStrategy(QFont::NoAntialias); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + f.setStyleStrategy(QFont::NoAntialias); + } label->setFont(f); //_imp->label->setDefaultTextColor( QColor(200,200,200) ); } diff --git a/Gui/NodeGraphTextItem.cpp b/Gui/NodeGraphTextItem.cpp index 36b8a1ba8f..e64269a6f1 100644 --- a/Gui/NodeGraphTextItem.cpp +++ b/Gui/NodeGraphTextItem.cpp @@ -29,7 +29,10 @@ #include #include +#include "Engine/Settings.h" + #include "Gui/NodeGraph.h" +#include "Gui/GuiApplicationManager.h" #define NODEGRAPH_TEXT_ITEM_MIN_HEIGHT_PX 4 #define NODEGRAPH_SIMPLE_TEXT_ITEM_MIN_HEIGHT_PX 6 @@ -41,7 +44,10 @@ NodeGraphTextItem::NodeGraphTextItem(NodeGraph* graph,QGraphicsItem* parent,bool , _alwaysDrawText(alwaysDrawText) { QFont f = font(); - f.setStyleStrategy(QFont::NoAntialias); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + f.setStyleStrategy(QFont::NoAntialias); + } setFont(f); } @@ -79,7 +85,10 @@ NodeGraphSimpleTextItem::NodeGraphSimpleTextItem(NodeGraph* graph,QGraphicsItem* , _alwaysDrawText(alwaysDrawText) { QFont f = font(); - f.setStyleStrategy(QFont::NoAntialias); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + f.setStyleStrategy(QFont::NoAntialias); + } setFont(f); } diff --git a/Gui/NodeGui.cpp b/Gui/NodeGui.cpp index cd2add4648..6fd4adf693 100644 --- a/Gui/NodeGui.cpp +++ b/Gui/NodeGui.cpp @@ -562,7 +562,10 @@ NodeGui::createGui() _persistentMessage->setZValue(depth + 3); QFont f = _persistentMessage->font(); f.setPixelSize(25); - f.setStyleStrategy(QFont::NoAntialias); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + f.setStyleStrategy(QFont::NoAntialias); + } _persistentMessage->setFont(f); _persistentMessage->hide(); @@ -2662,7 +2665,10 @@ NodeGui::setNameItemHtml(const QString & name, if (hasFontData) { KnobGuiString::parseFont(textLabel, &f, &color); } - f.setStyleStrategy(QFont::NoAntialias); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + f.setStyleStrategy(QFont::NoAntialias); + } _nameItem->setFont(f); QRectF bbox = boundingRect(); From bc2de0ac38abc1419c3cce72d51025da5404e8eb Mon Sep 17 00:00:00 2001 From: Alexandre Gauthier Date: Wed, 25 Nov 2015 09:14:57 +0100 Subject: [PATCH 13/13] Also affect antialias of edges with antialias setting --- Engine/Settings.cpp | 3 ++- Gui/Edge.cpp | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Engine/Settings.cpp b/Engine/Settings.cpp index d5b41c658a..4e8e1c1921 100644 --- a/Engine/Settings.cpp +++ b/Engine/Settings.cpp @@ -901,7 +901,8 @@ Settings::initializeKnobsNodeGraph() _nodegraphTab->addKnob(_usePluginIconsInNodeGraph); _useAntiAliasing = Natron::createKnob(this, "Anti-Aliasing"); - _useAntiAliasing->setHintToolTip("When checked, the node graph will be painted using anti-aliasing. Unchecking it may increase performances."); + _useAntiAliasing->setHintToolTip("When checked, the node graph will be painted using anti-aliasing. Unchecking it may increase performances." + " Changing this requires a restart of Natron"); _useAntiAliasing->setAnimationEnabled(false); _nodegraphTab->addKnob(_useAntiAliasing); diff --git a/Gui/Edge.cpp b/Gui/Edge.cpp index 5ca6d0f5d4..521e47be71 100644 --- a/Gui/Edge.cpp +++ b/Gui/Edge.cpp @@ -705,7 +705,11 @@ Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem * /*options*/, QWidget * /*parent*/) { - painter->setRenderHint(QPainter::Antialiasing, false); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + painter->setRenderHint(QPainter::Antialiasing, false); + } + QPen myPen = pen(); boost::shared_ptr dst = _imp->dest.lock(); @@ -879,7 +883,10 @@ LinkArrow::paint(QPainter *painter, const QStyleOptionGraphicsItem* /*options*/, QWidget* /*parent*/) { - painter->setRenderHint(QPainter::Antialiasing, false); + bool antialias = appPTR->getCurrentSettings()->isNodeGraphAntiAliasingEnabled(); + if (!antialias) { + painter->setRenderHint(QPainter::Antialiasing, false); + } QPen myPen = pen(); myPen.setColor(_renderColor);