Author Topic: GTK2 toolchain and rootfs released  (Read 7428 times)

batman52 (OP)

  • *
  • Posts: 111
GTK2 toolchain and rootfs released
« on: November 20, 2009, 10:39:53 pm »
EDIT:
I finally released a dingux toolchain for compiling GTK2 apps, and a rootfs. You can test the rootfs with gtkperf. You can find all in the downloads section.


http://code.google.com/p/dingux-code/


Good GTK coding!

P.S.: once again thanks to vimrc!

release thread here:

http://boards.dingoonity.org/dingux-releases/gtk2-toolchain-and-rootfs-released/


*****************************************

I am trying to compile GTK2 over dircetfb.

To compile tslib, autoconf and libtool are needed, so i have installed them on my ubuntu system:
Code: [Select]
sudo apt-get install autoconf libtool

the ingenic sources are available here:
ftp://ftp.ingenic.cn/3sw/01linux/05apps/gtk/gtk-directfb-jz.tar.bz2

after having unpacked the archive you can go to the scripts subdirectory and set the right prefix in the build script. The following libraries compile good out of the box:

- tslib      -> OK
- libxml2   -> OK
- freetype   -> OK
- fontconfig   -> OK
- directfb   -> OK

to compile them, go to the build subdir, then:
Code: [Select]
../script/build

Glib didn'tt work, so I have taken the version compiled by vimrc, as explained here:
http://boards.dingoonity.org/dingux-development/how-to-run-debian-mipsel-application-on-dingux-%28again-thanks-dan!%29/msg3297/#msg3297
the archive is here:
http://bossninja.googlepages.com/gettext_glib2.tar.bz2
unpack the package and merge with the toolchain

Code: [Select]
sudo apt-get install libglib2.0-dev

----> change prefix in /opt/mipsel-linux-uclibc/lib/pkgconfig/glib2.0.pc , gobject.pc , gmodule.pc, gmodule-export , gmodule-no-export, gthread
----> change paths in libglib.la libgobject.la libgmodule.la libgthread.la
- atk      -> OK

Code: [Select]
cp -r /opt/mipsel-linux-uclibc/usr/lib/pkgconfig /opt/mipsel-linux-uclibc/lib/

- cairo      -> OK

----> cp all files in /opt/mipsel-linux-uclibc/include/cairo to /include

I am stuck in compiling pango, getting a lot of undefined references of function contained in libpangocairo.so . In attachment the log of the make issues. In the other attachment, there are also the scripts i made to compile separately every single library (zip archive renamed to pdf). I  Hope someone can give me some good hint.
« Last Edit: December 25, 2009, 01:58:03 am by batman52 »

vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #1 on: November 21, 2009, 03:32:15 pm »
Nice work, i will try to pass the Pango.. Or we may need the help from that German guy.


vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #2 on: November 22, 2009, 04:45:15 pm »
Hi, batman52,

The problem is pango depends on the cairo, if you add the libcairo.so, you can kill these undefined references.

or you can simply get my complied cairo lib to pass it.
http://bossninja.googlepages.com/libcairo1.8.8.rar

It seems you miss the pixman?  For the pkg path, you can always use
Code: [Select]
export PKG_CONFIG_PATH=/opt/mipsel-linux-uclibc/usr/lib/pkgconfig/


Success!

« Last Edit: November 22, 2009, 04:55:10 pm by vimrc »

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #3 on: November 22, 2009, 05:00:07 pm »
Hi, batman52,

The problem is pango depends on the cairo, if you add the libcairo.so, you can kill these undefined references.

or you can simply get my complied cairo lib to pass it.
http://bossninja.googlepages.com/libcairo1.8.8.rar

It seems you miss the pixman?  For the pkg path, you can always use
Code: [Select]
export PKG_CONFIG_PATH=/opt/mipsel-linux-uclibc/usr/lib/pkgconfig/
Success!

