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 | | |