Ticket #50183: QtCurve.diff

File QtCurve.diff, 11.9 KB (added by RJVB (René Bertin), 9 years ago)
  • /opt/local/

    old new  
    11# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
    2 # $Id: Portfile 141605 2015-10-22 20:56:07Z mk@macports.org $
    3 # kde/libkgapi/Portfile
     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: Portfile Thu Jun  5 12:10:38 UTC 2014 rjvbertin@gmail.com $
    44
    55PortSystem          1.0
    66
    77fetch.type          git
    8 git.url             git://anongit.kde.org/qtcurve.git
    9 git.branch          e3e2325e
     8if {[file exists ${filespath}/QtCurve-git/.git]} {
     9    git.url         ${filespath}//QtCurve-git
     10} else {
     11    git.url         git://anongit.kde.org/qtcurve.git
     12}
    1013
    1114name                QtCurve
    1215set qtc_version     1.8.18
    13 version             ${qtc_version}.20150127
     16if {${subport} ne "${name}-gtk2"} {
     17#     git.branch      a3fff13ed5a362064c7abee8485e224be945cdc6
     18#     version         ${qtc_version}.20150711
     19    git.branch      330bfa56785d329aedfbb20a61e58705f725ded9
     20    version         ${qtc_version}.20151017
     21} else {
     22    # newer GTk2 engine versions have issues with respecting the selected font and "icons in buttons" setting
     23    git.branch      e3e2325e
     24    version         ${qtc_version}.20150127
     25}
    1426revision            1
    1527
    1628description         A set of widget styles for Qt4/KDE4, Qt5/KF5 and/or GTk2 based apps.
     
    2941
    3042worksrcdir          ${name}-${qtc_version}
    3143
    32 subport qt5-${name} {
    33     replaced_by     ${name}-qt5
    34     PortGroup       obsolete 1.0
    35 }
     44PortGroup           muniversal 1.0
     45
     46test.run            yes
    3647
     48# this port should probably be replaced by kf5-${qtcurve}
    3749subport ${name}-qt5 {
    38     # replace this with the KF5 portgroup when it exists!!
    39     PortGroup               kde4 1.1
    40     # remove dependencies pulled in by the kde4 portgroup:
    41     depends_build-delete    port:automoc
    42     depends_lib-delete      port:phonon port:doxygen port:qt4-mac
     50    if {![variant_isset qtonly]} {
     51        long_description        A highly configurable widget style for Qt5/KF5
     52    } else {
     53        long_description        A highly configurable widget style for Qt5
     54    }
     55}
    4356
    44     PortGroup               qt5 1.0
     57if {${os.platform} eq "darwin" && ${os.major} <= 10} {
     58    depends_build-delete    port:clang-3.4 port:clang-3.5
     59    ui_msg "This port only builds with configure.compiler=macports-gcc-4.7 (from port:gcc47) or newer on OS X 10.6"
    4560}
    4661
    4762subport ${name}-gtk2 {
    4863    PortGroup               cmake 1.0
     64    cmake.out_of_source     yes
     65    long_description        The GTk2 version of the highly configurable QtCurve widget style for Qt
    4966
    5067    post-extract            { file mkdir ${workpath}/build }
    5168    # standard post-arg, where to find the primary CMakeLists.txt file.
     
    5370    default configure.dir       {${workpath}/build}
    5471    default build.dir           {${workpath}/build}
    5572
    56         depends_lib-append      port:gtk2
    57         configure.args-delete   -DQTC_ENABLE_X11:BOOL=OFF
    58         configure.args-append   -DENABLE_GTK2:BOOL=ON -DQTC_ENABLE_X11:BOOL=ON \
     73    variant LTO description {Build with Link-Time Optimisation (LTO) (currently not 100% compatible with SSE4+ and 3DNow intrinsics)} {
     74        configure.cflags-append     -flto
     75        configure.cxxflags-append   -flto
     76        configure.objcflags-append  -flto
     77        configure.objcxxflags-append  -flto
     78        configure.ldflags-append    -flto
     79        # assume any compiler not clang will be gcc
     80        if {![string match "*clang*" ${configure.compiler}]} {
     81            configure.cflags-append         -fuse-linker-plugin -ffat-lto-objects
     82            configure.cxxflags-append       -fuse-linker-plugin -ffat-lto-objects
     83            configure.objcflags-append      -fuse-linker-plugin -ffat-lto-objects
     84            configure.objcxxflags-append    -fuse-linker-plugin -ffat-lto-objects
     85            configure.ldflags-append        -fuse-linker-plugin
     86        }
     87    }
     88    depends_lib-append      port:gtk2
     89    depends_run-append      port:perl5
     90    configure.args-delete   -DQTC_ENABLE_X11:BOOL=OFF
     91    configure.args-append   -DENABLE_GTK2:BOOL=ON -DQTC_ENABLE_X11:BOOL=ON \
    5992                            -DENABLE_QT4:BOOL=OFF -DENABLE_QT5:BOOL=OFF \
    6093                            -DQTC_QT4_ENABLE_KDE:BOOL=OFF -DQTC_QT5_ENABLE_KDE:BOOL=OFF \
    6194                            -DQTC_UTILSLIB_INFIX:STRING="-gtk2"
    6295}
    6396
    64 if {${subport} ne "${name}-gtk2"} {
     97subport ${name}-extra {
     98    long_description        Additional configuration presets and colour palettes for QtCurve
     99    use_configure           no
     100    installs_libs           no
     101    supported_archs         noarch
     102    fetch {}
     103    checksum {}
     104    extract {}
     105    build {}
     106    destroot {
     107        xinstall -m 755 -d ${destroot}/${prefix}/share/apps/kstyle/themes
     108        xinstall -m 755 -d ${destroot}/${prefix}/share/apps/color-schemes
     109        xinstall -m 644 ${filespath}/qtc_qtcurve-rjvb.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
     110        xinstall -m 644 ${filespath}/qtc_qtcurve-osx.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
     111        xinstall -m 644 ${filespath}/qtc_qtcurve-osxgraphite.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
     112        xinstall -m 644 ${filespath}/qtc_qtcurve-osxgraphite-qt5.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
     113        xinstall -m 644 ${filespath}/QtCurveOSX.colors ${destroot}/${prefix}/share/apps/color-schemes/
     114        xinstall -m 644 ${filespath}/OxygenOSXGraphite.colors ${destroot}/${prefix}/share/apps/color-schemes/
     115    }
     116}
     117
     118if {${subport} ne "${name}-extra"} {
     119    depends_run-append      port:${name}-extra
     120}
     121
     122if {(${subport} ne "${name}-gtk2") && (${subport} ne "${name}-extra")} {
    65123    if {${subport} eq "${name}-qt5"} {
    66124
    67125        categories              kde kf5 qt5
    68126
     127        if {![variant_isset qtonly]} {
     128            PortGroup               kf5 1.1
     129            long_description        A highly configurable widget style for Qt5/KF5
     130            depends_build-append    port:gettext \
     131                                    ${kf5.pythondep}
     132            kf5.depends_frameworks  karchive kconfig kconfigwidgets \
     133                                    ki18n kdelibs4support kguiaddons kio \
     134                                    kiconthemes kwidgetsaddons kxmlgui
     135            # (to be) submitted upstream:
     136            patchfiles-append       patch-reenable-kf5-support.diff \
     137                                    patch-respect-buttonhaveicons.diff
     138            # these address the rendering issue that has long altered the appearance of
     139            # checks, radiobuttons and round sliders
     140            patchfiles-append       patch-qt5-always-antialias.diff \
     141                                    patch-qt5-fix-appearance.diff
     142            configure.args-append   -DPYTHON_EXECUTABLE=${prefix}/bin/python${kf5.pyversion} \
     143                                    -DQTC_QT5_ENABLE_KDE:BOOL=ON
     144            unset kf5.allow_docs_generation
     145            notes-append            "Install port:kf5-frameworkintegration and set KDE_SESSION_VERSION to 5 \
     146                                    (launchctl setenv KDE_SESSION_VERSION 5 and the equivalent expr. in your login script) \
     147                                    in order to use this or any other KDE theme automatically in Qt5 and KF5 \
     148                                    applications."
     149        } else {
     150            PortGroup               cmake 1.0
     151            # Prefer port:qt5-kde if the user hasn't installed a Qt5 port yet.
     152            # This *is* a KDE style after all.
     153            set qt5.prefer_kde      1
     154            PortGroup               qt5 1.0
     155            long_description        A highly configurable widget style for Qt5
     156            configure.args-append   -DQTC_QT5_ENABLE_KDE:BOOL=OFF
     157        }
     158        cmake.out_of_source     yes
     159
     160        # CMake will look for automoc4, but will of course not use it.
    69161        configure.args-append   -DENABLE_QT4:BOOL=OFF -DENABLE_QT5:BOOL=ON \
    70                                 -DQTC_QT4_ENABLE_KDE:BOOL=OFF -DQTC_QT5_ENABLE_KDE:BOOL=ON \
     162                                -DQTC_QT4_ENABLE_KDE:BOOL=OFF \
    71163                                -DQTC_UTILSLIB_INFIX:STRING="-qt5"
    72164
    73         # not sure if this is going to be relevant:
    74         notes-append "To access QtCurve and other KDE styles from pure Qt5 applications, execute
    75          ln -s ${prefix}/lib/kf5/plugins/styles (???) ${prefix}/share/qt5/plugins
    76          with the appropriate privileges or install qt5-mac's +KDE variant"
     165        # looks like this is not going to be relevant, as KF5 plugins install into Qt5's plugin dir:
     166#         notes-append "To access QtCurve and other KDE styles from pure Qt5 applications, execute
     167#          ln -s ${prefix}/lib/kf5/plugins/styles (???) ${prefix}/share/qt5/plugins
     168#          with the appropriate privileges or install port:qt5-mac+KDE or port:qt5-kde"
    77169
    78170    } else {
    79171
     
    81173
    82174        if { [variant_isset qtonly] } {
    83175            PortGroup           qt4 1.0
     176            PortGroup           cmake 1.0
     177            cmake.out_of_source yes
     178            long_description    A highly configurable widget style for Qt4
    84179        } else {
    85180            PortGroup           kde4 1.1
    86181            depends_lib-append  port:kdelibs4
     182            long_description    A highly configurable widget style for Qt4/KDE4
    87183        }
    88184
    89185        configure.args-append   -DENABLE_QT4:BOOL=ON -DENABLE_QT5:BOOL=OFF \
     
    91187
    92188        notes-append "To access QtCurve and other KDE styles from pure Qt4 applications, execute
    93189         ln -s ${prefix}/lib/kde4/plugins/styles ${prefix}/share/qt4/plugins
    94          with the appropriate privileges or install qt4-mac's +KDE variant"
     190         with the appropriate privileges or install port:qt4-mac+KDE"
    95191    }
    96192
    97193    configure.args-append       -DQTC_QT4_STYLE_SUPPORT:BOOL=OFF -DQTC_QT4_ENABLE_KWIN:BOOL=OFF \
    98                                 -DQTC_ENABLE_PO:BOOL=ON -DENABLE_GTK2:BOOL=OFF -DQTC_ENABLE_X11:BOOL=OFF
     194                                -DQTC_ENABLE_PO:BOOL=ON -DENABLE_GTK2:BOOL=OFF
     195    if {${os.platform} eq "darwin"} {
     196        configure.args-append   -DQTC_ENABLE_X11:BOOL=OFF
     197    }
    99198
    100199    variant qtonly description {Build only Qt style support, for installations without KDE} {}
    101200
     
    105204    } else {
    106205
    107206        post-destroot {
    108             if {${subport} ne "${name}-qt5"} {
    109                 xinstall -m 644 ${filespath}/qtc_qtcurve-rjvb.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
    110                 xinstall -m 644 ${filespath}/qtc_qtcurve-osx.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
    111                 xinstall -m 644 ${filespath}/QtCurveOSX.colors ${destroot}/${prefix}/share/apps/color-schemes/
     207            if {${subport} eq "${name}-qt5"} {
     208            } else {
    112209                xinstall -d -m 755 ${destroot}${prefix}/share/qt4/plugins
    113210                if {[file exists ${qt_plugins_dir}] && ![file exists ${qt_plugins_dir}/styles]} {
    114                     ln -s ${prefix}/lib/kde4/plugins/styles ${destroot}${qt_plugins_dir}/
     211                    system "ln -s ${prefix}/lib/kde4/plugins/styles ${destroot}${qt_plugins_dir}/"
    115212                }
    116213            }
    117214        }
    118215
    119216    }
    120 
    121217}
    122218
    123219variant devel description {Prevent stripping of binaries} {}
    124220if { [variant_isset devel] } {
    125         configure.args-delete -DCMAKE_BUILD_TYPE=Release
    126         configure.args-append -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_STRIP:FILEPATH=/bin/echo
     221    if {${subport} eq "${name}"} {
     222        ui_debug "Requested an obsolete variant that is now handled through the KDE4 PortGroup"
     223    } else {
     224        configure.args-delete -DCMAKE_BUILD_TYPE=Release
     225        configure.args-append -DCMAKE_BUILD_TYPE:STRING=MacPorts -DCMAKE_STRIP:FILEPATH=/bin/echo
     226    }
    127227}
    128228