summaryrefslogtreecommitdiff
path: root/packages/mythtv/mythtv_0.20.bb
blob: e2680ebb9ec7e92f75c2a2bf47e41cea9295cdfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
DESCRIPTION = "A full featured personal video recorder system."
HOMEPAGE = "http://www.mythtv.org"
LICENSE = "GPL"
SECTION = "x11/multimedia"
DEPENDS = "libxinerama lame libxv libxxf86vm libxvmc lirc qt-x11-free openchrome"
PR = "r0"

SRC_URI = "http://www.mythtv.org/mc/mythtv-${PV}.tar.bz2 \
	file://configure.patch;patch=1 \
	file://libmyth-libdir.patch;patch=1"

inherit qmake qt3x11

# there is a -march=586 somewhere in the source tree
COMPATIBLE_HOST = 'i.86.*-linux'

QMAKE_PROFILES = "mythtv.pro"

mythlibs = "mythavutil mythavcodec mythavformat myth mythtv mythui mythfreemheg mythupnp mythlivemedia"
PACKAGES =+ "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data"

FILES_mythtv-backend = "${bindir}/mythbackend ${bindir}/mythcommflag ${bindir}/mythfilldatabase ${bindir}/mythtranscode"
FILES_mythtv-frontend = "${bindir}/mythfrontend ${datadir}/mythtv/i18n/mythfrontend_* ${datadir}/mythtv/*.ttf"
RDEPENDS_mythtv-frontend = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats"
FILES_mythtv-bin = "${bindir}"
FILES_mythtv-filters = "${libdir}/mythtv/filters"
FILES_mythtv-data = "${datadir}"
RDEPENDS_${PN} = "mythtv-backend mythtv-frontend mythtv-bin mythtv-filters mythtv-data"
ALLOW_EMPTY_${PN} = "1"

python __anonymous () {
    import bb

    mythlibs = bb.data.getVar('mythlibs', d).split()
    pv = bb.data.expand(bb.data.getVar("PV", d), d)

    for m in mythlibs:
        bb.data.setVar("FILES_lib%s%s" % (m, pv), "${libdir}/lib%s-%s.so.*" % (m, pv), d)
        bb.data.setVar("FILES_lib%s%s-dev" % (m, pv), "${libdir}/lib%s-%s.*" % (m, pv), d)

    packages = " ".join(map(lambda x: "lib%s%s lib%s%s-dev" % (x, pv, x, pv), mythlibs) + bb.data.getVar("PACKAGES", d).split())

    bb.data.setVar("PACKAGES", packages, d)
}

def mythtv_arch(d):
        import bb, re
        arch = bb.data.getVar('TARGET_ARCH', d, 1)
        if re.match("^i.86$", arch):
                arch = "x86"
        elif arch == "x86_64":
                arch = "x86"
        elif arch == "arm":
                arch = "armv4l"
        return arch

MYTHTV_ARCH := "${@mythtv_arch(d)}"

do_configure_prepend() {
# it's not autotools anyway, so we call ./configure directly
	find . -name "Makefile"|xargs rm -f
	./configure	--prefix=/usr		\
			--mandir=/usr/man 	\
			--cpu=${MYTHTV_ARCH}	\
			--enable-mmx		\
			--disable-altivec	\
			--enable-v4l		\
			--enable-audio-oss	\
			--enable-proc-opt	\
			--enable-xvmc		\
			--enable-xvmc-pro	\
			--enable-dvb		\
			--dvb-path=${STAGING_INCDIR}

	sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new
	mv settings.pro.new settings.pro
}

do_install() {
	oe_runmake INSTALL_ROOT=${D} install
}

python populate_packages_prepend () {
	new_packages = []

	def the_hook(file, pkg, pattern, format, basename):
		new_packages.append(pkg)

	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)

	bb.data.setVar("RDEPENDS_${PN}", "%s %s" % (bb.data.getVar("RDEPENDS_${PN}", d), " ".join(new_packages)), d)
}