| 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 |
| | 23 | subport ${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) |
| 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 | } |
| 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 |
| | 75 | patchfiles-append patch-cmake_PhononMacros.cmake.diff |
| 106 | | variant demos description "Build Phonon demos" { |
| 107 | | configure.args-append -DPHONON_BUILD_DEMOS=ON |
| | 96 | if {${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 | } |