Ticket #47329: qt5creatormac.diff

File qt5creatormac.diff, 8.3 KB (added by RJVB (René Bertin), 9 years ago)
  • devel/qt5-creator-mac/Portfile

    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;
    23# $Id: Portfile 127658 2014-10-31 18:21:47Z mcalhoun@macports.org $
    34
    45PortSystem          1.0
     
    910    universal_variant no
    1011    supported_archs   noarch
    1112}
     13
    1214PortGroup           qmake5 1.0
     15# universal build hasn't been tested (20150410)
     16# universal_variant   no
    1317
    14 version             3.2.2
    1518categories          devel aqua
    1619platforms           darwin
    1720license             LGPL-2.1
    18 maintainers         mcalhoun openmaintainer
     21maintainers         gmail.com:rjvbertin mcalhoun openmaintainer
    1922description         Cross-platform integrated development environment (IDE) tailored to the needs of Qt developers.
    2023long_description    Qt Creator is a cross-platform integrated development environment (IDE) tailored to the needs of Qt developers.
     24installs_libs       no
     25
     26homepage            http://wiki.qt.io/Category:Tools::QtCreator
     27
     28subport ${name}-devel {
     29    set use_git         yes
     30    if {${use_git}} {
     31        depends_fetch-append port:git
     32        fetch.type      git
     33        git.url     git://code.qt.io/qt-creator/qt-creator.git
     34        git.branch      51bb521
     35        set qbs.branch  760dc4e
     36        version         3.4.0.638.g${git.branch}
     37        distname        qt-creator-opensource-src-3.4.x
     38        fetch {
     39            # I don't see any provisions for git submodules in MacPorts, so we have to clone by hand:
     40            system "${prefix}/bin/git clone --depth=1 --no-single-branch --recursive -q ${git.url} ${workpath}/${worksrcdir}"
     41            system "cd ${workpath}/${worksrcdir} ; ${prefix}/bin/git checkout -q ${git.branch}"
     42            system "cd ${workpath}/${worksrcdir}/src/shared/qbs ; ${prefix}/bin/git checkout -q ${qbs.branch}"
     43        }
     44        # hopefully temporary patches:
     45        patchfiles-append \
     46                        patch-missing-botan-headers.diff \
     47                        patch-coreplugin+CoreServices.diff
     48    } else {
     49        version         3.4.0
     50        master_sites    https://download.qt.io/official_releases/qtcreator/[join [lrange [split ${version} .] 0 1] .]/${version}/
     51
     52        distname        qt-creator-opensource-src-${version}
     53        checksums       rmd160  de85ab935a094e94a8e8864406d82dbb57b3233a \
     54                        sha256  b80baf5be9b0421b3d951a8a0eb411a65cf008f4c753f5a80d205e90fa4fe112
     55        livecheck.type  regex
     56        livecheck.url   http://www.qt.io/download-open-source/
     57        livecheck.regex qt-creator-opensource-src-(\[a-z0-9.\]+)${extract.suffix}
     58    }
    2159
    22 homepage            http://qt-project.org/wiki/Category:Tools::QtCreator
    23 distname            qt-creator-opensource-src-${version}
    24 master_sites        https://download.qt-project.org/official_releases/qtcreator/[join [lrange [split ${version} .] 0 1] .]/${version}/
     60    # don't let QtCreator set up a global Mac-style menubar when using the xcb plugin
     61    patchfiles-append   devel/patch-show-menubar-with-xcb.diff
     62}
     63#else
     64if { ${subport} ne "${name}-devel" } {
     65#     version         3.3.2
     66#     master_sites    https://download.qt.io/official_releases/qtcreator/[join [lrange [split ${version} .] 0 1] .]/${version}/
     67#
     68#     distname        qt-creator-opensource-src-${version}
     69#     checksums       rmd160  faeff05d1d58f3eb4666618221a3775239f4c6ec \
     70#                     sha256  6ef76d23c778a58caffb487b8bc6a192defa2d5dd5fab1ecf8eb70d53ccfb98a
     71#     livecheck.type  regex
     72#     livecheck.url   http://www.qt.io/download-open-source/
     73#     livecheck.regex qt-creator-opensource-src-(\[a-z0-9.\]+)${extract.suffix}
     74    version         3.4.0
     75    master_sites    https://download.qt.io/official_releases/qtcreator/[join [lrange [split ${version} .] 0 1] .]/${version}/
     76
     77    distname        qt-creator-opensource-src-${version}
     78    checksums       rmd160  de85ab935a094e94a8e8864406d82dbb57b3233a \
     79                    sha256  b80baf5be9b0421b3d951a8a0eb411a65cf008f4c753f5a80d205e90fa4fe112
     80    livecheck.type  regex
     81    livecheck.url   http://www.qt.io/download-open-source/
     82    livecheck.regex qt-creator-opensource-src-(\[a-z0-9.\]+)${extract.suffix}
    2583
    26 checksums           rmd160  5c85bfb5dc02c3639453421dd48355c8b4aa8145 \
    27                     sha256  a115f1d7b08446dcfeb79537f3d8d251dbc3c9808d0ff377efe5c4fad7dbd8f0
     84    patchfiles-append   patch-show-menubar-with-xcb.diff
     85}
     86# don't set up a Dock menu when using the xcb plugin
     87patchfiles-append   patch-no-dockmenu-xcb.diff
    2888
    29 if { ${subport} eq ${name} } {
     89if { ${subport} eq ${name} || ${subport} eq "${name}-devel" } {
    3090    depends_lib-append     port:botan
    3191    configure.args-append  "USE_SYSTEM_BOTAN=1"
    32        
     92
     93    post-fetch            {
     94        file mkdir ${workpath}/build
     95        if {${use_git} && (${subport} eq "${name}-devel")} {
     96            catch {eval exec sh -c "\"cd ${workpath}/${worksrcdir} ; git submodule update --init\""} result
     97            ui_debug "git submodule -init: $result"
     98            if {[file exists ${filespath}/QC-git/.git]} {
     99                reinplace -W ${workpath}/${worksrcdir} "s|qt-labs/qbs.git|files/QC-git/src/shared/qbs|g" .git/config
     100            }
     101            catch {eval exec sh -c "\"cd ${workpath}/${worksrcdir} ; git submodule update\""} result
     102            ui_debug "git submodule: $result"
     103        }
     104    }
     105    configure.args-append   ../${worksrcdir}/qtcreator.pro
     106    default configure.dir   {${workpath}/build}
     107    default build.dir       {${workpath}/build}
     108
    33109    if { ![variant_isset universal] } {
    34110        destroot {
    35111            # make install attempts to install command line tools into /bin, etc.
    36112            xinstall -m 755 -d ${destroot}${qt_apps_dir}
    37             copy "${worksrcpath}/bin/Qt Creator.app" "${destroot}${qt_apps_dir}"
     113            copy "${build.dir}/bin/Qt Creator.app" "${destroot}${qt_apps_dir}"
     114            reinplace "s|/usr/local|${prefix}|g" \
     115                "${destroot}${qt_apps_dir}/Qt Creator.app/Contents/Resources/qbs/share/qbs/imports/qbs/Probes/PathProbe.qbs"
     116            reinplace "s|/usr/local/lib|${qt_frameworks_dir}|g" \
     117                "${destroot}${qt_apps_dir}/Qt Creator.app/Contents/Resources/qbs/share/qbs/imports/qbs/Probes/FrameworkProbe.qbs"
    38118        }
    39119    } else {
    40120        # We should really just override destroot, but the muniversal Portgroup would override our override.
    41121        destroot.cmd "true"
    42122        merger-post-destroot {
    43123            foreach arch ${universal_archs_to_use} {
    44                 xinstall -m 755 -d ${destroot}-${arch}${qt_apps_dir}
    45                 copy "${worksrcpath}-${arch}/bin/Qt Creator.app" "${destroot}-${arch}${qt_apps_dir}"
     124                set adest ${destroot}-${arch}${qt_apps_dir}
     125                xinstall -m 755 -d ${adest}
     126                copy "${worksrcpath}-${arch}/bin/Qt Creator.app" "${adest}"
     127                reinplace "s|/usr/local/|${prefix}/|g" \
     128                    "${adest}/Qt Creator.app/Contents/Resources/qbs/share/qbs/imports/qbs/Probes/FrameworkProbe.qbs" \
     129                    "${adest}/Qt Creator.app/Contents/Resources/qbs/share/qbs/imports/qbs/Probes/PathProbe.qbs"
    46130            }
    47131        }
    48132    }
     133    post-destroot {
     134        xinstall -m 755 -d ${destroot}/${qt_bins_dir}
     135        ln -s "${qt_apps_dir}/Qt Creator.app/Contents/MacOS/Qt Creator" ${destroot}/${qt_bins_dir}/qtcreator
     136        copy ${filespath}/qtcreator-remote ${destroot}/${qt_bins_dir}
     137        reinplace "s|@@QT_APPS_DIR@@|${qt_apps_dir}|g" ${destroot}/${qt_bins_dir}/qtcreator-remote
     138    }
    49139}
    50140
    51 use_parallel_build  no
     141#use_parallel_build  no
    52142
    53143subport ${name}-docs {
    54144    depends_lib-append port:${name} port:qt5-mac-sqlite3-plugin
     
    75165    destroot.target -f Makefile.static INSTALL_ROOT=${destroot}${prefix} install_examples
    76166}
    77167
    78 livecheck.type      regex
    79 livecheck.url       http://www.qt.io/download-open-source/
    80 livecheck.regex     qt-creator-opensource-src-(\[a-z0-9.\]+)${extract.suffix}"