Can't understand... I already compiled myself cairo, so i'm sure i don't need yours. Maybe it's a question of moving libcairo somewhere else? i am a bit clueless.

vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #4 on: November 22, 2009, 05:08:17 pm »
Oh, if you have cairo, it's easier. The following part is from your log:

mipsel-linux-gcc -g -O2 -Wall -o .libs/cairosimple cairosimple.o  -L/opt/mipsel-linux-uclibc/lib -L/opt/mipsel-linux-uclibc/usr/lib ../pango/.libs/libpango-1.0.so ../pango/.libs/libpangocairo-1.0.so /media/Data/dingoo/dingux/dev/gtk-directfb/build/pango-1.16.4/pango/.libs/libpangoft2-1.0.so ../pango/.libs/libpangoft2-1.0.so /media/Data/dingoo/dingux/dev/gtk-directfb/build/pango-1.16.4/pango/.libs/libpango-1.0.so /opt/mipsel-linux-uclibc/lib/libgobject-2.0.so /opt/mipsel-linux-uclibc/lib/libgmodule-2.0.so /opt/mipsel-linux-uclibc/lib/libglib-2.0.so /opt/mipsel-linux-uclibc/lib/libintl.so -lc /opt/mipsel-linux-uclibc/lib/libfontconfig.so /opt/mipsel-linux-uclibc//lib/libxml2.so -ldl /opt/mipsel-linux-uclibc/usr/lib/libiconv.so /opt/mipsel-linux-uclibc/lib/libfreetype.so -lz -lm -Wl,--rpath -Wl,/opt/mipsel-linux-uclibc/lib -Wl,--rpath -Wl,/opt/mipsel-linux-uclibc/usr/lib -Wl,--rpath -Wl,/opt/mipsel-linux-uclibc//lib

But this command missed the libcairo.so, so if you add it, like this:

mipsel-linux-gcc -g -O2 -Wall -o .libs/cairosimple cairosimple.o  -L/opt/mipsel-linux-uclibc/lib -L/opt/mipsel-linux-uclibc/usr/lib ../pango/.libs/libpango-1.0.so ../pango/.libs/libpangocairo-1.0.so /media/Data/dingoo/dingux/dev/gtk-directfb/build/pango-1.16.4/pango/.libs/libpangoft2-1.0.so ../pango/.libs/libpangoft2-1.0.so /media/Data/dingoo/dingux/dev/gtk-directfb/build/pango-1.16.4/pango/.libs/libpango-1.0.so /opt/mipsel-linux-uclibc/lib/libgobject-2.0.so /opt/mipsel-linux-uclibc/lib/libgmodule-2.0.so /opt/mipsel-linux-uclibc/lib/libglib-2.0.so /opt/mipsel-linux-uclibc/lib/libintl.so -lc /opt/mipsel-linux-uclibc/lib/libfontconfig.so /opt/mipsel-linux-uclibc//lib/libxml2.so  /opt/mipsel-linux-uclibc//lib/libcairo.so -ldl /opt/mipsel-linux-uclibc/usr/lib/libiconv.so /opt/mipsel-linux-uclibc/lib/libfreetype.so -lz -lm -Wl,--rpath -Wl,/opt/mipsel-linux-uclibc/lib -Wl,--rpath -Wl,/opt/mipsel-linux-uclibc/usr/lib -Wl,--rpath -Wl,/opt/mipsel-linux-uclibc//lib

