Merge branch 'org.openembedded.dev' of git@git.openembedded.net:/openembedded into...
[vuplus_openembedded] / packages / mythtv / mythtv_0.20.bb
1 require mythtv.inc
2
3 inherit qmake2 qt3x11
4
5 DEPENDS += "openchrome"
6 PR = "r1"
7
8 SRC_URI += "file://configure.patch;patch=1 \
9             file://libmyth-libdir.patch;patch=1"
10
11 # Seen on the mythtv web page:
12 # http://www.mythtv.org/mc/fix-mythweb-in-0.20.diff;patch=1
13
14 QMAKE_PROFILES = "mythtv.pro"
15
16 mythlibs = "mythavutil mythavcodec mythavformat myth mythtv mythui mythfreemheg mythupnp mythlivemedia"
17 PACKAGES =+ "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data"
18
19 FILES_mythtv-backend = "${bindir}/mythbackend ${bindir}/mythcommflag ${bindir}/mythfilldatabase ${bindir}/mythtranscode"
20 FILES_mythtv-frontend = "${bindir}/mythfrontend ${datadir}/mythtv/i18n/mythfrontend_* ${datadir}/mythtv/*.ttf"
21 RDEPENDS_mythtv-frontend = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats"
22 FILES_mythtv-bin = "${bindir}"
23 FILES_mythtv-filters = "${libdir}/mythtv/filters"
24 FILES_mythtv-data = "${datadir}"
25 RDEPENDS_${PN} = "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data"
26 ALLOW_EMPTY_${PN} = "1"
27
28 PACKAGES_DYNAMIC = "mythtv-theme-*"
29
30 python __anonymous () {
31     import bb
32
33     mythlibs = bb.data.getVar('mythlibs', d).split()
34     pv = bb.data.expand(bb.data.getVar("PV", d), d)
35
36     for m in mythlibs:
37         bb.data.setVar("FILES_lib%s%s" % (m, pv), "${libdir}/lib%s-%s.so.*" % (m, pv), d)
38         bb.data.setVar("FILES_lib%s%s-dev" % (m, pv), "${libdir}/lib%s-%s.*" % (m, pv), d)
39
40     packages = " ".join(map(lambda x: "lib%s%s lib%s%s-dev" % (x, pv, x, pv), mythlibs) + bb.data.getVar("PACKAGES", d).split())
41
42     bb.data.setVar("PACKAGES", packages, d)
43 }
44 do_configure_prepend() {
45 # it's not autotools anyway, so we call ./configure directly
46         find . -name "Makefile"|xargs rm -f
47         ./configure     --prefix=/usr           \
48                         --mandir=/usr/man       \
49                         --cpu=${MYTHTV_ARCH}    \
50                         --enable-mmx            \
51                         --disable-altivec       \
52                         --enable-v4l            \
53                         --enable-audio-oss      \
54                         --enable-proc-opt       \
55                         --enable-xvmc           \
56                         --enable-xvmc-pro       \
57                         --enable-dvb            \
58                         --dvb-path=${STAGING_INCDIR}
59
60         sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new
61         mv settings.pro.new settings.pro
62 }
63
64 python populate_packages_prepend () {
65         new_packages = []
66
67         def the_hook(file, pkg, pattern, format, basename):
68                 new_packages.append(pkg)
69
70         do_split_packages(d, root=bb.data.expand('${datadir}/mythtv/themes', d), file_regex='(.*)', output_pattern='mythtv-theme-%s', description='MythTV theme %s', allow_dirs=True, hook=the_hook, prepend=True)
71
72         bb.data.setVar("RDEPENDS_${PN}", "%s %s" % (bb.data.getVar("RDEPENDS_${PN}", d), " ".join(new_packages)), d)
73 }