Ticket #51620: py-pyqt5.2.diff

File py-pyqt5.2.diff, 8.0 KB (added by RJVB (René Bertin), 7 years ago)
  • python/py-pyqt5/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
    22# $Id$
    33
    4 PortSystem          1.0
    5 PortGroup           qt5 1.0
    6 PortGroup           python 1.0
    7 
    8 name                py-pyqt5
    9 version             5.6
    10 revision            2
    11 categories-append   devel
    12 platforms           darwin
    13 maintainers         mmoll openmaintainer
    14 description         PyQt5 is a set of Python bindings for the Qt5 toolkit
    15 long_description \
    16     PyQt5 is a set of Python bindings for the Qt5 toolkit. The bindings \
    17     are implemented as a set of Python modules and contain over 620 classes.
    18 homepage            http://www.riverbankcomputing.co.uk/software/pyqt/intro
    19 license             GPL-3
    20 master_sites        sourceforge:pyqt
    21 distname            PyQt5_gpl-${version}
    22 checksums           rmd160  498905b678fc2641c8ff6521b5c2126ac6ddf347 \
    23                     sha256  2e481a6c4c41b96ed3b33449e5f9599987c63a5c8db93313bd57a6acbf20f0e1
     4PortSystem              1.0
     5PortGroup               qt5 1.0
     6set depends_lib_backup  ${depends_lib}
     7PortGroup               python 1.0
     8
     9name                    py-pyqt5
     10version                 5.6
     11revision                3
     12categories-append       devel
     13platforms               darwin
     14maintainers             mmoll openmaintainer
     15description             PyQt5 is a set of Python bindings for the Qt5 toolkit
     16long_description        ${description}. The bindings \
     17                        are implemented as a set of Python modules and contain over 620 classes.
     18homepage                http://www.riverbankcomputing.co.uk/software/pyqt/intro
     19license                 GPL-3
     20master_sites            sourceforge:pyqt
     21distname                PyQt5_gpl-${version}
     22checksums               rmd160  498905b678fc2641c8ff6521b5c2126ac6ddf347 \
     23                        sha256  2e481a6c4c41b96ed3b33449e5f9599987c63a5c8db93313bd57a6acbf20f0e1
    2424
    2525python.versions 27 34 35
    2626
     27# at this point, the python portgroup will have reset depends_lib (python.versions does that),
     28depends_lib-append      ${depends_lib_backup}
     29
     30if {[info procs qt5.depends_component] eq ""} {
     31    proc qt5.depends_component {first args} {
     32        global qt5_component_lib qt5.using_kde os.major
     33        # join ${first} and (the optional) ${args}
     34        set args [linsert $args[set list {}] 0 ${first}]
     35        if {[info exists qt5.using_kde] && ${qt5.using_kde}} {
     36            set qt5main "qt5-kde"
     37        } if {${os.major} == 11} {
     38            set qt5main "qt55"
     39        } else {
     40            set qt5main "qt5"
     41        }
     42        foreach comp ${args} {
     43            if {${comp} eq "qt5"} {
     44                if {[info exists qt5.using_kde] && ${qt5.using_kde}} {
     45                    global qt5_dependency
     46                    depends_lib-append ${qt5_dependency}
     47                } else {
     48                    depends_lib-append port:${qt5main}
     49                }
     50            } else {
     51                set portname "${qt5main}-${comp}"
     52                depends_lib-append port:${portname}
     53            }
     54        }
     55    }
     56}
     57
    2758if {${name} ne ${subport}} {
    28     depends_lib-append port:py${python.version}-sip \
    29         port:qt5                                    \
    30         port:dbus-python${python.version}
    31     use_configure      yes
    32     configure.pre_args
    33     configure.cmd      "${python.bin} configure.py"
    34     configure.args-append  -q ${qt_qmake_cmd} --verbose --confirm-license \
    35         --sip=${prefix}/bin/sip-${python.branch}
     59    depends_lib-append  port:py${python.version}-sip \
     60                        port:dbus-python${python.version}
    3661
    37     # modules that are not installed with qt5 port
     62    use_configure       yes
     63    configure.pre_args
     64    configure.cmd       "${python.bin} configure.py"
    3865    configure.args-append \
    39         --disable=QtWebKit \
    40         --disable=QtWebKitWidgets \
    41         --disable=QtWebEngineCore \
    42         --disable=QtWebEngineWidgets
    43 
    44     build.cmd          make
    45     build.target       all
    46     destroot.cmd       ${build.cmd}
    47     destroot.destdir   DESTDIR=${destroot}
     66                        -q ${qt_qmake_cmd} \
     67                        --verbose \
     68                        --confirm-license \
     69                        --sip=${prefix}/bin/sip-${python.branch} \
     70                        --dbus=${python.include}/dbus-1.0 \
     71                        --designer-plugindir=${qt_plugins_dir}/designer/Py${python.version}Qt5 \
     72                        --qml-plugindir=${qt_plugins_dir}/Py${python.version}Qt5 \
     73                        --disable=QtWebKit \
     74                        --disable=QtWebKitWidgets \
     75                        --disable=QtWebEngineCore \
     76                        --disable=QtWebEngineWidgets
     77
     78    post-configure {
     79        # using --dbus means the compiler will find dbus-python.h but not
     80        # the DBus headers themselves. Correct dbus.pro :
     81        set dbus1incpath [strsed [exec pkg-config --cflags-only-I dbus-1] "g/-I//"]
     82        reinplace "s|INCLUDEPATH += .$|INCLUDEPATH += . ${dbus1incpath}|g" \
     83                        ${worksrcpath}/dbus/dbus.pro
     84        system -W ${worksrcpath}/dbus "${qt_qmake_cmd} dbus.pro"
     85    }
     86
     87    build.cmd           make
     88    build.target        all
     89    destroot.cmd        ${build.cmd}
     90    destroot.destdir    DESTDIR=${destroot}
    4891
    4992    # override QMAKE_MACOSX_DEPLOYMENT_TARGET set in ${prefix}/libexec/qt5/mkspecs/macx-clang/qmake.conf
    50     configure.args-append QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}
     93    configure.args-append \
     94                        QMAKE_MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target}
    5195
    5296    # override C++ flags set in ${prefix}/libexec/qt5/mkspecs/common/clang-mac.conf
    5397    #    so value of ${configure.cxx_stdlib} can always be used
    5498    configure.args-append \
    55         QMAKE_CXXFLAGS-=-stdlib=libc++ \
    56         QMAKE_LFLAGS-=-stdlib=libc++ \
    57         QMAKE_CXXFLAGS+=-stdlib=${configure.cxx_stdlib} \
    58         QMAKE_LFLAGS+=-stdlib=${configure.cxx_stdlib}
     99                        QMAKE_CXXFLAGS-=-stdlib=libc++ \
     100                        QMAKE_LFLAGS-=-stdlib=libc++ \
     101                        QMAKE_CXXFLAGS+=-stdlib=${configure.cxx_stdlib} \
     102                        QMAKE_LFLAGS+=-stdlib=${configure.cxx_stdlib}
    59103
    60104    variant debug description "Build debug libraries" {
    61105        configure.cmd-append --debug
    62106    }
    63107
    64108    variant webengine conflicts universal description {Build QtWebEngine module} {
    65         depends_lib-append port:qt5-qtwebengine
    66 
    67         configure.args-delete --disable=QtWebEngineCore
    68         configure.args-delete --disable=QtWebEngineWidgets
     109        qt5.depends_component qtwebengine
     110        configure.args-delete --disable=QtWebEngineCore \
     111                              --disable=QtWebEngineWidgets
    69112    }
    70113
    71     default_variants-append +webengine
     114# probably not justified yet, given QtWebEngine's size
     115#     default_variants-append +webengine
    72116
    73117    variant webkit description {Build QtWebKit module} {
    74         depends_lib-append port:qt5-qtwebkit
    75 
     118        qt5.depends_component qtwebkit
    76119        configure.args-delete --disable=QtWebKit
    77         configure.args-delete --disable=QtWebKitWidgets
     120                              --disable=QtWebKitWidgets
     121    }
     122
     123    variant graceful description {Don't abort (crash) on Python errors} {
     124        patchfiles-append  patch-no-abort-on-python-errors.diff
    78125    }
    79126
    80127    if { ![variant_isset universal] } {
     
    85132        set merger_configure_args(x86_64) "--spec=${qt_qmake_spec_64}"
    86133    }
    87134
    88     livecheck.type     none
    89 } else {
    90     livecheck.type     regex
    91     livecheck.url      https://www.riverbankcomputing.co.uk/software/pyqt/download5
    92     livecheck.regex    >PyQt5_gpl-(\[0-9.\]*).tar.gz<
    93135}
     136
     137livecheck.type     regex
     138livecheck.url      http://www.riverbankcomputing.co.uk/software/pyqt/download5
     139livecheck.regex    >PyQt5_gpl-(\[0-9.\]*).tar.gz<