From 4007f810d394f0f0a8109ee6f71d9df0e0776c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Thu, 22 Apr 2021 23:10:41 -0700 Subject: [PATCH] MacPorts: qt4 patch for Big Sur see #606 --- tools/MacPorts/aqua/qt4-mac/Portfile | 1252 ++++++++ tools/MacPorts/aqua/qt4-mac/files/c++11.prf | 3 + .../aqua/qt4-mac/files/c++11/c++11.test | 21 + .../aqua/qt4-mac/files/c++11/c++11_test.cpp | 12 + .../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 + .../qt4-mac/files/patch-allow_libressl.diff | 63 + ...tch-better-invalid-fonttable-handling.diff | 650 ++++ .../files/patch-compiler_standard.diff | 16 + .../patch-config.tests_unix_compile.test.diff | 11 + .../patch-config.tests_unix_precomp.test.diff | 22 + .../aqua/qt4-mac/files/patch-configure.diff | 353 +++ .../aqua/qt4-mac/files/patch-cxx11.diff | 594 ++++ .../aqua/qt4-mac/files/patch-darwin-g++.diff | 20 + .../patch-fix_pointer_comparison_to_0.diff | 22 + .../patch-graphicssystem-via-qtconfig.diff | 122 + .../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 ++ .../aqua/qt4-mac/files/patch-nis.diff | 10 + .../files/patch-parallelize_qmake_build.diff | 29 + ...ch-qmake_generators_unix_unixmake.cpp.diff | 11 + ...generators_unix_unixmake.cpp.fix_arch.diff | 87 + ...enerators_unix_unixmake.cpp.framework.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 + .../qt4-mac/files/patch-qsettings-null.diff | 60 + .../files/patch-qt-custom-threadpool.diff | 149 + .../files/patch-qt4-contentsformat.diff | 29 + .../qt4-mac/files/patch-qt4-openssl111.diff | 398 +++ ...atch-qt4-versions-without-underscores.diff | 12 + .../files/patch-qthread-stacksize.diff | 56 + ...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 + ...b_io_qfilesystemengine_unix.cpp-tiger.diff | 41 + ...atch-src_corelib_io_qprocess_unix.cpp.diff | 16 + .../patch-src_corelib_io_qsettings.cpp.diff | 11 + ...c_corelib_tools_qelapsedtimer-mac.cpp.diff | 11 + ...ch-src_gui_dialogs_qfiledialog_mac.mm.diff | 18 + ..._gui_dialogs_qfontdialog_mac.mm-tiger.diff | 34 + .../patch-src_gui_kernel_qcursor_mac.mm.diff | 17 + .../patch-src_gui_kernel_qmime_mac.cpp.diff | 207 ++ ...i_painting_qpaintengine_mac.cpp-tiger.diff | 19 + ...tch-src_gui_painting_qpaintengine_mac.diff | 106 + ...ui_painting_qprintengine_mac.mm-tiger.diff | 14 + ..._gui_text_qfontdatabase_mac.cpp-tiger.diff | 21 + ...-src_gui_text_qfontengine_coretext.mm.diff | 11 + ...rk_kernel_qnetworkproxy_mac.cpp-tiger.diff | 18 + .../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 + .../files/patch-test_compiler_version.diff | 11 + .../files/patch-tools-build_qtconfig.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 + .../qt4-mac/files/patch-webkit-tiger.diff | 2619 +++++++++++++++++ .../aqua/qt4-mac/files/split_sources.prf | 52 + 84 files changed, 8835 insertions(+) create mode 100644 tools/MacPorts/aqua/qt4-mac/Portfile create mode 100644 tools/MacPorts/aqua/qt4-mac/files/c++11.prf create mode 100755 tools/MacPorts/aqua/qt4-mac/files/c++11/c++11.test create mode 100644 tools/MacPorts/aqua/qt4-mac/files/c++11/c++11_test.cpp create mode 100755 tools/MacPorts/aqua/qt4-mac/files/cpath/cpath.test create mode 100644 tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.c create mode 100644 tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.h create mode 100755 tools/MacPorts/aqua/qt4-mac/files/fconstant_cfstrings.test create mode 100755 tools/MacPorts/aqua/qt4-mac/files/library_path/library_path.test create mode 100644 tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.c create mode 100644 tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.h create mode 100644 tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_test.c create mode 100755 tools/MacPorts/aqua/qt4-mac/files/objc_block/objc_block.test create mode 100644 tools/MacPorts/aqua/qt4-mac/files/objc_block/objc_block_test.m create mode 100644 tools/MacPorts/aqua/qt4-mac/files/objective_cxx.prf create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-allow_libressl.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-better-invalid-fonttable-handling.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-compiler_standard.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-configure.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-cxx11.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-darwin-g++.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-graphicssystem-via-qtconfig.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-nis.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-parallelize_qmake_build.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.fix_arch.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.framework.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_option.h.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_project.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_property.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qsettings-null.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qt-custom-threadpool.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qt4-contentsformat.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qt4-openssl111.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-qthread-stacksize.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qsettings.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontengine_coretext.mm.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_qbase.pri.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_qt_install.pri.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-test_compiler_version.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools-build_qtconfig.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/patch-webkit-tiger.diff create mode 100644 tools/MacPorts/aqua/qt4-mac/files/split_sources.prf diff --git a/tools/MacPorts/aqua/qt4-mac/Portfile b/tools/MacPorts/aqua/qt4-mac/Portfile new file mode 100644 index 0000000000..38739c40a3 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/Portfile @@ -0,0 +1,1252 @@ +# -*- 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 + +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 +version 4.8.7 +revision 12 +set branch [join [lrange [split ${version} .] 0 1] .] + +categories aqua +platforms macosx +maintainers {michaelld @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 \ + size 241075567 + +if {[info exists use_xcode]} { + use_xcode yes +} +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 \ + path:include/turbojpeg.h:libjpeg-turbo + +# 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, MAJOR +set MAJOR "" +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 MAJOR [lindex [split ${macosx_deployment_target} "."] 0] + set MINOR [lindex [split ${macosx_deployment_target} "."] 1] +} else { + # Do we really need this branch still ?? + if { ${os.major} < 20 } { + set MAJOR 10 + set MINOR [expr [lindex [split ${os.version} "."] 0] - 4] + } else { + # Bit of a guess, and will not work once we have macOS 12 + set MAJOR 11 + set MINOR [expr [lindex [split ${os.version} "."] 0] - 20] + } +} +ui_debug "Deduced OS MAJOR.MINOR = ${MAJOR}.${MINOR}" + +############################################### +# 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 + +# (13a) 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_unixmake.cpp.framework.diff + +# (13b) In QMake: fix issue for when LFLAGS and env LDFLAGS contain +# multiple "-arch FOO" duplicate flags, which would result in output +# such as "-arch x86_64 -arch -Xarch_x86_64 ...". + +patchfiles-append patch-qmake_generators_unix_unixmake.cpp.fix_arch.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) fix the Mac timer's use of "mach_timebase_info" + +patchfiles-append \ + patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff + +# (20) Under 10.8 and 10.9: Patch to fix corelib linking + +platform darwin { + if {${MAJOR} > 10 || ${MINOR} >= 8} { + patchfiles-append patch-src_corelib_corelib.pro.diff + } +} + +# (21) fix Framework directory in MacDeployQt tool + +patchfiles-append \ + patch-tools_macdeployqt_shared_shared.cpp.diff + +# (22) 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 + +# (23) 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 + +# (24) 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 + +# (25) fix build on Leopard; see also: +# https://trac.macports.org/ticket/43746 + +patchfiles-append \ + patch-src_gui_dialogs_qfiledialog_mac.mm.diff + +# (26) QTKit no longer exists as of macOS 10.12 (Sierra) +# https://trac.macports.org/ticket/52332 + +platform darwin { + if {${MAJOR} > 10 || ${MINOR} >= 12} { + patchfiles-append patch-src_gui_kernel_qmime_mac.cpp.diff + } +} + +# (27) Better invalid fonttable handling +# Qt commit 0a2f2382 on July 10, 2015 at 7:22:32 AM EDT. +# not included in 4.8.7 release. + +patchfiles-append patch-better-invalid-fonttable-handling.diff + +# (28) Fix pointer comparison with 0 +# These error out on clang 4.0, whereas they didn't in 3.9. + +patchfiles-append patch-fix_pointer_comparison_to_0.diff + +# (29) Backport of Qt5 patch to fix an issue with null bytes in +# QSetting strings (QTBUG-56124). + +patchfiles-append patch-qsettings-null.diff + +# (30) Various patches to fix compilation and runtime on 10.4 Tiger. +# These us # macros keyed on >= 10.5 or not, and so do not harm +# compilation on non-Tiger Mac OS X. + +patchfiles-append \ + patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff \ + patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff \ + patch-src_gui_painting_qprintengine_mac.mm-tiger.diff \ + patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff \ + patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff \ + patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff \ + patch-webkit-tiger.diff + +# (31) Patch to fix build on macOS High Sierra + +patchfiles-append patch-qt4-versions-without-underscores.diff + +# (32) Fix default thread stack size on Mac OS X (QTBUG-49607) +# https://bugreports.qt.io/secure/attachment/52520/patch-qthread-stacksize.diff +# Note that Qt 5.10 and later implement QThreadPool:stackSize to set the +# stack size (QTBUG-2568). + +patchfiles-append patch-qthread-stacksize.diff + +# (33) Add possibility to set a custom global thread pool + +patchfiles-append patch-qt-custom-threadpool.diff + +# (34) Allow control over the default graphics system to be used via +# Qt's own qtconfig utility: Native vs. Raster vs. OpenGL. Qtconfig +# is not normally built on Mac so a patch is required to activate it. +patchfiles-append patch-tools-build_qtconfig.diff \ + patch-graphicssystem-via-qtconfig.diff + +# (35) Various from NiXos +# see also < https://trac.macports.org/ticket/55932 > +# and < https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/libraries/qt-4.x/4.8 > + +# (a) allow use of libressl as well as openssl + +patchfiles-append patch-allow_libressl.diff + +# (b) allow parallel qmake building +# normally qmake is built using a single thread / job + +patchfiles-append patch-parallelize_qmake_build.diff + +# (c) fix unix makefile generation to augment this specific variable +# ('ret'), not overwrite it -- this matches the other uses of the +# specific variable in that area, especially that in the 'if' statement. + +patchfiles-append patch-qmake_generators_unix_unixmake.cpp.diff + +# (d) fix to not call qsettings before constructing a qapplication, +# because it causes a dead-lock. + +patchfiles-append patch-src_corelib_io_qsettings.cpp.diff + +# (e) fix to properly use QFixed as a type rather than a constructor +# (I think). Without this fix, the build errors out on Clang 5. + +patchfiles-append patch-src_gui_text_qfontengine_coretext.mm.diff + +# fix build against openssl 1.1.1 +# see https://trac.macports.org/ticket/58205 +patchfiles-append patch-qt4-openssl111.diff + +# newer versions of MacPorts Clang default to newer C++ standards +# see https://trac.macports.org/ticket/57751 +if {![variant_isset cxx11]} { + patchfiles-append patch-compiler_standard.diff +} + +# Fix slow drawing on Big Sur. +# See: +# - https://developer.apple.com/forums/thread/663256 +# - https://gist.github.com/lukaskubanek/9a61ac71dc0db8bb04db2028f2635779 +# - https://trac.wxwidgets.org/ticket/19111 +# The fix can only be compiled with the 10.12 SDK or later. +patchfiles-append patch-qt4-contentsformat.diff + +# the configure script uses the compiler version to determine if QtXmlPatterns and QtWebKit can be built +# the logic does not work for newer versions of GCC or Clang (masquerading as GCC) +patchfiles-append patch-test_compiler_version.diff + +# the version header file is part of C++20 +# newer versions of Clang find VERSION instead +post-extract { + move \ + ${worksrcpath}/src/3rdparty/javascriptcore/VERSION \ + ${worksrcpath}/src/3rdparty/javascriptcore/VERSION.txt +} + +# error out if trying to build on a new OSX version (> 11.0). + +platform darwin { + if { ( ${MAJOR} == 10 && ${MINOR} > 15 ) || ${MAJOR} > 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 Mac OS X later than 11 'Big Sur'." + 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 { ${MAJOR} == 10 && ${MINOR} == 4 } { + # OSX 10.4 requires an additional 'u' + set sdk_version "${MAJOR}.4u" + } else { + set sdk_version "${MAJOR}.${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 + } +} + +# no support for ARM64 yet +supported_archs ppc ppc64 i386 x86_64 + +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 affect 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 ${configure.universal_archs} " -arch "] + } else { + set ARCHES ${configure.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 "${MAJOR}.${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. +# + +# does not build against libc++ with Apple clangs up to 10.8 +# does not build against macports-clang-7+ +# not certain about macports-clang-6.0 at present + +compiler.blacklist-append { clang <= 503 } \ + gcc-3.3 *gcc-4.0 macports-gcc* \ + {macports-clang-[6-8].0} + +# --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 \ + --jobs=${build.jobs} + +# 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} +} + +# on older systems, /usr/include/rpcsvc/yp_prot.h redefines bool unless BOOL_DEFINED is defined +if {${os.major} < 11} { + configure.args-append {-D BOOL_DEFINED} + patchfiles-append patch-nis.diff +} + +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 {${MAJOR} == 10 && ${MINOR} == 4} { + + configure.args-append -carbon + + } elseif {${MAJOR} == 10 && ${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 {${MAJOR} == 10 && ${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 + + } + + # on Leopard and Snow Leopard with libc++ForOlderSystems + # installed, SDK must be unset as we can only use system libraries + # also, a missing library link must be replaced for build to + # succeed: + platform darwin { + if {${os.major} == 9 || ${os.major} == 10} { + if {${configure.cxx_stdlib} eq "libc++"} { + set SDK "" + configure.ldflags-append "-lobjc" + } + } + } + + # 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"] + 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} + + # link pkg-config files to where they will be found automatically + if {${qt_libs_dir} ne "${prefix}/lib"} { + + set qt_pc_dir ${qt_libs_dir}/pkgconfig + set dr_lib_pc_dir ${destroot}${prefix}/lib/pkgconfig + xinstall -d -m 0755 ${destroot}${qt_pc_dir} + foreach pcfile [glob -nocomplain -tails -directory ${destroot}${qt_pc_dir} *.pc] { + ln -s ${qt_pc_dir}/${pcfile} ${dr_lib_pc_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++)} { + + compiler.cxx_standard 2011 + + 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." +} + +notes-append \ +"Users experiencing graphics glitches on newer OS versions (10.13 and up) can\ +experiment with different graphics drawing systems that can be set in the\ +Interface tab of the ${qt_apps_dir}/qtconfig.app utility. Raster mode is\ +the preferred mode but is not compatible with all non-standard widget styles.\ +Keep an eye on the Fonts setting before saving!" + +livecheck.type none + +# livecheck.type regex +# livecheck.url http://download.qt.io/official_releases/qt/${branch}/ +# livecheck.regex >(\[0-9.\]+)/< diff --git a/tools/MacPorts/aqua/qt4-mac/files/c++11.prf b/tools/MacPorts/aqua/qt4-mac/files/c++11.prf new file mode 100644 index 0000000000..a6509d97e2 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/c++11/c++11.test b/tools/MacPorts/aqua/qt4-mac/files/c++11/c++11.test new file mode 100755 index 0000000000..fd39829cca --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/c++11/c++11_test.cpp b/tools/MacPorts/aqua/qt4-mac/files/c++11/c++11_test.cpp new file mode 100644 index 0000000000..6f134e6fae --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/cpath/cpath.test b/tools/MacPorts/aqua/qt4-mac/files/cpath/cpath.test new file mode 100755 index 0000000000..c6da16d7c9 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.c b/tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.c new file mode 100644 index 0000000000..421000c67b --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.h b/tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.h new file mode 100644 index 0000000000..9ebc53a122 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/cpath/cpath_test.h @@ -0,0 +1 @@ +extern int test_cpath; diff --git a/tools/MacPorts/aqua/qt4-mac/files/fconstant_cfstrings.test b/tools/MacPorts/aqua/qt4-mac/files/fconstant_cfstrings.test new file mode 100755 index 0000000000..d3ce4dc5ed --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/library_path/library_path.test b/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path.test new file mode 100755 index 0000000000..9c3486a38b --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.c b/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.c new file mode 100644 index 0000000000..9a19658a90 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.c @@ -0,0 +1 @@ +int test_cpath; diff --git a/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.h b/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.h new file mode 100644 index 0000000000..9ebc53a122 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_lib.h @@ -0,0 +1 @@ +extern int test_cpath; diff --git a/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_test.c b/tools/MacPorts/aqua/qt4-mac/files/library_path/library_path_test.c new file mode 100644 index 0000000000..73379c81a5 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/objc_block/objc_block.test b/tools/MacPorts/aqua/qt4-mac/files/objc_block/objc_block.test new file mode 100755 index 0000000000..e2dcff9284 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/objc_block/objc_block_test.m b/tools/MacPorts/aqua/qt4-mac/files/objc_block/objc_block_test.m new file mode 100644 index 0000000000..2b0ea34692 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/objective_cxx.prf b/tools/MacPorts/aqua/qt4-mac/files/objective_cxx.prf new file mode 100644 index 0000000000..3a89947ab9 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff new file mode 100644 index 0000000000..cfe49a0acf --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-QtHelp_10.4_only.diff @@ -0,0 +1,145 @@ +--- tools/assistant/tools/assistant/assistant.pro.orig ++++ tools/assistant/tools/assistant/assistant.pro +@@ -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 ++++ tools/assistant/tools/qcollectiongenerator/qcollectiongenerator.pro +@@ -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 ++++ tools/assistant/tools/qhelpconverter/qhelpconverter.pro +@@ -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 ++++ tools/assistant/tools/qhelpgenerator/qhelpgenerator.pro +@@ -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 ++++ tools/designer/src/plugins/qwebview/qwebview.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-allow_libressl.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-allow_libressl.diff new file mode 100644 index 0000000000..600a18d8f2 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-allow_libressl.diff @@ -0,0 +1,63 @@ +--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig ++++ src/network/ssl/qsslsocket_openssl_symbols.cpp +@@ -228,13 +228,17 @@ + #ifndef OPENSSL_NO_SSL2 + DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return) + #endif ++#ifndef OPENSSL_NO_SSL3 + DEFINEFUNC(const SSL_METHOD *, SSLv3_client_method, DUMMYARG, DUMMYARG, return 0, return) ++#endif + DEFINEFUNC(const SSL_METHOD *, SSLv23_client_method, DUMMYARG, DUMMYARG, return 0, return) + DEFINEFUNC(const SSL_METHOD *, TLSv1_client_method, DUMMYARG, DUMMYARG, return 0, return) + #ifndef OPENSSL_NO_SSL2 + DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return) + #endif ++#ifndef OPENSSL_NO_SSL3 + DEFINEFUNC(const SSL_METHOD *, SSLv3_server_method, DUMMYARG, DUMMYARG, return 0, return) ++#endif + DEFINEFUNC(const SSL_METHOD *, SSLv23_server_method, DUMMYARG, DUMMYARG, return 0, return) + DEFINEFUNC(const SSL_METHOD *, TLSv1_server_method, DUMMYARG, DUMMYARG, return 0, return) + #else +@@ -822,13 +826,17 @@ + #ifndef OPENSSL_NO_SSL2 + RESOLVEFUNC(SSLv2_client_method) + #endif ++#ifndef OPENSSL_NO_SSL3 + RESOLVEFUNC(SSLv3_client_method) ++#endif + RESOLVEFUNC(SSLv23_client_method) + RESOLVEFUNC(TLSv1_client_method) + #ifndef OPENSSL_NO_SSL2 + RESOLVEFUNC(SSLv2_server_method) + #endif ++#ifndef OPENSSL_NO_SSL3 + RESOLVEFUNC(SSLv3_server_method) ++#endif + RESOLVEFUNC(SSLv23_server_method) + RESOLVEFUNC(TLSv1_server_method) + RESOLVEFUNC(X509_NAME_entry_count) +--- src/network/ssl/qsslsocket_openssl.cpp.orig ++++ src/network/ssl/qsslsocket_openssl.cpp +@@ -267,15 +267,19 @@ + #endif + break; + case QSsl::SslV3: ++#ifndef OPENSSL_NO_SSL3 + ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method()); ++#else ++ ctx = 0; // SSL 3 not supported by the system, but chosen deliberately -> error ++#endif + break; +- case QSsl::SecureProtocols: // SslV2 will be disabled below +- case QSsl::TlsV1SslV3: // SslV2 will be disabled below + case QSsl::AnyProtocol: +- default: + ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method()); + break; + case QSsl::TlsV1: ++ case QSsl::SecureProtocols: ++ case QSsl::TlsV1SslV3: ++ default: + ctx = q_SSL_CTX_new(client ? q_TLSv1_client_method() : q_TLSv1_server_method()); + break; + } diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-better-invalid-fonttable-handling.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-better-invalid-fonttable-handling.diff new file mode 100644 index 0000000000..23d7b2f631 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-better-invalid-fonttable-handling.diff @@ -0,0 +1,650 @@ +--- src/gui/text/qfontengine.cpp.orig ++++ src/gui/text/qfontengine.cpp +@@ -69,6 +69,16 @@ + } + } + ++template ++static inline bool qSafeFromBigEndian(const uchar *source, const uchar *end, T *output) ++{ ++ if (source + sizeof(T) > end) ++ return false; ++ ++ *output = qFromBigEndian(source); ++ return true; ++} ++ + // Harfbuzz helper functions + + static HB_Bool hb_stringToGlyphs(HB_Font font, const HB_UChar16 *string, hb_uint32 length, HB_Glyph *glyphs, hb_uint32 *numGlyphs, HB_Bool rightToLeft) +@@ -808,26 +818,38 @@ + return; + + const uchar *table = reinterpret_cast(tab.constData()); ++ const uchar *end = table + tab.size(); ++ ++ quint16 version; ++ if (!qSafeFromBigEndian(table, end, &version)) ++ return; + +- unsigned short version = qFromBigEndian(table); + if (version != 0) { + // qDebug("wrong version"); + return; + } + +- unsigned short numTables = qFromBigEndian(table + 2); ++ quint16 numTables; ++ if (!qSafeFromBigEndian(table + 2, end, &numTables)) ++ return; ++ + { + int offset = 4; + for(int i = 0; i < numTables; ++i) { +- if (offset + 6 > tab.size()) { +-// qDebug("offset out of bounds"); +- goto end; +- } + const uchar *header = table + offset; + +- ushort version = qFromBigEndian(header); +- ushort length = qFromBigEndian(header+2); +- ushort coverage = qFromBigEndian(header+4); ++ quint16 version; ++ if (!qSafeFromBigEndian(header, end, &version)) ++ goto end; ++ ++ quint16 length; ++ if (!qSafeFromBigEndian(header + 2, end, &length)) ++ goto end; ++ ++ quint16 coverage; ++ if (!qSafeFromBigEndian(header + 4, end, &coverage)) ++ goto end; ++ + // qDebug("subtable: version=%d, coverage=%x",version, coverage); + if(version == 0 && coverage == 0x0001) { + if (offset + length > tab.size()) { +@@ -836,7 +858,10 @@ + } + const uchar *data = table + offset + 6; + +- ushort nPairs = qFromBigEndian(data); ++ quint16 nPairs; ++ if (!qSafeFromBigEndian(data, end, &nPairs)) ++ goto end; ++ + if(nPairs * 6 + 8 > length - 6) { + // qDebug("corrupt table!"); + // corrupt table +@@ -846,8 +871,21 @@ + int off = 8; + for(int i = 0; i < nPairs; ++i) { + QFontEngine::KernPair p; +- p.left_right = (((uint)qFromBigEndian(data+off)) << 16) + qFromBigEndian(data+off+2); +- p.adjust = QFixed(((int)(short)qFromBigEndian(data+off+4))) / scalingFactor; ++ ++ quint16 tmp; ++ if (!qSafeFromBigEndian(data + off, end, &tmp)) ++ goto end; ++ ++ p.left_right = uint(tmp) << 16; ++ if (!qSafeFromBigEndian(data + off + 2, end, &tmp)) ++ goto end; ++ ++ p.left_right |= tmp; ++ ++ if (!qSafeFromBigEndian(data + off + 4, end, &tmp)) ++ goto end; ++ ++ p.adjust = QFixed(int(short(tmp))) / scalingFactor; + kerning_pairs.append(p); + off += 6; + } +@@ -872,26 +910,31 @@ + QByteArray maxpTable = getSfntTable(MAKE_TAG('m', 'a', 'x', 'p')); + if (maxpTable.size() < 6) + return 0; +- return qFromBigEndian(reinterpret_cast(maxpTable.constData() + 4)); ++ ++ const uchar *source = reinterpret_cast(maxpTable.constData() + 4); ++ const uchar *end = source + maxpTable.size(); ++ ++ quint16 count = 0; ++ qSafeFromBigEndian(source, end, &count); ++ return count; + } + + const uchar *QFontEngine::getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize) + { + const uchar *header = table; +- if (tableSize < 4) +- return 0; +- + const uchar *endPtr = table + tableSize; + + // version check +- if (qFromBigEndian(header) != 0) ++ quint16 version; ++ if (!qSafeFromBigEndian(header, endPtr, &version) || version != 0) + return 0; + +- unsigned short numTables = qFromBigEndian(header + 2); +- const uchar *maps = table + 4; +- if (maps + 8 * numTables > endPtr) ++ quint16 numTables; ++ if (!qSafeFromBigEndian(header + 2, endPtr, &numTables)) + return 0; + ++ const uchar *maps = table + 4; ++ + enum { + Invalid, + AppleRoman, +@@ -906,8 +949,14 @@ + int tableToUse = -1; + int score = Invalid; + for (int n = 0; n < numTables; ++n) { +- const quint16 platformId = qFromBigEndian(maps + 8 * n); +- const quint16 platformSpecificId = qFromBigEndian(maps + 8 * n + 2); ++ quint16 platformId; ++ if (!qSafeFromBigEndian(maps + 8 * n, endPtr, &platformId)) ++ return 0; ++ ++ quint16 platformSpecificId; ++ if (!qSafeFromBigEndian(maps + 8 * n + 2, endPtr, &platformSpecificId)) ++ return 0; ++ + switch (platformId) { + case 0: // Unicode + if (score < Unicode && +@@ -961,20 +1010,30 @@ + resolveTable: + *isSymbolFont = (symbolTable > -1); + +- unsigned int unicode_table = qFromBigEndian(maps + 8*tableToUse + 4); ++ quint32 unicode_table; ++ if (!qSafeFromBigEndian(maps + 8 * tableToUse + 4, endPtr, &unicode_table)) ++ return 0; + +- if (!unicode_table || unicode_table + 8 > tableSize) ++ if (!unicode_table) + return 0; + + // get the header of the unicode table + header = table + unicode_table; + +- unsigned short format = qFromBigEndian(header); +- unsigned int length; +- if(format < 8) +- length = qFromBigEndian(header + 2); +- else +- length = qFromBigEndian(header + 4); ++ quint16 format; ++ if (!qSafeFromBigEndian(header, endPtr, &format)) ++ return 0; ++ ++ quint32 length; ++ if (format < 8) { ++ quint16 tmp; ++ if (!qSafeFromBigEndian(header + 2, endPtr, &tmp)) ++ return 0; ++ length = tmp; ++ } else { ++ if (!qSafeFromBigEndian(header + 4, endPtr, &length)) ++ return 0; ++ } + + if (table + unicode_table + length > endPtr) + return 0; +@@ -989,7 +1048,7 @@ + // Check that none of the latin1 range are in the unicode table + bool unicodeTableHasLatin1 = false; + for (int uc=0x00; uc<0x100; ++uc) { +- if (getTrueTypeGlyphIndex(selectedTable, uc) != 0) { ++ if (getTrueTypeGlyphIndex(selectedTable, length, uc) != 0) { + unicodeTableHasLatin1 = true; + break; + } +@@ -999,7 +1058,7 @@ + bool unicodeTableHasSymbols = false; + if (!unicodeTableHasLatin1) { + for (int uc=0xf000; uc<0xf100; ++uc) { +- if (getTrueTypeGlyphIndex(selectedTable, uc) != 0) { ++ if (getTrueTypeGlyphIndex(selectedTable, length, uc) != 0) { + unicodeTableHasSymbols = true; + break; + } +@@ -1017,12 +1076,17 @@ + return table + unicode_table; + } + +-quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, uint unicode) ++quint32 QFontEngine::getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint unicode) + { +- unsigned short format = qFromBigEndian(cmap); ++ const uchar *end = cmap + cmapSize; ++ quint16 format; ++ if (!qSafeFromBigEndian(cmap, end, &format)) ++ return 0; ++ + if (format == 0) { +- if (unicode < 256) +- return (int) *(cmap+6+unicode); ++ const uchar *ptr = cmap + 6 + unicode; ++ if (unicode < 256 && ptr < end) ++ return quint32(*ptr); + } else if (format == 4) { + /* some fonts come with invalid cmap tables, where the last segment + specified end = start = rangeoffset = 0xffff, delta = 0x0001 +@@ -1031,25 +1095,49 @@ + */ + if(unicode >= 0xffff) + return 0; +- quint16 segCountX2 = qFromBigEndian(cmap + 6); ++ ++ quint16 segCountX2; ++ if (!qSafeFromBigEndian(cmap + 6, end, &segCountX2)) ++ return 0; ++ + const unsigned char *ends = cmap + 14; ++ + int i = 0; +- for (; i < segCountX2/2 && qFromBigEndian(ends + 2*i) < unicode; i++) {} ++ for (; i < segCountX2/2; ++i) { ++ quint16 codePoint; ++ if (!qSafeFromBigEndian(ends + 2 * i, end, &codePoint)) ++ return 0; ++ if (codePoint >= unicode) ++ break; ++ } + + const unsigned char *idx = ends + segCountX2 + 2 + 2*i; +- quint16 startIndex = qFromBigEndian(idx); + ++ quint16 startIndex; ++ if (!qSafeFromBigEndian(idx, end, &startIndex)) ++ return 0; + if (startIndex > unicode) + return 0; + + idx += segCountX2; +- qint16 idDelta = (qint16)qFromBigEndian(idx); ++ ++ quint16 tmp; ++ if (!qSafeFromBigEndian(idx, end, &tmp)) ++ return 0; ++ qint16 idDelta = qint16(tmp); ++ + idx += segCountX2; +- quint16 idRangeoffset_t = (quint16)qFromBigEndian(idx); ++ ++ quint16 idRangeoffset_t; ++ if (!qSafeFromBigEndian(idx, end, &idRangeoffset_t)) ++ return 0; + + quint16 glyphIndex; + if (idRangeoffset_t) { +- quint16 id = qFromBigEndian(idRangeoffset_t + 2*(unicode - startIndex) + idx); ++ quint16 id; ++ if (!qSafeFromBigEndian(idRangeoffset_t + 2 * (unicode - startIndex) + idx, end, &id)) ++ return 0; ++ + if (id) + glyphIndex = (idDelta + id) % 0x10000; + else +@@ -1059,13 +1147,19 @@ + } + return glyphIndex; + } else if (format == 6) { +- quint16 tableSize = qFromBigEndian(cmap + 2); ++ quint16 tableSize; ++ if (!qSafeFromBigEndian(cmap + 2, end, &tableSize)) ++ return 0; + +- quint16 firstCode6 = qFromBigEndian(cmap + 6); ++ quint16 firstCode6; ++ if (!qSafeFromBigEndian(cmap + 6, end, &firstCode6)) ++ return 0; + if (unicode < firstCode6) + return 0; + +- quint16 entryCount6 = qFromBigEndian(cmap + 8); ++ quint16 entryCount6; ++ if (!qSafeFromBigEndian(cmap + 8, end, &entryCount6)) ++ return 0; + if (entryCount6 * 2 + 10 > tableSize) + return 0; + +@@ -1074,9 +1168,14 @@ + return 0; + + quint16 entryIndex6 = unicode - firstCode6; +- return qFromBigEndian(cmap + 10 + (entryIndex6 * 2)); ++ ++ quint16 index = 0; ++ qSafeFromBigEndian(cmap + 10 + (entryIndex6 * 2), end, &index); ++ return index; + } else if (format == 12) { +- quint32 nGroups = qFromBigEndian(cmap + 12); ++ quint32 nGroups; ++ if (!qSafeFromBigEndian(cmap + 12, end, &nGroups)) ++ return 0; + + cmap += 16; // move to start of groups + +@@ -1084,13 +1183,24 @@ + while (left <= right) { + int middle = left + ( ( right - left ) >> 1 ); + +- quint32 startCharCode = qFromBigEndian(cmap + 12*middle); ++ quint32 startCharCode; ++ if (!qSafeFromBigEndian(cmap + 12 * middle, end, &startCharCode)) ++ return 0; ++ + if(unicode < startCharCode) + right = middle - 1; + else { +- quint32 endCharCode = qFromBigEndian(cmap + 12*middle + 4); +- if(unicode <= endCharCode) +- return qFromBigEndian(cmap + 12*middle + 8) + unicode - startCharCode; ++ quint32 endCharCode; ++ if (!qSafeFromBigEndian(cmap + 12 * middle + 4, end, &endCharCode)) ++ return 0; ++ ++ if (unicode <= endCharCode) { ++ quint32 index; ++ if (!qSafeFromBigEndian(cmap + 12 * middle + 8, end, &index)) ++ return 0; ++ ++ return index + unicode - startCharCode; ++ } + left = middle + 1; + } + } +--- src/gui/text/qfontengine_mac.mm.orig ++++ src/gui/text/qfontengine_mac.mm +@@ -625,7 +625,7 @@ + } + + QFontEngineMac::QFontEngineMac(ATSUStyle baseStyle, ATSUFontID fontID, const QFontDef &def, QFontEngineMacMulti *multiEngine) +- : fontID(fontID), multiEngine(multiEngine), cmap(0), symbolCMap(false) ++ : fontID(fontID), multiEngine(multiEngine), cmap(0), symbolCMap(false), cmapSize(0) + { + fontDef = def; + ATSUCreateAndCopyStyle(baseStyle, &style); +@@ -747,22 +747,21 @@ + { + if (!cmap) { + cmapTable = getSfntTable(MAKE_TAG('c', 'm', 'a', 'p')); +- int size = 0; +- cmap = getCMap(reinterpret_cast(cmapTable.constData()), cmapTable.size(), &symbolCMap, &size); ++ cmap = getCMap(reinterpret_cast(cmapTable.constData()), cmapTable.size(), &symbolCMap, &cmapSize); + if (!cmap) + return false; + } + if (symbolCMap) { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(str, i, len); +- glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if(!glyphs->glyphs[i] && uc < 0x100) +- glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + } + } else { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(str, i, len); +- glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[i] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + } + } + +--- src/gui/text/qfontengine_mac_p.h.orig ++++ src/gui/text/qfontengine_mac_p.h +@@ -108,6 +108,7 @@ + qreal m_maxCharWidth; + QFixed m_xHeight; + QFixed m_averageCharWidth; ++ mutable int cmapSize; + }; + + class QFontEngineMacMulti : public QFontEngineMulti +--- src/gui/text/qfontengine_p.h.orig ++++ src/gui/text/qfontengine_p.h +@@ -247,7 +247,7 @@ + QFontEngineGlyphCache *glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const; + + static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize); +- static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode); ++ static quint32 getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint unicode); + + static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily); + +--- src/gui/text/qfontengine_qpa.cpp.orig ++++ src/gui/text/qfontengine_qpa.cpp +@@ -358,9 +358,9 @@ + unsigned int uc = getChar(str, i, len); + if (mirrored) + uc = QChar::mirroredChar(uc); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if(!glyphs->glyphs[glyph_pos] && uc < 0x100) +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + ++glyph_pos; + } + } else { +@@ -368,7 +368,7 @@ + unsigned int uc = getChar(str, i, len); + if (mirrored) + uc = QChar::mirroredChar(uc); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + #if 0 && defined(DEBUG_FONTENGINE) + QChar c(uc); + if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c)) +@@ -511,16 +511,16 @@ + if (symbol) { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(string, i, len); +- glyph_t g = getTrueTypeGlyphIndex(cmap, uc); ++ glyph_t g = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if(!g && uc < 0x100) +- g = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ g = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + if (!g) + return false; + } + } else { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(string, i, len); +- if (!getTrueTypeGlyphIndex(cmap, uc)) ++ if (!getTrueTypeGlyphIndex(cmap, cmapSize, uc)) + return false; + } + } +--- src/gui/text/qfontengine_qpf.cpp.orig ++++ src/gui/text/qfontengine_qpf.cpp +@@ -577,9 +577,9 @@ + if (symbol) { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(str, i, len); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if(!glyphs->glyphs[glyph_pos] && uc < 0x100) +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + ++glyph_pos; + } + } else { +@@ -587,7 +587,7 @@ + unsigned int uc = getChar(str, i, len); + if (mirrored) + uc = QChar::mirroredChar(uc); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + #if 0 && defined(DEBUG_FONTENGINE) + QChar c(uc); + if (!findGlyph(glyphs[glyph_pos].glyph) && !seenGlyphs.contains(c)) +@@ -786,16 +786,16 @@ + if (symbol) { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(string, i, len); +- glyph_t g = getTrueTypeGlyphIndex(cmap, uc); ++ glyph_t g = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if(!g && uc < 0x100) +- g = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ g = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + if (!g) + return false; + } + } else { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(string, i, len); +- if (!getTrueTypeGlyphIndex(cmap, uc)) ++ if (!getTrueTypeGlyphIndex(cmap, cmapSize, uc)) + return false; + } + } +--- src/gui/text/qfontengine_s60.cpp.orig ++++ src/gui/text/qfontengine_s60.cpp +@@ -77,6 +77,7 @@ + : m_cFont(cFont) + , m_symbolCMap(false) + , m_openFont(openFont) ++ , m_cmapSize(0) + { + if (!symbianFontTableApiAvailable()) { + TAny *trueTypeExtension = NULL; +@@ -161,10 +162,9 @@ + { + if (m_cmapTable.isNull()) { + const QByteArray cmapTable = getSfntTable(MAKE_TAG('c', 'm', 'a', 'p')); +- int size = 0; + const uchar *cmap = QFontEngine::getCMap(reinterpret_cast +- (cmapTable.constData()), cmapTable.size(), &m_symbolCMap, &size); +- m_cmapTable = QByteArray(reinterpret_cast(cmap), size); ++ (cmapTable.constData()), cmapTable.size(), &m_symbolCMap, &m_cmapSize); ++ m_cmapTable = QByteArray(reinterpret_cast(cmap), m_cmapSize); + } + return reinterpret_cast(m_cmapTable.constData()); + } +@@ -324,6 +324,7 @@ + for (int i = 0; i < len; ++i) { + const unsigned int uc = getChar(characters, i, len); + *g++ = QFontEngine::getTrueTypeGlyphIndex(cmap, ++ m_cmapSize, + (isRtl && !m_extras->isSymbolCMap()) ? QChar::mirroredChar(uc) : uc); + } + +@@ -463,7 +464,7 @@ + const unsigned char *cmap = m_extras->cmap(); + for (int i = 0; i < len; ++i) { + const unsigned int uc = getChar(string, i, len); +- if (QFontEngine::getTrueTypeGlyphIndex(cmap, uc) == 0) ++ if (QFontEngine::getTrueTypeGlyphIndex(cmap, m_cmapSize, uc) == 0) + return false; + } + return true; +--- src/gui/text/qfontengine_s60_p.h.orig ++++ src/gui/text/qfontengine_s60_p.h +@@ -93,6 +93,7 @@ + // the Font Table API + COpenFont *m_openFont; + mutable MOpenFontTrueTypeExtension *m_trueTypeExtension; ++ mutable int m_cmapSize; + }; + + class QFontEngineS60 : public QFontEngine +--- src/gui/text/qfontengine_win.cpp.orig ++++ src/gui/text/qfontengine_win.cpp +@@ -215,9 +215,8 @@ + bool symb = false; + if (ttf) { + cmapTable = getSfntTable(qbswap(MAKE_TAG('c', 'm', 'a', 'p'))); +- int size = 0; + cmap = QFontEngine::getCMap(reinterpret_cast(cmapTable.constData()), +- cmapTable.size(), &symb, &size); ++ cmapTable.size(), &symb, &cmapSize); + } + if (!cmap) { + ttf = false; +@@ -263,14 +262,14 @@ + if (symbol) { + for (; i < numChars; ++i, ++glyph_pos) { + unsigned int uc = getChar(str, i, numChars); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if (!glyphs->glyphs[glyph_pos] && uc < 0x100) +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + } + } else if (ttf) { + for (; i < numChars; ++i, ++glyph_pos) { + unsigned int uc = getChar(str, i, numChars); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, QChar::mirroredChar(uc)); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, QChar::mirroredChar(uc)); + } + } else { + #endif +@@ -296,14 +295,14 @@ + if (symbol) { + for (; i < numChars; ++i, ++glyph_pos) { + unsigned int uc = getChar(str, i, numChars); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + if(!glyphs->glyphs[glyph_pos] && uc < 0x100) +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc + 0xf000); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000); + } + } else if (ttf) { + for (; i < numChars; ++i, ++glyph_pos) { + unsigned int uc = getChar(str, i, numChars); +- glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, uc); ++ glyphs->glyphs[glyph_pos] = getTrueTypeGlyphIndex(cmap, cmapSize, uc); + } + } else { + #endif +@@ -335,6 +334,7 @@ + _name = name; + + cmap = 0; ++ cmapSize = 0; + hfont = _hfont; + logfont = lf; + HDC hdc = shared_dc(); +@@ -811,9 +811,9 @@ + if (symbol) { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(string, i, len); +- if (getTrueTypeGlyphIndex(cmap, uc) == 0) { ++ if (getTrueTypeGlyphIndex(cmap, cmapSize, uc) == 0) { + if (uc < 0x100) { +- if (getTrueTypeGlyphIndex(cmap, uc + 0xf000) == 0) ++ if (getTrueTypeGlyphIndex(cmap, cmapSize, uc + 0xf000) == 0) + return false; + } else { + return false; +@@ -823,7 +823,7 @@ + } else if (ttf) { + for (int i = 0; i < len; ++i) { + unsigned int uc = getChar(string, i, len); +- if (getTrueTypeGlyphIndex(cmap, uc) == 0) ++ if (getTrueTypeGlyphIndex(cmap, cmapSize, uc) == 0) + return false; + } + } else { +--- src/gui/text/qfontengine_win_p.h.orig ++++ src/gui/text/qfontengine_win_p.h +@@ -144,6 +144,7 @@ + mutable uint widthCacheSize; + mutable QFixed *designAdvances; + mutable int designAdvancesSize; ++ int cmapSize; + + private: + bool hasCFFTable() const; +-- +2.10.2 + diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-compiler_standard.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-compiler_standard.diff new file mode 100644 index 0000000000..7878eea66d --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-compiler_standard.diff @@ -0,0 +1,16 @@ +--- configure.orig 2019-11-03 08:14:10.000000000 -0700 ++++ configure 2019-11-03 08:21:30.000000000 -0700 +@@ -8030,6 +8030,13 @@ + QMAKE_CONFIG="$QMAKE_CONFIG exceptions_off" + fi + ++if [ "$PLATFORM_MAC" = "yes" ]; then ++ QMakeVar add QMAKE_CFLAGS "-std=c99" ++ QMakeVar add QMAKE_CXXFLAGS "-std=c++98" ++ QMakeVar add QMAKE_OBJECTIVE_CFLAGS "-std=c99" ++ QMakeVar add QMAKE_OBJECTIVE_CXXFLAGS "-std=c++98" ++fi ++ + # On Mac, set the minimum deployment target for the different architechtures + # using the Xarch compiler option when supported (10.5 and up). On 10.4 the + # deployment version is set to 10.4 globally using the QMAKE_MACOSX_DEPLOYMENT_TARGET diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff new file mode 100644 index 0000000000..dd26f83188 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_compile.test.diff @@ -0,0 +1,11 @@ +--- config.tests/unix/compile.test.orig ++++ config.tests/unix/compile.test +@@ -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/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff new file mode 100644 index 0000000000..c0672c5098 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-config.tests_unix_precomp.test.diff @@ -0,0 +1,22 @@ +--- config.tests/unix/precomp.test.orig ++++ config.tests/unix/precomp.test +@@ -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/MacPorts/aqua/qt4-mac/files/patch-configure.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-configure.diff new file mode 100644 index 0000000000..10301ed880 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-configure.diff @@ -0,0 +1,353 @@ +--- configure.orig ++++ configure +@@ -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/MacPorts/aqua/qt4-mac/files/patch-cxx11.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-cxx11.diff new file mode 100644 index 0000000000..64f5dbc8e5 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-cxx11.diff @@ -0,0 +1,594 @@ +--- src/gui/kernel/qcursor_mac.mm.orig ++++ src/gui/kernel/qcursor_mac.mm +@@ -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 ++++ src/gui/kernel/qcocoaview_mac.mm +@@ -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 ++++ src/gui/kernel/qt_cocoa_helpers_mac.mm +@@ -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 ++++ src/gui/accessible/qaccessible_mac.mm +@@ -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 ++++ src/gui/styles/qmacstyle_mac.mm +@@ -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 ++++ src/gui/text/qtextdocument_p.cpp +@@ -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 ++++ src/gui/widgets/qdialogbuttonbox.cpp +@@ -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 ++++ src/qt3support/other/q3dragobject.cpp +@@ -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 ++++ src/openvg/qpaintengine_vg.cpp +@@ -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 ++++ src/openvg/qpixmapdata_vg.cpp +@@ -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 ++++ src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.h +@@ -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 ++++ src/3rdparty/javascriptcore/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +@@ -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 ++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/Identifier.cpp +@@ -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 ++++ src/3rdparty/javascriptcore/JavaScriptCore/runtime/JSONObject.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/NullPtr.h +@@ -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 ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/text/AtomicString.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/Identifier.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/StringPrototype.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/JavaScriptCore/runtime/JSONObject.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/WebCore/dom/DocumentMarkerController.cpp +@@ -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 ++++ src/3rdparty/webkit/Source/WebCore/dom/Element.cpp +@@ -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 ++++ src/plugins/accessible/widgets/itemviews.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-darwin-g++.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-darwin-g++.diff new file mode 100644 index 0000000000..66bcd68b2b --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-darwin-g++.diff @@ -0,0 +1,20 @@ +--- configure_orig ++++ configure +@@ -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/MacPorts/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff new file mode 100644 index 0000000000..4ed86aaa41 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-fix_pointer_comparison_to_0.diff @@ -0,0 +1,22 @@ +--- src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp +@@ -74,7 +74,7 @@ + RefPtr image = adoptRef(new HTMLImageElement(imgTag, document)); + if (optionalWidth) + image->setWidth(*optionalWidth); +- if (optionalHeight > 0) ++ if (optionalHeight) + image->setHeight(*optionalHeight); + return image.release(); + } +--- tools/linguist/linguist/messagemodel.cpp.orig ++++ tools/linguist/linguist/messagemodel.cpp +@@ -183,7 +183,7 @@ + if (ContextItem *c = one->findContext(oc->context())) { + for (int j = 0; j < oc->messageCount(); ++j) { + MessageItem *m = oc->messageItem(j); +- if (c->findMessage(m->text(), m->comment()) >= 0) ++ if (c->findMessage(m->text(), m->comment())) + ++inBoth; + } + } diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-graphicssystem-via-qtconfig.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-graphicssystem-via-qtconfig.diff new file mode 100644 index 0000000000..bba678debb --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-graphicssystem-via-qtconfig.diff @@ -0,0 +1,122 @@ +diff --git src/gui/kernel/qapplication.cpp src/gui/kernel/qapplication.cpp +index 22da34e0154a5b37566f38c514648a9125ee5771..3efa5433eb2801bed7e2a5f1bcf8ae609ed88d86 100644 +--- src/gui/kernel/qapplication.cpp ++++ src/gui/kernel/qapplication.cpp +@@ -818,9 +818,19 @@ void QApplicationPrivate::construct( + + qt_is_gui_used = (qt_appType != QApplication::Tty); + process_cmdline(); +- // the environment variable has the lowest precedence of runtime graphicssystem switches ++ // the environment variable has almost the lowest precedence of runtime graphicssystem switches + if (graphics_system_name.isEmpty()) + graphics_system_name = QString::fromLocal8Bit(qgetenv("QT_GRAPHICSSYSTEM")); ++ if (graphics_system_name.isEmpty()) { ++ // Fetch the default graphics system from the settings store if no other setting has been made ++ QSettings settings(QSettings::UserScope, QLatin1String("Trolltech")); ++ settings.beginGroup(QLatin1String("Qt")); ++ const QString defaultGraphicsSystem = settings.value(QLatin1String("DefaultGraphicsSystem")).toString(); ++ if (! defaultGraphicsSystem.isNull() && ! defaultGraphicsSystem.isEmpty()) { ++ graphics_system_name = defaultGraphicsSystem; ++ } ++ } ++ + + #if defined(Q_WS_X11) && !defined(QT_NO_EGL) + if (graphics_system_name.isEmpty()) { +diff --git tools/qtconfig/main.cpp tools/qtconfig/main.cpp +index a0f5dd6ed3cc204f61041bc65f96b1af88bdbb97..1cbb8538d5c8706b223e89fcaca70e9000db1c8b 100644 +--- tools/qtconfig/main.cpp ++++ tools/qtconfig/main.cpp +@@ -51,6 +51,13 @@ int main(int argc, char **argv) + { + Q_INIT_RESOURCE(qtconfig); + ++ const QByteArray graphicsSystem = qgetenv("QT_GRAPHICSSYSTEM"); ++ if (graphicsSystem.isNull() || graphicsSystem.isEmpty()) { ++ // force native graphics mode unless the user set one via QT_GRAPHICSSYSTEM. ++ // We have to use QT_GRAPHICSSYSTEM because that will override any previous ++ // settings stored in our own settings store. ++ qputenv("QT_GRAPHICSSYSTEM", "Native"); ++ } + QApplication app(argc, argv); + + QTranslator translator; +diff --git tools/qtconfig/mainwindow.cpp tools/qtconfig/mainwindow.cpp +index 1bb6e4eae01fd43d9de41d627677abc8521908d8..e1726fb174c406311bf132d4f6c70ba3016a4c41 100644 +--- tools/qtconfig/mainwindow.cpp ++++ tools/qtconfig/mainwindow.cpp +@@ -227,6 +238,7 @@ MainWindow::MainWindow() + connect(ui->rtlExtensionsCheckBox, SIGNAL(toggled(bool)), SLOT(somethingModified())); + connect(ui->inputStyleCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->inputMethodCombo, SIGNAL(activated(int)), SLOT(somethingModified())); ++ connect(ui->graphicsSystemCombo, SIGNAL(activated(int)), SLOT(somethingModified())); + connect(ui->guiStyleCombo, SIGNAL(activated(QString)), SLOT(styleSelected(QString))); + connect(ui->familySubstitutionCombo, SIGNAL(activated(QString)), SLOT(substituteSelected(QString))); + connect(ui->tunePaletteButton, SIGNAL(clicked()), SLOT(tunePalette())); +@@ -416,7 +463,26 @@ MainWindow::MainWindow() + ui->inputMethodCombo->hide(); + ui->inputMethodLabel->hide(); + #endif +- ++#ifdef Q_OS_MAC ++ ui->graphicsSystemCombo->setToolTip(tr("Select the graphicsssystem to be used by default.\n" ++ "Native: use native CoreGraphics rendering\n" ++ "Raster: use raster graphics\n" ++ "OpenGL: use OpenGL (experimental!)\n" ++ "Raster mode is the preferred default except on Mac OS 10.14 and newer where it causes flickering.\n" ++ "Use Native rendering on those newer OS versions (or if you experience other graphics glitches).\n" ++ "Note that Raster mode is not compatible with certain built-in widget styles like CDE or Plastique.")); ++ QStringList graphicsSystems; ++ QString defaultGraphicsSystem = settings.value(QLatin1String("DefaultGraphicsSystem"), QLatin1String("(unset)")).toString(); ++ ++ graphicsSystems << "(unset)" << "Native" << "Raster" << "OpenGL"; ++ ui->graphicsSystemCombo->addItems(graphicsSystems); ++ if (!defaultGraphicsSystem.isNull() && !defaultGraphicsSystem.isEmpty()) { ++ ui->graphicsSystemCombo->setCurrentIndex(graphicsSystems.indexOf(QRegExp(defaultGraphicsSystem, Qt::CaseInsensitive))); ++ } ++#else ++ ui->graphicsSystemLabel->hide(); ++ ui->graphicsSystemCombo->hide(); ++#endif + ui->fontEmbeddingCheckBox->setChecked(settings.value(QLatin1String("embedFonts"), true) + .toBool()); + fontpaths = settings.value(QLatin1String("fontPath")).toStringList(); +@@ -573,6 +639,13 @@ void MainWindow::fileSave() + #if defined(Q_WS_X11) && !defined(QT_NO_XIM) + settings.setValue(QLatin1String("DefaultInputMethod"), ui->inputMethodCombo->currentText()); + #endif ++#ifdef Q_OS_MAC ++ if (ui->graphicsSystemCombo->currentIndex() > 0) { ++ settings.setValue(QLatin1String("DefaultGraphicsSystem"), ui->graphicsSystemCombo->currentText()); ++ } else { ++ settings.remove(QLatin1String("DefaultGraphicsSystem")); ++ } ++#endif + + QString audioSink = settings.value(QLatin1String("audiosink"), QLatin1String("Auto")).toString(); + QString videoMode = settings.value(QLatin1String("videomode"), QLatin1String("Auto")).toString(); +diff --git tools/qtconfig/mainwindow.ui tools/qtconfig/mainwindow.ui +index 454021ecdf2c00b29b9f2b86a2a68893da57b572..7593f7140b8ad73b1c615439dd4b473e37b3e9a7 100644 +--- tools/qtconfig/mainwindow.ui ++++ tools/qtconfig/mainwindow.ui +@@ -901,6 +901,20 @@ + + + ++ ++ ++ ++ Default Graphics System: ++ ++ ++ ++ ++ ++ ++ -1 ++ ++ ++ + + + diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff new file mode 100644 index 0000000000..c67cb4a869 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-base.conf.diff @@ -0,0 +1,26 @@ +--- mkspecs/common/g++-base.conf.orig ++++ mkspecs/common/g++-base.conf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff new file mode 100644 index 0000000000..4f316c7f64 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_g++-macx.conf.diff @@ -0,0 +1,25 @@ +--- mkspecs/common/g++-macx.conf.orig ++++ mkspecs/common/g++-macx.conf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff new file mode 100644 index 0000000000..8a1173381e --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_common_mac.conf.diff @@ -0,0 +1,23 @@ +--- mkspecs/common/mac.conf.orig ++++ mkspecs/common/mac.conf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff new file mode 100644 index 0000000000..6867167880 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_darwin-g++_qmake.conf.diff @@ -0,0 +1,158 @@ +--- mkspecs/darwin-g++/qmake.conf.orig ++++ mkspecs/darwin-g++/qmake.conf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff new file mode 100644 index 0000000000..ccebe10f59 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_moc.prf.diff @@ -0,0 +1,18 @@ +--- mkspecs/features/moc.prf.orig ++++ mkspecs/features/moc.prf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff new file mode 100644 index 0000000000..f2c40a4d73 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt.prf.diff @@ -0,0 +1,62 @@ +--- mkspecs/features/qt.prf.orig ++++ mkspecs/features/qt.prf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff new file mode 100644 index 0000000000..e1b5ab2d24 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_qt_functions.prf.diff @@ -0,0 +1,204 @@ +--- mkspecs/features/qt_functions.prf.orig ++++ mkspecs/features/qt_functions.prf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff new file mode 100644 index 0000000000..28855bc961 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_features_uitools.prf.diff @@ -0,0 +1,29 @@ +--- mkspecs/features/uitools.prf.orig ++++ mkspecs/features/uitools.prf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff new file mode 100644 index 0000000000..f05afa92dd --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_macx-g++_qmake.conf.diff @@ -0,0 +1,11 @@ +--- mkspecs/macx-g++/qmake.conf.orig ++++ mkspecs/macx-g++/qmake.conf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff new file mode 100644 index 0000000000..288c57f5c7 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-mkspecs_objective_cxx.diff @@ -0,0 +1,166 @@ +--- mkspecs/common/gcc-base-macx.conf.orig ++++ mkspecs/common/gcc-base-macx.conf +@@ -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 ++++ mkspecs/features/debug.prf +@@ -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 ++++ mkspecs/features/mac/default_post.prf +@@ -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 ++++ mkspecs/features/mac/objective_c.prf +@@ -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 ++++ mkspecs/features/mac/ppc.prf +@@ -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 ++++ mkspecs/features/mac/ppc64.prf +@@ -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 ++++ mkspecs/features/mac/sdk.prf +@@ -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 ++++ mkspecs/features/mac/x86.prf +@@ -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 ++++ mkspecs/features/mac/x86_64.prf +@@ -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 ++++ mkspecs/features/release.prf +@@ -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 ++++ mkspecs/features/unix/hide_symbols.prf +@@ -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 ++++ mkspecs/features/warn_off.prf +@@ -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 ++++ mkspecs/features/warn_on.prf +@@ -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/MacPorts/aqua/qt4-mac/files/patch-nis.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-nis.diff new file mode 100644 index 0000000000..9daacbc465 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-nis.diff @@ -0,0 +1,10 @@ +--- config.tests/unix/nis/nis.cpp.orig 2015-05-07 07:14:42.000000000 -0700 ++++ config.tests/unix/nis/nis.cpp 2019-11-04 10:14:47.000000000 -0700 +@@ -41,6 +41,7 @@ + + #include + #include ++#define BOOL_DEFINED + #include + #include + diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-parallelize_qmake_build.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-parallelize_qmake_build.diff new file mode 100644 index 0000000000..bf162424a1 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-parallelize_qmake_build.diff @@ -0,0 +1,29 @@ +--- configurel.orig ++++ configure +@@ -1087,6 +1087,7 @@ + #------------------------------------------------------------------------------- + # parse command line arguments + #------------------------------------------------------------------------------- ++JOBS= + + # parse the arguments, setting things to "yes" or "no" + while [ "$#" -gt 0 ]; do +@@ -2538,6 +2539,9 @@ + UNKNOWN_OPT=yes + fi + ;; ++ jobs) ++ JOBS=-j$VAL ++ ;; + *) + UNKNOWN_OPT=yes + ;; +@@ -5137,7 +5141,7 @@ + done + + QMAKE_BUILD_ERROR=no +- (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes ++ (cd "$outpath/qmake"; "$MAKE" $JOBS) || QMAKE_BUILD_ERROR=yes + [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake + [ '!' -z "$OLD_QCONFIG_H" ] && mv -f "${OLD_QCONFIG_H}.old" "$OLD_QCONFIG_H" #put back qconfig.h + [ "$QMAKE_BUILD_ERROR" = "yes" ] && exit 2 diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.diff new file mode 100644 index 0000000000..a15583fd41 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.diff @@ -0,0 +1,11 @@ +--- qmake/generators/unix/unixmake.cpp.orig ++++ qmake/generators/unix/unixmake.cpp +@@ -951,7 +951,7 @@ + else if(project->first("TEMPLATE") == "app" && !project->isEmpty("QMAKE_STRIPFLAGS_APP")) + ret += " " + var("QMAKE_STRIPFLAGS_APP"); + if(bundle) +- ret = " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\""; ++ ret += " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\""; + else + ret += " \"" + dst_targ + "\""; + } diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.fix_arch.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.fix_arch.diff new file mode 100644 index 0000000000..c1e085e03e --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.fix_arch.diff @@ -0,0 +1,87 @@ +--- qmake/generators/unix/unixmake.cpp.framework ++++ qmake/generators/unix/unixmake.cpp +@@ -589,9 +589,11 @@ + 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++) { ++ // warn_msg(WarnLogic, "processPrlFiles: 0: lflags[%d] is '%s'", i, lflags[i].toLatin1().constData()); + QStringList &l = project->values(lflags[i]); + for(int lit = 0; lit < l.size(); ++lit) { + QString opt = l.at(lit).trimmed(); ++ // warn_msg(WarnLogic, "processPrlFiles: 1: opt[%d] is '%s'", lit, opt.toLatin1().constData()); + if(opt.startsWith("-")) { + if(opt.startsWith("-L")) { + QMakeLocalFileName l(opt.right(opt.length()-2)); +@@ -727,6 +729,7 @@ + for(int lit = 0; lit < l.size(); ++lit) { + QString arch("default"); + QString opt = l.at(lit).trimmed(); ++ // warn_msg(WarnLogic, "processPrlFiles: 2: opt[%d] is '%s'", lit, opt.toLatin1().constData()); + if(opt.startsWith("-")) { + if (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-Xarch")) { + if (opt.length() > 7) { +@@ -734,7 +737,7 @@ + opt = l.at(++lit); + } + } +- ++ // warn_msg(WarnLogic, "processPrlFiles: 2: arch is '%s'", arch.toLatin1().constData()); + if(opt.startsWith("-L") || + (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { + if(!lflags[arch].contains(opt)) +@@ -771,6 +774,55 @@ + lflags[arch].append("-framework"); + lflags[arch].append(opt); + } ++ } else if (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-arch")) { ++ // warn_msg(WarnLogic, "%d / %d: %s, %s", lit, l.size (), opt.toLatin1().constData(), l.at(lit).toLatin1().constData(), l.at(1+lit).toLatin1().constData()); ++ // make sure "-arch" is exact ++ if (opt.toLower() != "-arch") { ++ warn_msg(WarnLogic, "Expect '-arch' flag to be standalone; got '%s'; ignoring extra.", opt.toLatin1().constData()); ++ } ++ // retrieve the next argument, if it exists ++ if (++lit >= l.size ()) { ++ warn_msg(WarnLogic, "Lone '-arch' flag; ignoring."); ++ continue; ++ } ++ QString t_arch = l.at(lit).trimmed().toLower(); ++ // make sure next option is valid ++ const QString archs[] = { "i386", "x86_64", "ppc", "ppc64", QString() }; ++ int i = 0; ++ for(; !archs[i].isNull(); ++i) { ++ if (t_arch.startsWith(archs[i])) { ++ break; ++ } ++ } ++ if (archs[i].isNull()) { ++ warn_msg(WarnLogic, "Lone '-arch' flag; ignoring."); ++ --lit; ++ continue; ++ } ++ // make sure the option is exact ++ if (archs[i] != t_arch) { ++ warn_msg(WarnLogic, "Expect ARCH of '-arch ARCH' flag to be exact; got '%s'; ignoring extra.", t_arch.toLatin1().constData()); ++ t_arch = archs[i]; ++ } ++ // see if this flag is alread in place in the ldflags ++ // for "default" and the selected arch. ++ // is "-arch ARCH" already in any set of flags? ++ bool found = false; ++ for(int j = 0; j < lflags["default"].size(); ++j) { ++ if ((lflags[arch].at(j) == "-arch") && ++ (lflags[arch].at(j+1) == t_arch)) { ++ // yes: flag already exists; ignore it ++ found = true; ++ break; ++ } ++ } ++ if (!found) { ++ // no: add it ++ lflags[arch].append("-arch"); ++ lflags[arch].append(t_arch); ++ } else { ++ warn_msg(WarnLogic, "Found duplicate '-arch %s' flag; ignoring.", t_arch.toLatin1().constData()); ++ } + } else { + lflags[arch].append(opt); + } diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.framework.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.framework.diff new file mode 100644 index 0000000000..814cad2233 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmake.cpp.framework.diff @@ -0,0 +1,108 @@ +--- qmake/generators/unix/unixmake.cpp.orig ++++ qmake/generators/unix/unixmake.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-qmake_option.h.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_option.h.diff new file mode 100644 index 0000000000..a738e59cbf --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_option.h.diff @@ -0,0 +1,10 @@ +--- qmake/option.h.orig ++++ qmake/option.h +@@ -214,6 +214,7 @@ + DocumentationPath, + HeadersPath, + LibrariesPath, ++ FrameworksPath, + BinariesPath, + PluginsPath, + DataPath, diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_project.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_project.cpp.diff new file mode 100644 index 0000000000..41e0452b33 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_project.cpp.diff @@ -0,0 +1,37 @@ +--- qmake/project.cpp.orig ++++ qmake/project.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-qmake_property.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_property.cpp.diff new file mode 100644 index 0000000000..912003cc14 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_property.cpp.diff @@ -0,0 +1,19 @@ +--- qmake/property.cpp.orig ++++ qmake/property.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff new file mode 100644 index 0000000000..883841babc --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qmake_qmake.pri.diff @@ -0,0 +1,11 @@ +--- qmake/qmake.pri.orig ++++ qmake/qmake.pri +@@ -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/MacPorts/aqua/qt4-mac/files/patch-qsettings-null.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qsettings-null.diff new file mode 100644 index 0000000000..9506bca44c --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qsettings-null.diff @@ -0,0 +1,60 @@ +--- src/corelib/io/qsettings.cpp.orig ++++ src/corelib/io/qsettings.cpp +@@ -487,7 +487,9 @@ + case QVariant::Double: + case QVariant::KeySequence: { + result = v.toString(); +- if (result.startsWith(QLatin1Char('@'))) ++ if (result.contains(QChar::Null)) ++ result = QLatin1String("@String(") + result + QLatin1Char(')'); ++ else if (result.startsWith(QLatin1Char('@'))) + result.prepend(QLatin1Char('@')); + break; + } +@@ -554,6 +556,8 @@ + if (s.endsWith(QLatin1Char(')'))) { + if (s.startsWith(QLatin1String("@ByteArray("))) { + return QVariant(s.toLatin1().mid(11, s.size() - 12)); ++ } else if (s.startsWith(QLatin1String("@String("))) { ++ return QVariant(s.midRef(8, s.size() - 9).toString()); + } else if (s.startsWith(QLatin1String("@Variant("))) { + #ifndef QT_NO_DATASTREAM + QByteArray a(s.toLatin1().mid(9)); +--- src/corelib/io/qsettings_mac.cpp.orig ++++ src/corelib/io/qsettings_mac.cpp +@@ -218,7 +218,14 @@ + case QVariant::String: + string_case: + default: +- result = QCFString::toCFStringRef(QSettingsPrivate::variantToString(value)); ++ QString string = QSettingsPrivate::variantToString(value); ++ if (string.contains(QChar::Null)) { ++ QByteArray ba = string.toUtf8(); ++ result = CFDataCreate(kCFAllocatorDefault, reinterpret_cast(ba.data()), ++ CFIndex(ba.size())); ++ } else { ++ result = QCFString::toCFStringRef(string); ++ } + } + return result; + } +@@ -269,8 +276,17 @@ + return (bool)CFBooleanGetValue(static_cast(cfvalue)); + } else if (typeId == CFDataGetTypeID()) { + CFDataRef cfdata = static_cast(cfvalue); +- return QByteArray(reinterpret_cast(CFDataGetBytePtr(cfdata)), +- CFDataGetLength(cfdata)); ++ QByteArray byteArray = QByteArray(reinterpret_cast(CFDataGetBytePtr(cfdata)), ++ CFDataGetLength(cfdata)); ++ ++ // Fast-path for QByteArray, so that we don't have to go ++ // though the expensive and lossy conversion via UTF-8. ++ if (!byteArray.startsWith('@')) ++ return byteArray; ++ ++ const QString str = QString::fromUtf8(byteArray.constData(), byteArray.size()); ++ return QSettingsPrivate::stringToVariant(str); ++ + } else if (typeId == CFDictionaryGetTypeID()) { + CFDictionaryRef cfdict = static_cast(cfvalue); + CFTypeID arrayTypeId = CFArrayGetTypeID(); diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qt-custom-threadpool.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qt-custom-threadpool.diff new file mode 100644 index 0000000000..ddeba265d4 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qt-custom-threadpool.diff @@ -0,0 +1,149 @@ +--- src/corelib/concurrent/qthreadpool.cpp.orig ++++ src/corelib/concurrent/qthreadpool.cpp +@@ -45,6 +45,8 @@ + + #ifndef QT_NO_THREAD + ++static QScopedPointer gThreadPool(new QThreadPool()); ++ + QT_BEGIN_NAMESPACE + + inline bool operator<(int priority, const QPair &p) +@@ -56,23 +58,6 @@ + return priority < p.second; + } + +-Q_GLOBAL_STATIC(QThreadPool, theInstance) +- +-/* +- QThread wrapper, provides synchronization against a ThreadPool +-*/ +-class QThreadPoolThread : public QThread +-{ +-public: +- QThreadPoolThread(QThreadPoolPrivate *manager); +- void run(); +- void registerThreadInactive(); +- +- QWaitCondition runnableReady; +- QThreadPoolPrivate *manager; +- QRunnable *runnable; +-}; +- + /* + QThreadPool private class. + */ +@@ -81,8 +66,8 @@ + /*!\internal + + */ +-QThreadPoolThread::QThreadPoolThread(QThreadPoolPrivate *manager) +- :manager(manager), runnable(0) ++QThreadPoolThread::QThreadPoolThread() ++ :manager(0), runnable(0) + { } + + /* \internal +@@ -240,13 +225,20 @@ + return activeThreadCount > maxThreadCount && (activeThreadCount - reservedThreads) > 1; + } + ++QThreadPoolThread* QThreadPool::createThreadPoolThread() const ++{ ++ QThreadPoolThread* ret = new QThreadPoolThread(); ++ ret->setObjectName(QLatin1String("Thread (pooled)")); ++ return ret; ++} ++ + /*! \internal + + */ + void QThreadPoolPrivate::startThread(QRunnable *runnable) + { +- QScopedPointer thread(new QThreadPoolThread(this)); +- thread->setObjectName(QLatin1String("Thread (pooled)")); ++ QScopedPointer thread(q_func()->createThreadPoolThread()); ++ thread->manager = this; + allThreads.insert(thread.data()); + ++activeThreads; + +@@ -444,7 +436,13 @@ + */ + QThreadPool *QThreadPool::globalInstance() + { +- return theInstance(); ++ return gThreadPool.data(); ++} ++ ++void ++QThreadPool::setGlobalInstance(QThreadPool* instance) ++{ ++ gThreadPool.reset(instance); + } + + /*! +--- src/corelib/concurrent/qthreadpool.h.orig ++++ src/corelib/concurrent/qthreadpool.h +@@ -46,15 +46,43 @@ + + #include + #include ++#include + + #ifndef QT_NO_THREAD + ++#define QT_CUSTOM_THREADPOOL ++ + QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE + + QT_MODULE(Core) + ++ + class QThreadPoolPrivate; ++class QThreadPool; ++ ++/* ++ QThread wrapper, provides synchronization against a ThreadPool ++ */ ++class Q_CORE_EXPORT QThreadPoolThread : public QThread ++{ ++public: ++ QThreadPoolThread(); ++ void run(); ++ ++private: ++ ++ friend class QThreadPoolPrivate; ++ friend class QThreadPool; ++ ++ void registerThreadInactive(); ++ ++ QWaitCondition runnableReady; ++ QThreadPoolPrivate *manager; ++ QRunnable *runnable; ++}; ++ ++ + class Q_CORE_EXPORT QThreadPool : public QObject + { + Q_OBJECT +@@ -69,6 +97,7 @@ + ~QThreadPool(); + + static QThreadPool *globalInstance(); ++ static void setGlobalInstance(QThreadPool* instance); + + void start(QRunnable *runnable, int priority = 0); + bool tryStart(QRunnable *runnable); +@@ -86,6 +115,10 @@ + + void waitForDone(); + bool waitForDone(int msecs); ++ ++protected: ++ ++ virtual QThreadPoolThread* createThreadPoolThread() const; + }; + + QT_END_NAMESPACE diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-contentsformat.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-contentsformat.diff new file mode 100644 index 0000000000..3df852a657 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-contentsformat.diff @@ -0,0 +1,29 @@ +--- src/gui/kernel/qcocoaview_mac.mm.orig 2021-04-22 11:42:11.000000000 -0700 ++++ src/gui/kernel/qcocoaview_mac.mm 2021-04-22 11:43:21.000000000 -0700 +@@ -997,6 +997,18 @@ + } + } + ++#if defined(MAC_OS_X_VERSION_10_12) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12 ++- (void) viewWillDraw ++{ ++ if (NSAppKitVersionNumber >= 2022.00) // Big Sur ++ { ++ CALayer* layer = self.layer; ++ layer.contentsFormat = kCAContentsFormatRGBA8Uint; ++ } ++ ++ [super viewWillDraw]; ++} ++#endif + + // NSTextInput Protocol implementation + +--- src/gui/kernel/mac.pri.orig 2021-04-22 13:28:24.000000000 -0700 ++++ src/gui/kernel/mac.pri 2021-04-22 13:28:54.000000000 -0700 +@@ -1,4 +1,4 @@ + !x11:!embedded:!qpa:mac { +- LIBS_PRIVATE += -framework Carbon -lz ++ LIBS_PRIVATE += -framework QuartzCore -framework Carbon -lz + *-mwerks:INCLUDEPATH += compat + } diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-openssl111.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-openssl111.diff new file mode 100644 index 0000000000..16dc1096c0 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-openssl111.diff @@ -0,0 +1,398 @@ +see https://trac.macports.org/ticket/58205 + +Description: Compile with openssl-1.1.0 + * Most changes are related to openssl structures are now opaque. + * The network/ssl threading setup has been disabled because the + old openssl threading model has been removed and is apparently + no longer needed. + * A number of new functions had to be imported (see changes to + src/network/ssl/qsslsocket_openssl_symbols.cpp) +Author: Gert Wollny +Last-Update: 2016-06-28 +Bug-Debian: http://bugs.debian.org/828522 + +diff --git src/network/ssl/qsslcertificate.cpp src/network/ssl/qsslcertificate.cpp +index 0f2314e2..96f6de43 100644 +--- src/network/ssl/qsslcertificate.cpp ++++ src/network/ssl/qsslcertificate.cpp +@@ -259,10 +259,10 @@ void QSslCertificate::clear() + QByteArray QSslCertificate::version() const + { + QMutexLocker lock(QMutexPool::globalInstanceGet(d.data())); +- if (d->versionString.isEmpty() && d->x509) ++ if (d->versionString.isEmpty() && d->x509) { + d->versionString = +- QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1); +- ++ QByteArray::number(qlonglong(q_X509_get_version(d->x509)) + 1); ++ } + return d->versionString; + } + +@@ -276,7 +276,7 @@ QByteArray QSslCertificate::serialNumber() const + { + QMutexLocker lock(QMutexPool::globalInstanceGet(d.data())); + if (d->serialNumberString.isEmpty() && d->x509) { +- ASN1_INTEGER *serialNumber = d->x509->cert_info->serialNumber; ++ ASN1_INTEGER *serialNumber = q_X509_get_serialNumber(d->x509); + // if we cannot convert to a long, just output the hexadecimal number + if (serialNumber->length > 4) { + QByteArray hexString; +@@ -489,24 +489,33 @@ QSslKey QSslCertificate::publicKey() const + QSslKey key; + + key.d->type = QSsl::PublicKey; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + X509_PUBKEY *xkey = d->x509->cert_info->key; ++#else ++ X509_PUBKEY *xkey = q_X509_get_X509_PUBKEY(d->x509); ++#endif + EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey); + Q_ASSERT(pkey); + +- if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) { ++ int key_id; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ key_id = q_EVP_PKEY_type(pkey->type); ++#else ++ key_id = q_EVP_PKEY_base_id(pkey); ++#endif ++ if (key_id == EVP_PKEY_RSA) { + key.d->rsa = q_EVP_PKEY_get1_RSA(pkey); + key.d->algorithm = QSsl::Rsa; + key.d->isNull = false; +- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DSA) { ++ } else if (key_id == EVP_PKEY_DSA) { + key.d->dsa = q_EVP_PKEY_get1_DSA(pkey); + key.d->algorithm = QSsl::Dsa; + key.d->isNull = false; +- } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) { ++ } else if (key_id == EVP_PKEY_DH) { + // DH unsupported + } else { + // error? + } +- + q_EVP_PKEY_free(pkey); + return key; + } +@@ -687,7 +696,7 @@ static QMap _q_mapFromX509Name(X509_NAME *name) + unsigned char *data = 0; + int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e)); + info[QString::fromUtf8(obj)] = QString::fromUtf8((char*)data, size); +- q_CRYPTO_free(data); ++ q_OPENSSL_free(data); + } + return info; + } +diff --git src/network/ssl/qsslkey.cpp src/network/ssl/qsslkey.cpp +index 437a177b..73753206 100644 +--- src/network/ssl/qsslkey.cpp ++++ src/network/ssl/qsslkey.cpp +@@ -321,8 +321,19 @@ int QSslKey::length() const + { + if (d->isNull) + return -1; ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + return (d->algorithm == QSsl::Rsa) + ? q_BN_num_bits(d->rsa->n) : q_BN_num_bits(d->dsa->p); ++#else ++ if (d->algorithm == QSsl::Rsa) { ++ return q_RSA_bits(d->rsa); ++ }else{ ++ const BIGNUM *p = NULL; ++ q_DSA_get0_pqg(d->dsa, &p, NULL, NULL); ++ return q_BN_num_bits(p); ++ } ++#endif ++ + } + + /*! +diff --git src/network/ssl/qsslsocket_openssl.cpp src/network/ssl/qsslsocket_openssl.cpp +index 8eba0761..12e9f47a 100644 +--- src/network/ssl/qsslsocket_openssl.cpp ++++ src/network/ssl/qsslsocket_openssl.cpp +@@ -93,6 +93,7 @@ bool QSslSocketPrivate::s_libraryLoaded = false; + bool QSslSocketPrivate::s_loadedCiphersAndCerts = false; + bool QSslSocketPrivate::s_loadRootCertsOnDemand = false; + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + /* \internal + + From OpenSSL's thread(3) manual page: +@@ -174,6 +175,8 @@ static unsigned long id_function() + } + } // extern "C" + ++#endif //OPENSSL_VERSION_NUMBER >= 0x10100000L ++ + QSslSocketBackendPrivate::QSslSocketBackendPrivate() + : ssl(0), + ctx(0), +@@ -222,9 +225,12 @@ QSslCipher QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(SSL_CIPHER *ciph + ciph.d->encryptionMethod = descriptionList.at(4).mid(4); + ciph.d->exportable = (descriptionList.size() > 6 && descriptionList.at(6) == QLatin1String("export")); + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ciph.d->bits = cipher->strength_bits; + ciph.d->supportedBits = cipher->alg_bits; +- ++#else ++ ciph.d->bits = q_SSL_CIPHER_get_bits(cipher, &ciph.d->supportedBits); ++#endif + } + return ciph; + } +@@ -367,7 +373,7 @@ init_context: + // + // See also: QSslContext::fromConfiguration() + if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) { +- q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle()); ++ q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(ctx), (X509 *)caCertificate.handle()); + } + } + +@@ -504,8 +510,10 @@ void QSslSocketBackendPrivate::destroySslContext() + */ + void QSslSocketPrivate::deinitialize() + { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + q_CRYPTO_set_id_callback(0); + q_CRYPTO_set_locking_callback(0); ++#endif + } + + /*! +@@ -526,13 +534,17 @@ bool QSslSocketPrivate::ensureLibraryLoaded() + return false; + + // Check if the library itself needs to be initialized. ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + QMutexLocker locker(openssl_locks()->initLock()); ++#endif + if (!s_libraryLoaded) { + s_libraryLoaded = true; + + // Initialize OpenSSL. ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + q_CRYPTO_set_id_callback(id_function); + q_CRYPTO_set_locking_callback(locking_function); ++#endif + if (q_SSL_library_init() != 1) + return false; + q_SSL_load_error_strings(); +@@ -571,7 +583,9 @@ bool QSslSocketPrivate::ensureLibraryLoaded() + + void QSslSocketPrivate::ensureCiphersAndCertsLoaded() + { +- QMutexLocker locker(openssl_locks()->initLock()); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ QMutexLocker locker(openssl_locks()->initLock()); ++#endif + if (s_loadedCiphersAndCerts) + return; + s_loadedCiphersAndCerts = true; +@@ -663,13 +677,18 @@ void QSslSocketPrivate::resetDefaultCiphers() + STACK_OF(SSL_CIPHER) *supportedCiphers = q_SSL_get_ciphers(mySsl); + for (int i = 0; i < q_sk_SSL_CIPHER_num(supportedCiphers); ++i) { + if (SSL_CIPHER *cipher = q_sk_SSL_CIPHER_value(supportedCiphers, i)) { +- if (cipher->valid) { ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++ if (cipher->valid) { ++#endif + QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher); + if (!ciph.isNull()) { + if (!ciph.name().toLower().startsWith(QLatin1String("adh"))) + ciphers << ciph; + } ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + } ++#endif + } + } + +diff --git src/network/ssl/qsslsocket_openssl_symbols.cpp src/network/ssl/qsslsocket_openssl_symbols.cpp +index b20baa27..507fc3e2 100644 +--- src/network/ssl/qsslsocket_openssl_symbols.cpp ++++ src/network/ssl/qsslsocket_openssl_symbols.cpp +@@ -111,16 +111,24 @@ DEFINEFUNC(int, ASN1_STRING_length, ASN1_STRING *a, a, return 0, return) + DEFINEFUNC2(int, ASN1_STRING_to_UTF8, unsigned char **a, a, ASN1_STRING *b, b, return 0, return); + DEFINEFUNC4(long, BIO_ctrl, BIO *a, a, int b, b, long c, c, void *d, d, return -1, return) + DEFINEFUNC(int, BIO_free, BIO *a, a, return 0, return) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++DEFINEFUNC(BIO *, BIO_new, const BIO_METHOD *a, a, return 0, return) ++#else + DEFINEFUNC(BIO *, BIO_new, BIO_METHOD *a, a, return 0, return) ++#endif + DEFINEFUNC2(BIO *, BIO_new_mem_buf, void *a, a, int b, b, return 0, return) + DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++DEFINEFUNC(const BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return) ++#else + DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return) ++#endif + DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return) + DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return) + DEFINEFUNC(int, CRYPTO_num_locks, DUMMYARG, DUMMYARG, return 0, return) + DEFINEFUNC(void, CRYPTO_set_locking_callback, void (*a)(int, int, const char *, int), a, return, DUMMYARG) + DEFINEFUNC(void, CRYPTO_set_id_callback, unsigned long (*a)(), a, return, DUMMYARG) +-DEFINEFUNC(void, CRYPTO_free, void *a, a, return, DUMMYARG) ++DEFINEFUNC(void, OPENSSL_free, void *a, a, return, DUMMYARG) + DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG) + #if OPENSSL_VERSION_NUMBER < 0x00908000L + DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, unsigned char **b, b, long c, c, return 0, return) +@@ -290,6 +298,22 @@ DEFINEFUNC(void, OPENSSL_add_all_algorithms_noconf, void, DUMMYARG, return, DUMM + DEFINEFUNC(void, OPENSSL_add_all_algorithms_conf, void, DUMMYARG, return, DUMMYARG) + DEFINEFUNC3(int, SSL_CTX_load_verify_locations, SSL_CTX *ctx, ctx, const char *CAfile, CAfile, const char *CApath, CApath, return 0, return) + DEFINEFUNC(long, SSLeay, void, DUMMYARG, return 0, return) ++DEFINEFUNC(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *ctx, ctx, return 0, return) ++ ++DEFINEFUNC(ASN1_INTEGER *, X509_get_serialNumber, X509 *x, x, return 0, return) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++DEFINEFUNC(int, EVP_PKEY_id, const EVP_PKEY *pkey, pkey, return 0, return) ++DEFINEFUNC(int, EVP_PKEY_base_id, const EVP_PKEY *pkey, pkey, return 0, return) ++DEFINEFUNC2(int, SSL_CIPHER_get_bits, const SSL_CIPHER *cipher, cipher, int *alg_bits, alg_bits, return 0, return) ++DEFINEFUNC2(long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, long options, options, return 0, return) ++DEFINEFUNC(long, X509_get_version, X509 *x, x, return 0, return) ++DEFINEFUNC(X509_PUBKEY *, X509_get_X509_PUBKEY, X509 *x, x, return 0, return) ++DEFINEFUNC(int, RSA_bits, const RSA *rsa, rsa, return 0, return) ++DEFINEFUNC(int, DSA_security_bits, const DSA *dsa, dsa, return 0, return) ++DEFINEFUNC(ASN1_TIME *, X509_get_notAfter, X509 *x, x, return 0, return) ++DEFINEFUNC(ASN1_TIME *, X509_get_notBefore, X509 *x, x, return 0, return) ++DEFINEFUNC4(void, DSA_get0_pqg, const DSA *d, d, const BIGNUM **p, p, const BIGNUM **q, q, const BIGNUM **g, g, return, return) ++#endif + + #ifdef Q_OS_SYMBIAN + #define RESOLVEFUNC(func, ordinal, lib) \ +@@ -801,6 +825,7 @@ bool q_resolveOpenSslSymbols() + RESOLVEFUNC(SSL_CTX_use_PrivateKey) + RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey) + RESOLVEFUNC(SSL_CTX_use_PrivateKey_file) ++ RESOLVEFUNC(SSL_CTX_get_cert_store) + RESOLVEFUNC(SSL_accept) + RESOLVEFUNC(SSL_clear) + RESOLVEFUNC(SSL_connect) +@@ -823,6 +848,23 @@ bool q_resolveOpenSslSymbols() + RESOLVEFUNC(SSL_set_connect_state) + RESOLVEFUNC(SSL_shutdown) + RESOLVEFUNC(SSL_write) ++ ++ RESOLVEFUNC(X509_get_serialNumber) ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++ RESOLVEFUNC(SSL_CTX_ctrl) ++ RESOLVEFUNC(EVP_PKEY_id) ++ RESOLVEFUNC(EVP_PKEY_base_id) ++ RESOLVEFUNC(SSL_CIPHER_get_bits) ++ RESOLVEFUNC(SSL_CTX_set_options) ++ RESOLVEFUNC(X509_get_version) ++ RESOLVEFUNC(X509_get_X509_PUBKEY) ++ RESOLVEFUNC(RSA_bits) ++ RESOLVEFUNC(DSA_security_bits) ++ RESOLVEFUNC(DSA_get0_pqg) ++ RESOLVEFUNC(X509_get_notAfter) ++ RESOLVEFUNC(X509_get_notBefore) ++#endif ++ + #ifndef OPENSSL_NO_SSL2 + RESOLVEFUNC(SSLv2_client_method) + #endif +diff --git src/network/ssl/qsslsocket_openssl_symbols_p.h src/network/ssl/qsslsocket_openssl_symbols_p.h +index 2bfe0632..3054df01 100644 +--- src/network/ssl/qsslsocket_openssl_symbols_p.h ++++ src/network/ssl/qsslsocket_openssl_symbols_p.h +@@ -59,6 +59,9 @@ + QT_BEGIN_NAMESPACE + + #define DUMMYARG ++#ifndef OPENSSL_NO_SSL2 ++#define OPENSSL_NO_SSL2 1 ++#endif + + #if !defined QT_LINKED_OPENSSL + // **************** Shared declarations ****************** +@@ -207,16 +210,24 @@ int q_ASN1_STRING_length(ASN1_STRING *a); + int q_ASN1_STRING_to_UTF8(unsigned char **a, ASN1_STRING *b); + long q_BIO_ctrl(BIO *a, int b, long c, void *d); + int q_BIO_free(BIO *a); ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++BIO *q_BIO_new(const BIO_METHOD *a); ++#else + BIO *q_BIO_new(BIO_METHOD *a); ++#endif + BIO *q_BIO_new_mem_buf(void *a, int b); + int q_BIO_read(BIO *a, void *b, int c); ++#if OPENSSL_VERSION_NUMBER >= 0x10100000L ++const BIO_METHOD *q_BIO_s_mem(); ++#else + BIO_METHOD *q_BIO_s_mem(); ++#endif + int q_BIO_write(BIO *a, const void *b, int c); + int q_BN_num_bits(const BIGNUM *a); + int q_CRYPTO_num_locks(); + void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int)); + void q_CRYPTO_set_id_callback(unsigned long (*a)()); +-void q_CRYPTO_free(void *a); ++void q_OPENSSL_free(void *a); + void q_DSA_free(DSA *a); + #if OPENSSL_VERSION_NUMBER >= 0x00908000L + // 0.9.8 broke SC and BC by changing this function's signature. +@@ -326,7 +337,6 @@ void q_SSL_set_accept_state(SSL *a); + void q_SSL_set_connect_state(SSL *a); + int q_SSL_shutdown(SSL *a); + #if OPENSSL_VERSION_NUMBER >= 0x10000000L +-const SSL_METHOD *q_SSLv2_client_method(); + const SSL_METHOD *q_SSLv3_client_method(); + const SSL_METHOD *q_SSLv23_client_method(); + const SSL_METHOD *q_TLSv1_client_method(); +@@ -335,7 +345,6 @@ const SSL_METHOD *q_SSLv3_server_method(); + const SSL_METHOD *q_SSLv23_server_method(); + const SSL_METHOD *q_TLSv1_server_method(); + #else +-SSL_METHOD *q_SSLv2_client_method(); + SSL_METHOD *q_SSLv3_client_method(); + SSL_METHOD *q_SSLv23_client_method(); + SSL_METHOD *q_TLSv1_client_method(); +@@ -399,7 +408,25 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length); + PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\ + bp,(char *)x,enc,kstr,klen,cb,u) + #endif ++ ++X509_STORE * q_SSL_CTX_get_cert_store(const SSL_CTX *ctx); ++ASN1_INTEGER * q_X509_get_serialNumber(X509 *x); ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + #define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL) ++#define q_X509_get_version(x) X509_get_version(x) ++#else ++int q_EVP_PKEY_id(const EVP_PKEY *pkey); ++int q_EVP_PKEY_base_id(const EVP_PKEY *pkey); ++int q_SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits); ++long q_SSL_CTX_set_options(SSL_CTX *ctx, long options); ++long q_X509_get_version(X509 *x); ++X509_PUBKEY * q_X509_get_X509_PUBKEY(X509 *x); ++int q_RSA_bits(const RSA *rsa); ++int q_DSA_security_bits(const DSA *dsa); ++void q_DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g); ++#endif ++ + #define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st) + #define q_SKM_sk_value(type, st,i) ((type * (*)(const STACK_OF(type) *, int))q_sk_value)(st, i) + #define q_sk_GENERAL_NAME_num(st) q_SKM_sk_num(GENERAL_NAME, (st)) +@@ -410,8 +437,15 @@ DSA *q_d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length); + #define q_sk_SSL_CIPHER_value(st, i) q_SKM_sk_value(SSL_CIPHER, (st), (i)) + #define q_SSL_CTX_add_extra_chain_cert(ctx,x509) \ + q_SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + #define q_X509_get_notAfter(x) X509_get_notAfter(x) + #define q_X509_get_notBefore(x) X509_get_notBefore(x) ++#else ++ASN1_TIME *q_X509_get_notAfter(X509 *x); ++ASN1_TIME *q_X509_get_notBefore(X509 *x); ++#endif ++ + #define q_EVP_PKEY_assign_RSA(pkey,rsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_RSA,\ + (char *)(rsa)) + #define q_EVP_PKEY_assign_DSA(pkey,dsa) q_EVP_PKEY_assign((pkey),EVP_PKEY_DSA,\ diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff new file mode 100644 index 0000000000..26d9140735 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qt4-versions-without-underscores.diff @@ -0,0 +1,12 @@ +--- src/gui/kernel/qt_cocoa_helpers_mac.mm.orig ++++ src/gui/kernel/qt_cocoa_helpers_mac.mm +@@ -73,6 +73,9 @@ + ** + ****************************************************************************/ + ++// Workaround for macOS 10.13 and later ++#define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 1 ++ + #include + #include + #include diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-qthread-stacksize.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-qthread-stacksize.diff new file mode 100644 index 0000000000..0eb64f99a0 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-qthread-stacksize.diff @@ -0,0 +1,56 @@ +--- src/corelib/thread/qthread_unix.cpp.orig ++++ src/corelib/thread/qthread_unix.cpp +@@ -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); diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_PluginView.h.diff new file mode 100644 index 0000000000..bac79dd4b8 --- /dev/null +++ b/tools/MacPorts/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 ++++ src/3rdparty/webkit/Source/WebCore/plugins/PluginView.h +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_3rdparty_webkit_Source_WebCore_plugins_mac_PluginViewMac.mm.diff new file mode 100644 index 0000000000..a37f30bc4c --- /dev/null +++ b/tools/MacPorts/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 ++++ src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginViewMac.mm +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff new file mode 100644 index 0000000000..ec3afbb4cf --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_corelib.pro.diff @@ -0,0 +1,11 @@ +--- src/corelib/corelib.pro.orig ++++ src/corelib/corelib.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff new file mode 100644 index 0000000000..b9a62dcaee --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.cpp.diff @@ -0,0 +1,25 @@ +--- src/corelib/global/qlibraryinfo.cpp.orig ++++ src/corelib/global/qlibraryinfo.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff new file mode 100644 index 0000000000..e242c9b036 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_global_qlibraryinfo.h.diff @@ -0,0 +1,10 @@ +--- src/corelib/global/qlibraryinfo.h.orig ++++ src/corelib/global/qlibraryinfo.h +@@ -70,6 +70,7 @@ + DocumentationPath, + HeadersPath, + LibrariesPath, ++ FrameworksPath, + BinariesPath, + PluginsPath, + DataPath, diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff new file mode 100644 index 0000000000..6b0b7bcd07 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qfilesystemengine_unix.cpp-tiger.diff @@ -0,0 +1,41 @@ +--- src/corelib/io/qfilesystemengine_unix.cpp.orig ++++ src/corelib/io/qfilesystemengine_unix.cpp +@@ -83,6 +83,7 @@ + return (fileInfo->finderFlags & kIsInvisible); + } + ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &entry) + { + if (!data.isDirectory()) +@@ -138,6 +139,7 @@ + FolderInfo *folderInfo = reinterpret_cast(catalogInfo.finderInfo); + return folderInfo->finderFlags & kHasBundle; + } ++#endif + + #else + static inline bool _q_isMacHidden(const char *nativePath) +@@ -529,8 +531,22 @@ + + #if !defined(QWS) && !defined(Q_WS_QPA) && defined(Q_OS_MAC) + if (what & QFileSystemMetaData::BundleType) { ++#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 + if (entryExists && isPackage(data, entry)) + data.entryFlags |= QFileSystemMetaData::BundleType; ++#else ++ if (entryExists && data.isDirectory()) { ++ QCFType path = CFStringCreateWithBytes(0, ++ (const UInt8*)nativeFilePath, nativeFilePathLength, ++ kCFStringEncodingUTF8, false); ++ QCFType url = CFURLCreateWithFileSystemPath(0, path, ++ kCFURLPOSIXPathStyle, true); ++ ++ UInt32 type, creator; ++ if (CFBundleGetPackageInfoInDirectory(url, &type, &creator)) ++ data.entryFlags |= QFileSystemMetaData::BundleType; ++ } ++#endif + data.knownFlagsMask |= QFileSystemMetaData::BundleType; + } + #endif diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff new file mode 100644 index 0000000000..ef4a5fb9fa --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qprocess_unix.cpp.diff @@ -0,0 +1,16 @@ +--- src/corelib/io/qprocess_unix.cpp.orig ++++ src/corelib/io/qprocess_unix.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qsettings.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qsettings.cpp.diff new file mode 100644 index 0000000000..9ddf725695 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_io_qsettings.cpp.diff @@ -0,0 +1,11 @@ +--- src/corelib/io/qsettings.cpp.orig ++++ src/corelib/io/qsettings.cpp +@@ -122,7 +122,7 @@ + Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc) + Q_GLOBAL_STATIC(PathHash, pathHashFunc) + Q_GLOBAL_STATIC(CustomFormatVector, customFormatVectorFunc) +-Q_GLOBAL_STATIC(QMutex, globalMutex) ++Q_GLOBAL_STATIC_WITH_ARGS(QMutex, globalMutex, (QMutex::Recursive)) + static QSettings::Format globalDefaultFormat = QSettings::NativeFormat; + + #ifndef Q_OS_WIN diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff new file mode 100644 index 0000000000..65a299c983 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_corelib_tools_qelapsedtimer-mac.cpp.diff @@ -0,0 +1,11 @@ +--- src/corelib/tools/qelapsedtimer_mac.cpp.orig ++++ src/corelib/tools/qelapsedtimer_mac.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff new file mode 100644 index 0000000000..2c353aa8f9 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfiledialog_mac.mm.diff @@ -0,0 +1,18 @@ +--- src/gui/dialogs/qfiledialog_mac.mm.orig ++++ src/gui/dialogs/qfiledialog_mac.mm +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff new file mode 100644 index 0000000000..3b10b6778a --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_dialogs_qfontdialog_mac.mm-tiger.diff @@ -0,0 +1,34 @@ +--- src/gui/dialogs/qfontdialog_mac.mm.orig ++++ src/gui/dialogs/qfontdialog_mac.mm +@@ -141,6 +141,7 @@ + QFont newFont; + if (cocoaFont) { + int pSize = qRound([cocoaFont pointSize]); ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + CTFontDescriptorRef font = CTFontCopyFontDescriptor((CTFontRef)cocoaFont); + // QCoreTextFontDatabase::populateFontDatabase() is using localized names + QString family = QCFString::toQString((CFStringRef) CTFontDescriptorCopyLocalizedAttribute(font, kCTFontFamilyNameAttribute, NULL)); +@@ -151,6 +152,23 @@ + newFont.setStrikeOut(resolveFont.strikeOut()); + + CFRelease(font); ++#else ++ // This pre-Leopard version is buggy and was fixed in 717e36037cf246aa201c0aaf15a5dcbd7883f159 ++ // see QTBUG-27415 https://codereview.qt-project.org/#/c/42830/ ++ QString family(qt_mac_NSStringToQString([cocoaFont familyName])); ++ QString typeface(qt_mac_NSStringToQString([cocoaFont fontName])); ++ ++ int hyphenPos = typeface.indexOf(QLatin1Char('-')); ++ if (hyphenPos != -1) { ++ typeface.remove(0, hyphenPos + 1); ++ } else { ++ typeface = QLatin1String("Normal"); ++ } ++ ++ newFont = QFontDatabase().font(family, typeface, pSize); ++ newFont.setUnderline(resolveFont.underline()); ++ newFont.setStrikeOut(resolveFont.strikeOut()); ++#endif + } + return newFont; + } diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qcursor_mac.mm.diff new file mode 100644 index 0000000000..4a02c36aa6 --- /dev/null +++ b/tools/MacPorts/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/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff new file mode 100644 index 0000000000..f605e0f538 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_kernel_qmime_mac.cpp.diff @@ -0,0 +1,207 @@ +--- .//src/gui/kernel/qmime_mac.cpp.orig ++++ .//src/gui/kernel/qmime_mac.cpp +@@ -68,12 +68,6 @@ + #include "qmap.h" + #include + +- +-#ifdef Q_WS_MAC32 +-#include +-#include +-#endif +- + QT_BEGIN_NAMESPACE + + extern CGImageRef qt_mac_createCGImageFromQImage(const QImage &img, const QImage **imagePtr = 0); // qpaintengine_mac.cpp +@@ -501,147 +495,6 @@ + return ret; + } + +- +-#ifdef Q_WS_MAC32 +- +-// This can be removed once 10.6 is the minimum (or we have to require 64-bit) whichever comes first. +- +-typedef ComponentResult (*PtrGraphicsImportSetDataHandle)(GraphicsImportComponent, Handle); +-typedef ComponentResult (*PtrGraphicsImportCreateCGImage)(GraphicsImportComponent, CGImageRef*, UInt32); +-typedef ComponentResult (*PtrGraphicsExportSetInputCGImage)(GraphicsExportComponent, CGImageRef); +-typedef ComponentResult (*PtrGraphicsExportSetOutputHandle)(GraphicsExportComponent, Handle); +-typedef ComponentResult (*PtrGraphicsExportDoExport)(GraphicsExportComponent, unsigned long *); +- +-static PtrGraphicsImportSetDataHandle ptrGraphicsImportSetDataHandle = 0; +-static PtrGraphicsImportCreateCGImage ptrGraphicsImportCreateCGImage = 0; +-static PtrGraphicsExportSetInputCGImage ptrGraphicsExportSetInputCGImage = 0; +-static PtrGraphicsExportSetOutputHandle ptrGraphicsExportSetOutputHandle = 0; +-static PtrGraphicsExportDoExport ptrGraphicsExportDoExport = 0; +- +-static bool resolveMimeQuickTimeSymbols() +-{ +- static bool triedResolve = false; +- if (!triedResolve) { +- QLibrary library(QLatin1String("/System/Library/Frameworks/QuickTime.framework/QuickTime")); +- ptrGraphicsImportSetDataHandle = reinterpret_cast(library.resolve("GraphicsImportSetDataHandle")); +- ptrGraphicsImportCreateCGImage = reinterpret_cast(library.resolve("GraphicsImportCreateCGImage")); +- ptrGraphicsExportSetInputCGImage = reinterpret_cast(library.resolve("GraphicsExportSetInputCGImage")); +- ptrGraphicsExportSetOutputHandle = reinterpret_cast(library.resolve("GraphicsExportSetOutputHandle")); +- ptrGraphicsExportDoExport = reinterpret_cast(library.resolve("GraphicsExportDoExport")); +- triedResolve = true; +- } +- +- return ptrGraphicsImportSetDataHandle != 0 +- && ptrGraphicsImportCreateCGImage != 0 && ptrGraphicsExportSetInputCGImage != 0 +- && ptrGraphicsExportSetOutputHandle != 0 && ptrGraphicsExportDoExport != 0; +-} +- +-class QMacPasteboardMimePict : public QMacPasteboardMime { +-public: +- QMacPasteboardMimePict() : QMacPasteboardMime(MIME_ALL) { } +- QString convertorName(); +- +- QString flavorFor(const QString &mime); +- QString mimeFor(QString flav); +- bool canConvert(const QString &mime, QString flav); +- QVariant convertToMime(const QString &mime, QList data, QString flav); +- QList convertFromMime(const QString &mime, QVariant data, QString flav); +-}; +- +-QString QMacPasteboardMimePict::convertorName() +-{ +- return QLatin1String("Pict"); +-} +- +-QString QMacPasteboardMimePict::flavorFor(const QString &mime) +-{ +- if(mime.startsWith(QLatin1String("application/x-qt-image"))) +- return QLatin1String("com.apple.pict"); +- return QString(); +-} +- +-QString QMacPasteboardMimePict::mimeFor(QString flav) +-{ +- if(flav == QLatin1String("com.apple.pict")) +- return QLatin1String("application/x-qt-image"); +- return QString(); +-} +- +-bool QMacPasteboardMimePict::canConvert(const QString &mime, QString flav) +-{ +- return flav == QLatin1String("com.apple.pict") +- && mime == QLatin1String("application/x-qt-image"); +-} +- +- +-QVariant QMacPasteboardMimePict::convertToMime(const QString &mime, QList data, QString flav) +-{ +- if(data.count() > 1) +- qWarning("QMacPasteboardMimePict: Cannot handle multiple member data"); +- QVariant ret; +- if (!resolveMimeQuickTimeSymbols()) +- return ret; +- +- if(!canConvert(mime, flav)) +- return ret; +- const QByteArray &a = data.first(); +- +- // This function expects the 512 header (just to skip it, so create the extra space for it). +- Handle pic = NewHandle(a.size() + 512); +- memcpy(*pic + 512, a.constData(), a.size()); +- +- GraphicsImportComponent graphicsImporter; +- ComponentResult result = OpenADefaultComponent(GraphicsImporterComponentType, +- kQTFileTypePicture, &graphicsImporter); +- QCFType cgImage; +- if (!result) +- result = ptrGraphicsImportSetDataHandle(graphicsImporter, pic); +- if (!result) +- result = ptrGraphicsImportCreateCGImage(graphicsImporter, &cgImage, +- kGraphicsImportCreateCGImageUsingCurrentSettings); +- if (!result) +- ret = QVariant(QPixmap::fromMacCGImageRef(cgImage).toImage()); +- CloseComponent(graphicsImporter); +- DisposeHandle(pic); +- return ret; +-} +- +-QList QMacPasteboardMimePict::convertFromMime(const QString &mime, QVariant variant, +- QString flav) +-{ +- QList ret; +- if (!resolveMimeQuickTimeSymbols()) +- return ret; +- +- if (!canConvert(mime, flav)) +- return ret; +- QCFType cgimage = qt_mac_createCGImageFromQImage(qvariant_cast(variant)); +- Handle pic = NewHandle(0); +- GraphicsExportComponent graphicsExporter; +- ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType, +- kQTFileTypePicture, &graphicsExporter); +- if (!result) { +- unsigned long sizeWritten; +- result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage); +- if (!result) +- result = ptrGraphicsExportSetOutputHandle(graphicsExporter, pic); +- if (!result) +- result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten); +- +- CloseComponent(graphicsExporter); +- } +- +- int size = GetHandleSize((Handle)pic); +- // Skip the Picture File header (512 bytes) and feed the raw data +- QByteArray ar(reinterpret_cast(*pic + 512), size - 512); +- ret.append(ar); +- DisposeHandle(pic); +- return ret; +-} +- +- +-#endif //Q_WS_MAC32 +- + class QMacPasteboardMimeTiff : public QMacPasteboardMime { + public: + QMacPasteboardMimeTiff() : QMacPasteboardMime(MIME_ALL) { } +@@ -734,30 +587,7 @@ + ret.append(ar); + } else + #endif +- { +-#ifdef Q_WS_MAC32 +- Handle tiff = NewHandle(0); +- if (resolveMimeQuickTimeSymbols()) { +- GraphicsExportComponent graphicsExporter; +- ComponentResult result = OpenADefaultComponent(GraphicsExporterComponentType, +- kQTFileTypeTIFF, &graphicsExporter); +- if (!result) { +- unsigned long sizeWritten; +- result = ptrGraphicsExportSetInputCGImage(graphicsExporter, cgimage); +- if (!result) +- result = ptrGraphicsExportSetOutputHandle(graphicsExporter, tiff); +- if (!result) +- result = ptrGraphicsExportDoExport(graphicsExporter, &sizeWritten); + +- CloseComponent(graphicsExporter); +- } +- } +- int size = GetHandleSize((Handle)tiff); +- QByteArray ar(reinterpret_cast(*tiff), size); +- ret.append(ar); +- DisposeHandle(tiff); +-#endif +- } + return ret; + } + +@@ -1158,12 +988,6 @@ + + //standard types that we wrap + new QMacPasteboardMimeTiff; +-#ifdef Q_WS_MAC32 +- // 10.6 does automatic synthesis to and from PICT to standard image types (like TIFF), +- // so don't bother doing it ourselves, especially since it's not available in 64-bit. +- if (QSysInfo::MacintoshVersion < QSysInfo::MV_10_6) +- new QMacPasteboardMimePict; +-#endif + new QMacPasteboardMimeUnicodeText; + new QMacPasteboardMimePlainText; + new QMacPasteboardMimeHTMLText; diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff new file mode 100644 index 0000000000..17b84f4277 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.cpp-tiger.diff @@ -0,0 +1,19 @@ +--- src/gui/painting/qpaintengine_mac.cpp.orig ++++ src/gui/painting/qpaintengine_mac.cpp +@@ -334,7 +334,16 @@ + if ((colorSpace = m_displayColorSpaceHash.value(displayID))) + return colorSpace; + ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + colorSpace = CGDisplayCopyColorSpace(displayID); ++#else ++ CMProfileRef displayProfile = 0; ++ CMError err = CMGetProfileByAVID((CMDisplayIDType)displayID, &displayProfile); ++ if (err == noErr) { ++ colorSpace = CGColorSpaceCreateWithPlatformColorSpace(displayProfile); ++ CMCloseProfile(displayProfile); ++ } ++#endif + if (colorSpace == 0) + colorSpace = CGColorSpaceCreateDeviceRGB(); + diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qpaintengine_mac.diff new file mode 100644 index 0000000000..e3f6f32ba1 --- /dev/null +++ b/tools/MacPorts/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 @@ + } + + 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::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 @@ + 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::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 @@ + 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/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff new file mode 100644 index 0000000000..7e5ce5c8a7 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_painting_qprintengine_mac.mm-tiger.diff @@ -0,0 +1,14 @@ +--- src/gui/painting/qprintengine_mac.mm.orig ++++ src/gui/painting/qprintengine_mac.mm +@@ -187,7 +187,11 @@ + paperMargins.top = topMargin; + paperMargins.right = rightMargin; + paperMargins.bottom = bottomMargin; ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + PMPaperCreateCustom(printer, paperId, QCFString("Custom size"), customSize.width(), customSize.height(), &paperMargins, &customPaper); ++#else ++ PMPaperCreate(printer, paperId, QCFString("Custom size"), customSize.width(), customSize.height(), &paperMargins, &customPaper); ++#endif + PMPageFormat tmp; + PMCreatePageFormatWithPMPaper(&tmp, customPaper); + PMCopyPageFormat(tmp, format); diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff new file mode 100644 index 0000000000..f52c0e6424 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontdatabase_mac.cpp-tiger.diff @@ -0,0 +1,21 @@ +--- src/gui/text/qfontdatabase_mac.cpp.orig ++++ src/gui/text/qfontdatabase_mac.cpp +@@ -546,6 +546,7 @@ + + QString QFontDatabase::resolveFontFamilyAlias(const QString &family) + { ++#if defined(QT_MAC_USE_COCOA) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + QCFString expectedFamily = QCFString(family); + + QCFType attributes = CFDictionaryCreateMutable(NULL, 0, +@@ -563,6 +564,10 @@ + + QCFString familyName = (CFStringRef) CTFontDescriptorCopyLocalizedAttribute(matched, kCTFontFamilyNameAttribute, NULL); + return familyName; ++#else ++ // https://bugreports.qt.io/browse/QTBUG-25417?focusedCommentId=185393&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-185393 ++ return family; ++#endif + } + + QT_END_NAMESPACE diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontengine_coretext.mm.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontengine_coretext.mm.diff new file mode 100644 index 0000000000..b43a14a431 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_gui_text_qfontengine_coretext.mm.diff @@ -0,0 +1,11 @@ +--- src/gui/text/qfontengine_coretext.mm.orig ++++ src/gui/text/qfontengine_coretext.mm +@@ -886,7 +886,7 @@ + + QFixed QCoreTextFontEngine::emSquareSize() const + { +- return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont))); ++ return QFixed(int(CTFontGetUnitsPerEm(ctfont))); + } + + QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff new file mode 100644 index 0000000000..78b9839227 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_network_kernel_qnetworkproxy_mac.cpp-tiger.diff @@ -0,0 +1,18 @@ +--- src/network/kernel/qnetworkproxy_mac.cpp.orig ++++ src/network/kernel/qnetworkproxy_mac.cpp +@@ -148,6 +148,7 @@ + } + + ++#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5) + static QNetworkProxy proxyFromDictionary(CFDictionaryRef dict) + { + QNetworkProxy::ProxyType proxyType = QNetworkProxy::DefaultProxy; +@@ -180,6 +181,7 @@ + + return QNetworkProxy(proxyType, hostName, port, user, password); + } ++#endif + + const char * cfurlErrorDescription(SInt32 errorCode) + { diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-src_qbase.pri.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_qbase.pri.diff new file mode 100644 index 0000000000..c330805736 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_qbase.pri.diff @@ -0,0 +1,30 @@ +--- src/qbase.pri.orig ++++ src/qbase.pri +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_qt_install.pri.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_qt_install.pri.diff new file mode 100644 index 0000000000..a465e4c8f8 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_qt_install.pri.diff @@ -0,0 +1,16 @@ +--- src/qt_install.pri.orig ++++ src/qt_install.pri +@@ -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/MacPorts/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff new file mode 100644 index 0000000000..61dfdf2e04 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-src_tools_bootstrap_bootstrap.pro.diff @@ -0,0 +1,11 @@ +--- src/tools/bootstrap/bootstrap.pro.orig ++++ src/tools/bootstrap/bootstrap.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-test_compiler_version.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-test_compiler_version.diff new file mode 100644 index 0000000000..4b29be3caf --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-test_compiler_version.diff @@ -0,0 +1,11 @@ +--- configure.orig 2019-11-04 10:17:41.000000000 -0700 ++++ configure 2019-11-04 11:13:15.000000000 -0700 +@@ -7795,8 +7795,6 @@ + canBuildWebKit="no" + ;; + *) +- canBuildWebKit="no" +- canBuildQtXmlPatterns="no" + ;; + esac + ;; diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-tools-build_qtconfig.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools-build_qtconfig.diff new file mode 100644 index 0000000000..2a1bd7c12c --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools-build_qtconfig.diff @@ -0,0 +1,11 @@ +--- tools/orig.tools.pro 2014-04-10 20:37:12.000000000 +0200 ++++ tools/tools.pro 2015-03-21 21:58:01.000000000 +0100 +@@ -20,7 +20,7 @@ + SUBDIRS += designer + } + } +- unix:!symbian:!mac:!embedded:!qpa:SUBDIRS += qtconfig ++ unix:!symbian:!embedded:!qpa:SUBDIRS += qtconfig + win32:!wince*:SUBDIRS += activeqt + } + contains(QT_CONFIG, declarative) { diff --git a/tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff new file mode 100644 index 0000000000..c31df53dc3 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_fulltextsearch_fulltextsearch.pro.diff @@ -0,0 +1,14 @@ +--- tools/assistant/lib/fulltextsearch/fulltextsearch.pro.orig ++++ tools/assistant/lib/fulltextsearch/fulltextsearch.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff new file mode 100644 index 0000000000..a492204c12 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_assistant_lib_lib.pro.diff @@ -0,0 +1,26 @@ +--- tools/assistant/lib/lib.pro.orig ++++ tools/assistant/lib/lib.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_components_lib_lib.pro.diff new file mode 100644 index 0000000000..b615040e6f --- /dev/null +++ b/tools/MacPorts/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 ++++ tools/designer/src/components/lib/lib.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff new file mode 100644 index 0000000000..686a0f1fca --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_lib_lib.pro.diff @@ -0,0 +1,55 @@ +--- tools/designer/src/lib/lib.pro.orig ++++ tools/designer/src/lib/lib.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff new file mode 100644 index 0000000000..cabb6ec573 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_designer_src_uitools_uitools.pro.diff @@ -0,0 +1,88 @@ +--- tools/designer/src/uitools/uitools.pro.orig ++++ tools/designer/src/uitools/uitools.pro +@@ -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/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff new file mode 100644 index 0000000000..e3fd0913a8 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_macdeployqt_main.cpp.diff @@ -0,0 +1,11 @@ +--- tools/macdeployqt/macdeployqt/main.cpp.orig ++++ tools/macdeployqt/macdeployqt/main.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff new file mode 100644 index 0000000000..e74674cfd5 --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-tools_macdeployqt_shared_shared.cpp.diff @@ -0,0 +1,11 @@ +--- tools/macdeployqt/shared/shared.cpp.orig ++++ tools/macdeployqt/shared/shared.cpp +@@ -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/MacPorts/aqua/qt4-mac/files/patch-webkit-tiger.diff b/tools/MacPorts/aqua/qt4-mac/files/patch-webkit-tiger.diff new file mode 100644 index 0000000000..e1115ff25a --- /dev/null +++ b/tools/MacPorts/aqua/qt4-mac/files/patch-webkit-tiger.diff @@ -0,0 +1,2619 @@ +--- src/3rdparty/webkit/Source/JavaScriptCore/API/JSContextRef.cpp.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/API/JSContextRef.cpp +@@ -66,7 +66,7 @@ + #if OS(DARWIN) + // When running on Tiger or Leopard, or if the application was linked before JSGlobalContextCreate was changed + // to use a unique JSGlobalData, we use a shared one for compatibility. +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + if (NSVersionOfLinkTimeLibrary("JavaScriptCore") <= webkitFirstVersionWithConcurrentGlobalContexts) { + #else + { +--- src/3rdparty/webkit/Source/JavaScriptCore/ChangeLog.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/ChangeLog +@@ -1944,21 +1944,6 @@ + * Android.mk: Removed. + * Android.v8.wtf.mk: Removed. + +-2011-04-27 Mark Rowe +- +- Fix 32-bit build after r85036. +- +- * wtf/Platform.h: USE(PLUGIN_HOST_PROCESS) is only true for 64-bit. +- +-2011-04-27 Csaba Osztrogonác +- +- Unreviewed buildfix after r85036. +- +- Readd non-dead code. +- +- * wtf/OSAllocatorPosix.cpp: +- (WTF::OSAllocator::reserveAndCommit): +- + 2011-04-27 Adam Barth + + Reviewed by Kenneth Russell. +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/FastMalloc.cpp.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/FastMalloc.cpp +@@ -97,7 +97,12 @@ + #endif + + // Use a background thread to periodically scavenge memory to release back to the system ++// https://bugs.webkit.org/show_bug.cgi?id=27900: don't turn this on for Tiger until we have figured out why it caused a crash. ++#if defined(BUILDING_ON_TIGER) ++#define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 0 ++#else + #define USE_BACKGROUND_THREAD_TO_SCAVENGE_MEMORY 1 ++#endif + + #ifndef NDEBUG + namespace WTF { +@@ -4607,10 +4612,10 @@ + malloc_introspection_t jscore_fastmalloc_introspection = { &FastMallocZone::enumerate, &FastMallocZone::goodSize, &FastMallocZone::check, &FastMallocZone::print, + &FastMallocZone::log, &FastMallocZone::forceLock, &FastMallocZone::forceUnlock, &FastMallocZone::statistics + +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + , 0 // zone_locked will not be called on the zone unless it advertises itself as version five or higher. + #endif +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + , 0, 0, 0, 0 // These members will not be used unless the zone advertises itself as version seven or higher. + #endif + +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/OSAllocatorPosix.cpp +@@ -76,7 +76,7 @@ + flags |= MAP_NORESERVE; + #endif + +-#if OS(DARWIN) ++#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) + int fd = usage; + #else + int fd = -1; +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h +@@ -392,12 +392,16 @@ + + /* FIXME: BUILDING_ON_.., and TARGETING... macros should be folded into the OS() system */ + #include +-#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 ++#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 ++#define BUILDING_ON_TIGER 1 ++#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 + #define BUILDING_ON_LEOPARD 1 + #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7 + #define BUILDING_ON_SNOW_LEOPARD 1 + #endif +-#if !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 ++#if !defined(MAC_OS_X_VERSION_10_5) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5 ++#define TARGETING_TIGER 1 ++#elif !defined(MAC_OS_X_VERSION_10_6) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_6 + #define TARGETING_LEOPARD 1 + #elif !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 + #define TARGETING_SNOW_LEOPARD 1 +@@ -623,10 +627,10 @@ + #endif + + #if PLATFORM(MAC) && !PLATFORM(IOS) +-#if !defined(BUILDING_ON_LEOPARD) && CPU(X86_64) ++#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_TIGER) && CPU(X86_64) + #define WTF_USE_PLUGIN_HOST_PROCESS 1 + #endif +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + #define ENABLE_GESTURE_EVENTS 1 + #define ENABLE_RUBBER_BANDING 1 + #define WTF_USE_WK_SCROLLBAR_PAINTER 1 +@@ -661,7 +665,7 @@ + #define WTF_USE_CF 1 + #endif + +-#if OS(DARWIN) && !PLATFORM(GTK) && !PLATFORM(QT) ++#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) && !PLATFORM(GTK) && !PLATFORM(QT) + #define ENABLE_PURGEABLE_MEMORY 1 + #endif + +@@ -725,8 +729,12 @@ + #define ENABLE_GLOBAL_FASTMALLOC_NEW 0 + #if OS(DARWIN) + #define WTF_USE_CF 1 ++#ifndef BUILDING_ON_TIGER + #define WTF_USE_CORE_TEXT 1 + #define ENABLE_WEB_ARCHIVE 1 ++#else ++#define WTF_USE_ATSUI 1 ++#endif + #endif + #endif + +@@ -791,7 +799,7 @@ + #define HAVE_SYS_TIMEB_H 1 + #define WTF_USE_ACCELERATE 1 + +-#ifndef TARGETING_LEOPARD ++#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD) + + #define HAVE_DISPATCH_H 1 + #define HAVE_HOSTED_CORE_ANIMATION 1 +@@ -1153,7 +1161,7 @@ + + #if PLATFORM(MAC) + /* Complex text framework */ +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + #define WTF_USE_ATSUI 0 + #define WTF_USE_CORE_TEXT 1 + #else +@@ -1163,15 +1171,15 @@ + #endif + + /* Accelerated compositing */ +-#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) &&!defined(WIN_CAIRO)) ++#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) &&!defined(WIN_CAIRO)) + #define WTF_USE_ACCELERATED_COMPOSITING 1 + #endif + +-#if (PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS) ++#if (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) || PLATFORM(IOS) + #define WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK 1 + #endif + +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + #define WTF_USE_AVFOUNDATION 1 + #endif + +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/VMTags.h.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/VMTags.h +@@ -32,6 +32,8 @@ + + #include + ++#if !defined(TARGETING_TIGER) ++ + #if defined(VM_MEMORY_TCMALLOC) + #define VM_TAG_FOR_TCMALLOC_MEMORY VM_MAKE_TAG(VM_MEMORY_TCMALLOC) + #else +@@ -50,6 +52,19 @@ + #define VM_TAG_FOR_REGISTERFILE_MEMORY VM_MAKE_TAG(65) + #endif // defined(VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE) + ++#else // !defined(TARGETING_TIGER) ++ ++// mmap on Tiger fails with tags that work on Leopard, so fall ++// back to Tiger-compatible tags (that also work on Leopard) ++// when targeting Tiger. ++#define VM_TAG_FOR_TCMALLOC_MEMORY -1 ++#define VM_TAG_FOR_EXECUTABLEALLOCATOR_MEMORY -1 ++#define VM_TAG_FOR_REGISTERFILE_MEMORY -1 ++ ++#endif // !defined(TARGETING_TIGER) ++ ++// Tags for vm_map and vm_allocate work on both Tiger and Leopard. ++ + #if defined(VM_MEMORY_JAVASCRIPT_CORE) + #define VM_TAG_FOR_COLLECTOR_MEMORY VM_MAKE_TAG(VM_MEMORY_JAVASCRIPT_CORE) + #else +--- src/3rdparty/webkit/Source/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp.orig ++++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/unicode/icu/CollatorICU.cpp +@@ -61,7 +61,7 @@ + { + #if OS(DARWIN) && USE(CF) + // Mac OS X doesn't set UNIX locale to match user-selected one, so ICU default doesn't work. +-#if !defined(BUILDING_ON_LEOPARD) && !OS(IOS) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !OS(IOS) + RetainPtr currentLocale(AdoptCF, CFLocaleCopyCurrent()); + CFStringRef collationOrder = (CFStringRef)CFLocaleGetValue(currentLocale.get(), kCFLocaleCollatorIdentifier); + #else +--- src/3rdparty/webkit/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig.orig ++++ src/3rdparty/webkit/Source/ThirdParty/ANGLE/Configurations/Base.xcconfig +@@ -35,6 +35,9 @@ + + // If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK. + SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ++SDKROOT_1050_1040 = macosx10.4internal; ++SDKROOT_1060_1040 = macosx10.4internal; + SDKROOT_1060_1050 = macosx10.5internal; ++SDKROOT_1070_1040 = macosx10.4internal; + SDKROOT_1070_1050 = macosx10.5internal; + SDKROOT_1070_1060 = macosx10.6internal; +--- src/3rdparty/webkit/Source/ThirdParty/ANGLE/Configurations/CompilerVersion.xcconfig.orig ++++ src/3rdparty/webkit/Source/ThirdParty/ANGLE/Configurations/CompilerVersion.xcconfig +@@ -29,6 +29,8 @@ + // number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and + // XCODE_VERSION_ACTUAL for the full version number. + TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ++TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040); ++TARGET_GCC_VERSION_1040 = GCC_40; + + TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR)); + TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL)); +--- src/3rdparty/webkit/Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig.orig ++++ src/3rdparty/webkit/Source/ThirdParty/ANGLE/Configurations/DebugRelease.xcconfig +@@ -1,6 +1,8 @@ + #include "Base.xcconfig" + + ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ++ARCHS_ = $(ARCHS_1040); ++ARCHS_1040 = $(NATIVE_ARCH); + ARCHS_1050 = $(NATIVE_ARCH); + ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT); + ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT); +@@ -8,6 +10,8 @@ + ONLY_ACTIVE_ARCH = YES; + + MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR)); ++MACOSX_DEPLOYMENT_TARGET_ = 10.4; ++MACOSX_DEPLOYMENT_TARGET_1040 = 10.4; + MACOSX_DEPLOYMENT_TARGET_1050 = 10.5; + MACOSX_DEPLOYMENT_TARGET_1060 = 10.6; + MACOSX_DEPLOYMENT_TARGET_1070 = 10.7; +--- src/3rdparty/webkit/Source/WebCore/WebCore.exp.in.orig ++++ src/3rdparty/webkit/Source/WebCore/WebCore.exp.in +@@ -1419,7 +1419,7 @@ + __ZN7WebCore20LogNotYetImplementedE + #endif + +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + _wkContentAreaDidHide + _wkContentAreaDidShow + _wkContentAreaResized +@@ -1785,6 +1785,21 @@ + .objc_class_name_DOMSVGForeignObjectElement + #endif + ++#if defined(BUILDING_ON_TIGER) ++_wkClearGlyphVector ++_wkConvertCharToGlyphs ++_wkCopyFullFontName ++_wkGetATSStyleGroup ++_wkGetCGFontFromNSFont ++_wkGetFontMetrics ++_wkGetGlyphVectorFirstRecord ++_wkGetGlyphVectorNumGlyphs ++_wkGetGlyphVectorRecordSize ++_wkGetNSFontATSUFontId ++_wkInitializeGlyphVector ++_wkReleaseStyleGroup ++_wkSupportsMultipartXMixedReplace ++#endif + + #if ENABLE(VIDEO) + __ZN7WebCore16HTMLMediaElement12endScrubbingEv +@@ -1850,7 +1865,7 @@ + __ZNK7WebCore23ApplicationCacheStorage11maximumSizeEv + #endif + +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + __ZN7WebCore6Editor13lowercaseWordEv + __ZN7WebCore6Editor13uppercaseWordEv + __ZN7WebCore6Editor14capitalizeWordEv +--- src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityList.h.orig ++++ src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityList.h +@@ -29,7 +29,7 @@ + #ifndef AccessibilityList_h + #define AccessibilityList_h + +-#if PLATFORM(MAC) && defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && (defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)) + #define ACCESSIBILITY_LISTS 0 + #else + #define ACCESSIBILITY_LISTS 1 +--- src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityTable.h.orig ++++ src/3rdparty/webkit/Source/WebCore/accessibility/AccessibilityTable.h +@@ -32,7 +32,7 @@ + #include "AccessibilityRenderObject.h" + #include + +-#if PLATFORM(MAC) && defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && (defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)) + #define ACCESSIBILITY_TABLES 0 + #else + #define ACCESSIBILITY_TABLES 1 +--- src/3rdparty/webkit/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp +@@ -205,7 +205,7 @@ + + // This is a deprecated code path which should not be required on Android. + // Remove this guard once Bug 39476 is fixed. +-#if PLATFORM(ANDROID) ++#if PLATFORM(ANDROID) || defined(BUILDING_ON_TIGER) + if (!handled) + result = callJNIMethod(m_instance->m_instance, jMethod->returnType(), jMethod->name().utf8().data(), jMethod->signature(), jArgs.data()); + #endif +--- src/3rdparty/webkit/Source/WebCore/config.h.orig ++++ src/3rdparty/webkit/Source/WebCore/config.h +@@ -239,6 +239,10 @@ + #endif + #endif /* USE(CG) */ + ++#ifdef BUILDING_ON_TIGER ++#undef ENABLE_FTPDIR ++#define ENABLE_FTPDIR 0 ++#endif + + #if PLATFORM(WIN) && USE(CG) + #define WTF_USE_SAFARI_THEME 1 +--- src/3rdparty/webkit/Source/WebCore/css/CSSImportRule.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/css/CSSImportRule.cpp +@@ -67,7 +67,7 @@ + bool enforceMIMEType = strict; + bool needsSiteSpecificQuirks = parent && parent->document() && parent->document()->settings() && parent->document()->settings()->needsSiteSpecificQuirks(); + +-#ifdef BUILDING_ON_LEOPARD ++#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + if (enforceMIMEType && needsSiteSpecificQuirks) { + // Covers both http and https, with or without "www." + if (baseURL.string().contains("mcafee.com/japan/", false)) +--- src/3rdparty/webkit/Source/WebCore/dom/Document.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/dom/Document.cpp +@@ -326,9 +326,9 @@ + + static bool disableRangeMutation(Page* page) + { +- // This check is made on super-hot code paths, so we only want this on Leopard. +-#ifdef TARGETING_LEOPARD +- // Disable Range mutation on document modifications in Leopard Mail. ++ // This check is made on super-hot code paths, so we only want this on Tiger and Leopard. ++#if defined(TARGETING_TIGER) || defined(TARGETING_LEOPARD) ++ // Disable Range mutation on document modifications in Tiger and Leopard Mail + // See + return page && (page->settings()->needsLeopardMailQuirks() || page->settings()->needsTigerMailQuirks()); + #else +--- src/3rdparty/webkit/Source/WebCore/editing/Editor.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/editing/Editor.cpp +@@ -1908,10 +1908,14 @@ + return; + } + ++#ifndef BUILDING_ON_TIGER ++ // Post-Tiger, this menu item is a show/hide toggle, to match AppKit. Leave Tiger behavior alone ++ // to match rest of OS X. + if (client()->spellingUIIsShowing()) { + client()->showSpellingUI(false); + return; + } ++#endif + + advanceToNextMisspelling(true); + client()->showSpellingUI(true); +@@ -3151,9 +3155,9 @@ + } + } + +-#if !PLATFORM(MAC) || (PLATFORM(MAC) && (defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD))) ++#if !PLATFORM(MAC) || (PLATFORM(MAC) && (defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD))) + // This only erases markers that are in the first unit (word or sentence) of the selection. +- // Perhaps peculiar, but it matches AppKit on these Mac OS X versions. ++ // Perhaps peculiar, but it matches AppKit on these Mac OSX versions. + if (RefPtr wordRange = newAdjacentWords.toNormalizedRange()) + m_frame->document()->markers()->removeMarkers(wordRange.get(), DocumentMarker::Spelling); + #endif +--- src/3rdparty/webkit/Source/WebCore/editing/SpellingCorrectionController.h.orig ++++ src/3rdparty/webkit/Source/WebCore/editing/SpellingCorrectionController.h +@@ -26,7 +26,7 @@ + #ifndef SpellingCorrectionController_h + #define SpellingCorrectionController_h + +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + // Some platforms provide UI for suggesting autocorrection. + #define SUPPORT_AUTOCORRECTION_PANEL 1 + // Some platforms use spelling and autocorrection markers to provide visual cue. +@@ -35,7 +35,7 @@ + #else + #define SUPPORT_AUTOCORRECTION_PANEL 0 + #define REMOVE_MARKERS_UPON_EDITING 0 +-#endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + + #include "DocumentMarker.h" + #include "EditCommand.h" +--- src/3rdparty/webkit/Source/WebCore/editing/TypingCommand.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/editing/TypingCommand.cpp +@@ -321,7 +321,7 @@ + + void TypingCommand::markMisspellingsAfterTyping(ETypingCommand commandType) + { +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + if (!document()->frame()->editor()->isContinuousSpellCheckingEnabled() + && !document()->frame()->editor()->isAutomaticQuoteSubstitutionEnabled() + && !document()->frame()->editor()->isAutomaticLinkDetectionEnabled() +@@ -356,7 +356,7 @@ + { + updatePreservesTypingStyle(commandTypeForAddedTyping); + +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + document()->frame()->editor()->appliedEditing(this); + // Since the spellchecking code may also perform corrections and other replacements, it should happen after the typing changes. + if (!m_shouldPreventSpellChecking) +--- src/3rdparty/webkit/Source/WebCore/html/HTMLLinkElement.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/html/HTMLLinkElement.cpp +@@ -376,7 +376,7 @@ + if (enforceMIMEType && document()->page() && !document()->page()->settings()->enforceCSSMIMETypeInNoQuirksMode()) + enforceMIMEType = false; + +-#ifdef BUILDING_ON_LEOPARD ++#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + if (enforceMIMEType && needsSiteSpecificQuirks) { + // Covers both http and https, with or without "www." + if (baseURL.string().contains("mcafee.com/japan/", false)) +--- src/3rdparty/webkit/Source/WebCore/loader/EmptyClients.h.orig ++++ src/3rdparty/webkit/Source/WebCore/loader/EmptyClients.h +@@ -492,8 +492,11 @@ + virtual void setInsertionPasteboard(NSPasteboard*) { }; + virtual NSURL* canonicalizeURL(NSURL*) { return 0; } + virtual NSURL* canonicalizeURLString(NSString*) { return 0; } ++#ifdef BUILDING_ON_TIGER ++ virtual NSArray* pasteboardTypesForSelection(Frame*) { return 0; } + #endif +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#endif ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + virtual void uppercaseWord() { } + virtual void lowercaseWord() { } + virtual void capitalizeWord() { } +--- src/3rdparty/webkit/Source/WebCore/loader/FrameLoader.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/loader/FrameLoader.cpp +@@ -2126,8 +2126,12 @@ + + case FrameLoadTypeStandard: + history()->updateForStandardLoad(); ++#ifndef BUILDING_ON_TIGER ++ // This code was originally added for a Leopard performance imporvement. We decided to ++ // ifdef it to fix correctness issues on Tiger documented in . + if (m_frame->view()) + m_frame->view()->setScrollbarsSuppressed(true); ++#endif + m_client->transitionToCommittedForNewPage(); + break; + +--- src/3rdparty/webkit/Source/WebCore/loader/MainResourceLoader.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/loader/MainResourceLoader.cpp +@@ -42,6 +42,9 @@ + #include "HTMLFormElement.h" + #include "InspectorInstrumentation.h" + #include "Page.h" ++#if PLATFORM(QT) ++#include "PluginDatabase.h" ++#endif + #include "ResourceError.h" + #include "ResourceHandle.h" + #include "ResourceLoadScheduler.h" +@@ -50,10 +53,6 @@ + #include "Settings.h" + #include + +-#if PLATFORM(QT) +-#include "PluginDatabase.h" +-#endif +- + // FIXME: More that is in common with SubresourceLoader should move up into ResourceLoader. + + namespace WebCore { +@@ -435,7 +434,7 @@ + + ASSERT(!m_response.isNull()); + +-#if USE(CFNETWORK) || PLATFORM(MAC) ++#if USE(CFNETWORK) || (PLATFORM(MAC) && !defined(BUILDING_ON_TIGER)) + // Workaround for + if (m_response.isNull()) { + m_response = ResourceResponse(KURL(), "text/html", 0, String(), String()); +--- src/3rdparty/webkit/Source/WebCore/page/ContextMenuController.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/page/ContextMenuController.cpp +@@ -361,9 +361,11 @@ + case ContextMenuItemTagCheckSpellingWhileTyping: + frame->editor()->toggleContinuousSpellChecking(); + break; ++#ifndef BUILDING_ON_TIGER + case ContextMenuItemTagCheckGrammarWithSpelling: + frame->editor()->toggleGrammarChecking(); + break; ++#endif + #if PLATFORM(MAC) + case ContextMenuItemTagShowFonts: + frame->editor()->showFontPanel(); +@@ -375,7 +377,7 @@ + frame->editor()->showColorPanel(); + break; + #endif +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + case ContextMenuItemTagMakeUpperCase: + frame->editor()->uppercaseWord(); + break; +@@ -465,6 +467,7 @@ + fontMenuItem.setSubMenu(&fontMenu); + } + ++#if !defined(BUILDING_ON_TIGER) + + #if !PLATFORM(GTK) + +@@ -501,6 +504,27 @@ + + #endif // !PLATFORM(GTK) + ++#else ++ ++void ContextMenuController::createAndAppendSpellingSubMenu(ContextMenuItem& spellingMenuItem) ++{ ++ ContextMenu spellingMenu; ++ ++ ContextMenuItem showSpellingPanel(ActionType, ContextMenuItemTagShowSpellingPanel, ++ contextMenuItemTagShowSpellingPanel(true)); ++ ContextMenuItem checkSpelling(ActionType, ContextMenuItemTagCheckSpelling, ++ contextMenuItemTagCheckSpelling()); ++ ContextMenuItem checkAsYouType(CheckableActionType, ContextMenuItemTagCheckSpellingWhileTyping, ++ contextMenuItemTagCheckSpellingWhileTyping()); ++ ++ appendItem(showSpellingPanel, &spellingMenu); ++ appendItem(checkSpelling, &spellingMenu); ++ appendItem(checkAsYouType, &spellingMenu); ++ ++ spellingMenuItem.setSubMenu(&spellingMenu); ++} ++ ++#endif + + #if PLATFORM(MAC) + +@@ -554,7 +578,7 @@ + + #endif + +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + + void ContextMenuController::createAndAppendSubstitutionsSubMenu(ContextMenuItem& substitutionsMenuItem) + { +@@ -609,7 +633,7 @@ + } + + #if PLATFORM(MAC) +-#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) ++#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) + #define INCLUDE_SPOTLIGHT_CONTEXT_MENU_ITEM 1 + #else + #define INCLUDE_SPOTLIGHT_CONTEXT_MENU_ITEM 0 +@@ -839,7 +863,7 @@ + } else + appendItem(IgnoreGrammarItem, m_contextMenu.get()); + appendItem(*separatorItem(), m_contextMenu.get()); +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + } else { + // If the string was autocorrected, generate a contextual menu item allowing it to be changed back. + String replacedString = m_hitTestResult.replacedString(); +@@ -899,6 +923,7 @@ + #endif + + if (!inPasswordField) { ++#ifndef BUILDING_ON_TIGER + #if !PLATFORM(GTK) + appendItem(*separatorItem(), m_contextMenu.get()); + ContextMenuItem SpellingAndGrammarMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu, +@@ -906,7 +931,13 @@ + createAndAppendSpellingAndGrammarSubMenu(SpellingAndGrammarMenuItem); + appendItem(SpellingAndGrammarMenuItem, m_contextMenu.get()); + #endif +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#else ++ ContextMenuItem SpellingMenuItem(SubmenuType, ContextMenuItemTagSpellingMenu, ++ contextMenuItemTagSpellingMenu()); ++ createAndAppendSpellingSubMenu(SpellingMenuItem); ++ appendItem(SpellingMenuItem, m_contextMenu.get()); ++#endif ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + ContextMenuItem substitutionsMenuItem(SubmenuType, ContextMenuItemTagSubstitutionsMenu, + contextMenuItemTagSubstitutionsMenu()); + createAndAppendSubstitutionsSubMenu(substitutionsMenuItem); +@@ -1059,9 +1090,11 @@ + shouldEnable = frame->selection()->isRange(); + break; + case ContextMenuItemTagCheckGrammarWithSpelling: ++#ifndef BUILDING_ON_TIGER + if (frame->editor()->isGrammarCheckingEnabled()) + shouldCheck = true; + shouldEnable = true; ++#endif + break; + case ContextMenuItemTagItalic: { + shouldCheck = frame->editor()->selectionHasStyle(CSSPropertyFontStyle, "italic") != FalseTriState; +@@ -1077,10 +1110,12 @@ + shouldEnable = false; + break; + case ContextMenuItemTagShowSpellingPanel: ++#ifndef BUILDING_ON_TIGER + if (frame->editor()->spellingPanelIsShowing()) + item.setTitle(contextMenuItemTagShowSpellingPanel(false)); + else + item.setTitle(contextMenuItemTagShowSpellingPanel(true)); ++#endif + shouldEnable = frame->editor()->canEdit(); + break; + case ContextMenuItemTagNoGuessesFound: +@@ -1094,7 +1129,7 @@ + case ContextMenuItemTagTransformationsMenu: + break; + case ContextMenuItemTagShowSubstitutions: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + if (frame->editor()->substitutionsPanelIsShowing()) + item.setTitle(contextMenuItemTagShowSubstitutions(false)); + else +@@ -1109,32 +1144,32 @@ + shouldEnable = frame->editor()->canEdit(); + break; + case ContextMenuItemTagCorrectSpellingAutomatically: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + shouldCheck = frame->editor()->isAutomaticSpellingCorrectionEnabled(); + #endif + break; + case ContextMenuItemTagSmartCopyPaste: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + shouldCheck = frame->editor()->smartInsertDeleteEnabled(); + #endif + break; + case ContextMenuItemTagSmartQuotes: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + shouldCheck = frame->editor()->isAutomaticQuoteSubstitutionEnabled(); + #endif + break; + case ContextMenuItemTagSmartDashes: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + shouldCheck = frame->editor()->isAutomaticDashSubstitutionEnabled(); + #endif + break; + case ContextMenuItemTagSmartLinks: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + shouldCheck = frame->editor()->isAutomaticLinkDetectionEnabled(); + #endif + break; + case ContextMenuItemTagTextReplacement: +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + shouldCheck = frame->editor()->isAutomaticTextReplacementEnabled(); + #endif + break; +--- src/3rdparty/webkit/Source/WebCore/page/EditorClient.h.orig ++++ src/3rdparty/webkit/Source/WebCore/page/EditorClient.h +@@ -132,9 +132,12 @@ + virtual void setInsertionPasteboard(NSPasteboard*) = 0; + virtual NSURL* canonicalizeURL(NSURL*) = 0; + virtual NSURL* canonicalizeURLString(NSString*) = 0; ++#ifdef BUILDING_ON_TIGER ++ virtual NSArray* pasteboardTypesForSelection(Frame*) = 0; ++#endif + #endif + +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + virtual void uppercaseWord() = 0; + virtual void lowercaseWord() = 0; + virtual void capitalizeWord() = 0; +--- src/3rdparty/webkit/Source/WebCore/platform/DefaultLocalizationStrategy.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/DefaultLocalizationStrategy.cpp +@@ -316,7 +316,7 @@ + + String DefaultLocalizationStrategy::contextMenuItemTagLookUpInDictionary(const String& selectedString) + { +-#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) ++#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD) + UNUSED_PARAM(selectedString); + return WEB_UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item"); + #else +--- src/3rdparty/webkit/Source/WebCore/platform/SuddenTermination.h.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/SuddenTermination.h +@@ -34,7 +34,7 @@ + void disableSuddenTermination(); + void enableSuddenTermination(); + +-#if (!PLATFORM(MAC) || defined(BUILDING_ON_LEOPARD)) && !PLATFORM(CHROMIUM) ++#if (!PLATFORM(MAC) || defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)) && !PLATFORM(CHROMIUM) + inline void disableSuddenTermination() { } + inline void enableSuddenTermination() { } + #endif +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/FontPlatformData.h.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/FontPlatformData.h +@@ -62,7 +62,9 @@ + #endif + + typedef struct CGFont* CGFontRef; ++#ifndef BUILDING_ON_TIGER + typedef const struct __CTFont* CTFontRef; ++#endif + + #include + #include +@@ -85,18 +87,20 @@ + #if USE(CG) || USE(SKIA_ON_MAC_CHROME) + typedef struct CGFont* CGFontRef; + #if OS(DARWIN) ++#ifndef BUILDING_ON_TIGER + typedef const struct __CTFont* CTFontRef; + typedef UInt32 FMFont; + typedef FMFont ATSUFontID; + typedef UInt32 ATSFontRef; + #endif + #endif ++#endif + + namespace WebCore { + + class FontDescription; + +-#if OS(DARWIN) ++#if OS(DARWIN) && !defined(BUILDING_ON_TIGER) + inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast(nsFont); } + #endif + +@@ -114,7 +118,7 @@ + #elif OS(DARWIN) + , m_font(hashTableDeletedFontValue()) + #endif +-#if USE(CG) && PLATFORM(WIN) ++#if USE(CG) && (defined(BUILDING_ON_TIGER) || PLATFORM(WIN)) + , m_cgFont(0) + #elif USE(CAIRO) + , m_scaledFont(hashTableDeletedFontValue()) +@@ -136,7 +140,7 @@ + #if OS(DARWIN) + , m_font(0) + #endif +-#if USE(CG) && PLATFORM(WIN) ++#if USE(CG) && (defined(BUILDING_ON_TIGER) || PLATFORM(WIN)) + , m_cgFont(0) + #elif USE(CAIRO) + , m_scaledFont(0) +@@ -161,7 +165,7 @@ + #if OS(DARWIN) + , m_font(0) + #endif +-#if USE(CG) && PLATFORM(WIN) ++#if USE(CG) && (defined(BUILDING_ON_TIGER) || PLATFORM(WIN)) + , m_cgFont(0) + #elif USE(CAIRO) + , m_scaledFont(0) +@@ -214,7 +218,11 @@ + + #if USE(CG) || USE(SKIA_ON_MAC_CHROME) + #if OS(DARWIN) ++#ifndef BUILDING_ON_TIGER + CGFontRef cgFont() const { return m_cgFont.get(); } ++#else ++ CGFontRef cgFont() const { return m_cgFont; } ++#endif + CTFontRef ctFont() const; + + bool roundsGlyphAdvances() const; +@@ -325,7 +333,11 @@ + #if PLATFORM(WIN) + RetainPtr m_cgFont; + #else ++#ifndef BUILDING_ON_TIGER + RetainPtr m_cgFont; ++#else ++ CGFontRef m_cgFont; // It is not necessary to refcount this, since either an NSFont owns it or some CachedFont has it referenced. ++#endif + mutable RetainPtr m_CTFont; + #endif + #endif +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/Gradient.h.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/Gradient.h +@@ -39,7 +39,7 @@ + + typedef struct CGContext* CGContextRef; + +-#define USE_CG_SHADING defined(BUILDING_ON_LEOPARD) ++#define USE_CG_SHADING defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + + #if USE_CG_SHADING + typedef struct CGShading* CGShadingRef; +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/SimpleFontData.h.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/SimpleFontData.h +@@ -256,6 +256,12 @@ + float m_syntheticBoldOffset; + #endif + ++#ifdef BUILDING_ON_TIGER ++public: ++ void* m_styleGroup; ++ ++private: ++#endif + + #if USE(ATSUI) + public: +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp +@@ -45,7 +45,7 @@ + + using namespace std; + +-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD)) ++#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) + + namespace WebCore { + +@@ -1263,7 +1263,7 @@ + + // FIXME: maybe only do trilinear if the image is being scaled down, + // but then what if the layer size changes? +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + m_contentsLayer->setMinificationFilter(PlatformCALayer::Trilinear); + #endif + m_contentsLayer->setContents(m_pendingContentsImage.get()); +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/ca/mac/PlatformCAAnimationMac.mm +@@ -35,7 +35,7 @@ + #import + #import + +-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD)) ++#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) + + using namespace WebCore; + +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm +@@ -41,7 +41,7 @@ + #import + #import + +-#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD)) ++#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) + + using namespace WebCore; + +@@ -91,7 +91,7 @@ + + @interface CALayer(Private) + - (void)setContentsChanged; +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + - (void)setAcceleratesDrawing:(BOOL)flag; + - (BOOL)acceleratesDrawing; + #endif +@@ -557,7 +557,7 @@ + + bool PlatformCALayer::acceleratesDrawing() const + { +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + return [m_layer.get() acceleratesDrawing]; + #else + return false; +@@ -566,7 +566,7 @@ + + void PlatformCALayer::setAcceleratesDrawing(bool acceleratesDrawing) + { +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + BEGIN_BLOCK_OBJC_EXCEPTIONS + [m_layer.get() setAcceleratesDrawing:acceleratesDrawing]; + END_BLOCK_OBJC_EXCEPTIONS +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp +@@ -53,12 +53,12 @@ + + #if PLATFORM(MAC) || (PLATFORM(CHROMIUM) && OS(DARWIN)) + +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + // Building on 10.6 or later: kCGInterpolationMedium is defined in the CGInterpolationQuality enum. + #define HAVE_CG_INTERPOLATION_MEDIUM 1 + #endif + +-#ifndef TARGETING_LEOPARD ++#if !defined(TARGETING_TIGER) && !defined(TARGETING_LEOPARD) + // Targeting 10.6 or later: use kCGInterpolationMedium. + #define WTF_USE_CG_INTERPOLATION_MEDIUM 1 + #endif +@@ -93,7 +93,7 @@ + CGColorSpaceRef sRGBColorSpaceRef() + { + // FIXME: Windows should be able to use kCGColorSpaceSRGB, this is tracked by http://webkit.org/b/31363. +-#if PLATFORM(WIN) ++#if PLATFORM(WIN) || defined(BUILDING_ON_TIGER) + return deviceRGBColorSpaceRef(); + #else + static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); +@@ -104,7 +104,7 @@ + CGColorSpaceRef linearRGBColorSpaceRef() + { + // FIXME: Windows should be able to use kCGColorSpaceGenericRGBLinear, this is tracked by http://webkit.org/b/31363. +-#if PLATFORM(WIN) ++#if PLATFORM(WIN) || defined(BUILDING_ON_TIGER) + return deviceRGBColorSpaceRef(); + #else + static CGColorSpaceRef linearRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGBLinear); +@@ -1353,7 +1353,7 @@ + void GraphicsContext::setAllowsFontSmoothing(bool allowsFontSmoothing) + { + UNUSED_PARAM(allowsFontSmoothing); +-#if !defined(BUILDING_ON_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + CGContextRef context = platformContext(); + CGContextSetAllowsFontSmoothing(context, allowsFontSmoothing); + #endif +@@ -1457,6 +1457,7 @@ + CGContextSetShouldSmoothFonts(platformContext(), enable); + } + ++#ifndef BUILDING_ON_TIGER // Tiger's setPlatformCompositeOperation() is defined in GraphicsContextMac.mm. + void GraphicsContext::setPlatformCompositeOperation(CompositeOperator mode) + { + if (paintingDisabled()) +@@ -1509,5 +1510,6 @@ + } + CGContextSetBlendMode(platformContext(), target); + } ++#endif + + } +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/ImageBufferDataCG.h +@@ -29,7 +29,7 @@ + #include + #include + +-#if (PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)) ++#if (PLATFORM(MAC) && USE(CA) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)) + #define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1 + #endif + +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/ImageCG.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/ImageCG.cpp +@@ -313,9 +313,11 @@ + // Adjust the color space. + subImage = imageWithColorSpace(subImage.get(), styleColorSpace); + ++#ifndef BUILDING_ON_TIGER + // Leopard has an optimized call for the tiling of image patterns, but we can only use it if the image has been decoded enough that + // its buffer is the same size as the overall image. Because a partially decoded CGImageRef with a smaller width or height than the + // overall image buffer needs to tile with "gaps", we can't use the optimized tiling call in that case. ++ // FIXME: Could create WebKitSystemInterface SPI for CGCreatePatternWithImage2 and probably make Tiger tile faster as well. + // FIXME: We cannot use CGContextDrawTiledImage with scaled tiles on Leopard, because it suffers from rounding errors. Snow Leopard is ok. + float scaledTileWidth = tileRect.width() * narrowPrecisionToFloat(patternTransform.a()); + float w = CGImageGetWidth(tileImage); +@@ -326,8 +328,12 @@ + #endif + CGContextDrawTiledImage(context, FloatRect(adjustedX, adjustedY, scaledTileWidth, scaledTileHeight), subImage.get()); + else { ++#endif + +- // On Leopard and newer, this code now only runs for partially decoded images whose buffers do not yet match the overall size of the image. ++ // On Leopard, this code now only runs for partially decoded images whose buffers do not yet match the overall size of the image. ++ // On Tiger this code runs all the time. This code is suboptimal because the pattern does not reference the image directly, and the ++ // pattern is destroyed before exiting the function. This means any decoding the pattern does doesn't end up cached anywhere, so we ++ // redecode every time we paint. + static const CGPatternCallbacks patternCallbacks = { 0, drawPatternCallback, NULL }; + CGAffineTransform matrix = CGAffineTransformMake(narrowPrecisionToCGFloat(patternTransform.a()), 0, 0, narrowPrecisionToCGFloat(patternTransform.d()), adjustedX, adjustedY); + matrix = CGAffineTransformConcat(matrix, CGContextGetCTM(context)); +@@ -352,7 +358,9 @@ + CGContextSetFillColorWithColor(context, color.get()); + CGContextFillRect(context, CGContextGetClipBoundingBox(context)); + ++#ifndef BUILDING_ON_TIGER + } ++#endif + + stateSaver.restore(); + +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp +@@ -83,7 +83,7 @@ + + void ImageSource::clear(bool destroyAllFrames, size_t, SharedBuffer* data, bool allDataReceived) + { +-#if !defined(BUILDING_ON_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + // Recent versions of ImageIO discard previously decoded image frames if the client + // application no longer holds references to them, so there's no need to throw away + // the decoder unless we're explicitly asked to destroy all of the frames. +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm +@@ -37,7 +37,11 @@ + void FontPlatformData::loadFont(NSFont* nsFont, float, NSFont*& outNSFont, CGFontRef& cgFont) + { + outNSFont = nsFont; ++#ifndef BUILDING_ON_TIGER + cgFont = CTFontCopyGraphicsFont(toCTFontRef(nsFont), 0); ++#else ++ cgFont = wkGetCGFontFromNSFont(nsFont); ++#endif + } + #endif // PLATFORM(MAC) + +@@ -50,7 +54,7 @@ + , m_size(size) + , m_widthVariant(widthVariant) + , m_font(nsFont) +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + // FIXME: Chromium: The following code isn't correct for the Chromium port since the sandbox might + // have blocked font loading, in which case we'll only have the real loaded font file after the call to loadFont(). + , m_isColorBitmapFont(CTFontGetSymbolicTraits(toCTFontRef(nsFont)) & kCTFontColorGlyphsTrait) +@@ -66,7 +70,11 @@ + if (m_font) + CFRetain(m_font); + ++#ifndef BUILDING_ON_TIGER + m_cgFont.adoptCF(cgFont); ++#else ++ m_cgFont = cgFont; ++#endif + } + + FontPlatformData:: ~FontPlatformData() +@@ -138,8 +146,12 @@ + } + #endif + ++#ifndef BUILDING_ON_TIGER + m_cgFont.adoptCF(cgFont); +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#else ++ m_cgFont = cgFont; ++#endif ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + m_isColorBitmapFont = CTFontGetSymbolicTraits(toCTFontRef(m_font)) & kCTFontColorGlyphsTrait; + #endif + m_CTFont = 0; +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp +@@ -1611,7 +1611,7 @@ + + bool MediaPlayerPrivateGStreamer::supportsFullscreen() const + { +-#if defined(BUILDING_ON_LEOPARD) ++#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + // See + return false; + #else +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/ComplexTextController.h.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/ComplexTextController.h +@@ -122,6 +122,9 @@ + ComplexTextRun(const SimpleFontData*, const UChar* characters, unsigned stringLocation, size_t stringLength, bool ltr); + + #if USE(ATSUI) ++#ifdef BUILDING_ON_TIGER ++ typedef UInt32 URefCon; ++#endif + static OSStatus overrideLayoutOperation(ATSULayoutOperationSelector, ATSULineRef, URefCon, void*, ATSULayoutOperationCallbackStatus*); + #endif + +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp +@@ -144,7 +144,7 @@ + static CFDictionaryRef ltrTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, ltrOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + static CFDictionaryRef rtlTypesetterOptions = CFDictionaryCreate(kCFAllocatorDefault, optionKeys, rtlOptionValues, WTF_ARRAY_LENGTH(optionKeys), &kCFCopyStringDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); + +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + ProviderInfo info = { cp, length, fontData->getCFStringAttributes(m_font.typesettingFeatures(), fontData->platformData().orientation()) }; + RetainPtr typesetter(AdoptCF, wkCreateCTTypesetterWithUniCharProviderAndOptions(&provideStringAndAttributes, 0, &info, m_run.ltr() ? ltrTypesetterOptions : rtlTypesetterOptions)); + #else +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/FontCacheMac.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/FontCacheMac.mm +@@ -39,6 +39,9 @@ + #import + #import + ++#ifdef BUILDING_ON_TIGER ++typedef int NSInteger; ++#endif + + namespace WebCore { + +@@ -52,7 +55,7 @@ + fontCache()->invalidate(); + } + +-#if !defined(BUILDING_ON_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + static void fontCacheRegisteredFontsChangedNotificationCallback(CFNotificationCenterRef, void* observer, CFStringRef name, const void *, CFDictionaryRef) + { + ASSERT_UNUSED(observer, observer == fontCache()); +@@ -69,7 +72,7 @@ + void FontCache::platformInit() + { + wkSetUpFontCache(); +-#if !defined(BUILDING_ON_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(), this, fontCacheRegisteredFontsChangedNotificationCallback, kCTFontManagerRegisteredFontsChangedNotification, 0, CFNotificationSuspensionBehaviorDeliverImmediately); + #else + // kCTFontManagerRegisteredFontsChangedNotification does not exist on Leopard and earlier. +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp +@@ -31,7 +31,7 @@ + + FontCustomPlatformData::~FontCustomPlatformData() + { +-#ifdef BUILDING_ON_LEOPARD ++#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) + if (m_atsContainer) + ATSFontDeactivate(m_atsContainer, NULL, kATSOptionFlagsDefault); + #endif +@@ -69,7 +69,7 @@ + + RetainPtr cgFontRef; + +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + RetainPtr bufferData(AdoptCF, buffer->createCFData()); + RetainPtr dataProvider(AdoptCF, CGDataProviderCreateWithCFData(bufferData.get())); + +@@ -100,14 +100,16 @@ + } + + cgFontRef.adoptCF(CGFontCreateWithPlatformFont(&fontRef)); ++#ifndef BUILDING_ON_TIGER + // Workaround for . + if (cgFontRef && !CGFontGetNumberOfGlyphs(cgFontRef.get())) + cgFontRef = 0; ++#endif + if (!cgFontRef) { + ATSFontDeactivate(containerRef, NULL, kATSOptionFlagsDefault); + return 0; + } +-#endif // !defined(BUILDING_ON_LEOPARD) ++#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + + return new FontCustomPlatformData(containerRef, cgFontRef.releaseRef()); + } +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/FontMac.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/FontMac.mm +@@ -119,7 +119,7 @@ + } else + CGContextShowGlyphsWithAdvances(context, glyphs, advances, count); + } +-#if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + else { + if (!count) + return; +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp +@@ -36,6 +36,7 @@ + + namespace WebCore { + ++#ifndef BUILDING_ON_TIGER + static bool shouldUseCoreText(UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData) + { + if (fontData->platformData().widthVariant() != RegularWidth || fontData->hasVerticalGlyphs()) { +@@ -48,11 +49,13 @@ + + return false; + } ++#endif + + bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData) + { + bool haveGlyphs = false; + ++#ifndef BUILDING_ON_TIGER + if (!shouldUseCoreText(buffer, bufferLength, fontData)) { + Vector glyphs(bufferLength); + wkGetGlyphsForCharacters(fontData->platformData().cgFont(), buffer, glyphs.data(), bufferLength); +@@ -124,6 +127,39 @@ + } + } + } ++#else ++ // Use an array of long so we get good enough alignment. ++ long glyphVector[(GLYPH_VECTOR_SIZE + sizeof(long) - 1) / sizeof(long)]; ++ ++ OSStatus status = wkInitializeGlyphVector(GlyphPage::size, &glyphVector); ++ if (status != noErr) ++ // This should never happen, perhaps indicates a bad font! If it does the ++ // font substitution code will find an alternate font. ++ return false; ++ ++ wkConvertCharToGlyphs(fontData->m_styleGroup, buffer, bufferLength, &glyphVector); ++ ++ unsigned numGlyphs = wkGetGlyphVectorNumGlyphs(&glyphVector); ++ if (numGlyphs != length) { ++ // This should never happen, perhaps indicates a bad font? ++ // If it does happen, the font substitution code will find an alternate font. ++ wkClearGlyphVector(&glyphVector); ++ return false; ++ } ++ ++ ATSLayoutRecord* glyphRecord = (ATSLayoutRecord*)wkGetGlyphVectorFirstRecord(glyphVector); ++ for (unsigned i = 0; i < length; i++) { ++ Glyph glyph = glyphRecord->glyphID; ++ if (!glyph) ++ setGlyphDataForIndex(offset + i, 0, 0); ++ else { ++ setGlyphDataForIndex(offset + i, glyph, fontData); ++ haveGlyphs = true; ++ } ++ glyphRecord = (ATSLayoutRecord *)((char *)glyphRecord + wkGetGlyphVectorRecordSize(glyphVector)); ++ } ++ wkClearGlyphVector(&glyphVector); ++#endif + + return haveGlyphs; + } +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm +@@ -46,9 +46,15 @@ + + static void drawFocusRingToContext(CGContextRef context, CGPathRef focusRingPath, CGColorRef color, int radius) + { ++#ifdef BUILDING_ON_TIGER ++ CGContextBeginTransparencyLayer(context, 0); ++#endif + CGContextBeginPath(context); + CGContextAddPath(context, focusRingPath); + wkDrawFocusRing(context, color, radius); ++#ifdef BUILDING_ON_TIGER ++ CGContextEndTransparencyLayer(context); ++#endif + } + + void GraphicsContext::drawFocusRing(const Path& path, int width, int /*offset*/, const Color& color) +@@ -81,6 +87,17 @@ + drawFocusRingToContext(platformContext(), focusRingPath.get(), colorRef, radius); + } + ++#ifdef BUILDING_ON_TIGER // Post-Tiger's setPlatformCompositeOperation() is defined in GraphicsContextCG.cpp. ++void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op) ++{ ++ if (paintingDisabled()) ++ return; ++ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; ++ [[NSGraphicsContext graphicsContextWithGraphicsPort:platformContext() flipped:YES] ++ setCompositingOperation:(NSCompositingOperation)op]; ++ [pool drain]; ++} ++#endif + + static NSColor* createPatternColor(NSString* name, NSColor* defaultColor, bool& usingDot) + { +@@ -125,7 +142,7 @@ + patternColor = grammarPatternColor.get(); + break; + } +-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) ++#if PLATFORM(MAC) && !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) + // To support correction panel. + case TextCheckingReplacementLineStyle: + { +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/IconMac.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/IconMac.mm +@@ -46,7 +46,12 @@ + return 0; + + bool useIconFromFirstFile; ++#ifdef BUILDING_ON_TIGER ++ // FIXME: find a better image for multiple files to use on Tiger. ++ useIconFromFirstFile = true; ++#else + useIconFromFirstFile = filenames.size() == 1; ++#endif + if (useIconFromFirstFile) { + // Don't pass relative filenames -- we don't want a result that depends on the current directory. + // Need 0U here to disambiguate String::operator[] from operator(NSString*, int)[] +@@ -59,11 +64,15 @@ + + return adoptRef(new Icon(image)); + } ++#ifdef BUILDING_ON_TIGER ++ return 0; ++#else + NSImage* image = [NSImage imageNamed:NSImageNameMultipleDocuments]; + if (!image) + return 0; + + return adoptRef(new Icon(image)); ++#endif + } + + void Icon::paint(GraphicsContext* context, const IntRect& rect) +--- src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm.orig ++++ src/3rdparty/webkit/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm +@@ -35,6 +35,9 @@ + #include "DocumentLoader.h" + #endif + ++#ifdef BUILDING_ON_TIGER ++#import "AutodrainedPool.h" ++#endif + + #import "BlockExceptions.h" + #import "DocumentLoader.h" +@@ -61,6 +64,14 @@ + #import + + #if USE(ACCELERATED_COMPOSITING) ++#ifdef BUILDING_ON_TIGER ++static IMP method_setImplementation(Method m, IMP imp) ++{ ++ IMP result = m->method_imp; ++ m->method_imp = imp; ++ return result; ++} ++#endif + #include "GraphicsLayer.h" + #endif + +@@ -111,8 +122,10 @@ + SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoLocalToRemoteSiteAttribute, NSString *) + SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoRemoteToLocalSiteAttribute, NSString *) + SOFT_LINK_POINTER(QTKit, QTVideoRendererWebKitOnlyNewImageAvailableNotification, NSString *) ++#ifndef BUILDING_ON_TIGER + SOFT_LINK_POINTER(QTKit, QTMovieApertureModeClean, NSString *) + SOFT_LINK_POINTER(QTKit, QTMovieApertureModeAttribute, NSString *) ++#endif + + #define QTMovie getQTMovieClass() + #define QTMovieView getQTMovieViewClass() +@@ -149,8 +162,10 @@ + #define QTSecurityPolicyNoLocalToRemoteSiteAttribute getQTSecurityPolicyNoLocalToRemoteSiteAttribute() + #define QTSecurityPolicyNoRemoteToLocalSiteAttribute getQTSecurityPolicyNoRemoteToLocalSiteAttribute() + #define QTVideoRendererWebKitOnlyNewImageAvailableNotification getQTVideoRendererWebKitOnlyNewImageAvailableNotification() ++#ifndef BUILDING_ON_TIGER + #define QTMovieApertureModeClean getQTMovieApertureModeClean() + #define QTMovieApertureModeAttribute getQTMovieApertureModeAttribute() ++#endif + + // Older versions of the QTKit header don't have these constants. + #if !defined QTKIT_VERSION_MAX_ALLOWED || QTKIT_VERSION_MAX_ALLOWED <= QTKIT_VERSION_7_0 +@@ -195,6 +210,9 @@ + @end + + namespace WebCore { ++#ifdef BUILDING_ON_TIGER ++static const long minimumQuickTimeVersion = 0x07300000; // 7.3 ++#endif + + PassOwnPtr MediaPlayerPrivateQTKit::create(MediaPlayer* player) + { +@@ -256,7 +274,9 @@ + [NSNumber numberWithBool:NO], QTMovieAskUnresolvedDataRefsAttribute, + [NSNumber numberWithBool:NO], QTMovieLoopsAttribute, + [NSNumber numberWithBool:!m_privateBrowsing], @"QTMovieAllowPersistentCacheAttribute", ++#ifndef BUILDING_ON_TIGER + QTMovieApertureModeClean, QTMovieApertureModeAttribute, ++#endif + nil]; + + if (m_preload < MediaPlayer::Auto) +@@ -478,7 +498,12 @@ + parentView = m_player->frameView()->documentView(); + [parentView addSubview:m_qtMovieView.get()]; + #endif ++#ifdef BUILDING_ON_TIGER ++ // setDelegate: isn't a public call in Tiger, so use performSelector to keep the compiler happy ++ [m_qtMovieView.get() performSelector:@selector(setDelegate:) withObject:m_objcObserver.get()]; ++#else + [m_qtMovieView.get() setDelegate:m_objcObserver.get()]; ++#endif + [m_objcObserver.get() setView:m_qtMovieView.get()]; + [m_qtMovieView.get() setMovie:m_qtMovie.get()]; + [m_qtMovieView.get() setControllerVisible:NO]; +@@ -499,7 +524,12 @@ + { + if (m_qtMovieView) { + [m_objcObserver.get() setView:nil]; ++#ifdef BUILDING_ON_TIGER ++ // setDelegate: isn't a public call in Tiger, so use performSelector to keep the compiler happy ++ [m_qtMovieView.get() performSelector:@selector(setDelegate:) withObject:nil]; ++#else + [m_qtMovieView.get() setDelegate:nil]; ++#endif + [m_qtMovieView.get() removeFromSuperview]; + m_qtMovieView = nil; + } +@@ -900,7 +930,7 @@ + + bool MediaPlayerPrivateQTKit::supportsFullscreen() const + { +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + return true; + #else + // See +@@ -926,7 +956,7 @@ + if (metaDataAvailable()) { + wkQTMovieSetShowClosedCaptions(m_qtMovie.get(), closedCaptionsVisible); + +-#if USE(ACCELERATED_COMPOSITING) && !defined(BUILDING_ON_LEOPARD) ++#if USE(ACCELERATED_COMPOSITING) && (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)) + if (closedCaptionsVisible && m_qtVideoLayer) { + // Captions will be rendered upside down unless we flag the movie as flipped (again). See . + [m_qtVideoLayer.get() setGeometryFlipped:YES]; +@@ -1019,7 +1049,7 @@ + NSSize initialSize = NSZeroSize; + NSSize naturalSize = [[m_qtMovie.get() attributeForKey:QTMovieNaturalSizeAttribute] sizeValue]; + +-#ifndef BUILDING_ON_LEOPARD ++#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) + // QTMovieCurrentSizeAttribute is not allowed with instances of QTMovie that have been + // opened with QTMovieOpenForPlaybackAttribute, so ask for the display transform attribute instead. + NSAffineTransform *displayTransform = [m_qtMovie.get() attributeForKey:@"QTMoviePreferredTransformAttribute"]; +@@ -1318,6 +1348,9 @@ + if (1==m_frameCountWhilePlaying) + m_timeStartedPlaying = [NSDate timeIntervalSinceReferenceDate]; + } ++#ifdef BUILDING_ON_TIGER ++ AutodrainedPool pool; ++#endif + #endif + m_videoFrameHasDrawn = true; + m_player->repaint(); +@@ -1513,8 +1546,23 @@ + + bool MediaPlayerPrivateQTKit::isAvailable() + { ++#ifdef BUILDING_ON_TIGER ++ SInt32 version; ++ OSErr result; ++ result = Gestalt(gestaltQuickTime, &version); ++ if (result != noErr) { ++ LOG_ERROR("No QuickTime available. Disabling