Merge bk://openembedded@openembedded.bkbits.net/packages
[vuplus_openembedded] / gtk+ / gtk+_2.2.4.oe
1 DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
2 set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
3 HOMEPAGE = "http://www.gtk.org"
4 SECTION = "libs"
5 PRIORITY = "optional"
6 MAINTAINER = "Philip Blundell <pb@handhelds.org>"
7 RDEPENDS = "pango atk jpeg libpng xext"
8 DEPENDS = "pango atk jpeg libpng xext"
9
10 SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.2/gtk+-${PV}.tar.bz2 \
11            http://handhelds.org/packages/gtk-2.0/gtk+-2.2.4.diff.bz2;patch=1;pnum=1 \
12            file://${FILESDIR}/automake-lossage.patch;patch=1;pnum=0 \
13            file://${FILESDIR}/configure-lossage.patch;patch=1;pnum=0 \
14            file://${FILESDIR}/no-demos.patch;patch=1 \
15            file://${FILESDIR}/libtool-lossage.patch;patch=1;pnum=0 \
16            file://${FILESDIR}/no-xwc.patch;patch=1;pnum=0"
17
18 inherit autotools libtool pkgconfig
19
20 do_configure_prepend() {
21         install -d m4
22         install ${FILESDIR}/glib-2.0.m4 m4/
23         install ${FILESDIR}/glib-gettext.m4 m4/
24 }
25
26 EXTRA_OECONF = "--without-libtiff --enable-debug=no --disable-cruft"
27
28 SOV = "0.200.4"
29 LIBV = "2.2.0"
30
31 gtk_include = "gtk.h gtkaccelgroup.h gtkaccellabel.h gtkaccelmap.h gtkaccessible.h gtkadjustment.h gtkalignment.h gtkarrow.h gtkaspectframe.h gtkbbox.h gtkbin.h gtkbindings.h gtkbox.h gtkbutton.h gtkcalendar.h gtkcelleditable.h gtkcellrenderer.h gtkcellrendererpixbuf.h gtkcellrenderertext.h gtkcellrenderertoggle.h gtkcheckbutton.h gtkcheckmenuitem.h gtkclipboard.h gtkclist.h gtkcolorsel.h gtkcolorseldialog.h gtkcombo.h gtkcontainer.h gtkctree.h gtkcurve.h gtkdebug.h gtkdialog.h gtkdnd.h gtkdrawingarea.h gtkeditable.h gtkentry.h gtkenums.h gtkeventbox.h gtkfilesel.h gtkfixed.h gtkfontsel.h gtkframe.h gtkgamma.h gtkgc.h gtkhandlebox.h gtkhbbox.h gtkhbox.h gtkhpaned.h gtkhruler.h gtkhscale.h gtkhscrollbar.h gtkhseparator.h gtkiconfactory.h gtkimage.h gtkimagemenuitem.h gtkimcontext.h gtkimcontextsimple.h gtkimmodule.h gtkimmulticontext.h gtkinputdialog.h gtkinvisible.h gtkitem.h gtkitemfactory.h gtklabel.h gtklayout.h gtklist.h gtklistitem.h gtkliststore.h gtkmain.h gtkmarshal.h gtkmenu.h gtkmenubar.h gtkmenuitem.h gtkmenushell.h gtkmessagedialog.h gtkmisc.h gtknotebook.h gtkobject.h gtkoldeditable.h gtkoptionmenu.h gtkpaned.h gtkpixmap.h gtkplug.h gtkpreview.h gtkprivate.h gtkprogress.h gtkprogressbar.h gtkradiobutton.h gtkradiomenuitem.h gtkrange.h gtkrc.h gtkruler.h gtkscale.h gtkscrollbar.h gtkscrolledwindow.h gtkselection.h gtkseparator.h gtkseparatormenuitem.h gtksettings.h gtksignal.h gtksizegroup.h gtksocket.h gtkspinbutton.h gtkstatusbar.h gtkstock.h gtkstyle.h gtktable.h gtktearoffmenuitem.h gtktext.h gtktextbuffer.h gtktextchild.h gtktextdisplay.h gtktextiter.h gtktextlayout.h gtktextmark.h gtktexttag.h gtktexttagtable.h gtktextview.h gtktipsquery.h gtktogglebutton.h gtktoolbar.h gtktooltips.h gtktree.h gtktreednd.h gtktreeitem.h gtktreemodel.h gtktreemodelsort.h gtktreeselection.h gtktreesortable.h gtktreestore.h gtktreeview.h gtktreeviewcolumn.h gtktypebuiltins.h gtktypeutils.h gtkvbbox.h gtkvbox.h gtkversion.h gtkviewport.h gtkvpaned.h gtkvruler.h gtkvscale.h gtkvscrollbar.h gtkvseparator.h gtkwidget.h gtkwindow.h"
32 gdk_include = "gdk.h gdkcolor.h gdkcursor.h gdkdisplay.h gdkdisplaymanager.h gdkdnd.h gdkdrawable.h gdkenumtypes.h gdkevents.h gdkfont.h gdkgc.h gdki18n.h gdkimage.h gdkinput.h gdkkeys.h gdkkeysyms.h gdkpango.h gdkpixbuf.h gdkpixmap.h gdkprivate.h gdkproperty.h gdkregion.h gdkrgb.h gdkscreen.h gdkselection.h gdktypes.h gdkvisual.h gdkwindow.h x11/gdkx.h"
33 gdk_pixbuf_include = "gdk-pixbuf-animation.h gdk-pixbuf-enum-types.h gdk-pixbuf-features.h gdk-pixbuf-io.h gdk-pixbuf-loader.h gdk-pixbuf-marshal.h gdk-pixbuf.h gdk-pixdata.h"
34
35 do_stage () {
36         oe_soinstall gtk/.libs/libgtk-x11-2.0.so.${SOV} ${STAGING_LIBDIR}/
37         install -m 0644 gtk/.libs/libgtk-x11-2.0.lai ${STAGING_LIBDIR}/libgtk-x11-2.0.la
38         install -m 0644 gtk/.libs/libgtk-x11-2.0.a ${STAGING_LIBDIR}/libgtk-x11-2.0.a
39
40         oe_soinstall gdk/.libs/libgdk-x11-2.0.so.${SOV} ${STAGING_LIBDIR}/
41         install -m 0644 gdk/.libs/libgdk-x11-2.0.lai ${STAGING_LIBDIR}/libgdk-x11-2.0.la
42         install -m 0644 gdk/.libs/libgdk-x11-2.0.a ${STAGING_LIBDIR}/libgdk-x11-2.0.a
43
44         oe_soinstall gdk-pixbuf/.libs/libgdk-pixbuf-x11-2.0.so.${SOV} ${STAGING_LIBDIR}/
45
46         oe_soinstall gdk-pixbuf/.libs/libgdk_pixbuf-2.0.so.${SOV} ${STAGING_LIBDIR}/
47         install -m 0644 gdk-pixbuf/.libs/libgdk_pixbuf-2.0.lai ${STAGING_LIBDIR}/libgdk_pixbuf-2.0.la
48         install -m 0644 gdk-pixbuf/.libs/libgdk_pixbuf-2.0.a ${STAGING_LIBDIR}/libgdk_pixbuf-2.0.a
49
50         mkdir -p ${STAGING_INCDIR}/gtk-2.0/gtk
51         for i in ${gtk_include}; do
52                 install -m 0644 gtk/$i ${STAGING_INCDIR}/gtk-2.0/gtk/$i
53         done
54
55         mkdir -p ${STAGING_INCDIR}/gtk-2.0/gdk
56         for i in ${gdk_include}; do
57                 install -m 0644 gdk/$i ${STAGING_INCDIR}/gtk-2.0/gdk/`basename $i`
58         done
59
60         mkdir -p ${STAGING_INCDIR}/gtk-2.0/gdk-pixbuf
61         for i in ${gdk_pixbuf_include}; do
62                 install -m 0644 gdk-pixbuf/$i ${STAGING_INCDIR}/gtk-2.0/gdk-pixbuf/$i
63         done
64
65         mkdir -p ${STAGING_LIBDIR}/gtk-2.0/include
66         install -m 0644 gdk/gdkconfig.h ${STAGING_LIBDIR}/gtk-2.0/include/gdkconfig.h
67
68         install -m 0644 m4macros/gtk-2.0.m4 ${STAGING_DIR}/share/aclocal/
69 }
70
71 python populate_packages_prepend () {
72         import string, os
73         def do_split(root, pattern, format, description, postinst):
74                 dvar = oe.data.getVar('D', d, 1)
75                 if not dvar:
76                         oe.error("D not defined")
77                         return
78
79                 packages = string.split(oe.data.getVar('PACKAGES', d, 1))
80                 if not packages:
81                         oe.error("PACKAGES not defined")
82                         return
83
84                 postinst = '#!/bin/sh\n' + postinst
85                 objs = os.listdir(dvar + root)
86                 mainpkg = packages[0]
87                 for o in objs:
88                         import re
89                         m = re.match(pattern, o)
90                         if not m:
91                                 continue
92                         on = m.group(1)
93                         pkg = format % on
94                         packages.append(pkg)
95                         oe.data.setVar('FILES_' + pkg, os.path.join(root, o), d)
96                         oe.data.setVar('RDEPENDS_' + pkg, mainpkg, d)
97                         oe.data.setVar('DESCRIPTION_' + pkg, description % on, d)
98                         oe.data.setVar('pkg_postinst_' + pkg, postinst, d)
99
100                 oe.data.setVar('PACKAGES', string.join(packages, ' '), d)
101
102         libdir = oe.data.getVar('libdir', d, 1)
103         if not libdir:
104                 oe.error("libdir not defined")
105                 return
106
107         gtk_libdir = os.path.join(libdir, "gtk-2.0", oe.data.getVar('LIBV', d))
108         loaders_root = os.path.join(gtk_libdir, 'loaders')
109         immodules_root = os.path.join(gtk_libdir, 'immodules')
110
111         do_split(loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', 'gdk-pixbuf-query-loaders > /etc/gtk-2.0/gdk-pixbuf.loaders')
112         do_split(immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', 'gtk-query-immodules > /etc/gtk-2.0/gtk.immodules')
113 }