Ticket #46552: phonon-483.diff

File phonon-483.diff, 9.6 KB (added by RJVB (René Bertin), 9 years ago)

updated against mainstream Portfile r134243

  • audio/phonon/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 # $Id: Portfile 134243 2015-03-20 14:52:09Z michaelld@macports.org $
     2# $Id: Portfile 122949 2014-08-02 20:49:01Z michaelld@macports.org $
    33
    44PortSystem          1.0
    55
    66name                phonon
    77version             4.8.3
    88revision            1
    9 categories          audio kde kde4
    109license             {LGPL-2.1 LGPL-3}
    1110maintainers         michaelld openmaintainer
    1211description         Cross Platform Multimedia API used by KDE4
     
    2221    configure.args-append   -DPHONON_BUILD_DEMOS:BOOL=ON
    2322}
    2423
    25 # fix use of CMAKE_INSTALL_NAME to be an absolute path
    26 
    27 patchfiles-append   patch-cmake_FindPhononInternal.cmake.diff
    28 
    29 # fix MODULE names to end in .dylib instead of .so
    30 
    31 patchfiles-append   patch-cmake_PhononMacros.cmake.diff
    32 
    33 # (1) fix install location of cmake module files;
    34 # patch here and post-patch reinplace.
    35 # (2) fix library compatibility version to be 4.4.0,
    36 # because pretty much every KDE port expects it.
    37 
    38 patchfiles-append   patch-CMakeLists.txt.diff
    39 
    40 post-patch {
    41     set rel_mp_qt_cmake_dir [strsed ${qt_cmake_module_dir} "g@${qt_dir}/@@"]
    42     reinplace "s|@MACPORTS_CMAKE_DIR@|${rel_mp_qt_cmake_dir}|" \
    43         ${worksrcpath}/CMakeLists.txt
    44 }
    45 
    46 # do VPATH (out of source tree) build
    47 
    48 cmake.out_of_source yes
    49 
    50 # standard args
     24subport ${name}-qt5 {
     25    PortGroup           qt5 1.0
     26    PortGroup           cmake 1.0
     27    categories          audio kde kf5
     28    long_description    Phonon is a multimedia, multi-platform sound \
     29        framework for the application developer. This is the  Phonon 4\
     30        transitional library for Qt5 (API compatible with regular Phonon4)
    5131
    52 configure.args-append   \
    53     ${qt_cmake_defines} \
    54     -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=TRUE \
    55     -DWITH_QZeitgeist=OFF
     32    configure.args-append   -DPHONON_BUILD_PHONON4QT5:BOOL=ON
    5633
    57 if {${subport} ne "${name}-qt5"} {
    58     PortGroup       qt4 1.0
    59     PortGroup       cmake 1.0
    60     categories      audio kde kde4
    61     long_description    Phonon is a multimedia, multi-platform sound \
    62         framework for the application developer.
    63     depends_build-append  port:automoc
     34    set LPH libphonon4qt5
     35    post-destroot {
    6436
    65     variant compversion440 description {Build libraries with compatibility version 4.4.0 for existing Qt4 installs expecting that} {
    66         # fix the library compatibility version to be 4.4.0
    67         patchfiles          patch-CMakeLists.txt.diff
     37        if {[variant_isset demos]} {
     38            set demos_dest_dir ${destroot}${prefix}/share/examples/phonon4qt5
     39            xinstall -m 775 -d ${demos_dest_dir}
     40            copy ${workpath}/build/demos/simpleplayer/simpleplayer ${demos_dest_dir}
     41            copy ${workpath}/build/demos/metadatareader/metadatareader ${demos_dest_dir}
     42            copy ${workpath}/build/demos/phota/phota ${demos_dest_dir}
     43            copy ${workpath}/build/demos/simplecapture/simplecapture ${demos_dest_dir}
     44        }
     45
     46        # fix library and plugin self-names
     47        system "install_name_tool -id ${prefix}/lib/${LPH}.4.dylib ${destroot}${prefix}/lib/${LPH}.dylib"
     48        system "install_name_tool -id ${prefix}/lib/${LPH}experimental.4.dylib ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     49
     50        # fix use of libphonon4qt5
     51        system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     52            ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     53        system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     54            ${destroot}${qt_plugins_dir}/designer/libphononwidgets.dylib"
     55        system "install_name_tool -id libphononwidgets.dylib ${destroot}${qt_plugins_dir}/designer/libphononwidgets.dylib"
     56        if {[variant_isset demos]} {
     57            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     58                ${demos_dest_dir}/simpleplayer"
     59            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     60                ${demos_dest_dir}/metadatareader"
     61            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     62                ${demos_dest_dir}/phota"
     63            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     64                ${demos_dest_dir}/simplecapture"
     65        }
    6866    }
     67}
    6968
    70     # link major library version name
     69default_variants    +compversion440
    7170
    72     ln -s libphonon.dylib ${destroot}${prefix}/lib/libphonon.4.dylib
    73     ln -s libphononexperimental.dylib ${destroot}${prefix}/lib/libphononexperimental.4.dylib
     71# fix use of CMAKE_INSTALL_NAME to be an absolute path
     72# (RJVB: why is this necessary?)
     73patchfiles-append   patch-cmake_FindPhononInternal.cmake.diff
    7474
    75     if {[variant_isset demos]} {
    76         set demos_dest_dir ${destroot}${prefix}/share/examples/phonon
    77         xinstall -m 775 -d ${demos_dest_dir}
    78         copy ${workpath}/build/demos/simpleplayer/simpleplayer ${demos_dest_dir}
    79         copy ${workpath}/build/demos/metadatareader/metadatareader ${demos_dest_dir}
    80         copy ${workpath}/build/demos/phota/phota ${demos_dest_dir}
    81         copy ${workpath}/build/demos/simplecapture/simplecapture ${demos_dest_dir}
    82     }
    83 }
     75# fix MODULE names to end in .dylib instead of .so
     76patchfiles-append   patch-cmake_PhononMacros.cmake.diff
    8477
    8578variant pulseaudio description "Build Phonon with additional support for PulseAudio" {
    86 
    8779    depends_lib-append port:pulseaudio
    8880    configure.args-append \
    8981        -DWITH_PulseAudio=ON \
     
    10395        -DPULSEAUDIO_MAINLOOP_LIBRARY=
    10496}
    10597
    106 variant demos description "Build Phonon demos" {
    107     configure.args-append -DPHONON_BUILD_DEMOS=ON
     98if {${subport} ne "${name}-qt5"} {
     99    PortGroup           qt4 1.0
     100    PortGroup           cmake 1.0
     101    categories          audio kde kde4
     102    long_description    Phonon is a multimedia, multi-platform sound \
     103        framework for the application developer.
     104    # do we really depend on port:automoc, because cmake prints
     105    # -- Using CMake automoc builtin
     106    depends_build-append    port:automoc
     107
     108    variant compversion440 description {Build libraries with compatibility version 4.4.0 for existing Qt4 installs expecting that} {
     109        # fix the library compatibility version to be 4.4.0
     110        patchfiles-append   patch-CMakeLists.txt.diff
     111    }
     112
     113    set LPH libphonon
     114    post-destroot {
     115
     116        global demos_dest_dir
     117        if {[variant_isset demos]} {
     118            set demos_dest_dir ${destroot}${prefix}/share/examples/phonon
     119            xinstall -m 775 -d ${demos_dest_dir}
     120            copy ${workpath}/build/demos/simpleplayer/simpleplayer ${demos_dest_dir}
     121            copy ${workpath}/build/demos/metadatareader/metadatareader ${demos_dest_dir}
     122            copy ${workpath}/build/demos/phota/phota ${demos_dest_dir}
     123            copy ${workpath}/build/demos/simplecapture/simplecapture ${demos_dest_dir}
     124        }
     125
     126        if {[variant_isset compversion440]} {
     127            # link major library version name
     128            ln -s ${prefix}/lib/${LPH}.dylib ${destroot}${prefix}/lib/${LPH}.4.dylib
     129            ln -s ${prefix}/lib/${LPH}experimental.dylib ${destroot}${prefix}/lib/${LPH}experimental.4.dylib
     130
     131            set DLVERS  4.4.0
     132        } else {
     133            set DLVERS  4
     134        }
     135
     136        # fix library and plugin self-names
     137        system "install_name_tool -id ${prefix}/lib/${LPH}.4.dylib ${destroot}${prefix}/lib/${LPH}.dylib"
     138        system "install_name_tool -id ${prefix}/lib/${LPH}experimental.4.dylib ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     139
     140        # fix use of libphonon
     141        system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     142            ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     143        system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     144            ${destroot}${qt_plugins_dir}/designer/libphononwidgets.dylib"
     145        if {[variant_isset demos]} {
     146            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     147                ${demos_dest_dir}/simpleplayer"
     148            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     149                ${demos_dest_dir}/metadatareader"
     150            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     151                ${demos_dest_dir}/phota"
     152            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     153                ${demos_dest_dir}/simplecapture"
     154        }
     155    }
    108156}
    109157
    110 if {![variant_isset demos]} {
    111     configure.args-append -DPHONON_BUILD_DEMOS=OFF
     158cmake.out_of_source         yes
    112159
    113160post-patch {
    114161    set rel_mp_qt_cmake_dir [strsed ${qt_cmake_module_dir} "g@${prefix}/@@"]
     
    116163        ${worksrcpath}/CMakeLists.txt
    117164}
    118165
    119 livecheck.type   regex
    120 livecheck.url    http://www.gtlib.gatech.edu/pub/kde/stable/${name}/
    121 livecheck.regex  "\(\\d+(?:\\.\\d+)*)\/"
     166# nb: there is no WITH_QZeitgeist option...
     167configure.args-append   \
     168    ${qt_cmake_defines} \
     169    -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=true \
     170    -DWITH_QZeitgeist=OFF
     171
     172configure.ldflags-append -F${qt_frameworks_dir}
     173
     174
     175livecheck.type          regex
     176livecheck.url           http://www.gtlib.gatech.edu/pub/kde/stable/${name}/
     177livecheck.regex         "\(\\d+(?:\\.\\d+)*)\/"