From 2bebd2a04ec828644f87505fa426758b6c74e10f Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 22 Jul 2008 09:17:36 +0000 Subject: mythtv: start beating it into a state where it will crosscompile --- packages/mythtv/mythtv.inc | 8 ++-- packages/mythtv/mythtv/.mtn2git_empty | 0 packages/mythtv/mythtv/configure.patch | 47 +++++++++++++++++++++ packages/mythtv/mythtv_0.21.bb | 68 +++++++++++++++++++++++++++++++ packages/mythtv/mythtv_svn.bb | 74 ++++++++++++++++++++++++++++++++++ 5 files changed, 192 insertions(+), 5 deletions(-) create mode 100644 packages/mythtv/mythtv/.mtn2git_empty create mode 100644 packages/mythtv/mythtv/configure.patch create mode 100644 packages/mythtv/mythtv_0.21.bb create mode 100644 packages/mythtv/mythtv_svn.bb diff --git a/packages/mythtv/mythtv.inc b/packages/mythtv/mythtv.inc index 4ceda5d421..3485cca682 100644 --- a/packages/mythtv/mythtv.inc +++ b/packages/mythtv/mythtv.inc @@ -2,15 +2,13 @@ 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" +DEPENDS = "libxinerama libxv libxxf86vm libxvmc lirc qt-x11-free" RDEPENDS_${PN} = "qt-x11-plugins-sqldrivers qt-x11-plugins-imageformats" SRC_URI = "http://www.mythtv.org/mc/mythtv-${PV}.tar.bz2" -inherit qmake qt3x11 +inherit qmake2 qt3x11 -# there is a -march=586 somewhere in the source tree -COMPATIBLE_HOST = 'i.86.*-linux' QMAKE_PROFILES = "mythtv.pro" @@ -22,7 +20,7 @@ def mythtv_arch(d): elif arch == "x86_64": arch = "x86" elif arch == "arm": - arch = "armv4l" + arch = "${BASE_PACKAGE_ARCH}" return arch MYTHTV_ARCH := "${@mythtv_arch(d)}" diff --git a/packages/mythtv/mythtv/.mtn2git_empty b/packages/mythtv/mythtv/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/mythtv/mythtv/configure.patch b/packages/mythtv/mythtv/configure.patch new file mode 100644 index 0000000000..0d5a8fc3c1 --- /dev/null +++ b/packages/mythtv/mythtv/configure.patch @@ -0,0 +1,47 @@ +--- /tmp/configure 2008-07-22 10:27:56.000000000 +0200 ++++ mythtv/configure 2008-07-22 10:54:24.000000000 +0200 +@@ -1714,7 +1714,7 @@ + + has_library() + { +- if test -f /etc/ld.so.conf ; then ++ if test -f /etc/ld.so.conf && disabled cross_compile ; then + LIBPATHS=`cat /etc/ld.so.conf | grep -v "#" | grep -v "include"` + else + LIBPATHS='' +@@ -1725,7 +1725,7 @@ + LIBPATHS="$LIBPATHS `echo $DYLD_LIBRARY_PATH | sed s/':'/' '/g` " + + # recurse down just one level, should be enough in most cases +- if test -f /etc/ld.so.conf ; then ++ if test -f /etc/ld.so.conf && disabled cross_compile ; then + INCL=`cat /etc/ld.so.conf | grep -v "#" | grep "^include"` + SRCH=`echo "$INCL" | sed '{ s/^include \//\//; s/^include /\/etc\//}'` + for x in $SRCH ; do +@@ -1734,7 +1734,7 @@ + done + fi + +- LIBPATHS="`echo $LIBPATHS /$libdir_name /usr/$libdir_name /usr/local/$libdir_name /usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` " ++ enabled cross_compile || LIBPATHS="`echo $LIBPATHS /$libdir_name /usr/$libdir_name /usr/local/$libdir_name /usr/X11R6/$libdir_name | sed s/'\/ '/' '/g` " + + HAS_IT="no" + for LIBPATH in $LIBPATHS ; do +@@ -2254,7 +2254,7 @@ + EOF + + if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then +-$TMPE && cpuclipspositive="yes" ++enabled cross_compile || $TMPE && cpuclipspositive="yes" + fi + + # test negative wrap +@@ -2269,7 +2269,7 @@ + EOF + + if $cc $CFLAGS $ECFLAGS -o $TMPE $TMPC 2>/dev/null ; then +-$TMPE && cpuclipsnegative="yes" ++enabled cross_compile || $TMPE && cpuclipsnegative="yes" + fi + + # test for distcc diff --git a/packages/mythtv/mythtv_0.21.bb b/packages/mythtv/mythtv_0.21.bb new file mode 100644 index 0000000000..a33c446813 --- /dev/null +++ b/packages/mythtv/mythtv_0.21.bb @@ -0,0 +1,68 @@ +require mythtv.inc + +PR = "r0" + +#SRC_URI += "file://configure.patch;patch=1 \ +# file://libmyth-libdir.patch;patch=1" + +# Seen on the mythtv web page: +# http://www.mythtv.org/mc/fix-mythweb-in-0.20.diff;patch=1 + +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" + +PACKAGES_DYNAMIC = "mythtv-theme-*" + +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) +} +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} \ + --disable-altivec \ + --enable-v4l \ + --enable-audio-oss \ + --enable-proc-opt \ + --enable-dvb \ + --cross-compile \ + --dvb-path=${STAGING_INCDIR} + + sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new + mv settings.pro.new settings.pro +} + +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) +} diff --git a/packages/mythtv/mythtv_svn.bb b/packages/mythtv/mythtv_svn.bb new file mode 100644 index 0000000000..2d7d7ac938 --- /dev/null +++ b/packages/mythtv/mythtv_svn.bb @@ -0,0 +1,74 @@ +require mythtv.inc + +DEFAULT_PREFERENCE = "-1" + +PV = "0.21+svnr${SRCREV}" +PR = "r0" + +SRCREV = "17880" +SRC_URI = "svn://svn.mythtv.org/svn/trunk;module=mythtv;proto=http" + +SRC_URI += "file://configure.patch;patch=1 \ + " + +S = "${WORKDIR}/mythtv" + +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" + +PACKAGES_DYNAMIC = "mythtv-theme-*" + +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) +} +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} \ + --disable-altivec \ + --enable-v4l \ + --enable-audio-oss \ + --enable-proc-opt \ + --enable-dvb \ + --enable-libmp3lame \ + --cross-compile \ + --dvb-path=${STAGING_INCDIR} + + sed 's!PREFIX =.*!PREFIX = ${prefix}!;/INCLUDEPATH += $${PREFIX}\/include/d' < settings.pro > settings.pro.new + mv settings.pro.new settings.pro +} + +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) +} -- cgit v1.2.3