You can kill the error. (:


Currently I am using the Pango from Openwrt, but it's very painful to compile it. I met hundreds of problems including this problem..., so I am sure you can use that way to pass it. Now I can compile it successfully but I am stuck by the "Make install", I guess I chose a bad version, maybe you can pass it.

It took me about 4 hours to kill the pango's problem, I have to go out and eat sth... (:
« Last Edit: November 22, 2009, 05:55:10 pm by vimrc »

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #5 on: November 22, 2009, 06:36:08 pm »
wow, it looks like i just had to add -lcairo to the config script!
Code: [Select]
#!/bin/sh

export SOURCE_PATH=/media/Data/dingoo/dingux/dev/gtk-directfb/source
export INSTALL_PATH=/opt/mipsel-linux-uclibc

export PKG_CONFIG_PATH=${INSTALL_PATH}/lib/pkgconfig
export CC=mipsel-linux-gcc

BUILDDIR=`pwd`

echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
echo "@@ building pango-1.16.4 ..."
echo "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"

# dependencies: glib, freetype, xml, cairo

cd ${BUILDDIR}
tar xjf ${SOURCE_PATH}/pango-1.16.4.tar.bz2
cd pango-1.16.4

sed -i -e 's/have_cairo=false/have_cairo=true/g' configure
sed -i -e 's/have_cairo_png=false/have_cairo_png=true/g' configure
sed -i -e 's/have_cairo_freetype=false/have_cairo_freetype=true/g' configure

./configure --prefix=${INSTALL_PATH} --host=mipsel-linux --without-x LDFLAGS="-L${INSTALL_PATH}/lib -lxml2 -lcairo"
make
make install

i am finally to the last step: GTK!

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #6 on: November 22, 2009, 06:56:53 pm »
i had to adda copy of libpng12.pc

Code: [Select]
cp  /opt/mipsel-linux-uclibc/usr/lib/pkgconfig/libpng12.pc  /opt/mipsel-linux-uclibc/lib/pkgconfig/

Then, still errors in compiling GTK...

Code: [Select]
mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Gdk-DirectFB\" -DGDK_COMPILATION -I../.. -I../../gdk -I../../gdk -DG_DISABLE_DEPRECATED -DG_DISABLE_CAST_CHECKS -pthread -D_REENTRANT -I/opt/mipsel-linux-uclibc/include/glib-2.0 -I/opt/mipsel-linux-uclibc/lib/glib-2.0/include -I/opt/mipsel-linux-uclibc/include/pango-1.0 -I/opt/mipsel-linux-uclibc//include/cairo -I/opt/mipsel-linux-uclibc/include/freetype2 -I/opt/mipsel-linux-uclibc/include -I/opt/mipsel-linux-uclibc/include/directfb -I/usr/include/libpng12 -D_REENTRANT -I/opt/mipsel-linux-uclibc//include/cairo -I/opt/mipsel-linux-uclibc/include/directfb -I/opt/mipsel-linux-uclibc/include/freetype2 -I/opt/mipsel-linux-uclibc/include -I/usr/include/libpng12 -I/opt/mipsel-linux-uclibc/include -Wall -MT gdkdrawable-directfb.lo -MD -MP -MF .deps/gdkdrawable-directfb.Tpo -c gdkdrawable-directfb.c  -fPIC -DPIC -o .libs/gdkdrawable-directfb.o
gdkdrawable-directfb.c: In function 'gdk_directfb_draw_arc':
gdkdrawable-directfb.c:479: error: expected ')' before 'G_GNUC_FUNCTION'
gdkdrawable-directfb.c: In function 'gdk_directfb_draw_text':
gdkdrawable-directfb.c:563: error: expected ')' before 'G_GNUC_FUNCTION'
gdkdrawable-directfb.c: In function 'gdk_directfb_draw_text_wc':
gdkdrawable-directfb.c:575: error: expected ')' before 'G_GNUC_FUNCTION'
make[4]: *** [gdkdrawable-directfb.lo] Errore 1
make[4]: uscita dalla directory «/media/Data/dingoo/dingux/dev/gtk-directfb/build/gtk+-2.10.14/gdk/directfb»
make[3]: *** [all-recursive] Errore 1
make[3]: uscita dalla directory «/media/Data/dingoo/dingux/dev/gtk-directfb/build/gtk+-2.10.14/gdk»
make[2]: *** [all] Errore 2
make[2]: uscita dalla directory «/media/Data/dingoo/dingux/dev/gtk-directfb/build/gtk+-2.10.14/gdk»
make[1]: *** [all-recursive] Errore 1
make[1]: uscita dalla directory «/media/Data/dingoo/dingux/dev/gtk-directfb/build/gtk+-2.10.14»
make: *** [all] Errore 2

vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #7 on: November 22, 2009, 07:06:01 pm »
Cool, just use:
G_STRLOC instead of the G_GNUC_FUNCTION

sth like this:
Code: [Select]
WARN_UNIMPLEMENTED (G_STRLOC);
we can pass this error!

I found my pango has several problems, let me know if you compile the GTK successfully. I guess
I chose a wrong version.
« Last Edit: November 22, 2009, 07:08:13 pm by vimrc »

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #8 on: November 22, 2009, 07:11:39 pm »
sorry... but i'm really a noob...
where am i supposed to set that define?

you can easily download the one from ingenic, too if you like...

EDIT: forget it, i found
I had to apply that change in: gdk/directfb/gdkdrawable-directfb.c, gdk/directfb/gdkimage-directfb.c
« Last Edit: November 22, 2009, 07:20:28 pm by batman52 »

vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #9 on: November 22, 2009, 09:55:38 pm »
Yes, I just use find/replace to pass this error. :)

