Ticket #48024: qt5-1.0.diff

File qt5-1.0.diff, 11.5 KB (added by RJVB (René Bertin), 9 years ago)
  • /opt/local/

    old new  
    11# -*- 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# 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;
     3# $Id: qt5-1.0.tcl 113952 2015-06-11 16:30:53Z gmail.com:rjvbertin $
    24# $Id: qt5-1.0.tcl 113952 2013-11-26 18:01:53Z michaelld@macports.org $
    35
    46# Copyright (c) 2014 The MacPorts Project
     
    3537# Usage:
    3638# PortGroup     qt5 1.0
    3739
    38 # no universal binary support in Qt 5
    39 #     see http://lists.qt-project.org/pipermail/interest/2012-December/005038.html
    40 #     see also https://bugreports.qt-project.org/browse/QTBUG-24952
    4140if { ![exists universal_variant] || [option universal_variant] } {
    4241    PortGroup muniversal 1.0
    4342    #universal_archs_supported i386 x86_64
     
    5958    }
    6059}
    6160
    62 # standard Qt5 name
     61# standard Qt5 name. This should be just "qt5" (or qt53 for instance when more
     62# specific version info must be included). There is nothing but a historical reason
     63# to call the Qt5 port itself qt5-mac, so that name should not appear on disk where
     64# files could be installed that would be the distant descendants of files from qt4-x11
    6365global qt_name
    6466set qt_name             qt5
    6567
     68# global definitions with explanation; set the actual values below for cleanness.
    6669# standard install directory
    67 global qt_dir
    68 set qt_dir               ${prefix}/libexec/qt5-mac
    69 
    70 # standard Qt non-.app executables directory
    71 global qt_bins_dir
    72 set qt_bins_dir         ${qt_dir}/bin
    73 
    74 # standard Qt includes directory
    75 global qt_includes_dir
    76 set qt_includes_dir     ${qt_dir}/include
    77 
    78 # standard Qt libraries directory
    79 global qt_libs_dir
    80 set qt_libs_dir         ${qt_dir}/lib
    81 
    82 # standard Qt libraries directory
    83 global qt_frameworks_dir
    84 set qt_frameworks_dir   ${qt_libs_dir}
    85 
    86 global qt_archdata_dir
    87 set qt_archdata_dir  ${qt_dir}
    88 
     70    global qt_dir
     71# idem, relative to ${prefix}
     72    global qt_dir_rel
     73# archdata: equal to qt_dir
     74    global qt_archdata_dir
     75# standard Qt documents directory
     76    global qt_docs_dir
    8977# standard Qt plugins directory
    90 global qt_plugins_dir
    91 set qt_plugins_dir      ${qt_archdata_dir}/plugins
    92 
     78    global qt_plugins_dir
     79# standard Qt mkspecs directory
     80    global qt_mkspecs_dir
    9381# standard Qt imports directory
    94 global qt_imports_dir
    95 set qt_imports_dir      ${qt_archdata_dir}/imports
    96 
     82    global qt_imports_dir
    9783# standard Qt qml directory
    98 global qt_qml_dir
    99 set qt_qml_dir          ${qt_archdata_dir}/qml
    100 
     84    global qt_qml_dir
     85# standard Qt includes directory, under ${prefix}/includes where they would be expected
     86    global qt_includes_dir
     87# standard Qt libraries directory
     88    global qt_libs_dir
     89# standard Qt libraries directory: OS X frameworks
     90    global qt_frameworks_dir
     91# idem, relative to ${prefix}
     92    global qt_frameworks_dir_rel
     93# standard Qt non-.app executables directory
     94    global qt_bins_dir
    10195# standard Qt data directory
    102 global qt_data_dir
    103 set qt_data_dir         ${qt_dir}
    104 
    105 # standard Qt documents directory
    106 global qt_docs_dir
    107 set qt_docs_dir         ${qt_data_dir}/doc
    108 
     96    global qt_data_dir
    10997# standard Qt translations directory
    110 global qt_translations_dir
    111 set qt_translations_dir ${qt_data_dir}/translations
    112 
     98    global qt_translations_dir
    11399# standard Qt sysconf directory
    114 global qt_sysconf_dir
    115 set qt_sysconf_dir      ${qt_dir}/etc/xdg
    116 
     100    global qt_sysconf_dir
     101# standard Qt .app executables directory, if created
     102    global qt_apps_dir
    117103# standard Qt examples directory
    118 global qt_examples_dir
    119 set qt_examples_dir     ${qt_dir}/examples
    120 
    121 # standard Qt tests directory
    122 global qt_tests_dir
    123 set qt_tests_dir        ${qt_dir}/tests
    124 
    125 # data used by qmake
    126 global qt_host_data_dir
    127 set qt_host_data_dir    ${qt_dir}
    128 
     104    global qt_examples_dir
    129105# standard Qt demos directory
    130 #global qt_demos_dir
    131 #set qt_demos_dir        ${qt_dir}/share/${qt_name}/demos
    132 
    133 # standard Qt mkspecs directory
    134 global qt_mkspecs_dir
    135 set qt_mkspecs_dir      ${qt_dir}/mkspecs
    136 
    137 # standard Qt .app executables directory, if created?
    138 #global qt_apps_dir
    139 #set qt_apps_dir         ${qt_bins_dir}
    140 
     106    global qt_demos_dir
     107# standard Qt tests directory
     108    global qt_tests_dir
    141109# standard CMake module directory for Qt-related files
    142 #global qt_cmake_module_dir
    143 #set qt_cmake_module_dir ${qt_libs_dir}/cmake
    144 
     110    global qt_cmake_module_dir
    145111# standard qmake command location
    146 global qt_qmake_cmd
    147 set qt_qmake_cmd        ${qt_dir}/bin/qmake
    148 
     112    global qt_qmake_cmd
    149113# standard moc command location
    150 global qt_moc_cmd
    151 set qt_moc_cmd          ${qt_dir}/bin/moc
    152 
     114    global qt_moc_cmd
    153115# standard uic command location
    154 global qt_uic_cmd
    155 set qt_uic_cmd          ${qt_dir}/bin/uic
    156 
     116    global qt_uic_cmd
    157117# standard lrelease command location
    158 global qt_lrelease_cmd
    159 set qt_lrelease_cmd     ${qt_dir}/bin/lrelease
     118    global qt_lrelease_cmd
    160119
    161 # standard PKGCONFIG path
    162 global qt_pkg_config_dir
    163 set qt_pkg_config_dir   ${qt_libs_dir}/pkgconfig
     120set qt_dir                  ${prefix}/libexec/${qt_name}
     121set qt_dir_rel              libexec/${qt_name}
     122set qt_includes_dir         ${prefix}/include/${qt_name}
     123set qt_libs_dir             ${qt_dir}/lib
     124set qt_frameworks_dir       ${qt_dir}/Library/Frameworks
     125set qt_frameworks_dir_rel   ${qt_dir_rel}/Library/Frameworks
     126set qt_bins_dir             ${qt_dir}/bin
     127set qt_cmake_module_dir     ${prefix}/lib/cmake
     128set qt_archdata_dir         ${qt_dir}
     129set qt_sysconf_dir          ${prefix}/etc/${qt_name}
     130set qt_data_dir             ${prefix}/share/${qt_name}
     131set qt_plugins_dir          ${prefix}/share/${qt_name}/plugins
     132set qt_mkspecs_dir          ${prefix}/share/${qt_name}/mkspecs
     133set qt_imports_dir          ${prefix}/share/${qt_name}/imports
     134set qt_qml_dir              ${prefix}/share/${qt_name}/qml
     135set qt_translations_dir     ${prefix}/share/${qt_name}/translations
     136set qt_tests_dir            ${prefix}/share/${qt_name}/tests
     137set qt_docs_dir             ${prefix}/share/doc/${qt_name}
     138
     139set qt_qmake_cmd            ${qt_dir}/bin/qmake
     140set qt_moc_cmd              ${qt_dir}/bin/moc
     141set qt_uic_cmd              ${qt_dir}/bin/uic
     142set qt_lrelease_cmd         ${qt_dir}/bin/lrelease
     143
     144set qt_apps_dir             ${applications_dir}/Qt5
     145set qt_examples_dir         ${qt_apps_dir}/examples
     146set qt_demos_dir            ${qt_apps_dir}/demos
    164147
    165 # standard qmake spec
    166 # other platforms required? (see http://doc.qt.io/qt-5/supported-platforms.html and http://doc.qt.io/QtSupportedPlatforms/index.html)
    167148global qt_qmake_spec
    168149global qt_qmake_spec_32
    169150global qt_qmake_spec_64
    170 compiler.whitelist clang
    171151
    172 set qt_qmake_spec_32 macx-clang-32
    173 set qt_qmake_spec_64 macx-clang
     152PortGroup                   compiler_blacklist_versions 1.0
     153compiler.whitelist          clang macports-clang-3.5 macports-clang-3.4
     154compiler.blacklist-append   macports-llvm-gcc-4.2 llvm-gcc-4.2
     155compiler.blacklist-append   gcc-4.2 apple-gcc-4.2 gcc-4.0
     156compiler.blacklist-append   macports-clang-3.1 macports-clang-3.0 macports-clang-3.2 macports-clang-3.3
     157compiler.blacklist-append   {clang < 500}
     158
     159
     160# set Qt understood arch types, based on user preference
     161options qt_arch_types
     162default qt_arch_types       {[string map {i386 x86} [get_canonical_archs]]}
     163
     164set qt_qmake_spec_32        macx-clang-32
     165set qt_qmake_spec_64        macx-clang
    174166
    175167if { ![option universal_variant] || ![variant_isset universal] } {
    176168    if { ${build_arch} eq "i386" } {
    177         set qt_qmake_spec ${qt_qmake_spec_32}
     169        set qt_qmake_spec   ${qt_qmake_spec_32}
    178170    } else {
    179         set qt_qmake_spec ${qt_qmake_spec_64}
     171        set qt_qmake_spec   ${qt_qmake_spec_64}
    180172    }
    181173} else {
    182174    set qt_qmake_spec ""
    183175}
    184176
     177# standard PKGCONFIG path
     178global qt_pkg_config_dir
     179set qt_pkg_config_dir       ${prefix}/lib/pkgconfig
     180
     181# data used by qmake
     182global qt_host_data_dir
     183set qt_host_data_dir        ${prefix}/share/${qt_name}
     184
    185185# standard cmake info for Qt5
    186186global qt_cmake_defines
    187187set qt_cmake_defines    \
     
    190190     -DQT_ZLIB_LIBRARY=${prefix}/lib/libz.dylib \
    191191     -DQT_PNG_LIBRARY=${prefix}/lib/libpng.dylib"
    192192
    193 # set Qt understood arch types, based on user preference
    194 options qt_arch_types
    195 default qt_arch_types   {[string map {i386 x86} [get_canonical_archs]]}
    196 
    197 # allow for depending on either qt5-mac and qt5-mac-devel, simultaneously
     193# allow for depending on either qt5[-mac] or qt5[-mac]-devel or qt5[-mac]*-kde, simultaneously
    198194
    199195if {![info exists building_qt5]} {
    200196    if {${os.platform} eq "darwin"} {
     
    202198        # see if the framework install exists, and if so depend on it;
    203199        # if not, depend on the library version
    204200
    205         if {[file exists ${qt_frameworks_dir}/QtCore/QtCore]} {
    206             depends_lib-append path:Library/Frameworks/QtCore/QtCore:qt5-mac
     201        if {[file exists ${qt_frameworks_dir}/QtCore.framework/QtCore]} {
     202            depends_lib-append path:libexec/${qt_name}/Library/Frameworks/QtCore.framework/QtCore:qt5-mac
    207203        } else {
    208             depends_lib-append path:lib/libQtCore.5.dylib:qt5-mac
     204            depends_lib-append path:libexec/${qt_name}/lib/libQtCore.5.dylib:qt5-mac
    209205        }
    210206    }
    211207}
     
    223219    } else {
    224220        set merger_configure_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
    225221        set merger_configure_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
     222        set merger_arch_flag             yes
     223        set merger_arch_compiler         yes
    226224    }
    227225
    228226    # make sure the Qt binaries' directory is in the path, if it is
     
    246244    if { ![option universal_variant] || ![variant_isset universal] } {
    247245        build.env-append QMAKESPEC=${qt_qmake_spec}
    248246    } else {
    249         set merger_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
    250         set merger_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
     247        set merger_build_env(i386)      "QMAKESPEC=${qt_qmake_spec_32}"
     248        set merger_build_env(x86_64)    "QMAKESPEC=${qt_qmake_spec_64}"
     249        set merger_arch_flag            yes
     250        set merger_arch_compiler        yes
    251251    }
    252252
    253253    # make sure the Qt binaries' directory is in the path, if it is
    254254    # not the current prefix
    255255
    256256    if {${qt_dir} ne ${prefix}} {
    257         build.env-append    PATH=${qt_dir}/bin:$env(PATH)
     257        build.env-append                PATH=${qt_dir}/bin:$env(PATH)
    258258    }
    259259}
    260260
    261261# use PKGCONFIG for Qt discovery in configure scripts
    262 depends_build-append    port:pkgconfig
     262depends_build-append                    port:pkgconfig
    263263
    264264# standard destroot environment
    265265if { ![option universal_variant] || ![variant_isset universal] } {
     
    282282    if { ![option universal_variant] || ![variant_isset universal] } {
    283283        build.env-append QMAKESPEC=${qt_qmake_spec}
    284284    } else {
    285         set destroot_build_env(i386)   "QMAKESPEC=${qt_qmake_spec_32}"
    286         set destroot_build_env(x86_64) "QMAKESPEC=${qt_qmake_spec_64}"
     285        set destroot_build_env(i386)    "QMAKESPEC=${qt_qmake_spec_32}"
     286        set destroot_build_env(x86_64)  "QMAKESPEC=${qt_qmake_spec_64}"
    287287    }
    288288
    289289    # make sure the Qt binaries' directory is in the path, if it is
     
    293293        destroot.env-append PATH=${qt_dir}/bin:$env(PATH)
    294294    }
    295295}
     296
     297proc qt_branch {} {
     298    global version
     299    return [join [lrange [split ${version} .] 0 1] .]
     300}