source: trunk/dports/audio/phonon/Portfile @ 84521

Last change on this file since 84521 was 84521, checked in by jmr@…, 6 years ago

phonon: license

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.5 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
2# $Id: Portfile 84521 2011-09-27 16:54:10Z jmr@macports.org $
3
4PortSystem          1.0
5PortGroup           qt4 1.0
6
7name                phonon
8version             4.4.2
9revision            3
10categories          audio kde kde4
11license             {LGPL-2.1 LGPL-3}
12maintainers         nomaintainer
13description         Cross Platform Multimedia API used by KDE4
14long_description    Cross Platform Multimedia API used by KDE4
15platforms           darwin
16homepage            http://phonon.kde.org
17master_sites        kde:stable/${name}/${version}/
18use_bzip2           yes
19distname            phonon-${version}
20checksums           md5 d9eab28383783261254f1cef3b92a3fa \
21                    sha1 c329d924fb75a89a9de8a4d799ff4dcd7ee3302e \
22                    rmd160 aa37903f166904dd09401541df8fc268a2858606
23
24depends_build-append  port:automoc
25
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
31patchfiles            patch-qt7.diff
32
33set PHONON_MAJOR_VERSION [lindex [split ${version} "."] 0]
34set PHONON_MINOR_VERSION [lindex [split ${version} "."] 1]
35set PHONON_PATCH_VERSION [lindex [split ${version} "."] 2]
36
37set PHONON_BUILD_DIR ${worksrcpath}/build
38
39post-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
122pre-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
136configure.cmd       ${qt_qmake_cmd}
137configure.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}
144configure.args      "-o Makefile phonon.pro"
145configure.universal_args
146
147# allow ccache, if specified by the user
148pre-build {
149    if {[tbool configure.ccache]} {
150        build.post_args "CCACHE=ccache"
151    }
152}
153
154# Install cmake files (taken from port 'kdelibs4'). To use this file,
155# include '-DCMAKE_MODULE_PATH=...' in configure.args during the
156# initial 'configure' stage (which uses CMake), to the full path of
157# where the CMake files are installed.
158post-destroot {
159    xinstall -m 755 -d ${destroot}${qt_cmake_module_dir}
160    xinstall -m 644 -W ${filespath} \
161        FindPhonon.cmake \
162        ${destroot}${qt_cmake_module_dir}
163}
164
165universal_variant   yes
166
167variant debug description "Build release and debug versions" {}
168
169livecheck.type          regex
170livecheck.url           http://ftp.gtlib.cc.gatech.edu/pub/kde/stable/${name}/
171livecheck.regex         "\(\\d+(?:\\.\\d+)*)\/"
Note: See TracBrowser for help on using the repository browser.