Ticket #31517: patch-Portfile.diff

File patch-Portfile.diff, 6.7 KB (added by NicosPavlov, 12 years ago)
  • Portfile

     
    33
    44PortSystem          1.0
    55PortGroup           qt4 1.0
     6PortGroup           cmake 1.0
    67
    78name                phonon
    8 version             4.4.2
    9 revision            3
     9version             4.5.1
    1010categories          audio kde kde4
    1111license             {LGPL-2.1 LGPL-3}
    1212maintainers         nomaintainer
     
    1414long_description    Cross Platform Multimedia API used by KDE4
    1515platforms           darwin
    1616homepage            http://phonon.kde.org
    17 master_sites        kde:stable/${name}/${version}/
    18 use_bzip2           yes
     17master_sites        kde:stable/${name}/${version}/src
     18use_xz              yes
    1919distname            phonon-${version}
    20 checksums           md5 d9eab28383783261254f1cef3b92a3fa \
    21                     sha1 c329d924fb75a89a9de8a4d799ff4dcd7ee3302e \
    22                     rmd160 aa37903f166904dd09401541df8fc268a2858606
     20checksums           md5     3df071b7f9996afcd67b18958955ecdd \
     21                    sha1    710a9ffffe7e558f4d0ce5ea5c118cb248fb8da8 \
     22                    rmd160  b5aa9313b62bac7d5233716db52c9275168ee191
    2323
    2424depends_build-append  port:automoc
    2525
    26 # after extracting both qt4-mac (latest) and phonon, do:
    27 # $ cd `port dir phonon`/phonon*/qt7
    28 # $ for tf in `ls -1`; do \
    29 # > diff -u ${tf} `port dir qt4-mac`/work/qt-*/src/3rdparty/phonon/qt7/${tf};
    30 # > done > `port dir phonon`/files/patch-qt7.diff
    31 patchfiles            patch-qt7.diff
    32 
    33 set PHONON_MAJOR_VERSION [lindex [split ${version} "."] 0]
    34 set PHONON_MINOR_VERSION [lindex [split ${version} "."] 1]
    35 set PHONON_PATCH_VERSION [lindex [split ${version} "."] 2]
    36 
    37 set PHONON_BUILD_DIR ${worksrcpath}/build
    38 
    39 post-patch {
    40     # fix phonon/audiodataoutput.cpp to not use the moc file
    41     reinplace "/audiodataoutput\.moc/d" \
    42         ${worksrcpath}/phonon/audiodataoutput.cpp
    43 
    44     # install qt 4.7.0 QMake files into phonon source
    45     system "cd ${filespath}/qmake && tar cf - . | \
    46         (cd ${worksrcpath}; tar xf -)"
    47 
    48     # create the 'phononnamespace.h' file
    49     system "cd ${worksrcpath}/phonon && \
    50         sed -e 's,@PHONON_LIB_MAJOR_VERSION@,${PHONON_MAJOR_VERSION},g' \
    51             -e 's,@PHONON_LIB_MINOR_VERSION@,${PHONON_MINOR_VERSION},g' \
    52             -e 's,@PHONON_LIB_PATCH_VERSION@,${PHONON_PATCH_VERSION},g' \
    53             phononnamespace.h.in > phononnamespace.h"
    54 
    55     # create the 'phonon.pc' files (release and debug)
    56     system "cd ${worksrcpath} && \
    57         mkdir -p ${PHONON_BUILD_DIR}/lib/pkgconfig && \
    58         sed -e 's,@PHONON_LIB_MAJOR_VERSION@,${PHONON_MAJOR_VERSION},g' \
    59             -e 's,@PHONON_LIB_MINOR_VERSION@,${PHONON_MINOR_VERSION},g' \
    60             -e 's,@PHONON_LIB_PATCH_VERSION@,${PHONON_PATCH_VERSION},g' \
    61             -e 's,@QT_MOC_CMD@,${qt_moc_cmd},g' \
    62             -e 's,@QT_UIC_CMD@,${qt_uic_cmd},g' \
    63             -e 's,@QT_LIBS_DIR@,${qt_libs_dir},g' \
    64             -e 's,@QT_INCLUDES_DIR@,${qt_includes_dir},g' \
    65             -e 's,@PHONON_PREFIX@,${prefix},g' < phonon_debug.pc.in > \
    66             ${PHONON_BUILD_DIR}/lib/pkgconfig/phonon_debug.pc"
    67     system "cd ${PHONON_BUILD_DIR}/lib/pkgconfig && \
    68         sed -e 's,_debug,,g' \
    69             -e 's,debug,release,g' \
    70             -e 's,Debug,Release,g' \
    71             phonon_debug.pc > phonon.pc"
    72 
    73     # create the 'headers.pri' and 'phonon' files
    74     set public_headers [exec find ${worksrcpath}/phonon \
    75                                  -name "*.h" -maxdepth 1 -mindepth 1 | \
    76                              sed -e "s@${worksrcpath}/@@g" | \
    77                              grep -v "_p"]
    78     set private_headers [exec find ${worksrcpath}/phonon \
    79                                  -name "*.h" -maxdepth 1 -mindepth 1 | \
    80                              sed -e "s@${worksrcpath}/@@g" | \
    81                              grep "_p"]
    82     set class_headers [exec find ${worksrcpath}/includes/phonon \
    83                                -name "\[A-Z\]*" | \
    84                            sed -e "s@${worksrcpath}/includes/@@g"]
    85 
    86     # create 'phonon' file first
    87     set INCLUDE_HEADERS ""
    88     foreach header ${public_headers} {
    89         set INCLUDE_HEADERS "${INCLUDE_HEADERS}\#include \"${header}\"@"
    90     }
    91     system "cd ${worksrcpath} && \
    92               sed -e 's,@INCLUDE_HEADERS@,${INCLUDE_HEADERS},' phonon.in | \
    93               tr '@' '\\n' > includes/phonon/phonon"
    94     unset INCLUDE_HEADERS
    95 
    96     # add new phonon to list of headers
    97     lappend public_headers "includes/phonon/phonon"
    98 
    99     # create 'headers.pri' file second
    100     set PUBLIC_HEADERS ""
    101     foreach header ${public_headers} {
    102         lappend PUBLIC_HEADERS "../${header}"
    103     }
    104     set CLASS_HEADERS ""
    105     foreach header ${class_headers} {
    106         lappend CLASS_HEADERS "../includes/${header}"
    107     }
    108     set PRIVATE_HEADERS ""
    109     foreach header ${private_headers} {
    110         lappend PRIVATE_HEADERS "../${header}"
    111     }
    112     system "cd ${worksrcpath} && \
    113               sed -e 's,@PHONON_PUBLIC_HEADERS@,${PUBLIC_HEADERS},' \
    114                   -e 's,@PHONON_CLASS_HEADERS@,${CLASS_HEADERS},' \
    115                   -e 's,@PHONON_PRIVATE_HEADERS@,${PRIVATE_HEADERS},' \
    116                 headers.pri.in > includes/phonon/headers.pri"
    117     unset PUBLIC_HEADERS
    118     unset CLASS_HEADERS
    119     unset PRIVATE_HEADERS
    120 }
    121 
    122 pre-configure {
    123     # set arch type(s); done is a stage to make sure the 'options
    124     # qt_arch_types' is evaluated -after- +universal (if selected).
    125     configure.pre_args-append CONFIG+="${qt_arch_types}"
    126 
    127     # set build type
    128     set build_type "release"
    129     if {[variant_isset debug]} {
    130         set build_type "debug_and_release build_all"
    131     }
    132     configure.pre_args-append CONFIG+=\"${build_type}\"
    133 }
    134 
    135 # set up to use the installed QMake files
    136 configure.cmd       ${qt_qmake_cmd}
    137 configure.pre_args  \
    138     CONFIG+="phonon phonon-backend" \
    139     PHONON_MAJOR_VERSION=${PHONON_MAJOR_VERSION} \
    140     PHONON_MINOR_VERSION=${PHONON_MINOR_VERSION} \
    141     PHONON_PATCH_VERSION=${PHONON_PATCH_VERSION} \
    142     WORKSRCPATH=${worksrcpath} \
    143     LOCAL_BUILD_TREE=${PHONON_BUILD_DIR}
    144 configure.args      "-o Makefile phonon.pro"
    145 configure.universal_args
    146 
    147 # allow ccache, if specified by the user
    148 pre-build {
    149     if {[tbool configure.ccache]} {
    150         build.post_args "CCACHE=ccache"
    151     }
    152 }
    153 
    15426# Install cmake files (taken from port 'kdelibs4'). To use this file,
    15527# include '-DCMAKE_MODULE_PATH=...' in configure.args during the
    15628# initial 'configure' stage (which uses CMake), to the full path of
     
    16436
    16537universal_variant   yes
    16638
    167 variant debug description "Build release and debug versions" {}
    168 
    16939livecheck.type          regex
    17040livecheck.url           http://ftp.gtlib.cc.gatech.edu/pub/kde/stable/${name}/
    17141livecheck.regex         "\(\\d+(?:\\.\\d+)*)\/"