diff options
author | Koen Kooi <koen@dominion.thruhere.net> | 2010-11-02 11:11:31 +0100 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2010-11-02 11:11:31 +0100 |
commit | 2b60e0c68657a6867704e8b1869879df97ba63d9 (patch) | |
tree | 349906ac00c6cdcf21c64700e569782587c12268 | |
parent | 8a3fda48e232073ecedb25e8b1136eeed78ca353 (diff) | |
download | meta-openembedded-2b60e0c68657a6867704e8b1869879df97ba63d9.tar.gz |
angstrom-layers: add gnome classes from OE to meta-openembedded
mime.bbclass throws a python error, so the package splitting is disabled for the time being
Signed-off-by: Koen Kooi <k-kooi@ti.com>
-rw-r--r-- | classes/gnome.bbclass | 4 | ||||
-rw-r--r-- | classes/gnomebase.bbclass | 30 | ||||
-rw-r--r-- | classes/mime.bbclass | 56 |
3 files changed, 90 insertions, 0 deletions
diff --git a/classes/gnome.bbclass b/classes/gnome.bbclass new file mode 100644 index 0000000000..7bc5d9c14e --- /dev/null +++ b/classes/gnome.bbclass | |||
@@ -0,0 +1,4 @@ | |||
1 | inherit gnomebase gtk-icon-cache gconf mime | ||
2 | |||
3 | EXTRA_OECONF += "--enable-introspection=no" | ||
4 | |||
diff --git a/classes/gnomebase.bbclass b/classes/gnomebase.bbclass new file mode 100644 index 0000000000..b50504f983 --- /dev/null +++ b/classes/gnomebase.bbclass | |||
@@ -0,0 +1,30 @@ | |||
1 | def gnome_verdir(v): | ||
2 | import re | ||
3 | m = re.match("^([0-9]+)\.([0-9]+)", v) | ||
4 | return "%s.%s" % (m.group(1), m.group(2)) | ||
5 | |||
6 | SECTION ?= "x11/gnome" | ||
7 | SRC_URI = "${GNOME_MIRROR}/${BPN}/${@gnome_verdir("${PV}")}/${BPN}-${PV}.tar.bz2;name=archive" | ||
8 | |||
9 | DEPENDS += "gnome-common" | ||
10 | |||
11 | FILES_${PN} += "${datadir}/application-registry \ | ||
12 | ${datadir}/mime-info \ | ||
13 | ${datadir}/mime/packages \ | ||
14 | ${datadir}/mime/application \ | ||
15 | ${datadir}/gnome-2.0 \ | ||
16 | ${datadir}/polkit* \ | ||
17 | " | ||
18 | |||
19 | FILES_${PN}-doc += "${datadir}/devhelp" | ||
20 | |||
21 | inherit autotools pkgconfig | ||
22 | |||
23 | AUTOTOOLS_STAGE_PKGCONFIG = "1" | ||
24 | |||
25 | do_install_append() { | ||
26 | rm -rf ${D}${localstatedir}/lib/scrollkeeper/* | ||
27 | rm -rf ${D}${localstatedir}/scrollkeeper/* | ||
28 | rm -f ${D}${datadir}/applications/*.cache | ||
29 | } | ||
30 | |||
diff --git a/classes/mime.bbclass b/classes/mime.bbclass new file mode 100644 index 0000000000..b9cdd7becd --- /dev/null +++ b/classes/mime.bbclass | |||
@@ -0,0 +1,56 @@ | |||
1 | DEPENDS += "shared-mime-info-native shared-mime-info" | ||
2 | |||
3 | mime_postinst() { | ||
4 | if [ "$1" = configure ]; then | ||
5 | if [ -x ${bindir}/update-mime-database ] ; then | ||
6 | echo "Updating MIME database... this may take a while." | ||
7 | update-mime-database $D${datadir}/mime | ||
8 | else | ||
9 | echo "Missing ${bindir}/update-mime-database, update of mime database failed!" | ||
10 | exit 1 | ||
11 | fi | ||
12 | fi | ||
13 | } | ||
14 | |||
15 | mime_postrm() { | ||
16 | if [ "$1" = remove ] || [ "$1" = upgrade ]; then | ||
17 | if [ -x ${bindir}/update-mime-database ] ; then | ||
18 | echo "Updating MIME database... this may take a while." | ||
19 | update-mime-database $D${datadir}/mime | ||
20 | else | ||
21 | echo "Missing ${bindir}/update-mime-database, update of mime database failed!" | ||
22 | exit 1 | ||
23 | fi | ||
24 | fi | ||
25 | } | ||
26 | |||
27 | python ppopulate_packages_append () { | ||
28 | import os.path, re | ||
29 | packages = bb.data.getVar('PACKAGES', d, 1).split() | ||
30 | pkgdest = bb.data.getVar('PKGDEST', d, 1) | ||
31 | |||
32 | for pkg in packages: | ||
33 | mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg) | ||
34 | mimes = [] | ||
35 | mime_re = re.compile(".*\.xml$") | ||
36 | if os.path.exists(mime_dir): | ||
37 | for f in os.listdir(mime_dir): | ||
38 | if mime_re.match(f): | ||
39 | mimes.append(f) | ||
40 | if mimes != []: | ||
41 | bb.note("adding mime postinst and postrm scripts to %s" % pkg) | ||
42 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) | ||
43 | if not postinst: | ||
44 | postinst = '#!/bin/sh\n' | ||
45 | postinst += bb.data.getVar('mime_postinst', d, 1) | ||
46 | bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) | ||
47 | postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) | ||
48 | if not postrm: | ||
49 | postrm = '#!/bin/sh\n' | ||
50 | postrm += bb.data.getVar('mime_postrm', d, 1) | ||
51 | bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) | ||
52 | bb.note("adding freedesktop-mime-info dependency to %s" % pkg) | ||
53 | rdepends = explode_deps(bb.data.getVar('RDEPENDS_' + pkg, d, 0) or bb.data.getVar('RDEPENDS', d, 0) or "") | ||
54 | rdepends.append("freedesktop-mime-info") | ||
55 | bb.data.setVar('RDEPENDS_' + pkg, " " + " ".join(rdepends), d) | ||
56 | } | ||