1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id$ |
---|
3 | PortSystem 1.0 |
---|
4 | PortGroup github 1.0 |
---|
5 | PortGroup qt4 1.0 |
---|
6 | |
---|
7 | set shorthash 6a9af026 |
---|
8 | # set fullhash 6a9af0260bf4d7c80e77a7889e999c4f0bb91867 |
---|
9 | set majorversion .25 |
---|
10 | set minorversion .1 |
---|
11 | github.setup MythTV mythtv ${shorthash} |
---|
12 | name mythtv-core${majorversion} |
---|
13 | version 0${majorversion}${minorversion}-Fixes-20120615 |
---|
14 | categories multimedia |
---|
15 | platforms darwin |
---|
16 | license GPL-2 |
---|
17 | maintainers cogeco.ca:ctreleaven openmaintainer |
---|
18 | |
---|
19 | description MythTV - Open source digital video recorder |
---|
20 | long_description The ultimate Digital Video Recorder and home media \ |
---|
21 | center hub. Think of it as a Free and Open Source alternative \ |
---|
22 | to Windows Media Center or Tivo. With its plugin architecture, \ |
---|
23 | it has been extended from a mere TV viewing application into a \ |
---|
24 | full home media center suite, capable of managing your personal \ |
---|
25 | photo, video, and music collections, as well as keep you up to \ |
---|
26 | date with the weather, a ZoneMinder home security system, and \ |
---|
27 | more. |
---|
28 | |
---|
29 | homepage http://www.mythtv.org/ |
---|
30 | checksums rmd160 f47519e860d7efa21a646d9719548f0db2e4111a \ |
---|
31 | sha256 d6b2172f9fc30c5a0beb2c6e36519c580e6bb60324fbf4ed232fc40e3f7d381b |
---|
32 | |
---|
33 | pre-fetch { |
---|
34 | if {! [file exists ${prefix}/share/qt4/plugins/sqldrivers/libqsqlmysql.dylib] } { |
---|
35 | return -code error "Must have Qt4-mac installed with MySQL support! (Eg. port install qt4-mac +mysql)" |
---|
36 | } |
---|
37 | } |
---|
38 | |
---|
39 | set nick mythtv |
---|
40 | set mythtvhomedir ${prefix}/var/mythtvuser |
---|
41 | set mythtvlogdir ${prefix}/var/log/${nick}${majorversion} |
---|
42 | set mythtvpiddir ${prefix}/var/run/${nick}${majorversion} |
---|
43 | set mythtvpidfile $mythtvpiddir/${nick} |
---|
44 | set plistDir ${prefix}/Library/LaunchDaemons |
---|
45 | set plistFl ${plistDir}/org.mythtv.mythbackend.plist |
---|
46 | set mythverstring v0${majorversion}${minorversion}-${shorthash} |
---|
47 | set mythbranch fixes/0${majorversion}-MacPorts |
---|
48 | |
---|
49 | depends_lib port:libdvdcss \ |
---|
50 | port:freetype \ |
---|
51 | port:lame \ |
---|
52 | port:x264 \ |
---|
53 | port:qt4-mac \ |
---|
54 | port:py26-mysql \ |
---|
55 | port:py26-lxml \ |
---|
56 | port:py26-urlgrabber \ |
---|
57 | port:p5.12-dbd-mysql \ |
---|
58 | port:p5.12-http-request-ascgi \ |
---|
59 | port:p5.12-lwp-useragent-determined \ |
---|
60 | port:p5.12-io-socket-inet6 \ |
---|
61 | port:p5.12-net-upnp |
---|
62 | |
---|
63 | depends_build port:yasm |
---|
64 | |
---|
65 | patchfiles patch-bindings-python-mythtv-utility.diff \ |
---|
66 | patch-greedyh.asm.diff |
---|
67 | # patch-mythtv_configure.diff \ << Todo: distcc/ccache s/b set by MacPorts |
---|
68 | # patch-bindings-python-mythtv-utility.diff see http://code.mythtv.org/trac/ticket/10737 |
---|
69 | # Fixed 2012May21 in master fff02e698418de20a918480694ac74661ce666db; not fixes/0.25 |
---|
70 | # patch-greedyh.asm.diff see http://code.mythtv.org/trac/ticket/10762 |
---|
71 | # Fixed 2012Jun15 in master 12a3eac312d06257ba1dca771ee710eacda6ce1e |
---|
72 | |
---|
73 | post-patch { |
---|
74 | set sedPath ${worksrcpath}/mythtv/ |
---|
75 | ui_info "Make Myth utils use MacPorts Perl" |
---|
76 | set myPerls [list "${sedPath}bindings/perl/Makefile.PL" \ |
---|
77 | "${sedPath}bindings/perl/MythTV.pm" \ |
---|
78 | "${sedPath}programs/scripts/internetcontent/topdocumentaryfilm.pl" \ |
---|
79 | "${sedPath}programs/scripts/internetcontent/twit.tv.pl" \ |
---|
80 | "${sedPath}contrib/maintenance/optimize_mythdb.pl" \ |
---|
81 | "${sedPath}contrib/user_jobs/mythlink.pl" \ |
---|
82 | "${sedPath}programs/scripts/database/mythconverg_backup.pl" \ |
---|
83 | "${sedPath}programs/scripts/database/mythconverg_restore.pl" |
---|
84 | ] |
---|
85 | foreach f $myPerls { |
---|
86 | reinplace "s|#!/usr/bin/perl|#!${prefix}/bin/perl5.12|" ${f} |
---|
87 | } |
---|
88 | reinplace "s|/usr/local/|${prefix}/|" ${sedPath}programs/scripts/database/mythconverg_backup.pl |
---|
89 | reinplace "s|\'/etc/|\'/private/etc/|" ${sedPath}programs/scripts/database/mythconverg_backup.pl |
---|
90 | reinplace "s|\'mysqldump\'|\'mysqldump5\'|" ${sedPath}programs/scripts/database/mythconverg_backup.pl |
---|
91 | reinplace "s|/usr/local/|${prefix}/|" ${sedPath}programs/scripts/database/mythconverg_restore.pl |
---|
92 | reinplace "s|\'/etc/|\'/private/etc/|" ${sedPath}programs/scripts/database/mythconverg_restore.pl |
---|
93 | reinplace "s|\'mysql\'|\'mysql5\'|" ${sedPath}programs/scripts/database/mythconverg_restore.pl |
---|
94 | |
---|
95 | ui_info "Record Myth version strings" |
---|
96 | reinplace "s#\${SOURCE_VERSION}#${mythverstring}#g" ${sedPath}version.sh |
---|
97 | reinplace "s#\${BRANCH}#${mythbranch}#g" ${sedPath}version.sh |
---|
98 | |
---|
99 | ui_info "Install Myth Python stuff to ${prefix}" |
---|
100 | reinplace "s|/usr/local|${prefix}|" ${worksrcpath}/mythtv/bindings/python/MythTV/static.py |
---|
101 | |
---|
102 | } |
---|
103 | |
---|
104 | # macosx_deployment_target 10.6 << ToDo: Python throws mismatch error if specified and != build os |
---|
105 | |
---|
106 | # Upstream has been working on clang compatibility but is not there yet |
---|
107 | # Eg http://code.mythtv.org/cgit/mythtv/commit/?id=12a3eac312d06257ba1dca771ee710eacda6ce1e |
---|
108 | if {${configure.compiler} == "llvm-gcc-4.2"} { |
---|
109 | configure.compiler gcc-4.2 |
---|
110 | } elseif {${configure.compiler} == "clang"} { |
---|
111 | depends_build-append port:apple-gcc42 |
---|
112 | depends_skip_archcheck-append apple-gcc42 |
---|
113 | configure.compiler apple-gcc-4.2 |
---|
114 | } |
---|
115 | |
---|
116 | configure.dir ${worksrcpath}/mythtv |
---|
117 | configure.args --compile-type=release \ |
---|
118 | --runprefix=${prefix} \ |
---|
119 | --cc=${configure.cc} \ |
---|
120 | --cxx=${configure.cxx} \ |
---|
121 | --extra-ldflags='-F/System/Library/Frameworks' \ |
---|
122 | --python=${prefix}/bin/python2.6 \ |
---|
123 | --disable-distcc \ |
---|
124 | --disable-firewire \ |
---|
125 | --disable-audio-jack --disable-indev=jack \ |
---|
126 | --enable-libmp3lame --enable-libx264 |
---|
127 | # --enable-nonfree --enable-libfaac << ToDo: optional variant?? |
---|
128 | # some MacPorts users may have Jack installed |
---|
129 | |
---|
130 | build.dir ${worksrcpath}/mythtv |
---|
131 | |
---|
132 | destroot.destdir INSTALL_ROOT=${destroot} |
---|
133 | |
---|
134 | post-destroot { |
---|
135 | # install the launchd plist for the backend |
---|
136 | ui_info "Installing startupitem/launchd plist..." |
---|
137 | xinstall -d -m 0755 ${destroot}${plistDir} |
---|
138 | reinplace "s|/opt/local|${prefix}|g" ${filespath}/org.${nick}.mythbackend.plist |
---|
139 | xinstall -c ${filespath}/org.${nick}.mythbackend.plist ${destroot}${plistDir} |
---|
140 | |
---|
141 | # install scripts we want in share/contrib |
---|
142 | ui_info "Installing share/$name/contrib scripts..." |
---|
143 | |
---|
144 | xinstall -d -m 755 ${destroot}${prefix}/share/${nick}/database |
---|
145 | xinstall -d -m 755 ${destroot}${prefix}/share/${nick}/contrib |
---|
146 | |
---|
147 | xinstall -c -m 755 \ |
---|
148 | ${configure.dir}/database/mc.sql \ |
---|
149 | ${destroot}${prefix}/share/${nick}/database/ |
---|
150 | xinstall -c -m 755 \ |
---|
151 | ${configure.dir}/contrib/maintenance/optimize_mythdb.pl \ |
---|
152 | ${configure.dir}/contrib/user_jobs/mythlink.pl \ |
---|
153 | ${destroot}${prefix}/share/${nick}/contrib/ |
---|
154 | |
---|
155 | # install some simple Applescripts to launch common myth apps |
---|
156 | ui_info "Installing Applescript helpers..." |
---|
157 | # compile the Applescripts |
---|
158 | xinstall -m 755 -d ${destroot}${applications_dir}/${nick}${majorversion} |
---|
159 | |
---|
160 | system "osacompile -x -o ${destroot}${applications_dir}/${nick}${majorversion}/Myth_Frontend.app ${filespath}/Myth_Frontend.scpt" |
---|
161 | system "osacompile -x -o ${destroot}${applications_dir}/${nick}${majorversion}/Myth_Frontend_Logging.app ${filespath}/Myth_Frontend_Logging.scpt" |
---|
162 | system "osacompile -x -o ${destroot}${applications_dir}/${nick}${majorversion}/Myth_Filldatabase.app ${filespath}/Myth_Filldatabase.scpt" |
---|
163 | system "osacompile -x -o ${destroot}${applications_dir}/${nick}${majorversion}/Myth_Setup.app ${filespath}/Myth_Setup.scpt" |
---|
164 | |
---|
165 | # make other directories myth will need |
---|
166 | xinstall -d -m 755 ${destroot}${mythtvhomedir} |
---|
167 | xinstall -d -m 755 ${destroot}${mythtvlogdir} |
---|
168 | xinstall -d -m 755 ${destroot}${mythtvpiddir} |
---|
169 | |
---|
170 | destroot.keepdirs \ |
---|
171 | ${destroot}${prefix}/share/${nick}/contrib \ |
---|
172 | ${destroot}${mythtvhomedir} \ |
---|
173 | ${destroot}${mythtvlogdir} \ |
---|
174 | ${destroot}${mythtvpiddir} \ |
---|
175 | ${destroot}${applications_dir}/${nick}${majorversion} |
---|
176 | |
---|
177 | # Fix up library entries in dylibs and executables ... |
---|
178 | # need to loop on arch's if/when build universal ?!? |
---|
179 | set libdir ${prefix}/lib |
---|
180 | |
---|
181 | ui_info "Correcting library entries in dylibs..." |
---|
182 | |
---|
183 | foreach {dylib} [glob -types f -tails -directory ${destroot}${libdir} *.dylib] { |
---|
184 | # glob gives us both files and links to files |
---|
185 | if { [file type ${destroot}${libdir}/${dylib}] == "file" } { |
---|
186 | ui_debug "... for ${dylib}" |
---|
187 | system "install_name_tool -id ${libdir}/${dylib} ${destroot}${libdir}/${dylib}" |
---|
188 | |
---|
189 | set otool [lrange [split [exec otool -L ${destroot}${libdir}/${dylib}] \n] 2 end] |
---|
190 | |
---|
191 | foreach {otoolentry} ${otool} { |
---|
192 | # fix entries like "libmythswscale.dylib" to "${prefix}/lib/libmythswscale.dylib" |
---|
193 | # assume anything without a leading slash needs fixing |
---|
194 | set firstchar [string range [string trimleft ${otoolentry}] 0 0] |
---|
195 | if { ${firstchar} != "/" } { |
---|
196 | set lib [lindex ${otoolentry} 0] |
---|
197 | ui_debug " Change ${lib} to ${libdir}/[file tail ${lib}]" |
---|
198 | system "install_name_tool -change \ |
---|
199 | ${lib} \ |
---|
200 | ${libdir}/[file tail ${lib}] \ |
---|
201 | ${destroot}${libdir}/${dylib}" |
---|
202 | } |
---|
203 | } |
---|
204 | } |
---|
205 | } |
---|
206 | set bindir ${prefix}/bin |
---|
207 | ui_info "Correcting library entries in executables..." |
---|
208 | |
---|
209 | foreach {prog} [glob -types f -tails -directory ${destroot}${bindir} *] { |
---|
210 | # glob gives us files and links to files but should be no links in bin dir |
---|
211 | ui_debug "... for ${prog}" |
---|
212 | |
---|
213 | set otool [lrange [split [exec otool -L ${destroot}${bindir}/${prog}] \n] 2 end] |
---|
214 | |
---|
215 | foreach {otoolentry} ${otool} { |
---|
216 | # fix entries like "libmythswscale.dylib" to "${prefix}/lib/libmythswscale.dylib" |
---|
217 | # assume anything without a leading slash needs fixing |
---|
218 | set firstchar [string range [string trimleft ${otoolentry}] 0 0] |
---|
219 | if { ${firstchar} != "/" } { |
---|
220 | set lib [lindex ${otoolentry} 0] |
---|
221 | ui_debug " Change ${lib} to ${libdir}/[file tail ${lib}]" |
---|
222 | system "install_name_tool -change \ |
---|
223 | ${lib} \ |
---|
224 | ${libdir}/[file tail ${lib}] \ |
---|
225 | ${destroot}${bindir}/${prog}" |
---|
226 | } |
---|
227 | } |
---|
228 | } |
---|
229 | |
---|
230 | # fix lib entries in filters |
---|
231 | set fltdir ${prefix}/lib/mythtv/filters |
---|
232 | set liblist [glob -types f -tails -directory ${destroot}${libdir} -- *.dylib] |
---|
233 | ui_info "Correcting library entries in plugins..." |
---|
234 | |
---|
235 | foreach {flt} [glob -types f -tails -directory ${destroot}${fltdir} *] { |
---|
236 | # glob gives us files and links to files but should be no links in filters dir |
---|
237 | ui_debug "... for ${flt}" |
---|
238 | |
---|
239 | set otool [lrange [split [exec otool -L ${destroot}${fltdir}/${flt}] \n] 2 end] |
---|
240 | |
---|
241 | foreach {otoolentry} ${otool} { |
---|
242 | # fix entries like "libmythswscale.dylib" to "${prefix}/lib/libmythswscale.dylib" |
---|
243 | # assume anything without a leading slash needs fixing |
---|
244 | set firstchar [string range [string trimleft ${otoolentry}] 0 0] |
---|
245 | if { ${firstchar} != "/" } { |
---|
246 | set lib [lindex ${otoolentry} 0] |
---|
247 | if { [ lsearch $liblist ${lib} ] > 0 } { |
---|
248 | set goodprefix ${libdir} |
---|
249 | } else { |
---|
250 | set goodprefix ${fltdir} |
---|
251 | } |
---|
252 | ui_debug " Change ${lib} to ${goodprefix}/[file tail ${lib}]" |
---|
253 | system "install_name_tool -change \ |
---|
254 | ${lib} \ |
---|
255 | ${goodprefix}/[file tail ${lib}] \ |
---|
256 | ${destroot}${fltdir}/${flt}" |
---|
257 | } |
---|
258 | } |
---|
259 | } |
---|
260 | } |
---|
261 | |
---|
262 | universal_variant no |
---|
263 | |
---|
264 | variant mysql_server description {Include database server software.} { |
---|
265 | depends_run-append port:mysql51-server |
---|
266 | # add backup and maintenance script!! |
---|
267 | } |
---|
268 | |
---|
269 | # variant mythweb description {Web-based access and control of MythTV} { |
---|
270 | # depends_run-append port:mythweb.25 <<== ToDo! |
---|
271 | #} |
---|
272 | |
---|
273 | #default_variants +mysql_server |
---|
274 | |
---|
275 | # startupitem.create yes |
---|
276 | # Need two environment variables set => roll our own plist |
---|
277 | |
---|
278 | post-activate { |
---|
279 | ln -s ${plistFl} /Library/LaunchDaemons |
---|
280 | } |
---|
281 | |
---|
282 | pre-deactivate { |
---|
283 | file delete -force /Library/LaunchDaemons/org.mythtv.mythbackend.plist |
---|
284 | # should throw error if mythbackend running! |
---|
285 | } |
---|
286 | |
---|
287 | notes "############################################################################ |
---|
288 | # |
---|
289 | # See http://www.mythtv.org/wiki/Myth_for_Mac_with_MacPorts for information |
---|
290 | # essential to finishing the installation of MythTV! |
---|
291 | # |
---|
292 | # NB - |
---|
293 | # For troubleshooting, all Myth-related logs are stored in |
---|
294 | # ${mythtvlogdir} |
---|
295 | # |
---|
296 | ############################################################################" |
---|