Ticket #46536: qt5.4-patches.diff

File qt5.4-patches.diff, 93.2 KB (added by RJVB (René Bertin), 9 years ago)

all-inclusive patch, created using kdesvn

  • new file trunk/dports/_resources/port1.0/group/qt5-2.0.tcl

    diff --git a/trunk/dports/_resources/port1.0/group/qt5-2.0.tcl b/trunk/dports/_resources/port1.0/group/qt5-2.0.tcl
    new file mode 10644
    - +  
     1# -*- 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
     2# $Id$
     3# $Id$
     4
     5# Copyright (c) 2014 The MacPorts Project
     6# All rights reserved.
     7#
     8# Redistribution and use in source and binary forms, with or without
     9# modification, are permitted provided that the following conditions are
     10# met:
     11#
     12# 1. Redistributions of source code must retain the above copyright
     13#    notice, this list of conditions and the following disclaimer.
     14# 2. Redistributions in binary form must reproduce the above copyright
     15#    notice, this list of conditions and the following disclaimer in the
     16#    documentation and/or other materials provided with the distribution.
     17# 3. Neither the name of Apple Computer, Inc. nor the names of its
     18#    contributors may be used to endorse or promote products derived from
     19#    this software without specific prior written permission.
     20#
     21# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     22# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     23# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     24# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     25# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     26# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     27# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     31# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32#
     33#
     34# This portgroup defines standard settings when using Qt5.
     35#
     36# Usage:
     37# PortGroup     qt5 2.0
     38
     39# no universal binary support in Qt 5
     40#     see http://lists.qt-project.org/pipermail/interest/2012-December/005038.html
     41#     see also https://bugreports.qt-project.org/browse/QTBUG-24952
     42if { ![exists universal_variant] || [option universal_variant] } {
     43    PortGroup muniversal 1.0
     44    #universal_archs_supported i386 x86_64
     45}
     46
     47# check for +debug variant of this port, and make sure Qt was
     48# installed with +debug as well; if not, error out.
     49platform darwin {
     50    pre-extract {
     51        if {[variant_exists debug] && \
     52            [variant_isset debug] && \
     53           ![info exists building_qt5]} {
     54            if {![file exists ${qt_frameworks_dir}/QtCore.framework/QtCore_debug]} {
     55                return -code error "\n\nERROR:\n\
     56In order to install this port as +debug,
     57Qt5 must also be installed with +debug.\n"
     58            }
     59        }
     60    }
     61}
     62
     63# standard Qt5 name
     64global qt_name
     65set qt_name             qt5
     66
     67# standard install directory
     68    global qt_dir
     69    global qt_dir_rel
     70# standard Qt documents directory
     71    global qt_docs_dir
     72# standard Qt plugins directory
     73    global qt_plugins_dir
     74# standard Qt mkspecs directory
     75    global qt_mkspecs_dir
     76# standard Qt imports directory
     77    global qt_imports_dir
     78# standard Qt qml directory
     79    global qt_qml_dir
     80# standard Qt includes directory
     81    global qt_includes_dir
     82# standard Qt libraries directory
     83    global qt_libs_dir
     84# standard Qt libraries directory
     85    global qt_frameworks_dir
     86    global qt_frameworks_dir_rel
     87# standard Qt non-.app executables directory
     88    global qt_bins_dir
     89# standard Qt data directory
     90    global qt_data_dir
     91# standard Qt translations directory
     92    global qt_translations_dir
     93# standard Qt sysconf directory
     94    global qt_sysconf_dir
     95# standard Qt examples directory
     96    global qt_examples_dir
     97# standard Qt tests directory
     98    global qt_tests_dir
     99# standard Qt demos directory
     100    global qt_demos_dir
     101# standard CMake module directory for Qt-related files
     102    global qt_cmake_module_dir
     103# standard qmake command location
     104    global qt_qmake_cmd
     105# standard moc command location
     106    global qt_moc_cmd
     107# standard uic command location
     108    global qt_uic_cmd
     109# standard lrelease command location
     110    global qt_lrelease_cmd
     111
     112global qt5_is_concurrent
     113# check if we're building qt5 itself
     114if {![info exists building_qt5] || ![info exists name] || ${name} ne "qt5-mac"} {
     115    # no, this must be a dependent port: check the qt5 install:
     116    if {[file exists ${prefix}/libexec/${qt_name}/bin/qmake]} {
     117        # we have a "concurrent" install, which means we must look for the various components
     118        # in different locations (esp. qmake)
     119        set qt5_is_concurrent   1
     120        set auto_concurrent     1
     121    }
     122} else {
     123    # we're building qt5-mac or one of its subports
     124    # we're asking for the standard concurrent install. No need to guess anything, give the user what s/he wants
     125    set qt5_is_concurrent   1
     126    set auto_concurrent     1
     127}
     128
     129if {![info exists qt5_is_concurrent]} {
     130    if {![info exists building_qt5]} {
     131                return -code error "\n\nERROR:\n\
     132Qt5 appears to be installed in the old, exclusive mode,
     133and this port, ${name}, ought to use PortGroup qt5 1.0\n"
     134    }
     135}
     136
     137set qt_dir              ${prefix}/libexec/${qt_name}
     138set qt_dir_rel          libexec/${qt_name}
     139set qt_docs_dir         ${prefix}/share/doc/${qt_name}
     140set qt_plugins_dir      ${prefix}/share/${qt_name}/plugins
     141set qt_mkspecs_dir      ${prefix}/share/${qt_name}/mkspecs
     142set qt_imports_dir      ${prefix}/share/${qt_name}/imports
     143set qt_qml_dir          ${prefix}/share/${qt_name}/qml
     144set qt_includes_dir     ${prefix}/include/${qt_name}
     145set qt_libs_dir         ${qt_dir}/lib
     146set qt_frameworks_dir   ${qt_dir}/Library/Frameworks
     147set qt_bins_dir         ${qt_dir}/bin
     148set qt_data_dir         ${prefix}/share/${qt_name}
     149set qt_translations_dir ${prefix}/share/${qt_name}/translations
     150set qt_sysconf_dir      ${prefix}/etc/${qt_name}
     151set qt_examples_dir     ${prefix}/share/${qt_name}/examples
     152set qt_tests_dir        ${prefix}/share/${qt_name}/tests
     153set qt_demos_dir        ${prefix}/share/${qt_name}/demos
     154set qt_cmake_module_dir ${prefix}/lib/cmake
     155set qt_qmake_cmd        ${qt_dir}/bin/qmake
     156set qt_moc_cmd          ${qt_dir}/bin/moc
     157set qt_uic_cmd          ${qt_dir}/bin/uic
     158set qt_lrelease_cmd     ${qt_dir}/bin/lrelease
     159set qt_frameworks_dir_rel   ${qt_dir_rel}/Library/Frameworks
     160
     161# standard Qt .app executables directory, if created
     162global qt_apps_dir
     163set qt_apps_dir         ${applications_dir}/Qt5
     164
     165# standard qmake spec
     166# configure script prefers clang (but "[a]dvertise[s] g++ as an alternative on Lion and below").
     167# According to http://qt-project.org/doc/qt-5/supported-platforms.html#reference-configurations,
     168#    however, Snow Leopard is only tested on "GCC as provided by Apple"
     169# Create a variant for Snow Leopard that uses "-platform macx-g++-32" or "-platform macx-g++"?
     170global qt_qmake_spec
     171global qt_qmake_spec_32
     172global qt_qmake_spec_64
     173compiler.whitelist clang
     174
     175set qt_qmake_spec_32 macx-clang-32
     176set qt_qmake_spec_64 macx-clang
     177
     178if { ![option universal_variant] || ![variant_isset universal] } {
     179    if { ${build_arch} eq "i386" } {
     180        set qt_qmake_spec ${qt_qmake_spec_32}
     181    } else {
     182        set qt_qmake_spec ${qt_qmake_spec_64}
     183    }
     184} else {
     185    set qt_qmake_spec ""
     186}
     187
     188# standard PKGCONFIG path
     189global qt_pkg_config_dir
     190set qt_pkg_config_dir   ${prefix}/lib/pkgconfig
     191
     192# data used by qmake
     193global qt_host_data_dir
     194set qt_host_data_dir   ${prefix}/share/${qt_name}
     195
     196# standard cmake info for Qt5
     197global qt_cmake_defines
     198set qt_cmake_defines    \
     199    "-DQT_QT_INCLUDE_DIR=${qt_includes_dir} \
     200     -DQT_QMAKESPEC=${qt_qmake_spec} \
     201     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
     202     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
     203
     204# allow for depending on either qt5-mac and qt5-mac-devel, simultaneously
     205
     206if {![info exists building_qt5]} {
     207    if {${os.platform} eq "darwin"} {
     208
     209        # see if the framework install exists, and if so depend on it;
     210        # if not, depend on the library version
     211
     212        if {[info exists qt5_is_concurrent]} {
     213            if {[file exists ${qt_frameworks_dir}/QtCore.framework/QtCore]} {
     214                depends_lib-append path:libexec/${qt_name}/Library/Frameworks/QtCore.framework/QtCore:qt5-mac
     215            } else {
     216                depends_lib-append path:libexec/${qt_name}/lib/libQtCore.5.dylib:qt5-mac
     217            }
     218        } else {
     219            if {[file exists ${qt_frameworks_dir}/QtCore.framework/QtCore]} {
     220                depends_lib-append path:Library/Frameworks/QtCore.framework/QtCore:qt5-mac
     221            } else {
     222                depends_lib-append path:lib/libQtCore.5.dylib:qt5-mac
     223            }
     224        }
     225    }
     226}
     227
     228# standard configure environment, when not building qt5
     229
     230if {![info exists building_qt5]} {
     231    configure.env-append \
     232        QTDIR=${qt_dir} \
     233        QMAKE=${qt_qmake_cmd} \
     234        MOC=${qt_moc_cmd}
     235
     236    if { ![option universal_variant] || ![variant_isset universal] } {
     237        configure.env-append QMAKESPEC=${qt_qmake_spec}
     238    } else {
     239        set merger_configure_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
     240        set merger_configure_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
     241    }
     242
     243    # make sure the Qt binaries' directory is in the path, if it is
     244    # not the current prefix
     245
     246    if {${qt_dir} ne ${prefix}} {
     247        configure.env-append PATH=${qt_dir}/bin:$env(PATH)
     248    }
     249} else {
     250    configure.env-append QMAKE_NO_DEFAULTS=""
     251}
     252
     253# standard build environment, when not building qt5
     254
     255if {![info exists building_qt5]} {
     256    build.env-append \
     257        QTDIR=${qt_dir} \
     258        QMAKE=${qt_qmake_cmd} \
     259        MOC=${qt_moc_cmd}
     260
     261    if { ![option universal_variant] || ![variant_isset universal] } {
     262        build.env-append QMAKESPEC=${qt_qmake_spec}
     263    } else {
     264        set merger_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
     265        set merger_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
     266    }
     267
     268    # make sure the Qt binaries' directory is in the path, if it is
     269    # not the current prefix
     270
     271    if {${qt_dir} ne ${prefix}} {
     272        build.env-append    PATH=${qt_dir}/bin:$env(PATH)
     273    }
     274}
     275
     276# use PKGCONFIG for Qt discovery in configure scripts
     277depends_build-append    port:pkgconfig
     278
     279# standard destroot environment
     280if { ![option universal_variant] || ![variant_isset universal] } {
     281    destroot.env-append \
     282        INSTALL_ROOT=${destroot}
     283} else {
     284    foreach arch ${configure.universal_archs} {
     285        lappend merger_destroot_env($arch) INSTALL_ROOT=${workpath}/destroot-${arch}
     286    }
     287}
     288
     289# standard destroot environment, when not building qt5
     290
     291if {![info exists building_qt5]} {
     292    destroot.env-append \
     293        QTDIR=${qt_dir} \
     294        QMAKE=${qt_qmake_cmd} \
     295        MOC=${qt_moc_cmd}
     296
     297    if { ![option universal_variant] || ![variant_isset universal] } {
     298        build.env-append QMAKESPEC=${qt_qmake_spec}
     299    } else {
     300        set destroot_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
     301        set destroot_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
     302    }
     303
     304    # make sure the Qt binaries' directory is in the path, if it is
     305    # not the current prefix
     306
     307    if {${qt_dir} ne ${prefix}} {
     308        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
     309    }
     310}
  • new file trunk/dports/_resources/port1.0/group/qmake5-2.0.tcl

    Property changes on: trunk/dports/_resources/port1.0/group/qt5-2.0.tcl
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    diff --git a/trunk/dports/_resources/port1.0/group/qmake5-2.0.tcl b/trunk/dports/_resources/port1.0/group/qmake5-2.0.tcl
    new file mode 10644
    - +  
     1# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
     2# $Id$
     3# $Id$
     4
     5#
     6# Copyright (c) 2013 The MacPorts Project
     7# All rights reserved.
     8#
     9# Redistribution and use in source and binary forms, with or without
     10# modification, are permitted provided that the following conditions are
     11# met:
     12#
     13# 1. Redistributions of source code must retain the above copyright
     14#    notice, this list of conditions and the following disclaimer.
     15# 2. Redistributions in binary form must reproduce the above copyright
     16#    notice, this list of conditions and the following disclaimer in the
     17#    documentation and/or other materials provided with the distribution.
     18# 3. Neither the name of Apple Computer, Inc. nor the names of its
     19#    contributors may be used to endorse or promote products derived from
     20#    this software without specific prior written permission.
     21#
     22# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     23# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     24# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     25# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     26# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     27# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     28# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     32# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33#
     34#
     35# This portgroup defines standard settings when using qmake.
     36#
     37# Usage:
     38# PortGroup                     qmake5 2.0
     39
     40PortGroup                       qt5 2.0
     41
     42configure.cmd                   ${qt_qmake_cmd} -r
     43configure.pre_args-replace      --prefix=${prefix} PREFIX=${prefix}
     44configure.universal_args-delete --disable-dependency-tracking
     45
     46# qmake defaults to -mmacosx-version-min=10.6, which implies stdlib is libstdc++, which caused problems
     47#    (see https://trac.macports.org/wiki/FAQ#libcpp)
     48configure.pre_args-append       "QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}"
     49
     50# qt5-mac does not currently support debug.
     51configure.pre_args-append       "CONFIG+=release"   
  • new file trunk/dports/aqua/qt5-mac-devel/Portfile

    Property changes on: trunk/dports/_resources/port1.0/group/qmake5-2.0.tcl
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    diff --git a/trunk/dports/aqua/qt5-mac-devel/Portfile b/trunk/dports/aqua/qt5-mac-devel/Portfile
    new file mode 10644
    - +  
     1# -*- 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
     2# $Id$
     3# $Id$
     4
     5PortSystem          1.0
     6
     7name                qt5-mac-devel
     8version             5.4.0
     9revision            1
     10
     11if {[catch {source "${portpath}/Portfile.qt5"} err]} {
     12    puts stderr "Error reading Portfile.qt5: $err"
     13    return 1;
     14}
  • new file trunk/dports/aqua/qt5-mac-devel/Portfile.qt5

    Property changes on: trunk/dports/aqua/qt5-mac-devel/Portfile
    ___________________________________________________________________
    Added: svn:eol-style
    ## -0,0 +1 ##
    +native
    \ No newline at end of property
    Added: svn:keywords
    ## -0,0 +1 ##
    +Id
    \ No newline at end of property
    diff --git a/trunk/dports/aqua/qt5-mac-devel/Portfile.qt5 b/trunk/dports/aqua/qt5-mac-devel/Portfile.qt5
    new file mode 10644
    - +  
     1# -*- 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
     2# $Id: port=qt5 1 2014-12-08 18:51:13Z rjvbertin@gmail.com, mcalhoun@macports.org $
     3
     4# set building_qt5 immediately!
     5set building_qt5    1
     6
     7PortGroup           qt5 2.0
     8set branch          [join [lrange [split ${version} .] 0 1] .]
     9
     10categories          aqua
     11platforms           macosx
     12maintainers         mcalhoun openmaintainer
     13license             {LGPL-2.1 GPL-3}
     14
     15homepage            http://qt-project.org
     16description         Qt Tool Kit 5.3
     17long_description    Qt Tool Kit: A cross-platform framework \
     18                    (headers, data, and libraries) for writing \
     19                    cross-platform GUI-based applications. \
     20                    Installs to ${qt_dir}
     21
     22distname            qt-everywhere-opensource-src-${version}
     23
     24master_sites        http://download.qt-project.org/official_releases/qt/${branch}/${version}/single/
     25
     26use_xz                  yes
     27checksums           rmd160  5c6b5a0e3ea6a7d3d9754b87fc502af7a4ff7a85 \
     28                    sha256  b2d9df47b9fd2fcfa5ebd162e1373b7eddf4759e6ba148c4589f3d8b6628c39c
     29
     30if { ${os.platform} ne "darwin" } {
     31        pre-fetch {
     32                ui_msg "You're on your own on \"${os.platform}\"!!"
     33        }
     34} elseif { ${os.major} < 10 } {
     35    pre-fetch {
     36        ui_error "OS X prior to 10.7 (Lion) is not a Reference Configuration for Qt."
     37        ui_error "OS X prior to 10.6 (Snow Leopard) is not even tested."
     38        ui_error "See http://qt-project.org/doc/qt-5/supported-platforms.html#reference-configurations"
     39        return -code error "unsupported OS"
     40    }
     41} elseif { ${os.major} == 10 } {
     42    pre-fetch {
     43        ui_warn "OS X prior to 10.7 (Lion) is not a Reference Configuration for Qt."
     44        if { [variant_isset universal] } {
     45            ui_warn "OS X 10.6 (Snow Leopard) is \"occasionally tested\" but ONLY in 32-bit mode."
     46            ui_warn "OS X 10.6 (Snow Leopard) is deprecated and scheduled for removal in Qt 5.4."
     47        } else {
     48            if { ${build_arch} eq "i386" } {
     49                ui_warn "OS X 10.6 (Snow Leopard) is \"occasionally tested\"."
     50                ui_warn "OS X 10.6 (Snow Leopard) is deprecated and scheduled for removal in Qt 5.4."
     51            } else {
     52                ui_warn "OS X 10.6 (Snow Leopard) is \"occasionally tested\" but ONLY in 32-bit mode."
     53                ui_warn "OS X 10.6 (Snow Leopard) is deprecated and scheduled for removal in Qt 5.4."
     54            }
     55        }
     56        ui_warn "See http://qt-project.org/doc/qt-5/supported-platforms.html#reference-configurations"
     57    }
     58} elseif { ${os.major} > 13 } {
     59    pre-fetch {
     60        ui_warn "OS X subsequent to 10.9 (Mavericks) is not a Reference Configuration for Qt."
     61        ui_warn "See http://qt-project.org/doc/qt-5/supported-platforms.html#reference-configurations"
     62    }
     63} else {
     64    # 11 <= ${os.major} <= 13
     65    if { [variant_isset universal] } {
     66        pre-fetch {
     67            ui_warn "Multiple architectures is not a Reference Configuration for Qt."
     68            ui_warn "See http://qt-project.org/doc/qt-5/supported-platforms.html#reference-configurations"
     69        }
     70    } else {
     71        if { ${build_arch} eq "i386" } {
     72            pre-fetch {
     73                ui_warn "32-bit mode is not a Reference Configuration for Qt."
     74                ui_warn "See http://qt-project.org/doc/qt-5/supported-platforms.html#reference-configurations"
     75            }
     76        }
     77    }
     78}
     79
     80if { ${subport} eq "${name}-docs"  } {
     81    universal_variant no
     82}
     83
     84if {[info exists env(QTDIR)]} {
     85    ui_msg "unsetting \$QTDIR"
     86    unset env(QTDIR)
     87}
     88
     89if { ${subport} eq ${name} || ${subport} eq "${name}-docs" } {
     90    # use the qt5 group; set 'building_qt5' so that the portgroup
     91    # does not include certain parts
     92    PortGroup           conflicts_build 1.0
     93    conflicts           qt3 qt3-mac
     94    PortGroup           xcodeversion 1.0
     95
     96
     97    minimum_xcodeversions   {10 3.2}
     98
     99    # From 5.4.0, qt5-mac ought to be able to co-exist with any qt4-mac version.
     100
     101    # Kuba states in https://trac.macports.org/ticket/44207#comment:7
     102    #  "There's no reason to have parallel building disabled. Really."
     103    #use_parallel_build no
     104
     105    # header file QtCore/private/qmachparser_p.h is included only if "defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)"
     106    #     code from header is used only "ifdef Q_OF_MACH_O"
     107    #     the two must be consistent
     108    #     assume the header include code is correct
     109    patchfiles-append patch-tst_qpluginloader.diff
     110
     111    # When testing, ensure that a universal object file is not inadvertently created.
     112    patchfiles-append patch-machtest.diff
     113
     114    # On testing of 32-bit systems,
     115    #  Pre-patch: QCOMPARE(unsigned long const&, unsigned int const&
     116    # Post-patch: QCOMPARE(unsigned int  const&, unsigned int const&
     117    # Function template is only instantiated for same first and second arguments.
     118    patchfiles-append patch-tst_qarraydata.diff
     119
     120    # see http://stackoverflow.com/questions/14506151/invalid-symbol-redefinition-in-inline-asm-on-llvm
     121    patchfiles-append patch-tst_benchlibcallgrind.diff
     122
     123    # During testing, NSStringFromRect requires NSRect.
     124    patchfiles-append patch-tst_qaccessibilitymac_helpers.diff
     125
     126    # see #44934 (and #35067 for the qt4-mac version)
     127    patchfiles-append patch-shared.diff
     128
     129    # avoid leaving zombies when starting an inexisting executable through QProcess
     130    patchfiles-append qprocess-nozombies.patch
     131
     132    # add (prepend) ${prefix}/share to the standard search paths so they become XDG-compliant
     133    patchfiles-append fix-qstandardpaths.patch
     134
     135    # make sure the private headers are always found through the CMake files,
     136    # even in an out-of-tree build
     137    patchfiles-append always_include_private_headers.diff
     138
     139    variant KDE description {Include a number of patches tailoring Qt5 for use with KDE, and enable useful backtraces into Qt code for debugging} {
     140        patchfiles-append       deactivate-menurole-heuristics.patch \
     141                                debug-negative-qtimerint.patch
     142        configure.args-append   -force-debug-info -no-strip -no-separate-debug-info
     143    }
     144
     145    # patches from Ubuntu 5.3.2+dfsg-4ubuntu8 (from Vivid Velvet)
     146    # TODO : check Report-the-system-error-on-why-chmod-2-failed-in-XDG.patch and Don-t-always-chmod-the-XDG_RUNTIME_DIR.patch
     147    # for relevance for qstandard_mac.?
     148    patchfiles-append           remove_icon_from_example.patch \
     149                                remove_google_adsense.patch \
     150                                load_testability_from_env_var.patch \
     151                                Add-workaround-for-GL-on-Android-emulator.patch \
     152                                disable-generic-plugin-when-others-available.patch \
     153                                QtBearer-networkmanager-make-sure-to-set-flag-Active.patch \
     154                                Break-after-handling-the-read-write.patch
     155
     156    # --prefix is not recognised.
     157    configure.pre_args-delete       --prefix=${prefix}
     158
     159    # --disable-dependency-tracking is not recognised.
     160    configure.universal_args-delete --disable-dependency-tracking
     161
     162    if {${configure.sdkroot} ne ""} {
     163        configure.args-append \
     164            -sdk [string tolower [join [lrange [split [lindex [split ${configure.sdkroot} "/"] end] "."] 0 end-1] "."]]
     165    }
     166
     167    # NB: -prefix->${prefix} !
     168    configure.args-append                      \
     169        -prefix         ${prefix}              \
     170        -archdatadir    ${qt_dir}              \
     171        -docdir         ${qt_docs_dir}         \
     172        -headerdir      ${qt_includes_dir}     \
     173        -plugindir      ${qt_plugins_dir}      \
     174        -importdir      ${qt_imports_dir}      \
     175        -qmldir         ${qt_qml_dir}          \
     176        -datadir        ${qt_data_dir}         \
     177        -libdir         ${qt_frameworks_dir}   \
     178        -bindir         ${qt_bins_dir}         \
     179        -libexecdir     ${qt_dir}/libexec      \
     180        -translationdir ${qt_translations_dir} \
     181        -sysconfdir     ${qt_sysconf_dir}      \
     182        -examplesdir    ${qt_examples_dir}     \
     183        -testsdir       ${qt_tests_dir}        \
     184        -hostbindir     ${qt_bins_dir}         \
     185        -hostlibdir     ${qt_frameworks_dir}   \
     186        -hostdatadir    ${qt_host_data_dir}
     187
     188    # Configure options:
     189    configure.args-append \
     190        -v                \
     191        -release          \
     192        -opensource       \
     193        -confirm-license  \
     194        -shared           \
     195        -force-pkg-config
     196
     197    # Third Party Libraries:
     198    configure.args-append \
     199        -no-mtdev         \
     200        -no-harfbuzz      \
     201        -openssl-linked   \
     202        -no-xinput2       \
     203        -no-xcb-xlib
     204
     205    # configure options that don't show up in configure --help
     206    configure.args-append \
     207        -no-libudev       \
     208        -no-egl
     209
     210    # Additional options:
     211    configure.args-append    \
     212        {-make libs}         \
     213        {-make tools}        \
     214        {-nomake examples}   \
     215        {-nomake tests}      \
     216        -verbose             \
     217        -nis                 \
     218        -cups                \
     219        -iconv               \
     220        -no-evdev            \
     221        -icu                 \
     222        -fontconfig          \
     223        -no-pch              \
     224        -dbus-linked         \
     225        -no-xcb              \
     226        -glib                \
     227        -directfb            \
     228        -no-linuxfb          \
     229        -no-kms              \
     230        -framework
     231
     232    configure.args-append   -optimized-qmake
     233
     234    foreach driver { db2 ibase mysql oci odbc psql sqlite sqlite2 tds } {
     235        configure.args-append -no-sql-${driver}
     236    }
     237
     238    if { ![variant_isset universal] } {
     239        configure.args-append "-platform ${qt_qmake_spec}"
     240    } else {
     241        set merger_configure_args(i386)   "-platform ${qt_qmake_spec_32}"
     242        set merger_configure_args(x86_64) "-platform ${qt_qmake_spec_64}"
     243    }
     244
     245    # configure options that don't show up in configure --help
     246    # openvg makes sense only when using X11 ...
     247    configure.args-append   -no-openvg
     248
     249#    # this is where MacPorts hides the dbus and glib headers:
     250#    # unnecessary when -force-pkg-config is given.
     251#    configure.args-append   -I ${prefix}/include/dbus-1.0 \
     252#                            -I ${prefix}/lib/dbus-1.0/include \
     253#                            -I ${prefix}/include/glib-2.0 \
     254#                            -I ${prefix}/lib/glib-2.0/include
     255
     256    # Qt builds part of the system using environment provided by MacPorts.
     257    # It builds the rest using its own internal environment.
     258    # For consistency, clear MacPorts environment.
     259    configure.cxx_stdlib
     260    configure.sdkroot
     261    configure.cc_archflags
     262    configure.cxx_archflags
     263    configure.objc_archflags
     264    configure.objcxx_archflags
     265    configure.ld_archflags
     266    configure.cppflags
     267#    configure.cflags
     268#    configure.cxxflags
     269#    configure.objcflags
     270#    configure.objcxxflags
     271#    configure.ldflags
     272    configure.objcflags-append  "-g"
     273    configure.objcxxflags-append  "-g"
     274    configure.pipe  no
     275    if { [variant_isset universal] } {
     276        set merger_arch_flag no
     277    }
     278    configure.march
     279    configure.mtune
     280    configure.universal_ldflags
     281    configure.universal_cflags
     282    configure.universal_cxxflags
     283    configure.universal_cppflags
     284}
     285
     286if { ${subport} eq ${name} } {
     287    depends_lib                              \
     288        port:zlib                            \
     289        port:libpng                          \
     290        port:jpeg                            \
     291        port:freetype                        \
     292        path:bin/dbus-daemon:dbus            \
     293        port:openssl                         \
     294        port:tiff                            \
     295        port:libmng                          \
     296        path:lib/pkgconfig/glib-2.0.pc:glib2 \
     297        port:icu                             \
     298        port:pcre                            \
     299        port:libiconv
     300
     301    post-extract            { file mkdir ${workpath}/build }
     302    default configure.cmd         {../${worksrcdir}/configure}
     303    default configure.dir       {${workpath}/build}
     304    default build.dir           {${workpath}/build}
     305
     306    # see https://bugreports.qt-project.org/browse/QTBUG-35514
     307    build.target
     308
     309    post-patch {
     310        #reinplace "s|//opt//local//|${prefix}/|g" ${worksrcpath}/qtbase/src/corelib/io/qstandardpaths_mac.cpp
     311    }
     312    # TODO : check if qtwebengine/src/core always has Release and Debug build directories
     313    # even when not configured with -debug-info -no-strip -no-separate-debug-info
     314    post-configure {
     315        # there's one subproject that mistakingly adds ${qt_includes_dir} to the build header search paths;
     316        # correct that!
     317        reinplace "s|-I${qt_includes_dir}||g" \
     318            ${workpath}/build/qtwebengine/src/core/Release/obj/src/core/QtWebEngineCore.ninja \
     319            ${workpath}/build/qtwebengine/src/core/Debug/obj/src/core/QtWebEngineCore.ninja
     320    }
     321    pre-build {
     322        # this is a kludge; should the build system regenerate the ninja files we edited
     323        # we reinplace them again restarting the `port build` step after the inevitable failure...
     324        reinplace "s|-I${qt_includes_dir}||g" \
     325            ${workpath}/build/qtwebengine/src/core/Release/obj/src/core/QtWebEngineCore.ninja \
     326            ${workpath}/build/qtwebengine/src/core/Debug/obj/src/core/QtWebEngineCore.ninja
     327    }
     328
     329    if { [variant_isset universal] } {
     330        merger-post-destroot {
     331            foreach arch ${universal_archs_to_use} {
     332                set dir ${destroot}-${arch}
     333
     334                reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_frameworks_dir}/pkgconfig/Qt5WebKit.pc
     335
     336                foreach prlfl [glob ${dir}${qt_frameworks_dir}/*.framework/*.prl] {
     337                    reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${prlfl}
     338                }
     339
     340                foreach prlfl [glob ${dir}${qt_frameworks_dir}/*.prl] {
     341                    reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${prlfl}
     342                }
     343
     344                foreach prlfl [glob ${dir}${qt_frameworks_dir}/*.framework/*.prl] {
     345                    reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${prlfl}
     346                }
     347
     348                reinplace "s|${worksrcpath}-${arch}|${worksrcpath}|g" ${dir}${qt_mkspecs_dir}/modules/qt_lib_bootstrap_private.pri
     349
     350                reinplace \
     351                    "s|^set(_qt5_corelib_extra_includes \"\${_qt5Core_install_prefix}/share/qt5//mkspecs/macx-clang.*\")$|set(_qt5_corelib_extra_includes \"\${_qt5Core_install_prefix}/share/qt5//mkspecs/macx-clang-32\" \"\${_qt5Core_install_prefix}/share/qt5//mkspecs/macx-clang\")|" \
     352                    ${dir}${qt_frameworks_dir}/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake
     353            }
     354        }
     355
     356        post-destroot {
     357            # delete preprocessor comments surrounding QT_CPU_FEATURES.i386 and QT_CPU_FEATURES.x86_64
     358            reinplace "/^#ifndef.*$/d" ${destroot}${qt_mkspecs_dir}/qmodule.pri
     359            reinplace "/^#else.*$/d"   ${destroot}${qt_mkspecs_dir}/qmodule.pri
     360            reinplace "/^#endif.*$/d"  ${destroot}${qt_mkspecs_dir}/qmodule.pri
     361        }
     362
     363        # The file ${prefix}/share/qt5/mkspecs/qconfig.pri is still not properly merged
     364        # The solution is ???.
     365    }
     366
     367    post-destroot {
     368
     369        # see #44204
     370        foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir}/pkgconfig *.pc] {
     371            set framework [file rootname [file tail ${f}]]
     372            set incname   [string map {Qt5 Qt} ${framework}]
     373            reinplace "s|-I\${includedir}/${incname}|-I\${includedir}|g" ${f}
     374            reinplace "s|includedir=\${prefix}/include|includedir=\${libdir}/${framework}/Headers|g" ${f}
     375        }
     376
     377        # move items out of the Frameworks directory that are more appropriate to lib directory
     378        xinstall -m 775 -d ${destroot}${qt_cmake_module_dir}
     379        foreach d [glob -tails -nocomplain -directory ${destroot}${qt_frameworks_dir}/cmake *] {
     380            xinstall -m 775 -d ${destroot}${qt_cmake_module_dir}/${d}
     381            foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir}/cmake/${d} *.cmake] {
     382                # ${qt_frameworks_dir} is  ${qt_dir}/Library/Frameworks while
     383                # ${qt_libs_dir}       is  ${qt_dir}/lib
     384                # unless modified, cmake files will point to a directory that is too high in the directory hierarchy
     385                reinplace "s|/../../../../|/../../../${qt_dir_rel}/|g" ${f}
     386                file rename ${f} ${destroot}${qt_cmake_module_dir}/${d}/
     387            }
     388        }
     389
     390        # get Qt's version numbers
     391
     392        set qt_vers [split ${version} "."]
     393        set qt_major [lindex ${qt_vers} 0]
     394        set qt_minor [lindex ${qt_vers} 1]
     395        set qt_patch [lindex ${qt_vers} 2]
     396
     397        # link includes and libraries for each actual installed framework
     398
     399        # make sure that the target directories exist
     400        exec mkdir -p ${destroot}${qt_includes_dir} ${destroot}${qt_libs_dir}
     401        foreach fixfile [exec find ${destroot}${qt_frameworks_dir} \
     402                             -name "*.framework" | \
     403                             sed -e "s@${destroot}@@g"] {
     404
     405            set tf_full [strsed ${fixfile} {s@\\.framework@@}]
     406            set tf [strsed ${tf_full} {g@.*\/@@}]
     407
     408            # special for QtWebKit entries
     409
     410            set t_minor ${qt_minor}
     411            set is_QtWebKit 0
     412            if {[string compare ${tf} QtWebKit] == 0} {
     413                set t_minor 9
     414                set is_QtWebKit 1
     415            }
     416
     417            # link headers into ${qt_includes_dir}, removing directories
     418            # if they are already there first
     419
     420            set inc_file ${destroot}${qt_includes_dir}/${tf}
     421            if {[file exists ${inc_file}]} {
     422                file delete -force ${inc_file}
     423            }
     424            ln -s ${tf_full}.framework/Headers ${inc_file}
     425
     426            # link libraries into ${qt_libs_dir}, all 4 number variants
     427
     428            set dr_qt_libs_dir ${destroot}${qt_libs_dir}
     429
     430            ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.dylib
     431            ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.dylib
     432            ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.dylib
     433            ln -s ${tf_full}.framework/${tf} ${dr_qt_libs_dir}/lib${tf}.${qt_major}.${t_minor}.${qt_patch}.dylib
     434
     435            # copy .prl file, then correct it for library usage
     436
     437            copy ${destroot}${tf_full}.framework/${tf}.prl ${dr_qt_libs_dir}/lib${tf}.prl
     438
     439            # fix TARGET in .prl file
     440
     441            reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}.prl
     442
     443            # fix PRL_LIBS -F -> -L in .prl file
     444
     445            reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}.prl
     446
     447            # fix "-framework Qt*" -> "-lQt*" in .prl file
     448
     449            reinplace "/QMAKE_PRL_LIBS/s|-framework Qt|-lQt|g" \
     450                ${dr_qt_libs_dir}/lib${tf}.prl
     451
     452            # remove the QMAKE_PRL_BUILD_DIR line from the .prl file
     453            reinplace "/QMAKE_PRL_BUILD_DIR/d" ${dr_qt_libs_dir}/lib${tf}.prl
     454
     455            # deal with debug files
     456
     457            # RJVB: I have *not* tested the block below!
     458            if {[variant_isset debug]} {
     459
     460                # but not if QtWebKit and +universal, since that one does
     461                # not exist (the 32-bit version of the debug library is
     462                # larger than fits into the 32-bit filespace).
     463
     464                if {[variant_isset debug] && ${is_QtWebKit}} {
     465                    continue
     466                }
     467
     468                # link libraries into ${qt_libs_dir}, all 4 number variants
     469
     470                ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.dylib
     471                ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.dylib
     472                ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.dylib
     473                ln -s ${tf_full}.framework/${tf}_debug ${dr_qt_libs_dir}/lib${tf}_debug.${qt_major}.${t_minor}.${qt_patch}.dylib
     474
     475                # copy .prl file, then correct it for library usage
     476
     477                copy ${destroot}${tf_full}.framework/${tf}_debug.prl ${dr_qt_libs_dir}/lib${tf}_debug.prl
     478
     479                # fix TARGET in .prl file
     480
     481                reinplace "/QMAKE_PRL_TARGET/s|Qt\\(\[^ \]*\\)|libQt\\1.${qt_major}.${t_minor}.${qt_patch}.dylib|" ${dr_qt_libs_dir}/lib${tf}_debug.prl
     482
     483                # fix PRL_LIBS -F -> -L in .prl file
     484
     485                reinplace "/QMAKE_PRL_LIBS/s|-F${qt_frameworks_dir}|-L${qt_libs_dir}|" ${dr_qt_libs_dir}/lib${tf}_debug.prl
     486
     487                # fix "-framework Qt*" -> "-lQt*_debug" in .prl file
     488
     489                reinplace "/QMAKE_PRL_LIBS/s|-framework Qt\\(\[^ \]*\\)|-lQt\\1_debug|g" ${dr_qt_libs_dir}/lib${tf}_debug.prl
     490            }
     491        }
     492
     493        ln -s ${qt_qmake_cmd} ${destroot}/${prefix}/bin/qmake-qt${qt_major}
     494        ln -s ${qt_moc_cmd} ${destroot}/${prefix}/bin/moc-qt${qt_major}
     495        ln -s ${qt_uic_cmd} ${destroot}/${prefix}/bin/uic-qt${qt_major}
     496        ln -s ${qt_lrelease_cmd} ${destroot}/${prefix}/bin/lrelease-qt${qt_major}
     497
     498        xinstall -m 775 -d ${destroot}${qt_pkg_config_dir}
     499        foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir}/pkgconfig *.pc] {
     500            file rename ${f} ${destroot}${qt_pkg_config_dir}
     501        }
     502        xinstall -m 775 -d ${destroot}${qt_libs_dir}/
     503        foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir} *.{a,prl,la}] {
     504            file rename ${f} ${destroot}${qt_libs_dir}/
     505        }
     506
     507        # move items out of the bin directory that are more appropriate to the Applications directory
     508        xinstall -m 775 -d ${destroot}${qt_apps_dir}
     509        foreach f [glob -nocomplain -directory ${destroot}${qt_bins_dir} *.app] {
     510            file rename ${f} ${destroot}${qt_apps_dir}/
     511        }
     512
     513        if {[variant_isset KDE]} {
     514            # expose KF5 styles to Qt5 ... once we know where those styles are stored and if it's still required.
     515            #ln -s ${prefix}/lib/kf5??/plugins/styles ${destroot}${qt_plugins_dir}/
     516        }
     517    }
     518
     519    variant harfbuzz description {(experimental) Use HarfBuzz-NG to do text shaping} {
     520        depends_lib-append port:harfbuzz
     521        configure.args-replace \
     522            -no-harfbuzz       \
     523            -system-harfbuzz
     524    }
     525
     526    variant tests description {Enable tests} {
     527        configure.args-replace {-nomake tests} {-make tests}
     528    }
     529
     530    variant examples description {Build examples} {
     531        configure.args-replace {-nomake examples} {-make examples}
     532    }
     533
     534    variant debug description {Build both release and debug library} {
     535        configure.args-replace -release -debug-and-release
     536    }
     537}
     538
     539subport ${name}-docs {
     540    depends_lib-append \
     541        path:${prefix}/bin/qdoc:${name} \
     542        path:${qt_plugins_dir}/sqldrivers/libqsqlite.dylib:${name}-sqlite3-plugin
     543
     544    supported_archs   noarch
     545
     546    build.target      docs
     547    destroot.target   install_docs
     548
     549    post-extract {
     550        # For the most part, generated makefiles use ${prefix}/bin/qdoc.
     551        # There are a couple of places that look in ${worksrcpath}/qtbase/src/tools/qdoc/.
     552        ln -s ${prefix}/bin/qdoc ${worksrcpath}/qtbase/src/tools/qdoc/
     553        ln -s ${prefix}/bin/qdoc ${worksrcpath}/qtbase/bin
     554
     555        # Similarly, location of qhelpgenerator is expected in ${worksrcpath}
     556        xinstall -d -m 755 ${worksrcpath}/qttools/bin/
     557        ln -s ${prefix}/bin/qhelpgenerator ${worksrcpath}/qttools/bin/
     558
     559        # Without this file, the makefile ${worksrcpath}/qtwebkit/Source/WebCore/Makefile.WebCore.Target
     560        #    keeps generating itself over and over again.
     561        # This file is only created when the library is being built, however.
     562        xinstall -d -m 755 ${worksrcpath}/qtwebkit/Source/WebCore/generated
     563        touch ${worksrcpath}/qtwebkit/Source/WebCore/generated/InspectorBackendCommands.qrc
     564    }
     565}
     566
     567# See http://qt-project.org/doc/qt-5/sql-driver.html for info on building SQL Database Drivers
     568
     569subport ${name}-sqlite3-plugin {
     570    PortGroup           qmake5 2.0
     571
     572    depends_lib-append port:sqlite3
     573
     574    # for single architecture, easier to use
     575    #    worksrcdir ${worksrcdir}/qtbase/src/plugins/sqldrivers/sqlite,
     576    #    but doesn't work for universal build
     577    configure.dir ${worksrcpath}/qtbase/src/plugins/sqldrivers/sqlite
     578    build.dir     ${configure.dir}
     579    destroot.dir  ${configure.dir}
     580
     581    configure.args-append "INCLUDEPATH+=${prefix}/include" "LIBS+=\"-L${prefix}/lib -lsqlite3\""
     582    post-destroot {
     583        xinstall -m 775 -d ${destroot}${qt_cmake_module_dir}
     584        foreach f [glob -nocomplain -directory ${destroot}${qt_frameworks_dir}/cmake/ *] {
     585            file rename ${f} ${destroot}${qt_cmake_module_dir}/
     586        }
     587    }
     588}
     589
     590subport ${name}-psql84-plugin {
     591    PortGroup           qmake5 2.0
     592
     593    depends_lib-append port:postgresql84
     594
     595    # for single architecture, easier to use
     596    #    worksrcdir ${worksrcdir}/qtbase/src/plugins/sqldrivers/psql,
     597    #    but doesn't work for universal build
     598    configure.dir ${worksrcpath}/qtbase/src/plugins/sqldrivers/psql
     599    build.dir     ${configure.dir}
     600    destroot.dir  ${configure.dir}
     601
     602    configure.args-append "INCLUDEPATH+=${prefix}/include/postgresql84" "LIBS+=\"-L${prefix}/lib/postgresql84 -lpq\""
     603}
     604
     605subport ${name}-mysql56-plugin {
     606    PortGroup           qmake5 2.0
     607
     608    depends_lib-append port:mysql56
     609
     610    # for single architecture, easier to use
     611    #    worksrcdir ${worksrcdir}/qtbase/src/plugins/sqldrivers/mysql,
     612    #    but doesn't work for universal build
     613    configure.dir ${worksrcpath}/qtbase/src/plugins/sqldrivers/mysql
     614    build.dir     ${configure.dir}
     615    destroot.dir  ${configure.dir}
     616
     617    configure.args-append "INCLUDEPATH+=${prefix}/include/mysql56/mysql" "LIBS+=\"-L${prefix}/lib/mysql56/mysql -lmysqlclient_r\""
     618}
     619
     620livecheck.type      regex
     621livecheck.url       http://download.qt.io/archive/qt/5.4/
     622livecheck.regex     (\\d+(\\.\\d+)+)
  • new file trunk/dports/aqua/qt5-mac-devel/files/Add-workaround-for-GL-on-Android-emulator.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/Add-workaround-for-GL-on-Android-emulator.patch b/trunk/dports/aqua/qt5-mac-devel/files/Add-workaround-for-GL-on-Android-emulator.patch
    new file mode 10644
    - +  
     1From cbf649ff92e7d3416cb9d03609648f96efdf76dd Mon Sep 17 00:00:00 2001
     2From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
     3Date: Mon, 17 Mar 2014 19:43:41 -0300
     4Subject: [PATCH] Add workaround for GL on Android emulator
     5
     6On the Android Emulator, the shaders will be compiled by a desktop
     7GL driver, since the GL driver in the emulator is just a thin
     8wrapper. The GL driver does not necessarily support the precision
     9qualifiers, which can cause applications to break. We detect this
     10at runtime in the platform plugin and set a workaround flag to
     11
     12Upstream (9eeb1bd) just enabled the workaround when the android
     13backend is used, which is not true in our case (traditional desktop).
     14As a consequence, we also need a similar check in order to have
     15a functional Ubuntu Touch emulator.
     16
     17Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
     18---
     19 src/gui/kernel/qopenglcontext.cpp | 5 +++++
     20 1 file changed, 5 insertions(+)
     21
     22--- qtbase/src/gui/kernel/qopenglcontext.cpp
     23+++ qtbase/src/gui/kernel/qopenglcontext.cpp
     24@@ -900,6 +900,11 @@
     25 
     26         d->shareGroup->d_func()->deletePendingResources(this);
     27 
     28+        const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
     29+        if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) {
     30+            QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(this);
     31+            ctx_d->workaround_missingPrecisionQualifiers = true;
     32+        }
     33 #ifndef QT_NO_DEBUG
     34         QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true);
     35 #endif
  • new file trunk/dports/aqua/qt5-mac-devel/files/Break-after-handling-the-read-write.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/Break-after-handling-the-read-write.patch b/trunk/dports/aqua/qt5-mac-devel/files/Break-after-handling-the-read-write.patch
    new file mode 10644
    - +  
     1From 2a733b9bf62df746fb538d37ba1b150ada70c0b0 Mon Sep 17 00:00:00 2001
     2From: Albert Astals Cid <albert.astals@canonical.com>
     3Date: Thu, 27 Nov 2014 13:27:06 +0100
     4Subject: [PATCH] Break after handling the read/write
     5
     6The loop is there because watchers may have two Watcher for the same
     7fd, one for read and one for write, but after we're processed the
     8correct one we don't need to keep looping.
     9
     10This fixes a crash since it's possible that while in processing
     11q_dbus_watch_handle we get a watch added/remove this invalidating
     12the iterator and crashing
     13
     14Change-Id: Icb61deae272d2f237a4c616fae598404d419df90
     15---
     16 src/dbus/qdbusintegrator.cpp | 2 ++
     17 1 file changed, 2 insertions(+)
     18
     19--- qtbase/src/dbus/qdbusintegrator.cpp
     20+++ qtbase/src/dbus/qdbusintegrator.cpp
     21@@ -1184,6 +1184,7 @@
     22         if (it->watch && it->read && it->read->isEnabled()) {
     23             if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_READABLE))
     24                 qDebug("OUT OF MEM");
     25+            break;
     26         }
     27         ++it;
     28     }
     29@@ -1198,6 +1199,7 @@
     30         if (it->watch && it->write && it->write->isEnabled()) {
     31             if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_WRITABLE))
     32                 qDebug("OUT OF MEM");
     33+            break;
     34         }
     35         ++it;
     36     }
  • new file trunk/dports/aqua/qt5-mac-devel/files/QtBearer-networkmanager-make-sure-to-set-flag-Active.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/QtBearer-networkmanager-make-sure-to-set-flag-Active.patch b/trunk/dports/aqua/qt5-mac-devel/files/QtBearer-networkmanager-make-sure-to-set-flag-Active.patch
    new file mode 10644
    - +  
     1From dedb8c1c928edbbb4408a0c5889353b142b20d1c Mon Sep 17 00:00:00 2001
     2From: Lorn Potter <lorn.potter@gmail.com>
     3Date: Thu, 13 Nov 2014 13:06:49 +1000
     4Subject: [PATCH] QtBearer networkmanager make sure to set flag Active
     5
     6Also, no need to create objects to get properties, when the properties
     7can be had for free.
     8
     9Make plugin more robust to network-manager or ofono crashes
     10
     11Change-Id: Ibadb46bd51aa27f130f8d245e8c50aa7bff5f9c8
     12---
     13 .../bearer/linux_common/qofonoservice_linux.cpp    |  12 +
     14 .../bearer/linux_common/qofonoservice_linux_p.h    |   2 +
     15 src/plugins/bearer/networkmanager/main.cpp         |   5 +-
     16 .../networkmanager/qnetworkmanagerengine.cpp       | 310 ++++++++++++++-------
     17 .../bearer/networkmanager/qnetworkmanagerengine.h  |  13 +
     18 .../networkmanager/qnetworkmanagerservice.cpp      |  22 ++
     19 .../bearer/networkmanager/qnetworkmanagerservice.h |   2 +
     20 7 files changed, 263 insertions(+), 103 deletions(-)
     21
     22--- qtbase/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
     23+++ qtbase/src/plugins/bearer/linux_common/qofonoservice_linux.cpp
     24@@ -269,6 +269,18 @@
     25     return contextList;
     26 }
     27 
     28+PathPropertiesList QOfonoDataConnectionManagerInterface::contextsWithProperties()
     29+{
     30+    if (contextListProperties.isEmpty()) {
     31+        QDBusPendingReply<PathPropertiesList > reply = call(QLatin1String("GetContexts"));
     32+        reply.waitForFinished();
     33+        if (!reply.isError()) {
     34+            contextListProperties = reply.value();
     35+        }
     36+    }
     37+    return contextListProperties;
     38+}
     39+
     40 bool QOfonoDataConnectionManagerInterface::roamingAllowed()
     41 {
     42     QVariant var = getProperty(QStringLiteral("RoamingAllowed"));
     43--- qtbase/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
     44+++ qtbase/src/plugins/bearer/linux_common/qofonoservice_linux_p.h
     45@@ -153,6 +153,7 @@
     46     ~QOfonoDataConnectionManagerInterface();
     47 
     48     QStringList contexts();
     49+    PathPropertiesList contextsWithProperties();
     50     bool roamingAllowed();
     51     QVariant getProperty(const QString &);
     52     QString bearer();
     53@@ -162,6 +163,7 @@
     54     QVariantMap getProperties();
     55     QVariantMap propertiesMap;
     56     QStringList contextList;
     57+    PathPropertiesList contextListProperties;
     58 private slots:
     59     void propertyChanged(const QString &, const QDBusVariant &value);
     60 };
     61--- qtbase/src/plugins/bearer/networkmanager/main.cpp
     62+++ qtbase/src/plugins/bearer/networkmanager/main.cpp
     63@@ -66,10 +66,7 @@
     64 {
     65     if (key == QLatin1String("networkmanager")) {
     66         QNetworkManagerEngine *engine = new QNetworkManagerEngine;
     67-        if (engine->networkManagerAvailable())
     68-            return engine;
     69-        else
     70-            delete engine;
     71+        return engine;
     72     }
     73 
     74     return 0;
     75--- qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
     76+++ qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
     77@@ -56,29 +56,34 @@
     78 
     79 QNetworkManagerEngine::QNetworkManagerEngine(QObject *parent)
     80 :   QBearerEngineImpl(parent),
     81-    managerInterface(new QNetworkManagerInterface(this)),
     82-    systemSettings(new QNetworkManagerSettings(NM_DBUS_SERVICE, this)),
     83-    ofonoManager(new QOfonoManagerInterface(this))
     84+    managerInterface(NULL),
     85+    systemSettings(NULL),
     86+    ofonoManager(NULL),
     87+    nmAvailable(false)
     88 {
     89-
     90-    if (!managerInterface->isValid())
     91-        return;
     92-
     93     qDBusRegisterMetaType<QNmSettingsMap>();
     94 
     95-    connect(managerInterface, SIGNAL(deviceAdded(QDBusObjectPath)),
     96-            this, SLOT(deviceAdded(QDBusObjectPath)));
     97-    connect(managerInterface, SIGNAL(deviceRemoved(QDBusObjectPath)),
     98-            this, SLOT(deviceRemoved(QDBusObjectPath)));
     99-    connect(managerInterface, SIGNAL(activationFinished(QDBusPendingCallWatcher*)),
     100-            this, SLOT(activationFinished(QDBusPendingCallWatcher*)));
     101-    connect(managerInterface, SIGNAL(propertiesChanged(QMap<QString,QVariant>)),
     102-            this, SLOT(interfacePropertiesChanged(QMap<QString,QVariant>)));
     103-    managerInterface->setConnections();
     104+    nmWatcher = new QDBusServiceWatcher(NM_DBUS_SERVICE,QDBusConnection::systemBus(),
     105+            QDBusServiceWatcher::WatchForRegistration |
     106+            QDBusServiceWatcher::WatchForUnregistration, this);
     107+    connect(nmWatcher, SIGNAL(serviceRegistered(QString)),
     108+            this, SLOT(nmRegistered(QString)));
     109+    connect(nmWatcher, SIGNAL(serviceUnregistered(QString)),
     110+            this, SLOT(nmUnRegistered(QString)));
     111+
     112+    ofonoWatcher = new QDBusServiceWatcher("org.ofono",QDBusConnection::systemBus(),
     113+            QDBusServiceWatcher::WatchForRegistration |
     114+            QDBusServiceWatcher::WatchForUnregistration, this);
     115+    connect(ofonoWatcher, SIGNAL(serviceRegistered(QString)),
     116+            this, SLOT(ofonoRegistered(QString)));
     117+    connect(ofonoWatcher, SIGNAL(serviceUnregistered(QString)),
     118+            this, SLOT(ofonoUnRegistered(QString)));
     119 
     120-    connect(systemSettings, SIGNAL(newConnection(QDBusObjectPath)),
     121-            this, SLOT(newConnection(QDBusObjectPath)));
     122-    systemSettings->setConnections();
     123+    if (QDBusConnection::systemBus().interface()->isServiceRegistered("org.ofono"))
     124+        ofonoRegistered();
     125+
     126+    if (QDBusConnection::systemBus().interface()->isServiceRegistered(NM_DBUS_SERVICE))
     127+        nmRegistered();
     128 }
     129 
     130 QNetworkManagerEngine::~QNetworkManagerEngine()
     131@@ -105,15 +110,13 @@
     132 
     133 void QNetworkManagerEngine::initialize()
     134 {
     135-    QMutexLocker locker(&mutex);
     136+    if (nmAvailable)
     137+        setupConfigurations();
     138+}
     139 
     140-    if (ofonoManager->isValid()) {
     141-        Q_FOREACH (const QString &modem, ofonoManager->getModems()) {
     142-            QOfonoDataConnectionManagerInterface *ofonoContextManager
     143-                    = new QOfonoDataConnectionManagerInterface(modem,this);
     144-            ofonoContextManagers.insert(modem, ofonoContextManager);
     145-        }
     146-    }
     147+void QNetworkManagerEngine::setupConfigurations()
     148+{
     149+    QMutexLocker locker(&mutex);
     150     // Get active connections.
     151     foreach (const QDBusObjectPath &acPath, managerInterface->activeConnections()) {
     152 
     153@@ -151,7 +154,7 @@
     154 
     155 bool QNetworkManagerEngine::networkManagerAvailable() const
     156 {
     157-    return managerInterface->isValid();
     158+    return nmAvailable;
     159 }
     160 
     161 QString QNetworkManagerEngine::getInterfaceFromId(const QString &settingsPath)
     162@@ -180,6 +183,9 @@
     163     const QString settingsPath = connection->connectionInterface()->path();
     164     QString specificPath = configuredAccessPoints.key(settingsPath);
     165 
     166+    if (isConnectionActive(settingsPath))
     167+        return;
     168+
     169     QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
     170     while (i.hasNext()) {
     171         i.next();
     172@@ -229,7 +235,7 @@
     173 
     174 void QNetworkManagerEngine::requestUpdate()
     175 {
     176-    if (managerInterface->wirelessEnabled()) {
     177+    if (managerInterface && managerInterface->wirelessEnabled()) {
     178         QHashIterator<QString, QNetworkManagerInterfaceDeviceWireless *> i(wirelessDevices);
     179         while (i.hasNext()) {
     180             i.next();
     181@@ -282,8 +288,9 @@
     182                 if (ptr) {
     183                     ptr->mutex.lock();
     184                     if (activeConnection->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED &&
     185-                        ptr->state != QNetworkConfiguration::Active) {
     186-                        ptr->state = QNetworkConfiguration::Active;
     187+                            (ptr->state & QNetworkConfiguration::Active) != QNetworkConfiguration::Active) {
     188+
     189+                        ptr->state |= QNetworkConfiguration::Active;
     190 
     191                         if (activeConnectionsList.value(id) && activeConnectionsList.value(id)->defaultRoute()
     192                                 && managerInterface->state() < QNetworkManagerInterface::NM_STATE_CONNECTED_GLOBAL) {
     193@@ -339,23 +346,25 @@
     194 
     195     QNetworkConfigurationPrivatePointer ptr = accessPointConfigurations.value(id);
     196     if (ptr) {
     197-        ptr->mutex.lock();
     198-        if (properties.value("State").toUInt() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
     199-            QStringList devices = activeConnection->devices();
     200-            if (!devices.isEmpty()) {
     201-                QNetworkManagerInterfaceDevice device(devices.at(0),this);
     202-                connectionInterfaces.insert(id,device.networkInterface());
     203-            }
     204-
     205-            ptr->state |= QNetworkConfiguration::Active;
     206-            ptr->mutex.unlock();
     207-
     208-            locker.unlock();
     209-            emit configurationChanged(ptr);
     210-            locker.relock();
     211-        } else {
     212-            connectionInterfaces.remove(id);
     213-            ptr->mutex.unlock();
     214+        if (properties.contains(QStringLiteral("State"))) {
     215+            ptr->mutex.lock();
     216+            if (properties.value("State").toUInt() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
     217+                QStringList devices = activeConnection->devices();
     218+                if (!devices.isEmpty()) {
     219+                    QNetworkManagerInterfaceDevice device(devices.at(0),this);
     220+                    connectionInterfaces.insert(id,device.networkInterface());
     221+                }
     222+
     223+                ptr->state |= QNetworkConfiguration::Active;
     224+                ptr->mutex.unlock();
     225+
     226+                locker.unlock();
     227+                emit configurationChanged(ptr);
     228+                locker.relock();
     229+            } else {
     230+                connectionInterfaces.remove(id);
     231+                ptr->mutex.unlock();
     232+            }
     233         }
     234     }
     235 }
     236@@ -403,9 +412,6 @@
     237         connect(wirelessDevice,SIGNAL(scanDone()),this,SLOT(scanFinished()));
     238         wirelessDevice->setConnections();
     239 
     240-        foreach (const QDBusObjectPath &apPath, wirelessDevice->getAccessPoints())
     241-            newAccessPoint(apPath.path());
     242-
     243         wirelessDevices.insert(path.path(), wirelessDevice);
     244     }
     245 
     246@@ -518,14 +524,9 @@
     247         parseConnection(settingsPath, connection->getSettings());
     248 
     249     // Check if connection is active.
     250-    QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
     251-    while (i.hasNext()) {
     252-        i.next();
     253-        if (i.value()->connection().path() == settingsPath) {
     254-            cpPriv->state |= QNetworkConfiguration::Active;
     255-            break;
     256-        }
     257-    }
     258+    if (isConnectionActive(settingsPath))
     259+        cpPriv->state |= QNetworkConfiguration::Active;
     260+
     261     if (deviceType == DEVICE_TYPE_ETHERNET) {
     262         QHashIterator<QString, QNetworkManagerInterfaceDevice*> i(interfaceDevices);
     263         while (i.hasNext()) {
     264@@ -539,12 +540,36 @@
     265              }
     266          }
     267      }
     268+
     269     QNetworkConfigurationPrivatePointer ptr(cpPriv);
     270     accessPointConfigurations.insert(ptr->id, ptr);
     271     locker.unlock();
     272     emit configurationAdded(ptr);
     273 }
     274 
     275+bool QNetworkManagerEngine::isConnectionActive(const QString &settingsPath)
     276+{
     277+    QHashIterator<QString, QNetworkManagerConnectionActive*> i(activeConnectionsList);
     278+    while (i.hasNext()) {
     279+        i.next();
     280+        if (i.value()->connection().path() == settingsPath) {
     281+            if (i.value()->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATING
     282+                    || i.value()->state() == NM_ACTIVE_CONNECTION_STATE_ACTIVATED) {
     283+                return true;
     284+            } else {
     285+                break;
     286+            }
     287+        }
     288+    }
     289+
     290+    QNetworkManagerSettingsConnection *settingsConnection = connectionFromId(settingsPath);
     291+    if (settingsConnection->getType() == DEVICE_TYPE_MODEM) {
     292+        return isActiveContext(settingsConnection->connectionInterface()->path());
     293+    }
     294+
     295+    return false;
     296+}
     297+
     298 void QNetworkManagerEngine::removeConnection(const QString &path)
     299 {
     300     QMutexLocker locker(&mutex);
     301@@ -652,7 +677,6 @@
     302 void QNetworkManagerEngine::newAccessPoint(const QString &path)
     303 {
     304     QMutexLocker locker(&mutex);
     305-
     306     QNetworkManagerInterfaceAccessPoint *accessPoint =
     307         new QNetworkManagerInterfaceAccessPoint(path,this);
     308 
     309@@ -683,6 +707,9 @@
     310                 ptr->mutex.lock();
     311                 QNetworkConfiguration::StateFlags flag = QNetworkConfiguration::Defined;
     312                 ptr->state = (flag | QNetworkConfiguration::Discovered);
     313+
     314+                if (isConnectionActive(settingsPath))
     315+                    ptr->state = (flag | QNetworkConfiguration::Active);
     316                 ptr->mutex.unlock();
     317 
     318                 locker.unlock();
     319@@ -762,7 +789,6 @@
     320     QMutexLocker locker(&mutex);
     321     QNetworkConfigurationPrivate *cpPriv = new QNetworkConfigurationPrivate;
     322     cpPriv->name = map.value("connection").value("id").toString();
     323-
     324     cpPriv->isValid = true;
     325     cpPriv->id = settingsPath;
     326     cpPriv->type = QNetworkConfiguration::InternetAccessPoint;
     327@@ -811,18 +837,46 @@
     328         }
     329     } else if (connectionType == QLatin1String("gsm")) {
     330 
     331-        const QString contextPath = map.value("connection").value("id").toString();
     332-        cpPriv->name = contextName(contextPath);
     333-        cpPriv->bearerType = currentBearerType(contextPath);
     334-
     335-        if (map.value("connection").contains("timestamp")) {
     336-            cpPriv->state |= QNetworkConfiguration::Discovered;
     337+        const QString connectionPath = map.value("connection").value("id").toString();
     338+        cpPriv->name = contextName(connectionPath);
     339+        cpPriv->bearerType = currentBearerType(connectionPath);
     340+
     341+        if (ofonoManager && ofonoManager->isValid()) {
     342+            const QString contextPart = connectionPath.section('/', -1);
     343+            QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
     344+            while (i.hasNext()) {
     345+                i.next();
     346+                const QString path = i.key() +"/"+contextPart;
     347+                if (isActiveContext(path)) {
     348+                    cpPriv->state |= QNetworkConfiguration::Active;
     349+                    break;
     350+                }
     351+            }
     352         }
     353     }
     354 
     355     return cpPriv;
     356 }
     357 
     358+bool QNetworkManagerEngine::isActiveContext(const QString &contextPath)
     359+{
     360+    if (ofonoManager && ofonoManager->isValid()) {
     361+        const QString contextPart = contextPath.section('/', -1);
     362+        QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
     363+        while (i.hasNext()) {
     364+            i.next();
     365+            PathPropertiesList list = i.value()->contextsWithProperties();
     366+            for (int i = 0; i < list.size(); ++i) {
     367+                if (list.at(i).path.path().contains(contextPart)) {
     368+                    return list.at(i).properties.value(QStringLiteral("Active")).toBool();
     369+
     370+                }
     371+            }
     372+        }
     373+    }
     374+    return false;
     375+}
     376+
     377 QNetworkManagerSettingsConnection *QNetworkManagerEngine::connectionFromId(const QString &id) const
     378 {
     379     for (int i = 0; i < connections.count(); ++i) {
     380@@ -967,53 +1021,111 @@
     381 
     382 QNetworkConfiguration::BearerType QNetworkManagerEngine::currentBearerType(const QString &id)
     383 {
     384-    if (ofonoManager->isValid()) {
     385-        QString contextPart = id.section('/', -1);
     386+    QString contextPart = id.section('/', -1);
     387+    QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
     388+    while (i.hasNext()) {
     389+        i.next();
     390+        QString contextPath = i.key() +"/"+contextPart;
     391 
     392-        QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
     393-        while (i.hasNext()) {
     394-            i.next();
     395-            QString contextPath = i.key() +"/"+contextPart;
     396-            if (i.value()->contexts().contains(contextPath)) {
     397+        if (i.value()->contexts().contains(contextPath)) {
     398 
     399-                QString bearer = i.value()->bearer();
     400-                if (bearer == QStringLiteral("gsm")) {
     401-                    return QNetworkConfiguration::Bearer2G;
     402-                } else if (bearer == QStringLiteral("edge")) {
     403-                    return QNetworkConfiguration::Bearer2G;
     404-                } else if (bearer == QStringLiteral("umts")) {
     405-                    return QNetworkConfiguration::BearerWCDMA;
     406-                } else if (bearer == QStringLiteral("hspa")
     407-                           || bearer == QStringLiteral("hsdpa")
     408-                           || bearer == QStringLiteral("hsupa")) {
     409-                    return QNetworkConfiguration::BearerHSPA;
     410-                } else if (bearer == QStringLiteral("lte")) {
     411-                    return QNetworkConfiguration::BearerLTE;
     412-                }
     413+            QString bearer = i.value()->bearer();
     414+
     415+            if (bearer == QStringLiteral("gsm")) {
     416+                return QNetworkConfiguration::Bearer2G;
     417+            } else if (bearer == QStringLiteral("edge")) {
     418+                return QNetworkConfiguration::Bearer2G;
     419+            } else if (bearer == QStringLiteral("umts")) {
     420+                return QNetworkConfiguration::BearerWCDMA;
     421+            } else if (bearer == QStringLiteral("hspa")
     422+                       || bearer == QStringLiteral("hsdpa")
     423+                       || bearer == QStringLiteral("hsupa")) {
     424+                return QNetworkConfiguration::BearerHSPA;
     425+            } else if (bearer == QStringLiteral("lte")) {
     426+                return QNetworkConfiguration::BearerLTE;
     427             }
     428         }
     429     }
     430+
     431     return QNetworkConfiguration::BearerUnknown;
     432 }
     433 
     434 QString QNetworkManagerEngine::contextName(const QString &path)
     435 {
     436-    if (ofonoManager->isValid()) {
     437-        QString contextPart = path.section('/', -1);
     438-        QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
     439-        while (i.hasNext()) {
     440-            i.next();
     441-            Q_FOREACH (const QString &oContext, i.value()->contexts()) {
     442-                if (oContext.contains(contextPart)) {
     443-                    QOfonoConnectionContextInterface contextInterface(oContext,this);
     444-                    return contextInterface.name();
     445-                }
     446+    QString contextPart = path.section('/', -1);
     447+    QHashIterator<QString, QOfonoDataConnectionManagerInterface*> i(ofonoContextManagers);
     448+    while (i.hasNext()) {
     449+        i.next();
     450+        PathPropertiesList list = i.value()->contextsWithProperties();
     451+        for (int i = 0; i < list.size(); ++i) {
     452+            if (list.at(i).path.path().contains(contextPart)) {
     453+                return list.at(i).properties.value(QStringLiteral("Name")).toString();
     454             }
     455         }
     456     }
     457     return path;
     458 }
     459 
     460+void QNetworkManagerEngine::nmRegistered(const QString &)
     461+{
     462+    if (ofonoManager) {
     463+        delete ofonoManager;
     464+        ofonoManager = NULL;
     465+    }
     466+    managerInterface = new QNetworkManagerInterface(this);
     467+    systemSettings = new QNetworkManagerSettings(NM_DBUS_SERVICE, this);
     468+
     469+    connect(managerInterface, SIGNAL(deviceAdded(QDBusObjectPath)),
     470+            this, SLOT(deviceAdded(QDBusObjectPath)));
     471+    connect(managerInterface, SIGNAL(deviceRemoved(QDBusObjectPath)),
     472+            this, SLOT(deviceRemoved(QDBusObjectPath)));
     473+    connect(managerInterface, SIGNAL(activationFinished(QDBusPendingCallWatcher*)),
     474+            this, SLOT(activationFinished(QDBusPendingCallWatcher*)));
     475+    connect(managerInterface, SIGNAL(propertiesChanged(QMap<QString,QVariant>)),
     476+            this, SLOT(interfacePropertiesChanged(QMap<QString,QVariant>)));
     477+    managerInterface->setConnections();
     478+
     479+    connect(systemSettings, SIGNAL(newConnection(QDBusObjectPath)),
     480+            this, SLOT(newConnection(QDBusObjectPath)));
     481+    systemSettings->setConnections();
     482+    nmAvailable = true;
     483+
     484+    setupConfigurations();
     485+}
     486+
     487+void QNetworkManagerEngine::nmUnRegistered(const QString &)
     488+{
     489+    if (systemSettings) {
     490+        delete systemSettings;
     491+        systemSettings = NULL;
     492+    }
     493+    if (managerInterface) {
     494+        delete managerInterface;
     495+        managerInterface = NULL;
     496+    }
     497+}
     498+
     499+void QNetworkManagerEngine::ofonoRegistered(const QString &)
     500+{
     501+    if (ofonoManager) {
     502+        delete ofonoManager;
     503+        ofonoManager = NULL;
     504+    }
     505+    ofonoManager = new QOfonoManagerInterface(this);
     506+    if (ofonoManager && ofonoManager->isValid()) {
     507+        Q_FOREACH (const QString &modem, ofonoManager->getModems()) {
     508+            QOfonoDataConnectionManagerInterface *ofonoContextManager
     509+                    = new QOfonoDataConnectionManagerInterface(modem,this);
     510+            ofonoContextManagers.insert(modem, ofonoContextManager);
     511+        }
     512+    }
     513+}
     514+
     515+void QNetworkManagerEngine::ofonoUnRegistered(const QString &)
     516+{
     517+    ofonoContextManagers.clear();
     518+}
     519+
     520 QT_END_NAMESPACE
     521 
     522 #endif // QT_NO_DBUS
     523--- qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
     524+++ qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
     525@@ -109,6 +109,12 @@
     526 
     527     void wiredCarrierChanged(bool);
     528 
     529+    void nmRegistered(const QString &serviceName = QString());
     530+    void nmUnRegistered(const QString &serviceName = QString());
     531+
     532+    void ofonoRegistered(const QString &serviceName = QString());
     533+    void ofonoUnRegistered(const QString &serviceName = QString());
     534+
     535 private:
     536     QNetworkConfigurationPrivate *parseConnection(const QString &settingsPath,
     537                                                   const QNmSettingsMap &map);
     538@@ -132,6 +138,13 @@
     539     QNetworkConfiguration::BearerType currentBearerType(const QString &id);
     540     QString contextName(const QString &path);
     541 
     542+    bool isConnectionActive(const QString &settingsPath);
     543+    QDBusServiceWatcher *ofonoWatcher;
     544+    QDBusServiceWatcher *nmWatcher;
     545+
     546+    bool isActiveContext(const QString &contextPath);
     547+    bool nmAvailable;
     548+    void setupConfigurations();
     549 };
     550 
     551 QT_END_NAMESPACE
     552--- qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
     553+++ qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerservice.cpp
     554@@ -688,6 +688,15 @@
     555                                   QLatin1String(NM_DBUS_INTERFACE_DEVICE_WIRELESS),
     556                                   QLatin1String("PropertiesChanged"),
     557                                   this,SLOT(propertiesSwap(QMap<QString,QVariant>)));
     558+
     559+    QDBusPendingReply<QList<QDBusObjectPath> > reply
     560+            = d->connectionInterface->asyncCall(QLatin1String("GetAccessPoints"));
     561+
     562+    QDBusPendingCallWatcher *callWatcher = new QDBusPendingCallWatcher(reply);
     563+    connect(callWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)),
     564+                     this, SLOT(accessPointsFinished(QDBusPendingCallWatcher*)));
     565+
     566+
     567     d->valid = true;
     568 }
     569 
     570@@ -749,6 +758,19 @@
     571     return allOk;
     572 }
     573 
     574+void QNetworkManagerInterfaceDeviceWireless::accessPointsFinished(QDBusPendingCallWatcher *watcher)
     575+{
     576+    QDBusPendingReply<QList<QDBusObjectPath> > reply(*watcher);
     577+    watcher->deleteLater();
     578+    if (!reply.isError()) {
     579+        accessPointsList = reply.value();
     580+    }
     581+
     582+    for (int i = 0; i < accessPointsList.size(); i++) {
     583+        Q_EMIT accessPointAdded(accessPointsList.at(i).path());
     584+    }
     585+}
     586+
     587 QDBusInterface *QNetworkManagerInterfaceDeviceWireless::connectionInterface() const
     588 {
     589     return d->connectionInterface;
     590--- qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h
     591+++ qtbase/src/plugins/bearer/networkmanager/qnetworkmanagerservice.h
     592@@ -369,6 +369,8 @@
     593     void slotAccessPointAdded(QDBusObjectPath);
     594     void slotAccessPointRemoved(QDBusObjectPath);
     595 
     596+    void accessPointsFinished(QDBusPendingCallWatcher *watcher);
     597+
     598 private:
     599     QNetworkManagerInterfaceDeviceWirelessPrivate *d;
     600     QVariantMap propertyMap;
  • new file trunk/dports/aqua/qt5-mac-devel/files/always_include_private_headers.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/always_include_private_headers.diff b/trunk/dports/aqua/qt5-mac-devel/files/always_include_private_headers.diff
    new file mode 10644
    - +  
     1--- qtbase/mkspecs/features/orig.create_cmake.prf       2014-12-05 17:24:38.000000000 +0100
     2+++ qtbase/mkspecs/features/create_cmake.prf    2015-01-12 18:38:41.000000000 +0100
     3@@ -28,7 +28,7 @@
     4 
     5 split_incpath {
     6     CMAKE_ADD_SOURCE_INCLUDE_DIRS = true
     7-    CMAKE_NO_PRIVATE_INCLUDES = true # Don't add private includes in the build dir which don't exist
     8+    #CMAKE_NO_PRIVATE_INCLUDES = true # Don't add private includes in the build dir which don't exist
     9     CMAKE_SOURCE_INCLUDES = \
     10         $$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME})
     11     CMAKE_SOURCE_PRIVATE_INCLUDES = \
     12@@ -51,7 +51,7 @@
     13     CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
     14 }
     15 
     16-!exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true
     17+#!exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true
     18 
     19 CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
     20 contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
  • new file trunk/dports/aqua/qt5-mac-devel/files/deactivate-menurole-heuristics.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/deactivate-menurole-heuristics.patch b/trunk/dports/aqua/qt5-mac-devel/files/deactivate-menurole-heuristics.patch
    new file mode 10644
    - +  
     1--- qtbase/src/plugins/platforms/cocoa/messages.cpp
     2+++ qtbase/src/plugins/platforms/cocoa/messages.cpp
     3@@ -70,16 +70,16 @@
     4 {
     5     QString captionNoAmpersand(caption);
     6     captionNoAmpersand.remove(QChar('&'));
     7-    const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
     8-    if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive))
     9-        return QPlatformMenuItem::AboutRole;
     10-    if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
     11-        || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
     12-        || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
     13-        || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
     14-        || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
     15-        return QPlatformMenuItem::PreferencesRole;
     16-    }
     17+//     const QString aboutString = QCoreApplication::translate("QCocoaMenuItem", "About");
     18+//     if (captionNoAmpersand.startsWith(aboutString, Qt::CaseInsensitive) || caption.endsWith(aboutString, Qt::CaseInsensitive))
     19+//         return QPlatformMenuItem::AboutRole;
     20+//     if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Config"), Qt::CaseInsensitive)
     21+//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Preference"), Qt::CaseInsensitive)
     22+//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Options"), Qt::CaseInsensitive)
     23+//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setting"), Qt::CaseInsensitive)
     24+//         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Setup"), Qt::CaseInsensitive)) {
     25+//         return QPlatformMenuItem::PreferencesRole;
     26+//     }
     27     if (captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Quit"), Qt::CaseInsensitive)
     28         || captionNoAmpersand.startsWith(QCoreApplication::translate("QCocoaMenuItem", "Exit"), Qt::CaseInsensitive)) {
     29         return QPlatformMenuItem::QuitRole;
  • new file trunk/dports/aqua/qt5-mac-devel/files/debug-negative-qtimerint.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/debug-negative-qtimerint.patch b/trunk/dports/aqua/qt5-mac-devel/files/debug-negative-qtimerint.patch
    new file mode 10644
    - +  
     1--- qtbase/src/corelib/kernel/qobject.cpp
     2+++ qtbase/src/corelib/kernel/qobject.cpp
     3@@ -1612,7 +1612,7 @@
     4     Q_D(QObject);
     5 
     6     if (Q_UNLIKELY(interval < 0)) {
     7-        qWarning("QObject::startTimer: Timers cannot have negative intervals");
     8+        qWarning() << "QObject::startTimer: Timer" << this << "cannot have a negative interval";
     9         return 0;
     10     }
     11     if (Q_UNLIKELY(!d->threadData->eventDispatcher.load())) {
  • new file trunk/dports/aqua/qt5-mac-devel/files/disable-generic-plugin-when-others-available.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/disable-generic-plugin-when-others-available.patch b/trunk/dports/aqua/qt5-mac-devel/files/disable-generic-plugin-when-others-available.patch
    new file mode 10644
    - +  
     1--- qtbase/src/network/bearer/qnetworkconfigmanager_p.cpp
     2+++ qtbase/src/network/bearer/qnetworkconfigmanager_p.cpp
     3@@ -405,7 +405,7 @@
     4             }
     5         }
     6 
     7-        if (generic)
     8+        if (generic && sessionEngines.count() == 0)
     9             sessionEngines.append(generic);
     10 #endif // QT_NO_LIBRARY
     11     }
  • new file trunk/dports/aqua/qt5-mac-devel/files/fix-qstandardpaths.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/fix-qstandardpaths.patch b/trunk/dports/aqua/qt5-mac-devel/files/fix-qstandardpaths.patch
    new file mode 10644
    - +  
     1--- qtbase/src/corelib/io/qstandardpaths_mac.cpp
     2+++ qtbase/src/corelib/io/qstandardpaths_mac.cpp
     3@@ -37,6 +37,7 @@
     4 
     5 #ifndef QT_BOOTSTRAPPED
     6 #include <qcoreapplication.h>
     7+#include <qlibraryinfo.h>
     8 #endif
     9 
     10 #include <CoreFoundation/CoreFoundation.h>
     11@@ -169,17 +169,85 @@
     12     }
     13 }
     14 
     15+static void normaliseDirs(QStringList &dirs)
     16+{
     17+    // Normalise paths, skip relative paths
     18+    QMutableListIterator<QString> it(dirs);
     19+    while (it.hasNext()) {
     20+        const QString dir = it.next();
     21+        if (!dir.startsWith(QLatin1Char('/')))
     22+            it.remove();
     23+        else
     24+            it.setValue(QDir::cleanPath(dir));
     25+    }
     26+
     27+    // Remove duplicates from the list, there's no use for duplicated
     28+    // paths in XDG_CONFIG_DIRS - if it's not found in the given
     29+    // directory the first time, it won't be there the second time.
     30+    // Plus duplicate paths causes problems for example for mimetypes,
     31+    // where duplicate paths here lead to duplicated mime types returned
     32+    // for a file, eg "text/plain,text/plain" instead of "text/plain"
     33+    dirs.removeDuplicates();
     34+}
     35+
     36+static QStringList xdgConfigDirs()
     37+{
     38+    QStringList dirs;
     39+    // http://standards.freedesktop.org/basedir-spec/latest/
     40+    QString xdgConfigDirsEnv = QFile::decodeName(qgetenv("XDG_CONFIG_DIRS"));
     41+    if (xdgConfigDirsEnv.isEmpty()) {
     42+#ifndef QT_BOOTSTRAPPED
     43+        dirs.append(QLibraryInfo::location(QLibraryInfo::PrefixPath) + QString::fromLatin1("/config"));
     44+#endif
     45+    } else {
     46+        dirs = xdgConfigDirsEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);
     47+
     48+        normaliseDirs(dirs);
     49+    }
     50+    return dirs;
     51+}
     52+
     53+static QStringList xdgDataDirs()
     54+{
     55+    QStringList dirs;
     56+    // http://standards.freedesktop.org/basedir-spec/latest/
     57+    QString xdgDataDirsEnv = QFile::decodeName(qgetenv("XDG_DATA_DIRS"));
     58+    if (xdgDataDirsEnv.isEmpty()) {
     59+#ifndef QT_BOOTSTRAPPED
     60+        dirs.append(QLibraryInfo::location(QLibraryInfo::PrefixPath) + QString::fromLatin1("/share"));
     61+#endif
     62+    } else {
     63+        dirs = xdgDataDirsEnv.split(QLatin1Char(':'), QString::SkipEmptyParts);
     64+
     65+        normaliseDirs(dirs);
     66+    }
     67+    return dirs;
     68+}
     69+
     70 QStringList QStandardPaths::standardLocations(StandardLocation type)
     71 {
     72     QStringList dirs;
     73 
     74+    if (type == GenericDataLocation) {
     75+        dirs.append(xdgDataDirs());
     76+    }
     77+
     78     if (type == GenericDataLocation || type == AppDataLocation || type == AppLocalDataLocation || type == GenericCacheLocation || type == CacheLocation) {
     79         const QString path = macLocation(type, kOnAppropriateDisk);
     80         if (!path.isEmpty())
     81             dirs.append(path);
     82     }
     83 
     84+    if (type == GenericConfigLocation || type == ConfigLocation)
     85+        dirs.append(xdgConfigDirs());
     86+
     87     if (type == AppDataLocation || type == AppLocalDataLocation) {
     88+        QStringList xdgDirs = xdgDataDirs();
     89+        for (int i = 0; i < xdgDirs.count(); ++i) {
     90+            appendOrganizationAndApp(xdgDirs[i]);
     91+        }
     92+        dirs.append(xdgDirs);
     93+
     94         CFBundleRef mainBundle = CFBundleGetMainBundle();
     95         if (mainBundle) {
     96             CFURLRef bundleUrl = CFBundleCopyBundleURL(mainBundle);
  • new file trunk/dports/aqua/qt5-mac-devel/files/load_testability_from_env_var.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/load_testability_from_env_var.patch b/trunk/dports/aqua/qt5-mac-devel/files/load_testability_from_env_var.patch
    new file mode 10644
    - +  
     1Description: load testability from environment variable
     2Author: Thomi Richards <thomi.richards@canonical.com>
     3Forwarded: https://bugreports.qt-project.org/browse/QTBUG-32974
     4
     5--- qtbase/src/gui/kernel/qguiapplication.cpp
     6+++ qtbase/src/gui/kernel/qguiapplication.cpp
     7@@ -1273,6 +1273,9 @@
     8         argc = j;
     9     }
     10 
     11+    if (qgetenv("QT_LOAD_TESTABILITY").toInt() > 0)
     12+        loadTestability = true;
     13+
     14 #if defined(QT_DEBUG) && defined(Q_OS_LINUX)
     15     if (!doGrabUnderDebugger && !QGuiApplicationPrivate::noGrab && runningUnderDebugger()) {
     16         QGuiApplicationPrivate::noGrab = true;
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-machtest.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-machtest.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-machtest.diff
    new file mode 10644
    - +  
     1--- qtbase/tests/auto/corelib/plugin/qpluginloader/machtest/machtest.pro
     2+++ qtbase/tests/auto/corelib/plugin/qpluginloader/machtest/machtest.pro
     3@@ -4,10 +4,10 @@
     4     generate-bad.pl
     5 
     6 i386.target = good.i386.dylib
     7-i386.commands = $(CXX) $(CXXFLAGS) -shared -arch i386 -o $@ -I$$[QT_INSTALL_HEADERS/get] $<
     8+i386.commands = $(CXX) $(filter-out -arch i386 x86_64,$(CXXFLAGS)) -shared -arch i386 -o $@ -I$$[QT_INSTALL_HEADERS/get] $<
     9 i386.depends += $$PWD/../fakeplugin.cpp
     10 x86_64.target = good.x86_64.dylib
     11-x86_64.commands = $(CXX) $(CXXFLAGS) -shared -arch x86_64 -o $@ -I$$[QT_INSTALL_HEADERS/get] $<
     12+x86_64.commands = $(CXX) $(filter-out -arch i386 x86_64,$(CXXFLAGS)) -shared -arch x86_64 -o $@ -I$$[QT_INSTALL_HEADERS/get] $<
     13 x86_64.depends += $$PWD/../fakeplugin.cpp
     14 
     15 # Current Mac OS X toolchains have no compiler for PPC anymore
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-qmacstyle_mac.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-qmacstyle_mac.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-qmacstyle_mac.diff
    new file mode 10644
    - +  
     1--- .//qtbase/src/widgets/styles/qmacstyle_mac.mm.orig  2014-09-11 03:48:01.000000000 -0700
     2+++ .//qtbase/src/widgets/styles/qmacstyle_mac.mm       2014-10-28 19:28:34.000000000 -0700
     3@@ -3667,9 +3667,9 @@
     4 
     5                 NSBezierPath *pushButtonFocusRingPath;
     6                 if (bdi.kind == kThemeBevelButton)
     7-                    pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:focusRect];
     8+                    pushButtonFocusRingPath = [NSBezierPath bezierPathWithRect:NSRectFromCGRect(focusRect)];
     9                 else
     10-                    pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:focusRect xRadius:4 yRadius:4];
     11+                    pushButtonFocusRingPath = [NSBezierPath bezierPathWithRoundedRect:NSRectFromCGRect(focusRect) xRadius:4 yRadius:4];
     12                 qt_drawFocusRingOnPath(cg, pushButtonFocusRingPath);
     13             }
     14 
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-shared.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-shared.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-shared.diff
    new file mode 10644
    - +  
     1--- qttools/src/macdeployqt/shared/shared.cpp
     2+++ qttools/src/macdeployqt/shared/shared.cpp
     3@@ -196,7 +196,7 @@
     4                 state = DylibName;
     5                 continue;
     6             } else if (part < parts.count() && parts.at(part).endsWith(".framework")) {
     7-                info.installName += "/" + (qtPath + "lib/").simplified();
     8+                info.installName += "/" + (qtPath + "Frameworks/").simplified();
     9                 info.frameworkDirectory = info.installName;
     10                 state = FrameworkName;
     11                 continue;
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-tst_benchlibcallgrind.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_benchlibcallgrind.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_benchlibcallgrind.diff
    new file mode 10644
    - +  
     1--- qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
     2+++ qtbase/tests/auto/testlib/selftests/benchlibcallgrind/tst_benchlibcallgrind.cpp
     3@@ -73,9 +73,9 @@
     4     QBENCHMARK {
     5         __asm__ __volatile__(
     6             "mov $100000000,%%eax   \n"
     7-            "LOOPTOP:               \n"
     8+            "1:                     \n"
     9             "dec %%eax              \n"
     10-            "jnz LOOPTOP            \n"
     11+            "jnz 1b                 \n"
     12             : /* no output */
     13             : /* no input */
     14             : /* clobber */ "eax"
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qaccessibilitymac_helpers.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qaccessibilitymac_helpers.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qaccessibilitymac_helpers.diff
    new file mode 10644
    - +  
     1--- qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
     2+++ qtbase/tests/auto/other/qaccessibilitymac/tst_qaccessibilitymac_helpers.mm
     3@@ -116,7 +116,7 @@
     4 
     5 - (AXUIElementRef) ref { return reference; }
     6 - (void) print {
     7-    NSLog(@"Accessible Object role: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.description, self.value, NSStringFromRect(self.rect));
     8+    NSLog(@"Accessible Object role: '%@', description: '%@', value: '%@', rect: '%@'", self.role, self.description, self.value, NSStringFromRect(NSRectFromCGRect(self.rect)));
     9     NSLog(@"    Children: %ld", [[self childList] count]);
     10 }
     11 
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qarraydata.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qarraydata.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qarraydata.diff
    new file mode 10644
    - +  
     1--- qtbase/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
     2+++ qtbase/tests/auto/corelib/tools/qarraydata/tst_qarraydata.cpp
     3@@ -789,7 +789,7 @@
     4                     + minAlignment - Q_ALIGNOF(QArrayData)));
     5 
     6         // Data is aligned
     7-        QCOMPARE(quintptr(data->data()) % alignment, quintptr(0u));
     8+        QCOMPARE(quintptr(quintptr(data->data()) % alignment), quintptr(0));
     9 
     10         // Check that the allocated array can be used. Best tested with a
     11         // memory checker, such as valgrind, running.
  • new file trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qpluginloader.diff

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qpluginloader.diff b/trunk/dports/aqua/qt5-mac-devel/files/patch-tst_qpluginloader.diff
    new file mode 10644
    - +  
     1--- qtbase/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
     2+++ qtbase/tests/auto/corelib/plugin/qpluginloader/tst_qpluginloader.cpp
     3@@ -311,7 +311,7 @@
     4 
     5 void tst_QPluginLoader::loadMachO_data()
     6 {
     7-#ifdef Q_OF_MACH_O
     8+#if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)
     9     QTest::addColumn<int>("parseResult");
     10 
     11     QTest::newRow("/dev/null") << int(QMachOParser::NotSuitable);
     12@@ -347,7 +347,7 @@
     13 
     14 void tst_QPluginLoader::loadMachO()
     15 {
     16-#ifdef Q_OF_MACH_O
     17+#if defined(QT_BUILD_INTERNAL) && defined(Q_OF_MACH_O)
     18     QFile f(QFINDTESTDATA(QTest::currentDataTag()));
     19     QVERIFY(f.open(QIODevice::ReadOnly));
     20     QByteArray data = f.readAll();
  • new file trunk/dports/aqua/qt5-mac-devel/files/qprocess-nozombies.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/qprocess-nozombies.patch b/trunk/dports/aqua/qt5-mac-devel/files/qprocess-nozombies.patch
    new file mode 10644
    - +  
     1--- qtbase/src/corelib/io/qprocess_unix.cpp
     2+++ qtbase/src/corelib/io/qprocess_unix.cpp
     3@@ -1312,17 +1312,18 @@
     4     processManager()->remove(q);
     5 }
     6 
     7+//https://codereview.qt-project.org/#/c/61294/
     8 bool QProcessPrivate::waitForDeadChild()
     9 {
     10     Q_Q(QProcess);
     11 
     12     // read a byte from the death pipe
     13     char c;
     14-    qt_safe_read(deathPipe[0], &c, 1);
     15+    qint64 readcount = qt_safe_read(deathPipe[0], &c, 1);
     16 
     17     // check if our process is dead
     18     int exitStatus;
     19-    if (qt_safe_waitpid(pid_t(pid), &exitStatus, WNOHANG) > 0) {
     20+    if (qt_safe_waitpid(pid_t(pid), &exitStatus, readcount > 0 ? WNOHANG : 0) > 0) {
     21         processManager()->remove(q);
     22         crashed = !WIFEXITED(exitStatus);
     23         exitCode = WEXITSTATUS(exitStatus);
  • new file trunk/dports/aqua/qt5-mac-devel/files/remove_google_adsense.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/remove_google_adsense.patch b/trunk/dports/aqua/qt5-mac-devel/files/remove_google_adsense.patch
    new file mode 10644
    - +  
     1Description: remove tracking javascript from examples
     2Author: Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
     3Last-Update: 2014-02-17
     4
     5---
     6 examples/xml/htmlinfo/trolltech_com.html |   45 -------------------------------
     7 1 file changed, 45 deletions(-)
     8
     9--- qtbase/examples/xml/htmlinfo/trolltech_com.html
     10+++ qtbase/examples/xml/htmlinfo/trolltech_com.html
     11@@ -23,14 +23,6 @@
     12               content="Trolltech creates application development platforms for desktop and mobile device innovation." />
     13         <meta name="keywords" content="" />
     14     
     15-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"><!-- &nbsp;--></script>
     16-<script type="text/javascript">
     17-    <!-- Urchin script
     18-                _uacct = "UA-4457116-1";
     19-                urchinTracker();
     20-    -->
     21-       </script>
     22-     
     23         <base href="http://trolltech.com/homepage" />
     24       
     25     
     26@@ -910,43 +902,6 @@
     27     </div>
     28       
     29     </div>
     30-<!-- ProspectXtractor tracker script -->
     31-<script type="text/javascript"><!--
     32-function _pxPar()
     33-{
     34-var p="";
     35-p+="&ref="+escape(top.document.referrer);
     36-p+="&dt="+escape(document.title);
     37-p+="&sr="+screen.width+"x"+screen.height;
     38-p+="&sd="+screen.colorDepth;
     39-p+="&fv="+_pxFV();
     40-return p;
     41-}
     42-function _pxFV()
     43-{
     44-var f=0,n=navigator;
     45-if (n.plugins && n.mimeTypes.length) {
     46-var x=n.plugins["Shockwave Flash"];
     47-if(x && x.description) {
     48-var y=x.description;
     49-f=y.charAt(y.indexOf('.')-1);
     50-}
     51-} else {
     52-r=false;
     53-for(var i=15;i>=3&&r!=true;i-=1){
     54-execScript('on error resume next: r=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
     55-f=i;
     56-}
     57-}
     58-return f;
     59-}
     60-document.write('<img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999'+_pxPar()+'" width="1" heigth="1" />');
     61-//-->
     62-</script>
     63-<noscript>
     64-<div><img src="http://pxreg.onlineservicesas.com/pxreg/?id=50C9FD2F-61D5-4824-B726-50D6B1F89999" width="1" height="1" alt="" /></div>
     65-</noscript>
     66-<!-- END ProspectXtractor tracker script -->
     67 </body>
     68 </html>
     69 
  • new file trunk/dports/aqua/qt5-mac-devel/files/remove_icon_from_example.patch

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/remove_icon_from_example.patch b/trunk/dports/aqua/qt5-mac-devel/files/remove_icon_from_example.patch
    new file mode 10644
    - +  
     1Description: remove icon link from example html file
     2 This patch removes a suposedly privacy breach detected by lintian.
     3 As the Trolltech site is down and the example is simply not working I am
     4 just removing the link to it.
     5Author: Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>
     6Forwarded: not-needed
     7Last-Update: 2014-06-25
     8
     9---
     10 examples/xml/htmlinfo/trolltech_com.html |    3 ---
     11 1 file changed, 3 deletions(-)
     12
     13--- qtbase/examples/xml/htmlinfo/trolltech_com.html
     14+++ qtbase/examples/xml/htmlinfo/trolltech_com.html
     15@@ -110,9 +110,6 @@
     16         <style type="text/css" media="all">@import url(http://trolltech.com/IEFixes.css);</style>
     17     <![endif]-->
     18 
     19-    <link rel="shortcut icon" type="image/x-icon"
     20-          href="http://trolltech.com/favicon.ico" />
     21-
     22     <link rel="home" href="http://trolltech.com"
     23           title="Front page" />
     24     <link rel="search"
  • new file trunk/dports/aqua/qt5-mac-devel/files/series

    diff --git a/trunk/dports/aqua/qt5-mac-devel/files/series b/trunk/dports/aqua/qt5-mac-devel/files/series
    new file mode 10644
    - +  
     1patch-tst_qpluginloader.diff
     2patch-machtest.diff
     3patch-tst_qarraydata.diff
     4patch-tst_benchlibcallgrind.diff
     5patch-tst_qaccessibilitymac_helpers.diff
     6qprocess-nozombies.patch
     7fix-qstandardpaths.patch
     8deactivate-menurole-heuristics.patch
     9debug-negative-qtimerint.patch
     10remove_icon_from_example.patch
     11remove_google_adsense.patch
     12load_testability_from_env_var.patch
     13Add-workaround-for-GL-on-Android-emulator.patch
     14disable-generic-plugin-when-others-available.patch
     15QtBearer-networkmanager-make-sure-to-set-flag-Active.patch
     16Break-after-handling-the-read-write.patch