Re: Volunteers for wrapping new API?




On Jan 9, 2009, at 4:09 PM, Emmanuel Rodriguez wrote:

I can give it a try as the weekend is arriving and it's cold outside
;) I don't have the most recent version of GTK nor perl Gtk2. I'm
using the stock versions provided by Ubuntu 7.10, which is not even
the most recent Ubuntu! I have a few questions:

I hope that this is the right way for sending the patches for the next
release of Gtk2. I will reply to the best of my knowledge to my own
questions, please correct me if there's a better answer. I hope that
this will help all new comers willing to contribute.

Yes, please send patches to the list for review and discussion. And do not be offended by critique. ;-)


What's the URL for perl Gtk2 trunk?

svn co http://svn.gnome.org/svn/perl-Gtk2/trunk

Installing the following modules from SVN might help to build the latest Gtk2:
http://svn.gnome.org/svn/perl-Glib/trunk
http://svn.gnome.org/svn/perl-Pango/trunk

In Ubuntu/Debian I had to install the modules this way:
perl Makefile.PL INSTALLDIRS=vendor && make && sudo make install PREFIX=/usr

Nooooo!   (see below)


It's a pity because this will install the newest version over the
existing one. But it should be possible to reinstall the original
version of the OS with :
sudo apt-get install libglib-perl libgtk2-perl --reinstall

What's the best way for installing the newest Gtk2 and all it's dependencies?

I tried to use jhbuild but it didn't work, so I had to install the
Gtk2 libraries over the existing ones :(

NnnnnnooooooooooooooooooooooooooooOOOOOooooooooooo......

jhbuild is recommended. You very much want to be able to distinguish between your stable distro gtk+ and the unstable development version. Be warned, it takes a long time to bootstrap with jhbuild.

The README in each gtk2-perl module's tarball or svn checkout has this to say about installing development versions in a non-standard place:

To avoid installing to a system directory, since this is a beta release,
you can change the installation prefix at Makefile.PL time with

   perl Makefile.PL PREFIX=/some/other/place

This will install the module to the subdirectory lib/perl5 under the given prefix. If this is not already in perl's include path, you'll need to tell perl how to get to this library directory so you can use it; there are three
ways:

  in your environment (the easiest):
    # assuming a bourne-style shell
    PERL5LIB=/some/other/place/lib/perl5/site_perl
    export PERL5LIB

  on the perl command line:
    perl -I /some/other/place/lib/perl5/site_perl yourscript

  in the code of your perl script:
    use lib '/some/other/place/lib/perl5/site_perl';



I install the perl modules to the same sandbox root i use for my jhbuild install -- $HOME/sandboxes/gnomesvn -- and when i need to work with that sandbox, i source a script that sets up my shell's environment for that sandbox. You can also use "jhbuild shell".


To compile and test it's faster to specify the files to build than to
do "make". Calling make without arguments will rebuild everything, at
least it did so on my system. That's very long and annoying. Instead,
for faster results do this:

 make xs/GtkCellView.c xs/GtkCellView.o blib/arch/auto/Gtk2/Gtk2.so

Typing "make" with no arguments will build the default target, "all", which includes the docs. If you just say

   make blib/arch/auto/Gtk2/Gtk2.so

then make will take care of rerunning xsubpp and compiling the necessary stuff.


Test the patch "make test" or run the test directly:

 perl -Iblib/lib -Iblib/arch t/GtkCellView.t

This is easier with -Mblib, e.g.

   perl -Mblib t/GtkCellView.t



Since we support all stable versions, your new support needs to be made conditional. There are a few classes of this:

1. in XS and C code, new symbols are wrapped in #if GTK_CHECK_VERSION(...) for the version of gtk+ in which the symbol was introduced. It's best to go by the @since tags in the gtk-doc for the new function over in the gtk+ source.

2. in perl and .t code, tests for new symbols go into SKIP blocks, conditional on the gtk+ version in which the symbol was added.

Look around at several other files, and you'll see the convention we use.




--
Well done, Android. Aperture Science reminds you that Android Hell is a real place, and you will be sent there at the first sign of defiance.
   -- GlaDOS




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]