Bug 4605 - (Maemo-GTk) Option " --with-maemo-gtk=no" breaks libhildon build and that option is not well-documented
(Maemo-GTk)
: Option " --with-maemo-gtk=no" breaks libhildon build and that option is not w...
Status: NEW
Product: Desktop platform
hildon-widgets
: 5.0-beta2
: x86 Linux
: Low major with 1 vote (vote)
: ---
Assigned To: Claudio Saavedra
: hildon-libs-bugs
: http://maemo.org/api_refs/5.0/beta/hi...
: docs, patch
:
:
  Show dependency tree
 
Reported: 2009-06-01 07:28 UTC by Kirtika Ruchandani
Modified: 2010-06-24 14:59 UTC (History)
6 users (show)

See Also:


Attachments
updated patch (19.99 KB, patch)
2009-09-22 11:52 UTC, Claudio Saavedra
Details
Move HildonSizeType to hildon-compat.h (4.79 KB, patch)
2009-09-22 15:09 UTC, Alberto Garcia Gonzalez
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description Kirtika Ruchandani (reporter) 2009-06-01 07:28:24 UTC
SOFTWARE VERSION: libhildon-2.1.62 [From the Maemo Fremantle repository]
[http://repository.maemo.org/pool/fremantle/free/libh/libhildon/libhildon_2.1.62-1+0m5.tar.gz]

STEPS TO REPRODUCE THE PROBLEM: 
Just a normal build : did a ./autogen.sh passing --with-maemo-gtk=no
Compilation fails at hildon-gtk.h because definition of HildonSizeType has been
moved to Maemo-Gtk+ headers.
This option is mentioned at 
http://maemo.org/api_refs/5.0/beta/hildon/hildon-building.html 
but it would be great if there was some explanation on what this option
does-i.e what is the implication of building without maemo-gtk support ? 
[gtk+ package is broken too and uses some arcane version of autotools(there are
patches but officially on the maemo repo),so that gives the user a strong
reason to try hildon without maemo-gtk]



REPRODUCIBILITY: Always

EXTRA SOFTWARE INSTALLED:

OTHER COMMENTS: 
1. Related issues here:
a. https://bugs.maemo.org/show_bug.cgi?id=4462
b. all discussions on Hildon definitions being moved under "maemo-gtk changes"
in gtk+


User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.10)
Gecko/2009042523 Ubuntu/8.10 (intrepid) Firefox/3.0.10
Comment 1 Kirtika Ruchandani (reporter) 2009-06-01 09:43:38 UTC
oops.. that should have been "but *not* officially on the maemo repo"
Comment 2 Murray Cumming 2009-06-02 12:20:21 UTC
What's the actual build error?
Comment 3 Kirtika Ruchandani (reporter) 2009-06-02 12:50:19 UTC
Build failure log here :
http://pastebin.com/f198d8167
It is unable to recognize HildonSizeType because it is defined in gtk+
headers,AFAIK.


Just in case someone wants the log here:

