Ticket #46507: qtcurve-diff-20150109.diff

File qtcurve-diff-20150109.diff, 7.1 KB (added by RJVB (René Bertin), 9 years ago)
  • /opt/local/site-ports/kde/QtCurve/

    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 126006 2014-10-01 21:17:50Z mk@macports.org $
     2# $Id: Portfile Thu Jun  5 12:10:38 UTC 2014 rjvbertin@gmail.com $
    33# kde/libkgapi/Portfile
    44
    55PortSystem          1.0
    6 PortGroup           kde4 1.1
    76
    87fetch.type          git
    98git.url             git://anongit.kde.org/qtcurve.git
    10 git.branch          660f859556471f13834ef4fb095816639aa85014
     9git.branch          6a54902
    1110
    1211name                QtCurve
    1312version             1.8.18
     13revision            20150106
    1414
    15 categories          kde kde4
    16 
    17 description         A set of widget styles for Qt4/KDE4 based apps.
     15description         A set of widget styles for Qt4/KDE4, Qt5/KF5 and/or GTk2 based apps.
    1816
    1917platforms           darwin
    2018license             LGPL-2+
     
    2927livecheck.url       http://quickgit.kde.org/?p=qtcurve.git
    3028livecheck.regex     (\\d+(\\.\\d+)+)
    3129
    32 depends_lib-append  port:gtk2 \
    33                     port:kdelibs4 \
    34                     port:qt4-mac
    35 
    36 configure.args-append   -DQTC_QT4_STYLE_SUPPORT:BOOL=OFF -DENABLE_QT5:BOOL=OFF \
    37                         -DQTC_QT4_ENABLE_KWIN:BOOL=OFF
    38 
    39 variant x11 description {build x11 support} {}
    40 if { [variant_isset x11] } {
    41         depends_lib-append port:xorg-libX11
    42         configure.args-append -DQTC_ENABLE_X11:BOOL=ON
    43 } else {
    44         configure.args-append -DQTC_ENABLE_X11:BOOL=OFF
     30# add an infix to libqtcurve-utils.dylib, so that it can exist in specific forms for Qt4, Qt5 and GTk2
     31# this is a -p1 patchfile
     32patch.pre_args      -p1
     33patchfiles-append   add-utilslib-infix.patch
     34
     35subport qt5-${name} {
     36    # replace this with the KF5 portgroup when it exists!!
     37    PortGroup               kde4 1.1
     38    # remove dependencies pulled in by the kde4 portgroup:
     39    depends_build-delete    port:automoc
     40    depends_lib-delete      port:phonon port:doxygen port:qt4-mac
     41
     42    PortGroup               qt5 1.0
    4543}
    4644
    47 variant gtk2 description {build the gtk2 plugin} {}
    48 if { [variant_isset gtk2] } {
    49         depends_lib-append port:gtk2
    50         configure.args-append -DENABLE_GTK2:BOOL=ON
    51 } else {
    52         configure.args-append -DENABLE_GTK2:BOOL=OFF
     45subport ${name}-gtk2 {
     46    PortGroup               cmake 1.0
     47
     48    post-extract            { file mkdir ${workpath}/build }
     49    # standard post-arg, where to find the primary CMakeLists.txt file.
     50    default configure.post_args {../${worksrcdir}}
     51    default configure.dir       {${workpath}/build}
     52    default build.dir           {${workpath}/build}
     53
     54        depends_lib-append      port:gtk2
     55        configure.args-delete   -DQTC_ENABLE_X11:BOOL=OFF
     56        configure.args-append   -DENABLE_GTK2:BOOL=ON -DQTC_ENABLE_X11:BOOL=ON \
     57                            -DENABLE_QT4:BOOL=OFF -DENABLE_QT5:BOOL=OFF \
     58                            -DQTC_QT4_ENABLE_KDE:BOOL=OFF -DQTC_QT5_ENABLE_KDE:BOOL=OFF \
     59                            -DQTC_UTILSLIB_INFIX:STRING="gtk2"
    5360}
    5461
    55 variant qt5 description {build for qt5 too} {}
    56 if { [variant_isset qt5] } {
    57         depends_lib-append port:qt5-mac
    58         # default for ENABLE_QT5=on:
    59         configure.args-delete -DENABLE_QT5:BOOL=OFF
     62if {${subport} ne "${name}-gtk2"} {
     63    if {${subport} eq "qt5-${name}"} {
     64
     65        categories              kde kf5 qt5
     66
     67        depends_lib-append      port:qt5-mac
     68
     69        configure.args-append   -DENABLE_QT4:BOOL=OFF -DENABLE_QT5:BOOL=ON \
     70                                -DQTC_QT4_ENABLE_KDE:BOOL=OFF -DQTC_QT5_ENABLE_KDE:BOOL=ON \
     71                                -DQTC_UTILSLIB_INFIX:STRING="qt5"
     72
     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"
     77
     78    } else {
     79
     80        categories              kde kde4 qt4
     81
     82        PortGroup               kde4 1.1
     83
     84        depends_lib-append      port:kdelibs4 \
     85                                port:qt4-mac
     86
     87        configure.args-append   -DENABLE_QT4:BOOL=ON -DENABLE_QT5:BOOL=OFF \
     88                                -DQTC_QT5_ENABLE_KDE:BOOL=OFF -DQTC_UTILSLIB_INFIX:STRING="qt4"
     89
     90        notes-append "To access QtCurve and other KDE styles from pure Qt4 applications, execute
     91         ln -s ${prefix}/lib/kde4/plugins/styles ${prefix}/share/qt4/plugins
     92         with the appropriate privileges or install qt4-mac's +KDE variant"
     93    }
     94
     95    configure.args-append       -DQTC_QT4_STYLE_SUPPORT:BOOL=OFF -DQTC_QT4_ENABLE_KWIN:BOOL=OFF \
     96                                -DQTC_ENABLE_PO:BOOL=ON -DENABLE_GTK2:BOOL=OFF -DQTC_ENABLE_X11:BOOL=OFF
     97
     98    variant qtonly description {Build only Qt style support, for installations without KDE} {}
     99
     100    if { [variant_isset qtonly] } {
     101        depends_lib-delete    port:kdelibs4
     102        configure.args-append -DQTC_QT4_ENABLE_KDE:BOOL=OFF -DQTC_QT5_ENABLE_KDE:BOOL=OFF
     103        configure.args-delete -DQTC_QT4_ENABLE_KDE:BOOL=ON -DQTC_QT5_ENABLE_KDE:BOOL=ON
     104    } else {
     105
     106        post-destroot {
     107            if {${subport} eq "qt5-${name}"} {
     108            } else {
     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/
     112                xinstall -d -m 755 ${destroot}${prefix}/share/qt4/plugins
     113                if {[file exists ${qt_plugins_dir}] && ![file exists ${qt_plugins_dir}/styles]} {
     114                    system "ln -s ${prefix}/lib/kde4/plugins/styles ${destroot}${qt_plugins_dir}/"
     115                }
     116            }
     117        }
     118
     119    }
     120
    60121}
    61122
    62123variant devel description {Prevent stripping of binaries} {}
     
    65126        configure.args-append -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo -DCMAKE_STRIP:FILEPATH=/bin/echo
    66127}
    67128
    68 variant qtonly description {Build only Qt style support, for installations without KDE} {}
    69 if { [variant_isset qtonly] } {
    70         depends_lib-delete    port:kdelibs4
    71 #       configure.args-append -DQTC_QT_ONLY:BOOL=ON
    72         configure.args-append -DQTC_QT4_ENABLE_KDE:BOOL=OFF
    73 } else {
    74     post-destroot {
    75         xinstall -m 644 ${filespath}/qtc_qtcurve-rjvb.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
    76         xinstall -m 644 ${filespath}/qtc_qtcurve-osx.themerc ${destroot}/${prefix}/share/apps/kstyle/themes/
    77         xinstall -m 644 ${filespath}/QtCurveOSX.colors ${destroot}/${prefix}/share/apps/color-schemes/
    78         xinstall -d -m 755 ${destroot}${prefix}/share/qt4/plugins
    79         system "ln -s ${prefix}/lib/kde4/plugins/styles ${destroot}${prefix}/share/qt4/plugins"
    80     }
    81 }
    82 
    83 notes-append "To access QtCurve and other KDE styles from pure Qt4 applications, execute
    84  ln -s ${prefix}/lib/kde4/plugins/styles ${prefix}/share/qt4/plugins
    85  with the appropriate privileges"