| 27 | | # fix use of CMAKE_INSTALL_NAME to be an absolute path |
| | 24 | subport ${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) |
| | 31 | |
| | 32 | configure.args-append -DPHONON_BUILD_PHONON4QT5:BOOL=ON |
| | 33 | |
| | 34 | set LPH libphonon4qt5 |
| | 35 | post-destroot { |
| | 36 | |
| | 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 | } |
| | 66 | } |
| | 67 | } |
| | 68 | |
| | 69 | default_variants +compversion440 |
| 35 | | # (1) fix install location of cmake module files; |
| 36 | | # patch here and post-patch reinplace. |
| 37 | | # (2) fix library compatibility version to be 4.4.0, |
| 38 | | # because pretty much every KDE port expects it. |
| 39 | | |
| 40 | | patchfiles-append patch-CMakeLists.txt.diff |
| 41 | | |
| 42 | | post-patch { |
| 43 | | set rel_mp_qt_cmake_dir [strsed ${qt_cmake_module_dir} "g@${qt_dir}/@@"] |
| 44 | | reinplace "s|@MACPORTS_CMAKE_DIR@|${rel_mp_qt_cmake_dir}|" \ |
| 45 | | ${worksrcpath}/CMakeLists.txt |
| 46 | | } |
| 47 | | |
| 48 | | # do VPATH (out of source tree) build |
| 49 | | |
| 50 | | cmake.out_of_source yes |
| 51 | | |
| 52 | | # standard args |
| 53 | | |
| 54 | | configure.args-append \ |
| 55 | | ${qt_cmake_defines} \ |
| 56 | | -DPHONON_INSTALL_QT_EXTENSIONS_INTO_SYSTEM_QT=TRUE \ |
| 57 | | -DWITH_QZeitgeist=OFF |
| 58 | | |
| 59 | | configure.ldflags-append -F${qt_frameworks_dir} |
| 60 | | |
| 61 | | post-destroot { |
| 62 | | |
| 63 | | # link major library version name |
| 64 | | |
| 65 | | ln -s libphonon.dylib ${destroot}${prefix}/lib/libphonon.4.dylib |
| 66 | | ln -s libphononexperimental.dylib ${destroot}${prefix}/lib/libphononexperimental.4.dylib |
| 67 | | |
| 68 | | if {[variant_isset demos]} { |
| 69 | | set demos_dest_dir ${destroot}${prefix}/share/examples/phonon |
| 70 | | xinstall -m 775 -d ${demos_dest_dir} |
| 71 | | copy ${workpath}/build/demos/simpleplayer/simpleplayer ${demos_dest_dir} |
| 72 | | copy ${workpath}/build/demos/metadatareader/metadatareader ${demos_dest_dir} |
| 73 | | copy ${workpath}/build/demos/phota/phota ${demos_dest_dir} |
| 74 | | copy ${workpath}/build/demos/simplecapture/simplecapture ${demos_dest_dir} |
| 75 | | } |
| 76 | | } |
| 77 | | |
| 99 | | variant demos description "Build Phonon demos" { |
| 100 | | configure.args-append -DPHONON_BUILD_DEMOS=ON |
| | 98 | if {${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 | } |