Ticket #46552: phonon.diff

File phonon.diff, 10.8 KB (added by RJVB (René Bertin), 8 years ago)
  • 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 140960 2015-10-06 20:13:45Z michaelld@macports.org $
     2# $Id: Portfile 122949 2014-08-02 20:49:01Z michaelld@macports.org $
    33
    44PortSystem          1.0
    55
    66name                phonon
    7 version             4.8.3
    8 revision            2
    9 categories          audio kde kde4
     7version             4.9.0
    108license             {LGPL-2.1 LGPL-3}
    119maintainers         michaelld openmaintainer
    1210description         Cross Platform Multimedia API used by KDE4
    1311platforms           darwin
    1412homepage            http://phonon.kde.org
    15 master_sites        kde:stable/${name}/${version}/src
     13master_sites        kde:stable/${name}/${version}
    1614use_xz              yes
    1715distname            phonon-${version}
    18 checksums           rmd160 c035f253eda49635377122423bb72161f97f18d3 \
    19                     sha256 a1149c961ca1570968d070bbd23671e614aa506f847ca93748960e309f85da16
     16checksums           rmd160  42e3230c39319bcb5da4a8b2b14da7d8e563e772 \
     17                    sha256  bb74b40f18ade1d9ab89ffcd7aeb7555be797ca395f1224c488b394da6deb0e0
    2018
    2119variant demos description {Build the demos} {
    2220    configure.args-append   -DPHONON_BUILD_DEMOS:BOOL=ON
    2321}
    2422
    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
     23subport ${name}-qt5 {
     24    PortGroup           qt5 1.0
     25    PortGroup           cmake 1.0
     26    categories          audio kde kf5
     27    long_description    Phonon is a multimedia, multi-platform sound \
     28        framework for the application developer. This is the  Phonon 4\
     29        transitional library for Qt5 (API compatible with regular Phonon4)
    4930
    50 # standard args
     31    configure.args-append   -DPHONON_BUILD_PHONON4QT5:BOOL=ON
    5132
    52 configure.args-append   \
    53     ${qt_cmake_defines} \
    54     -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=TRUE \
    55     -DWITH_QZeitgeist=OFF
     33    set LPH libphonon4qt5
     34    post-destroot {
    5635
    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
    64 
    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
     36        if {[variant_isset demos]} {
     37            set demos_dest_dir ${destroot}${prefix}/share/examples/phonon4qt5
     38            xinstall -m 775 -d ${demos_dest_dir}
     39            copy ${workpath}/build/demos/simpleplayer/simpleplayer.app ${demos_dest_dir}
     40            copy ${workpath}/build/demos/metadatareader/metadatareader.app ${demos_dest_dir}
     41            copy ${workpath}/build/demos/phota/phota.app ${demos_dest_dir}
     42            copy ${workpath}/build/demos/simplecapture/simplecapture.app ${demos_dest_dir}
     43        }
     44
     45        # fix library and plugin self-names
     46        system "install_name_tool -id ${prefix}/lib/${LPH}.4.dylib ${destroot}${prefix}/lib/${LPH}.dylib"
     47        system "install_name_tool -id ${prefix}/lib/${LPH}experimental.4.dylib ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     48
     49        # fix use of libphonon4qt5
     50        system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     51            ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     52        system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     53            ${destroot}${qt_plugins_dir}/designer/phononwidgets.dylib"
     54        system "install_name_tool -id phononwidgets.dylib ${destroot}${qt_plugins_dir}/designer/phononwidgets.dylib"
     55        if {[variant_isset demos]} {
     56            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     57                ${demos_dest_dir}/simpleplayer.app/Contents/MacOS/simpleplayer"
     58            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     59                ${demos_dest_dir}/metadatareader.app/Contents/MacOS/metadatareader"
     60            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     61                ${demos_dest_dir}/phota.app/Contents/MacOS/phota"
     62            system "install_name_tool -change lib/${LPH}.4.dylib ${prefix}/lib/${LPH}.4.dylib \
     63                ${demos_dest_dir}/simplecapture.app/Contents/MacOS/simplecapture"
     64        }
    6865    }
     66}
    6967
    70     # link major library version name
     68default_variants    +compversion440
    7169
    72     ln -s libphonon.dylib ${destroot}${prefix}/lib/libphonon.4.dylib
    73     ln -s libphononexperimental.dylib ${destroot}${prefix}/lib/libphononexperimental.4.dylib
     70# fix use of CMAKE_INSTALL_NAME to be an absolute path
     71# (RJVB: why is this necessary?)
     72patchfiles-append   patch-cmake_FindPhononInternal.cmake.diff
    7473
    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 }
     74# fix MODULE names to end in .dylib instead of .so
     75patchfiles-append   patch-cmake_PhononMacros.cmake.diff
    8476
    8577variant pulseaudio description "Build Phonon with additional support for PulseAudio" {
    86 
    8778    depends_lib-append port:pulseaudio
    8879    configure.args-append \
    89         -DWITH_PulseAudio=ON \
    90         -DPHONON_PULSESUPPORT=YES \
    9180        -DPULSEAUDIO_INCLUDE_DIR=${prefix}/include \
    9281        -DPULSEAUDIO_LIBRARY=${prefix}/lib/libpulse.dylib \
    93         -DPULSEAUDIO_MAINLOOP_LIBRARY=${prefix}/lib/libpulse-mainloop-glib.dylib
    94 
     82        -DPULSEAUDIO_MAINLOOP_LIBRARY=${prefix}/lib/libpulse-mainloop-glib.dylib \
     83        -DWITH_PulseAudio=ON \
     84        -DPHONON_PULSESUPPORT=YES
    9585}
    9686
    9787if {![variant_isset pulseaudio]} {
     
    10393        -DPULSEAUDIO_MAINLOOP_LIBRARY=
    10494}
    10595
    106 variant demos description "Build Phonon demos" {
    107     configure.args-append -DPHONON_BUILD_DEMOS=ON
     96if {${subport} ne "${name}-qt5"} {
     97    PortGroup           qt4 1.0
     98    PortGroup           cmake 1.0
     99    categories          audio kde kde4
     100    long_description    Phonon is a multimedia, multi-platform sound \
     101        framework for the application developer.
     102    # do we really depend on port:automoc, because cmake prints
     103    # -- Using CMake automoc builtin
     104    depends_build-append    port:automoc
     105
     106    variant compversion440 description {Build libraries with compatibility version 4.4.0 for existing Qt4 installs expecting that} {
     107        # fix the library compatibility version to be 4.4.0
     108        patchfiles-append   patch-CMakeLists.txt.diff
     109    }
     110
     111    set LPH libphonon
     112    post-destroot {
     113
     114        global demos_dest_dir
     115        if {[variant_isset demos]} {
     116            set demos_dest_dir ${destroot}${prefix}/share/examples/phonon
     117            xinstall -m 775 -d ${demos_dest_dir}
     118            copy ${workpath}/build/demos/simpleplayer/simpleplayer ${demos_dest_dir}
     119            copy ${workpath}/build/demos/metadatareader/metadatareader ${demos_dest_dir}
     120            copy ${workpath}/build/demos/phota/phota ${demos_dest_dir}
     121            copy ${workpath}/build/demos/simplecapture/simplecapture ${demos_dest_dir}
     122        }
     123
     124        if {[variant_isset compversion440]} {
     125            # link major library version name
     126            ln -s ${prefix}/lib/${LPH}.dylib ${destroot}${prefix}/lib/${LPH}.4.dylib
     127            ln -s ${prefix}/lib/${LPH}experimental.dylib ${destroot}${prefix}/lib/${LPH}experimental.4.dylib
     128
     129            set DLVERS  4.4.0
     130        } else {
     131            set DLVERS  4
     132        }
     133
     134        # fix library and plugin self-names
     135        system "install_name_tool -id ${prefix}/lib/${LPH}.4.dylib ${destroot}${prefix}/lib/${LPH}.dylib"
     136        system "install_name_tool -id ${prefix}/lib/${LPH}experimental.4.dylib ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     137
     138        # fix use of libphonon
     139        system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     140            ${destroot}${prefix}/lib/${LPH}experimental.dylib"
     141        system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     142            ${destroot}${qt_plugins_dir}/designer/libphononwidgets.dylib"
     143        if {[variant_isset demos]} {
     144            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     145                ${demos_dest_dir}/simpleplayer"
     146            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     147                ${demos_dest_dir}/metadatareader"
     148            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     149                ${demos_dest_dir}/phota"
     150            system "install_name_tool -change lib/${LPH}.${DLVERS}.dylib ${prefix}/lib/${LPH}.4.dylib \
     151                ${demos_dest_dir}/simplecapture"
     152        }
     153    }
    108154}
    109155
    110 if {![variant_isset demos]} {
    111     configure.args-append -DPHONON_BUILD_DEMOS=OFF
     156cmake.out_of_source         yes
    112157
    113158post-patch {
    114159    set rel_mp_qt_cmake_dir [strsed ${qt_cmake_module_dir} "g@${prefix}/@@"]
     
    116161        ${worksrcpath}/CMakeLists.txt
    117162}
    118163
    119 livecheck.type   regex
    120 livecheck.url    http://www.gtlib.gatech.edu/pub/kde/stable/${name}/
    121 livecheck.regex  "\(\\d+(?:\\.\\d+)*)\/"
     164# nb: there is no WITH_QZeitgeist option...
     165configure.args-append   \
     166    ${qt_cmake_defines} \
     167    -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=true \
     168    -DWITH_QZeitgeist=OFF
     169
     170configure.ldflags-append -F${qt_frameworks_dir}
     171
     172livecheck.type      regex
     173livecheck.url       http://www.gtlib.gatech.edu/pub/kde/stable/${name}/
     174livecheck.regex     "\(\\d+(?:\\.\\d+)*)\/"