Ticket #50966: qmake5.diff

File qmake5.diff, 9.2 KB (added by RJVB (René Bertin), 8 years ago)
  • _resources/port1.0/group/qmake5-1.0.tcl

    old new  
    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: qmake-1.0.tcl 106930 2013-06-12 03:13:56Z ryandesign@macports.org $
     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: qmake5-1.0.tcl 145157 2016-01-27 04:47:20Z mcalhoun@macports.org $
    33
    44#
    55# Copyright (c) 2013 The MacPorts Project
     
    3535#
    3636# Usage:
    3737# PortGroup                     qmake5 1.0
     38#
     39# or
     40# set qt5.prefer_kde            yes
     41# PortGroup                     qmake5 1.0
    3842
    3943PortGroup                       qt5 1.0
    40 PortGroup                       active_variants 1.1
    4144
    42 # with the -r option, the examples do not install correctly (no source code)
    43 #     the install_sources target is not created in the Makefile(s)
    44 configure.cmd                   ${qt_qmake_cmd}
    45 #configure.cmd                   ${qt_qmake_cmd} -r
    46 
    47 configure.pre_args-replace      --prefix=${prefix} "PREFIX=${prefix}"
    48 configure.universal_args-delete --disable-dependency-tracking
    49 
    50 # specify build configuration (compiler, 32-bit/64-bit, etc.)
    51 if { ![option universal_variant] || ![variant_isset universal] } {
    52     configure.args-append -spec ${qt_qmake_spec}
    53 } else {
    54     lappend merger_configure_args(i386)   -spec ${qt_qmake_spec_32}
    55     lappend merger_configure_args(x86_64) -spec ${qt_qmake_spec_64}
     45if {![info exists qt5.using_kde]} {
     46    ui_debug "qmake5 PortGroup : no qt5-kde info was provided by the Qt5 PortGroup"
     47    set qt5.using_kde           no
    5648}
    5749
    58 # if qtbase was build as a universal,
    59 #    QT_ARCH and QT_TARGET_ARCH may be set incorrectly in ${qt_mkspecs_dir}/qconfig.pri,
    60 #    so set them manually
    61 if { ![option universal_variant] || ![variant_isset universal] } {
    62     pre-configure {
    63         if {[active_variants qt5-qtbase universal ""]} {
    64             configure.args-append \
    65                 QT_ARCH=${build_arch} \
    66                 QT_TARGET_ARCH=${build_arch}
    67         }
     50if {${qt5.using_kde}} {
     51
     52    #configure.cmd                   ${qt_qmake_cmd} -r
     53    configure.cmd                   ${qt_qmake_cmd}
     54    configure.pre_args-replace      --prefix=${prefix} PREFIX=${prefix}
     55    configure.universal_args-delete --disable-dependency-tracking
     56
     57    # qmake defaults to -mmacosx-version-min=10.6, which implies stdlib is libstdc++, which caused problems
     58    #    (see https://trac.macports.org/wiki/FAQ#libcpp)
     59    # override QMAKE_MACOSX_DEPLOYMENT_TARGET set in ${prefix}/libexec/qt5/mkspecs/macx-clang/qmake.conf
     60    # see #50249
     61    configure.pre_args-append       "QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}"
     62
     63    if {[variant_exists universal] && [variant_isset universal]} {
     64        set merger_configure_args(i386)     "CONFIG+=\"x86\" -spec ${qt_qmake_spec_32}"
     65        set merger_configure_args(x86_64)   "-spec ${qt_qmake_spec_64}"
    6866    }
     67
     68    # qt5-kde does not currently support a debug variant, but does provide (some) debugging information
     69    configure.pre_args-append       "CONFIG+=release"   
     70
    6971} else {
    70     foreach arch ${configure.universal_archs} {
    71         lappend merger_configure_args(${arch}) \
    72             QT_ARCH=${arch} \
    73             QT_TARGET_ARCH=${arch}
    74     }
    75 }
    7672
    77 # override QMAKE_MACOSX_DEPLOYMENT_TARGET set in ${prefix}/libexec/qt5/mkspecs/macx-clang/qmake.conf
    78 # see #50249
    79 configure.args-append QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}
     73    # using the mainstream port:qt5
    8074
    81 # override C++11 flags set in ${prefix}/libexec/qt5/mkspecs/common/clang-mac.conf
    82 #    so value of ${configure.cxx_stdlib} can always be used
    83 configure.args-append \
    84     QMAKE_CXXFLAGS_CXX11-=-stdlib=libc++ \
    85     QMAKE_LFLAGS_CXX11-=-stdlib=libc++   \
    86     QMAKE_CXXFLAGS_CXX11+=-stdlib=${configure.cxx_stdlib} \
    87     QMAKE_LFLAGS_CXX11+=-stdlib=${configure.cxx_stdlib}
    88 
    89 # ensure ${configure.cxx_stdlib} is used for C++ stdlib
    90 configure.args-append \
    91     QMAKE_CXXFLAGS+=-stdlib=${configure.cxx_stdlib} \
    92     QMAKE_LFLAGS+=-stdlib=${configure.cxx_stdlib}
    93 
    94 if {![info exists qt5_qmake_request_no_debug]} {
    95     variant debug description {Build both release and debug libraries} {}
    96 
    97     # accommodating variant request varies depending on how qtbase was built
    98     pre-configure {
    99 
    100         # determine if qmake builds debug libraries by default (set via variants)
    101         if {[active_variants qt5-qtbase debug ""]} {
    102             set base_debug true
    103         } else {
    104             set base_debug false
    105         }
     75    PortGroup                       active_variants 1.1
    10676
    107         # determine if the user wants to build debug libraries
    108         if { [variant_exists debug] && [variant_isset debug] } {
    109             set this_debug true
    110         } else {
    111             set this_debug false
    112         }
     77    # with the -r option, the examples do not install correctly (no source code)
     78    #     the install_sources target is not created in the Makefile(s)
     79    configure.cmd                   ${qt_qmake_cmd}
     80    #configure.cmd                   ${qt_qmake_cmd} -r
     81
     82    configure.pre_args-replace      --prefix=${prefix} "PREFIX=${prefix}"
     83    configure.universal_args-delete --disable-dependency-tracking
     84
     85    # specify build configuration (compiler, 32-bit/64-bit, etc.)
     86    if { ![option universal_variant] || ![variant_isset universal] } {
     87        configure.args-append -spec ${qt_qmake_spec}
     88    } else {
     89        lappend merger_configure_args(i386)   -spec ${qt_qmake_spec_32}
     90        lappend merger_configure_args(x86_64) -spec ${qt_qmake_spec_64}
     91    }
    11392
    114         # determine of qmake's default and user requests are compatible; override qmake if necessary
    115         if { ${this_debug} && !${base_debug}  } {
    116             configure.args-append "QT_CONFIG+=\"debug_and_release build_all\""
     93    # if qtbase was build as a universal,
     94    #    QT_ARCH and QT_TARGET_ARCH may be set incorrectly in ${qt_mkspecs_dir}/qconfig.pri,
     95    #    so set them manually
     96    if { ![option universal_variant] || ![variant_isset universal] } {
     97        pre-configure {
     98            if {[active_variants qt5-qtbase universal ""]} {
     99                configure.args-append \
     100                    QT_ARCH=${build_arch} \
     101                    QT_TARGET_ARCH=${build_arch}
     102            }
     103        }
     104    } else {
     105        foreach arch ${configure.universal_archs} {
     106            lappend merger_configure_args(${arch}) \
     107                QT_ARCH=${arch} \
     108                QT_TARGET_ARCH=${arch}
    117109        }
     110    }
    118111
    119         if { !${this_debug} && ${base_debug}  } {
    120             configure.args-append "QT_CONFIG-=\"debug_and_release build_all\" CONFIG-=\"debug\""
     112    # override QMAKE_MACOSX_DEPLOYMENT_TARGET set in ${prefix}/libexec/qt5/mkspecs/macx-clang/qmake.conf
     113    # see #50249
     114    configure.args-append QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}
     115
     116    if {![info exists qt5_qmake_request_no_debug]} {
     117        variant debug description {Build both release and debug libraries} {}
     118
     119        # accommodating variant request varies depending on how qtbase was built
     120        pre-configure {
     121
     122            # determine if qmake builds debug libraries by default (set via variants)
     123            if {[active_variants qt5-qtbase debug ""]} {
     124                set base_debug true
     125            } else {
     126                set base_debug false
     127            }
     128
     129            # determine if the user wants to build debug libraries
     130            if { [variant_exists debug] && [variant_isset debug] } {
     131                set this_debug true
     132            } else {
     133                set this_debug false
     134            }
     135
     136            # determine of qmake's default and user requests are compatible; override qmake if necessary
     137            if { ${this_debug} && !${base_debug}  } {
     138                configure.args-append "QT_CONFIG+=\"debug_and_release build_all\""
     139            }
     140
     141            if { !${this_debug} && ${base_debug}  } {
     142                configure.args-append "QT_CONFIG-=\"debug_and_release build_all\" CONFIG-=\"debug\""
     143            }
    121144        }
    122145    }
     146
    123147}
     148
     149# override C++11 flags set in ${prefix}/libexec/qt5/mkspecs/common/clang-mac.conf
     150#    so value of ${configure.cxx_stdlib} can always be used
     151# RJVB: only use cxx_stdlib when it is actually set and not equal to libc++ already.
     152if {${configure.cxx_stdlib} ne ""} {
     153    if {${configure.cxx_stdlib} ne "libc++"} {
     154        configure.args-append \
     155            QMAKE_CXXFLAGS_CXX11-=-stdlib=libc++ \
     156            QMAKE_LFLAGS_CXX11-=-stdlib=libc++   \
     157            QMAKE_CXXFLAGS_CXX11+=-stdlib=${configure.cxx_stdlib} \
     158            QMAKE_LFLAGS_CXX11+=-stdlib=${configure.cxx_stdlib}
     159    }
     160    # ensure ${configure.cxx_stdlib} is used for C++ stdlib
     161    configure.args-append \
     162        QMAKE_CXXFLAGS+=-stdlib=${configure.cxx_stdlib} \
     163        QMAKE_LFLAGS+=-stdlib=${configure.cxx_stdlib}
     164}
     165
     166# kate: backspace-indents true; indent-pasted-text true; indent-width 4; keep-extra-spaces true; remove-trailing-spaces modified; replace-tabs true; replace-tabs-save true; syntax Tcl/Tk; tab-indents true; tab-width 4;