@batman52:
I just downloaded the gtk package from Ingenic, recompiled the pango and get the GTK2 finally...

I don't know how to set the DirectFB in Dingux, currently I met the same problem as in Mplayer:
DirectFB can't find the necessary library file. ): Hope someone can help me to solve it.

Code: [Select]
/boot/local/apps/gtkapp # ./gtkperf
commandline read: gtkperf

   ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.2 |~~~~~~~~~~~~~~~~~~~~~~~~~~
        (c) 2001-2009  The world wide DirectFB Open Source Community
        (c) 2000-2004  Convergence (integrated media) GmbH
      ----------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2009-11-22 21:58)
systems
(!) DirectFB/core/system: No system found!
(#) DirectFBError [gdk_display_open: DirectFBCreate]: No (suitable) implementation found!

(gtkperf:3549): Gtk-WARNING **: cannot open display:


Update:

I found a temporary solution! Because DirectFB always looks for the necessary libraries in the same directory as your host PC. However I can't create /opt/ in Dingux, so alternatively I created the /boot/local/apps/gtkapp/ in my pc, then compile the DirectFB using:

Code: [Select]
./configure --prefix=/boot/local/apps/gtkapp/ --host=mipsel-linux --target=mipsel-linux --disable-x11 --disable-osx --with-gfxdrivers=none --with-inputdrivers=keyboard,linuxinput CFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib"
Now I can run the gtkref in Dingux successfully.  :D Post a figure by fbgrab here (currently I haven't set any font, so...) The speed is fast, you can try it.  

The complied file is attached (As concerned before, please put files in /local/apps/gtkapp/, or DirectFB won't work. You also need to export LD_LIBRARY_PATH=/boot/local/apps/gtkapp/ )

http://bossninja.googlepages.com/gtkapp.rar

I will upload the Dingux toolchain with GTK2+ later if necessary.
« Last Edit: November 23, 2009, 11:46:20 am by vimrc »

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #10 on: November 23, 2009, 07:30:30 am »
wow! It's very good news! You really, really, really rock!
I think that we have to automate the building script now, in order to make it easier to replicate this. I have an important meeting today, so i think i can work on it tomorrow.

BTW: i am not sure i understood correctly but could the directfb issue solve problems with osd in mplayer too? Why you say you can't create the /opt folder? it's just a question of modify the rootfs as far as i can understand.

I feel really happy with this! ^_^

vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #11 on: November 23, 2009, 09:20:40 am »
@batman52,

It's true, I think directfb should work in Mplayer but I am not sure if it's helpful for the OSD... Let me try.
Yep, it's a good idea to modify the rootfs, but I think it's better to create a /lib/gtklib/ as the timidity
library without changing the default rootfs.

All the libraries except pango and gtk+ are from Openwrt:

atk-1.22.0
directFB-1.4.2
freetype-2.3.9
glib-2.22.2
cairo-1.8.8
fontconfig-2.6.0
gettext-0.16.1
libxml2-2.7.5
pixman-0.16.2

Pango and GTK+ are from Ingenic (tslib is not necessary, only useful for touchscreen devices):

Pango 1.16.4
GTK+2.10.14

At the current stage, I am focusing on the fonts...and the Mplayer. Let's discuss it here if there is any
problem.
« Last Edit: November 23, 2009, 10:35:18 am by vimrc »

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #12 on: November 23, 2009, 11:59:50 am »
Yep, it's a good idea to modify the rootfs, but I think it's better to create a /lib/gtklib/ as the timidity
library without changing the default rootfs.

But how do we do with symlinks? We should make a script to mount a romfs with gtk libs before launching avery single GTK app: i feel like it wouldn't be very comfortable.

It looks like (if we get it working alright) it would be better to include it all into the default rootfs, let's ask booboo too anyway.
« Last Edit: November 23, 2009, 12:01:41 pm by batman52 »

mirco

  • Guest
Re: Compiling GTK2 over directFB [WiP]
« Reply #13 on: November 23, 2009, 12:05:37 pm »
Hey.

I'm curious - why are you using exactly these versions of software? They seem to be quite outdated.

I made it done within OpenWrt a few weeks ago with quite recent versions (ok, gtk 2.17.0 is not the latest, because in more recent versions directfb-suoport is broken - however it's quite more recent than what you are / ingenic is using).
Maybe some of the patches I created may be useful for your tasks.
It's working well on the Ben NanoNote of qi which is also having an ingenic chip inside.

The article I wrote is published here: http://nanl.de/blog/2009/10/gtk2-running-on-top-of-directfb-on-openwrt/

The font problem you have results of missing fonts or a missing font-cache which can be created manually with fc-cache.
« Last Edit: November 23, 2009, 12:16:51 pm by mirco »

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #14 on: November 23, 2009, 12:15:41 pm »
@mirco:
our discussion rise again after having read your article  ^_^.

I started fron the ingenic sources, because... it was the only that i knew should have worked.  The ingenic stuff i used anyway is slightly different from what used vimrc.

I still haven't looked at openwrt things because i still can't use svn. Maybe you're right we shold switch to it if it works (no more need of flaky support by ingenic).

mirco

  • Guest
Re: Compiling GTK2 over directFB [WiP]
« Reply #15 on: November 23, 2009, 12:17:44 pm »
@mirco:
our discussion rise again after having read your article  ^_^.

I started fron the ingenic sources, because... it was the only that i knew should have worked.  The ingenic stuff i used anyway is slightly different from what used vimrc.

I still haven't looked at openwrt things because i still can't use svn. Maybe you're right we shold switch to it if it works (no more need of flaky support by ingenic).


ah, ok - sorry :)

vimrc

  • *
  • Posts: 66
Re: Compiling GTK2 over directFB [WiP]
« Reply #16 on: November 23, 2009, 12:23:59 pm »
@mirco,

Fancy to meet you here! I met several annoying problems when I compiled the latest pango, so I downgraded
its version to pass these error, just wanna know if my direction was right. Yes, now we have known gtk+ works
well, I will try to upgrade its version anyway.  (:

@batman52,

I agree with you. Maybe fbreader is promising to attract others into the GTK+ world. (;

Berticus

  • Guest
Re: Compiling GTK2 over directFB [WiP]
« Reply #17 on: November 24, 2009, 04:32:54 am »
Next, a port of apvlv or zathura (vim-like pdf readers)?

batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #18 on: November 24, 2009, 08:09:50 am »
Next, a port of apvlv or zathura (vim-like pdf readers)?

I think it's still a bit early for requests.

I believe the next step is to automate the compilation of GTK (I'll start working on it this eve).
BTW: i'll try using openwrt sources with mirco's patches.

Then, we can release the GTK toolchain (that hopefully will be integrated into the dingux default one).
When this will be achieved, everyone could start port his favourite application.

@Berticus: I'll start with FBreader, because in my experience i find that ebook formats are more suited for small-screen devices like the dingoo. With most pdf you would have to continuosly pan-scan the screen, that is very uncomfortable. Nevertheless i think that a pdf reader is a precious tool, so it's in my whishlist too. Anyway there is a plenty of software tools suited to convert pdf-to-anything, most notably calibre (http://calibre.kovidgoyal.net/).



batman52 (OP)

  • *
  • Posts: 111
Re: Compiling GTK2 over directFB [WiP]
« Reply #19 on: November 26, 2009, 04:54:02 pm »
@vimrc:
preface - it is the very first time i use svn -

i am tryng to sync with openwrt sources, referring to the "tutorial" you posted here:
http://boards.dingoonity.org/dingux-development/how-to-run-debian-mipsel-application-on-dingux-%28again-thanks-dan!%29/msg3297/#msg3297

well, after having downloaded the /trunk and /package trees you say to
" Include the "rule.mk" in the trunk directory "

but i can't find any rule.mk file... where is it supposed to be?
EDIT:  i found it is in the /trunk directory

Ok. I started copile again everything starting from openwrt sources. I used glib with vimrc patches, but i'm getting these errors:
Code: [Select]
libtool: compile:  mipsel-linux-gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../glib -DG_LOG_DOMAIN=\"GLib\" -DG_DISABLE_CAST_CHECKS -DG_DISABLE_DEPRECATED -DGLIB_COMPILATION -DG_DISABLE_SINGLE_INCLUDES -pthread -g -O2 -Wall -MT vasnprintf.lo -MD -MP -MF .deps/vasnprintf.Tpo -c vasnprintf.c  -fPIC -DPIC -o .libs/vasnprintf.o
vasnprintf.c: In function '_g_gnulib_vasnprintf':
vasnprintf.c:580: error: 'MB_CUR_MAX' undeclared (first use in this function)
vasnprintf.c:580: error: (Each undeclared identifier is reported only once
vasnprintf.c:580: error: for each function it appears in.)
make[4]: *** [vasnprintf.lo] Errore 1
make[4]: uscita dalla directory «/media/Data/dingoo/dingux/dev/openwrt/trunk/build_dir/target-_-/glib-2.22.2/glib/gnulib»
make[3]: *** [all-recursive] Errore 1
make[3]: uscita dalla directory «/media/Data/dingoo/dingux/dev/openwrt/trunk/build_dir/target-_-/glib-2.22.2/glib»
make[2]: *** [all] Errore 2
make[2]: uscita dalla directory «/media/Data/dingoo/dingux/dev/openwrt/trunk/build_dir/target-_-/glib-2.22.2/glib»
make[1]: *** [all-recursive] Errore 1
make[1]: uscita dalla directory «/media/Data/dingoo/dingux/dev/openwrt/trunk/build_dir/target-_-/glib-2.22.2»
make: *** [all] Errore 2

The same error is reported here:

http://blackfin.uclinux.org/gf/project/toolchain/forum/?_forum_action=ForumMessageBrowse&thread_id=23408&action=ForumBrowse&forum_id=44


other hints here:

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=69004&start=0

but to be honest i didn't understand much.

EDIT:  I must be some kind of stupid. For some script-ish reason I simply wasn't applying the patches provided by vimrc.
« Last Edit: December 02, 2009, 01:40:02 pm by batman52 »

 

Post a new topic
Post a new topic