From: Joshua Lock <josh@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 06/12] classes/[gnome|gnomebase|mime]: merge meta-oe's enhance gnome related classes
Date: Tue, 08 Nov 2011 08:35:34 -0800 [thread overview]
Message-ID: <4EB95A56.4010805@linux.intel.com> (raw)
In-Reply-To: <1320761139.10843.35.camel@ted>
On 08/11/11 06:05, Richard Purdie wrote:
> On Mon, 2011-11-07 at 16:10 -0800, Joshua Lock wrote:
>> This patch pulls in the gnome related classes from meta-openembedded which
>> adds extra packaging rules and functionality whilst modularising things
>> so that one can get a subset of the gnome classes functionality without adding
>> all of the extra dependencies.
>>
>> Signed-off-by: Joshua Lock <josh@linux.intel.com>
>> ---
>> meta/classes/gnome-base.bbclass | 15 ++++++++++
>> meta/classes/gnome.bbclass | 19 ++-----------
>> meta/classes/gnomebase.bbclass | 32 ++++++++++++++++++++++
>> meta/classes/mime.bbclass | 56 +++++++++++++++++++++++++++++++++++++++
>> 4 files changed, 106 insertions(+), 16 deletions(-)
>> create mode 100644 meta/classes/gnome-base.bbclass
>> create mode 100644 meta/classes/gnomebase.bbclass
>
> Couldn't we have better names for these? What is the difference betweem
> gnome base and gnomebase?
Oh, whoops - gnome-base is the class I wrote to facilitate the GConf
recipe before realising/recalling that meta-oe probably had something
similar. gnome-base is redundant here. Apologies for the noise.
>> diff --git a/meta/classes/gnome.bbclass b/meta/classes/gnome.bbclass
>> index 3d68b12..0a32a77 100644
>> --- a/meta/classes/gnome.bbclass
>> +++ b/meta/classes/gnome.bbclass
>> @@ -1,17 +1,4 @@
>> -def gnome_verdir(v):
>> - import re
>> - m = re.match("^([0-9]+)\.([0-9]+)", v)
>> - return "%s.%s" % (m.group(1), m.group(2))
>> +inherit gnomebase gtk-icon-cache gconf mime
>>
>> -SECTION ?= "x11/gnome"
>> -SRC_URI = "${GNOME_MIRROR}/${BPN}/${@gnome_verdir("${PV}")}/${BPN}-${PV}.tar.bz2;name=archive"
>> -
>> -DEPENDS += "gnome-common"
>> -
>> -FILES_${PN} += "${datadir}/application-registry \
>> - ${datadir}/mime-info \
>> - ${datadir}/gnome-2.0"
>> -
>> -inherit autotools pkgconfig gconf
>> -
>> -EXTRA_OEMAKE += "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1"
>> +EXTRA_OECONF += "--enable-introspection=no"
>> +BBCLASSEXTEND += "native"
>
> Do we really need to BBCLASSEXTEND every gnome recipe?
Probably not.
>
>> diff --git a/meta/classes/gnomebase.bbclass b/meta/classes/gnomebase.bbclass
>> new file mode 100644
>> index 0000000..5a332a0
>> --- /dev/null
>> +++ b/meta/classes/gnomebase.bbclass
>> @@ -0,0 +1,32 @@
>> +def gnome_verdir(v):
>> + import re
>> + m = re.match("^([0-9]+)\.([0-9]+)", v)
>> + return "%s.%s" % (m.group(1), m.group(2))
>> +
>> +SECTION ?= "x11/gnome"
>> +SRC_URI = "${GNOME_MIRROR}/${BPN}/${@gnome_verdir("${PV}")}/${BPN}-${PV}.tar.bz2;name=archive"
>> +
>> +DEPENDS += "gnome-common"
>> +
>> +FILES_${PN} += "${datadir}/application-registry \
>> + ${datadir}/mime-info \
>> + ${datadir}/mime/packages \
>> + ${datadir}/mime/application \
>> + ${datadir}/gnome-2.0 \
>> + ${datadir}/polkit* \
>> + ${datadir}/GConf \
>> + ${datadir}/glib-2.0/schemas \
>> +"
>> +
>> +FILES_${PN}-doc += "${datadir}/devhelp"
>> +
>> +inherit autotools pkgconfig
>> +
>> +AUTOTOOLS_STAGE_PKGCONFIG = "1"
>
> That variable is long dead, please don't bring it back :)
*whistles*
>
>> +
>> +do_install_append() {
>> + rm -rf ${D}${localstatedir}/lib/scrollkeeper/*
>> + rm -rf ${D}${localstatedir}/scrollkeeper/*
>> + rm -f ${D}${datadir}/applications/*.cache
>> +}
>> +
>> diff --git a/meta/classes/mime.bbclass b/meta/classes/mime.bbclass
>> new file mode 100644
>> index 0000000..b9cdd7b
>> --- /dev/null
>> +++ b/meta/classes/mime.bbclass
>> @@ -0,0 +1,56 @@
>> +DEPENDS += "shared-mime-info-native shared-mime-info"
>> +
>> +mime_postinst() {
>> +if [ "$1" = configure ]; then
>> + if [ -x ${bindir}/update-mime-database ] ; then
>
> This is wrong, it will use update-mime-database from the build system.
> We should really use which to see if its available from the environment
> and use PATH to resolve it.
Will do.
>
>> + echo "Updating MIME database... this may take a while."
>> + update-mime-database $D${datadir}/mime
>
> This however is using $D correctly making the above error all the more
> bizarre!
>
>> + else
>> + echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
>> + exit 1
>> + fi
>> +fi
>> +}
>> +
>> +mime_postrm() {
>> +if [ "$1" = remove ] || [ "$1" = upgrade ]; then
>> + if [ -x ${bindir}/update-mime-database ] ; then
>
> ditto.
>
>> + echo "Updating MIME database... this may take a while."
>> + update-mime-database $D${datadir}/mime
>> + else
>> + echo "Missing ${bindir}/update-mime-database, update of mime database failed!"
>> + exit 1
>> + fi
>> +fi
>> +}
>> +
>> +python ppopulate_packages_append () {
>> + import os.path, re
>> + packages = bb.data.getVar('PACKAGES', d, 1).split()
>> + pkgdest = bb.data.getVar('PKGDEST', d, 1)
>> +
>> + for pkg in packages:
>> + mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
>> + mimes = []
>> + mime_re = re.compile(".*\.xml$")
>> + if os.path.exists(mime_dir):
>> + for f in os.listdir(mime_dir):
>> + if mime_re.match(f):
>> + mimes.append(f)
>> + if mimes != []:
>> + bb.note("adding mime postinst and postrm scripts to %s" % pkg)
>> + postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1)
>> + if not postinst:
>> + postinst = '#!/bin/sh\n'
>> + postinst += bb.data.getVar('mime_postinst', d, 1)
>> + bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d)
>> + postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1)
>> + if not postrm:
>> + postrm = '#!/bin/sh\n'
>> + postrm += bb.data.getVar('mime_postrm', d, 1)
>> + bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d)
>> + bb.note("adding freedesktop-mime-info dependency to %s" % pkg)
>> + rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "")
>> + rdepends.append("freedesktop-mime-info")
>> + bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d)
>> +}
>
> We don't have freedesktop-mime-info do we? Shouldn't this also check
> DEPENDS and error out if it wasn't in DEPENDS else rootfs construction
> will fail.
>
Hmm, definitely needs more investigation. I'll spin a v2 with your
comments addressed, thanks for the review.
Cheers,
Joshua
--
Joshua Lock
Yocto Project "Johannes factotum"
Intel Open Source Technology Centre
next prev parent reply other threads:[~2011-11-08 16:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-08 0:10 [PATCH 00/12] Recipe upgrades, fixes and additions Joshua Lock
2011-11-08 0:10 ` [PATCH 01/12] cogl: add cogl 1.8.0 recipe Joshua Lock
2011-11-08 0:10 ` [PATCH 02/12] clutter-1.8: add 1.8.0 Joshua Lock
2011-11-08 0:10 ` [PATCH 03/12] clutter-gst-1.8: add 1.4.2 for use with clutter 1.8 Joshua Lock
2011-11-08 16:10 ` Saul Wold
2011-11-08 16:30 ` Joshua Lock
2011-11-08 16:54 ` Saul Wold
2011-11-08 16:59 ` Joshua Lock
2011-11-08 0:10 ` [PATCH 04/12] clutter-gtk-1.8: add clutter-gtk 0.11.4 Joshua Lock
2011-11-08 0:10 ` [PATCH 05/12] mx: add mx toolkit 1.3.2 Joshua Lock
2011-11-08 0:10 ` [PATCH 06/12] classes/[gnome|gnomebase|mime]: merge meta-oe's enhance gnome related classes Joshua Lock
2011-11-08 14:05 ` Richard Purdie
2011-11-08 16:35 ` Joshua Lock [this message]
2011-11-08 0:10 ` [PATCH 07/12] gconf: add upstream GNOME gconf 3.2.3 and drop gconf-dbus Joshua Lock
2011-11-08 0:10 ` [PATCH 08/12] libcanberra: add libvorbis to DEPENDS Joshua Lock
2011-11-08 0:10 ` [PATCH 09/12] gypsy: fix packaging Joshua Lock
2011-11-08 0:10 ` [PATCH 10/12] connman: split scripts into separate package Joshua Lock
2011-11-08 14:17 ` Koen Kooi
2011-11-08 0:10 ` [PATCH 11/12] pulseaudio: make X11 dependencies optional and add gtk+ Joshua Lock
2011-11-08 0:10 ` [PATCH 12/12] contacts: fix packaging of icons Joshua Lock
2011-11-08 14:18 ` [PATCH 00/12] Recipe upgrades, fixes and additions Richard Purdie
2011-11-08 15:48 ` Saul Wold
2011-11-15 19:03 ` Saul Wold
2011-11-15 21:38 ` Richard Purdie
2011-11-15 21:48 ` Joshua Lock
2011-11-08 17:36 ` Saul Wold
2011-11-08 18:31 ` Joshua Lock
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4EB95A56.4010805@linux.intel.com \
--to=josh@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.