Bug 42509

Summary: Support for building on Android
Product: Wocky Reporter: Alvaro Soliverez <alvaro.soliverez>
Component: GeneralAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium Keywords: patch
Version: git master   
Hardware: Other   
OS: other   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch to build on Android
Support for Android patch

Description Alvaro Soliverez 2011-11-02 05:17:40 UTC
Created attachment 53046 [details] [review]
Patch to build on Android

This patch enables building wocky on Android using Android NDK and androgenizer.

It adds new files needed by Android, and an additional target to Makefile that is used by androgenizer to generate the required Android makefiles
Comment 1 Will Thompson 2011-11-10 07:22:26 UTC
Comment on attachment 53046 [details] [review]
Patch to build on Android

Review of attachment 53046 [details] [review]:
-----------------------------------------------------------------

::: wocky/Makefile.am
@@ +244,5 @@
> +	 -:SOURCES $(handwritten_sources) $(built_sources) \
> +	 -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \
> +	 -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
> +	  -I$(abs_top_srcdir)/../libgcrypt/src \
> +	  -I$(abs_top_srcdir)/../libgpg-error/src \

Hrm, it depends on you happening to have libgcrypt's headers in some directory relative to this source directory?!
Comment 2 Alvaro Soliverez 2011-11-11 06:13:58 UTC
(In reply to comment #1)
> Comment on attachment 53046 [details] [review] [review]
> Patch to build on Android
> 
> Review of attachment 53046 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: wocky/Makefile.am
> @@ +244,5 @@
> > +	 -:SOURCES $(handwritten_sources) $(built_sources) \
> > +	 -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CFLAGS) \
> > +	 -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
> > +	  -I$(abs_top_srcdir)/../libgcrypt/src \
> > +	  -I$(abs_top_srcdir)/../libgpg-error/src \
> 
> Hrm, it depends on you happening to have libgcrypt's headers in some directory
> relative to this source directory?!

Yes, that's bad. Trying to fix it now.

Is it possible that there's a problem in the original build files? I don't see a dependency to libgcrypt, but the code won't build without it.
Comment 3 Alvaro Soliverez 2011-11-11 10:15:39 UTC
Created attachment 53417 [details] [review]
Support for Android patch

I fixed the hardcoded paths
Comment 4 Will Thompson 2011-11-14 04:54:33 UTC
(In reply to comment #2)
> Is it possible that there's a problem in the original build files? I don't see
> a dependency to libgcrypt, but the code won't build without it.

Possibly. Presumably it comes from:

  ./wocky/wocky-tls.c:#include <gcrypt.h>

GnuTLS depends on gcrypt, so Wocky does transitively depend on it when built against GnuTLS.
Comment 5 Alvaro Soliverez 2011-11-14 12:15:22 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > Is it possible that there's a problem in the original build files? I don't see
> > a dependency to libgcrypt, but the code won't build without it.
> 
> Possibly. Presumably it comes from:
> 
>   ./wocky/wocky-tls.c:#include <gcrypt.h>
> 
> GnuTLS depends on gcrypt, so Wocky does transitively depend on it when built
> against GnuTLS.

Yes, I found it. It looks like Android NDK does not manage this kind of transitive dependency very well. It is fixed in the above patch.
Comment 6 Will Thompson 2011-11-15 07:26:31 UTC
Comment on attachment 53417 [details] [review]
Support for Android patch

Review of attachment 53417 [details] [review]:
-----------------------------------------------------------------

Looks good!
Comment 7 Will Thompson 2011-11-22 09:38:28 UTC
http://cgit.freedesktop.org/wocky/commit/?id=16281498c3613e237b4096ee99789f80d02076c8 (forgot to include this in the message closing the bug, sorry)

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.