/bin/sh ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..
-DG_LOG_DOMAIN=\"hildon-1\" -DLOCALEDIR=\"/usr/local/share/locale\"  
-I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
-I/usr/local/include -I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/pango-1.0 -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/libpng12   -pthread -DORBIT2=1 -I/usr/local/include/glib-2.0
-I/usr/local/lib/glib-2.0/include -I/usr/include/gconf/2
-I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include   
-D_REENTRANT   -g -O2 -DG_DISABLE_ASSERT -Wall -Wmissing-prototypes
-Wmissing-declarations -Wno-format    -MT
libhildon_1_la-hildon-touch-selector.lo -MD -MP -MF
.deps/libhildon_1_la-hildon-touch-selector.Tpo -c -o
libhildon_1_la-hildon-touch-selector.lo `test -f 'hildon-touch-selector.c' ||
echo './'`hildon-touch-selector.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"hildon-1\"
-DLOCALEDIR=\"/usr/local/share/locale\" -I/usr/local/include/gtk-2.0
-I/usr/local/lib/gtk-2.0/include -I/usr/local/include/glib-2.0
-I/usr/local/lib/glib-2.0/include -I/usr/local/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/pixman-1
-I/usr/include/freetype2 -I/usr/include/libpng12 -pthread -DORBIT2=1
-I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include
-I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/dbus-1.0
-I/usr/lib/dbus-1.0/include -D_REENTRANT -g -O2 -DG_DISABLE_ASSERT -Wall
-Wmissing-prototypes -Wmissing-declarations -Wno-format -MT
libhildon_1_la-hildon-touch-selector.lo -MD -MP -MF
.deps/libhildon_1_la-hildon-touch-selector.Tpo -c hildon-touch-selector.c 
-fPIC -DPIC -o .libs/libhildon_1_la-hildon-touch-selector.o
In file included from hildon-touch-selector.c:170:
hildon-gtk.h:28: error: expected ‘)’ before ‘size’
hildon-gtk.h:31: error: expected ‘)’ before ‘size’
hildon-gtk.h:34: error: expected ‘)’ before ‘size’
hildon-gtk.h:38: error: expected ‘)’ before ‘size’
make[2]: *** [libhildon_1_la-hildon-touch-selector.lo] Error 1
make[2]: Leaving directory
`/home/oespirit/GSoC/maemo/packages/sources/libhildon-2.1.62/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/home/oespirit/GSoC/maemo/packages/sources/libhildon-2.1.62'
make: *** [all] Error 2
oespirit@rkirti:~/GSoC/maemo/packages/sources/libhildon-2.1.62$
Comment 4 Andre Klapper maemo.org 2009-06-02 15:09:57 UTC
Thanks for reporting this.
For future reference, please use the template.

STEPS TO REPRODUCE THE PROBLEM: 
1. fakeroot apt-get install gtk-doc-tools
   (to not get complaints about missing gtk-doc)
2. fakeroot apt-get source libhildon
3. cd libhildon-2.1.62
4. ./autogen.sh --with-maemo-gtk=no

> ACTUAL OUTCOME:
> Compilation fails at hildon-gtk.h because definition of HildonSizeType has 
> been moved to Maemo-Gtk+ headers.

After my four steps, I ran configure, make and make install without problems.
I cannot reproduce this. Do you have any other flags set, or other (newer)
stuff compiled from source that's not the default SDK beta shipped stuff?

> [gtk+ package is broken too and uses some arcane version of autotools
> (there are patches but officially on the maemo repo),so that gives the 
> user a strong reason to try hildon without maemo-gtk]

Can you file a separate bug report about this and explain exact steps to
reproduce, please?
Comment 5 Murray Cumming 2009-06-02 15:16:31 UTC
> 4. ./autogen.sh --with-maemo-gtk=no
> 
> > ACTUAL OUTCOME:
> > Compilation fails at hildon-gtk.h because definition of HildonSizeType has 
> > been moved to Maemo-Gtk+ headers.
> 
> After my four steps, I ran configure, make and make install without problems.

That's because you have the maemo version of GTK+ installed. This is about
building hildon without the modified GTK+, probably without the Maemo SDK and
outside of scratchbox.
Comment 6 Kirtika Ruchandani (reporter) 2009-06-02 15:21:11 UTC
Murray Cumming is right. I did this after ensuring I had uninstalled my maemo
version of gtk+ and this build is outside scratchbox, since my work requires me
to compile hildon libs outside of scratchbox.
As to the bug-report, I will take care to stick to the template in the future.
Sorry about that.
Comment 7 Claudio Saavedra 2009-06-02 15:33:08 UTC
OK, this looks like a legitimate issue, I'll look into it.
Comment 8 Javier Jardón 2009-09-02 17:33:38 UTC
Also, I think that would be great some warning or error in "autogen.sh" when
detect that you don't have maemo-gtk installed.
Comment 9 Alberto Garcia Gonzalez 2009-09-21 19:53:13 UTC
Claudio, I think it would be great to have this for 2.2.0
Comment 10 Javier Jardón 2009-09-21 19:58:17 UTC
Also, there is a patch in debian to solve this:
http://git.debian.org/?p=pkg-maemo/libhildon.git;a=commit;h=36f981a4c9c66e306e97d5a16eaf925e7cea6eae

(I'm able to compile hildon outside the SDK with that patch)
Comment 11 Alberto Garcia Gonzalez 2009-09-21 20:01:14 UTC
(In reply to comment #10)
> Also, there is a patch in debian to solve this:

Yes, they reverted the change when we moved those definitions to maemo-gtk

The proper solution would need a few #ifdef's. Something like this:

https://garage.maemo.org/pipermail/hildon-devel/2009-June/000003.html
Comment 12 Claudio Saavedra 2009-09-22 11:52:52 UTC
Created an attachment (id=1373) [details]
updated patch

(In reply to comment #9)
> Claudio, I think it would be great to have this for 2.2.0
> 

I rewrote the patch to work with master's HEAD. I had to also disable the
HildonUIMode switching abilities from HildonTouchSelector (and removed the
property involved).

Some examples needed to be moved to the maemo-gtk examples section.

The one bit that bothers me is that we don't have anymore the hildon
implementation of the placeholder text in HildonEntry and HildonTextView. As
long as this is not in upstream GTK+, either we remove that API or we
reintroduce the hildon implementation. In the patch, I just removed the calls
to hildon_gtk_entry/text_view_set_placeholder_text().
Comment 13 Claudio Saavedra 2009-09-22 13:10:35 UTC
Another problem with this patch is the redefinition of enumerations present in
both maemo-gtk and non-maemo-gtk hildon, since glib-mkenums can't differentiate
between those defined conditionally and those not. For instance,
HILDON_TYPE_SIZE_TYPE is #ifdef'ed out in maemo-gtk hildon, but:

In file included from ../hildon/hildon-caption.h:30,
                 from ../hildon/hildon.h:31,
                 from hildon-insensitive-example.c:29:
../hildon/hildon-enum-types.h:56:1: warning: "HILDON_TYPE_SIZE_TYPE" redefined
In file included from /usr/include/gtk-2.0/gtk/gtktypeutils.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkobject.h:37,
                 from /usr/include/gtk-2.0/gtk/gtkwidget.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkcontainer.h:37,
                 from /usr/include/gtk-2.0/gtk/gtkbin.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkwindow.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkdialog.h:36,
                 from /usr/include/gtk-2.0/gtk/gtkaboutdialog.h:32,
                 from /usr/include/gtk-2.0/gtk/gtk.h:33,
                 from hildon-insensitive-example.c:28:
/usr/include/gtk-2.0/gtk/gtktypebuiltins.h:175:1: warning: this is the location
of the previous definition
Comment 14 Alberto Garcia Gonzalez 2009-09-22 13:20:32 UTC
(In reply to comment #13)
> Another problem with this patch is the redefinition of enumerations
> present in both maemo-gtk and non-maemo-gtk hildon, since
> glib-mkenums can't differentiate between those defined conditionally
> and those not.

I guess that one solution could be to move those definitions to a
separate header file and use conditionals in Automake to process it.
Comment 15 Alberto Garcia Gonzalez 2009-09-22 15:09:57 UTC
Created an attachment (id=1375) [details]
Move HildonSizeType to hildon-compat.h

Here's what I mean. To be applied on top of your patch.
Comment 16 Andre Klapper maemo.org 2010-04-26 11:00:56 UTC
Claudio, is there a chance to get in the patches in comment 12 and comment 15?
Comment 17 Andre Klapper maemo.org 2010-06-23 15:11:26 UTC
Claudio, is there a chance to get in the patches in comment 12 and comment 15?
Comment 18 Claudio Saavedra 2010-06-23 23:18:25 UTC
I'm looking into this. To be honest, the results will need quite some work and
input from people using hildon with a stock GTK+ before this bug can be
considered fixed, so I'll push the changes to a branch in gitorious. Whether
this is merged into master will solely depend on someone stepping in and at
least giving it some feedback, and preferrable, some hands on.
Comment 19 Claudio Saavedra 2010-06-24 14:59:30 UTC
I pushed all changes required for hildon to compile with --with-maemo-gtk=no
and GTK+ 2 to a stock-gtk branch in gitorious[1]. Runtime issues are still
there (like warnings for signals that exist only in maemo GTK+), and some
widgets might not work very nicely, but there you have it.

This will be merged when/if it is usable and useful outside Maemo 5 with a
stock GTK+. Your contributions appreciated.

[1] http://maemo.gitorious.org/hildon/hildon/commits/stock-gtk