Preview of some introspection stuff



Aloha,

for people who feel like living on the bleeding edge, here's a preview
of Glib::Object::Introspection, a wrapper for the gobject-introspection
library, and PDF::Poppler, a binding for libpoppler-glib.so written in
pure Perl.

It's not exactly trivial to get this going, so here's a step-by-step
guide.

First, you need Poppler.  It's best to build it with jhbuild, so you
need that too.  I have jhbuild setup to install from the gnome-2.12
moduleset, into /home/torsten/opt/gnome.

  $ jhbuild poppler

Get into a jhbuild shell for a sane environment:

  $ jhbuild shell

Then you need libffi, which is required by gobject-introspection.  There
are some tarballs of libffi floating around, but I used gcc's CVS
repository:

  $ cvs -d:ext:anoncvs savannah gnu org:/cvsroot/gcc -qz9 checkout -P gcc

Now configure gcc, but don't build it:

  $ cd gcc
  $ ./configure --prefix /home/torsten/opt/gnome

Instead, go into the libffi sub directory and configure, build and
install it.  I had to apply the attached libffi-configure.patch first.

  $ cd libffi
  $ patch -p0 < ~/libffi-configure.patch
  $ ./configure --prefix /home/torsten/opt/gnome
  $ make install

You'll also need a pkg-config file for libffi.  I used the attached
libffi.pc:

  $ cp ~/libffi.pc /home/torsten/opt/gnome/lib/pkgconfig

Now you can checkout gobject-introspection:

  $ cvs -d :pserver:anonymous anoncvs gnome org:/cvs/gnome co gobject-introspection

Apply the attached gobject-introspection.patch and build and install:

  $ cd gobject-introspection
  $ patch -p0 < ~/gobject-introspection.patch
  $ ./autogen.sh --prefix /home/torsten/opt/gnome
  $ make install

Finally, build the Perl modules:

  $ tar xvzf Glib-Object-Introspection-0.01.tar.gz
  $ cd Glib-Object-Introspection-0.01/
  $ perl Makefile.PL PREFIX=/home/torsten/opt/perl
  $ make all test install

  $ tar xvzf PDF-Poppler-0.01.tar.gz
  $ cd PDF-Poppler-0.01/
  $ perl Build.PL install_base=/home/torsten/opt/perl
  $ ./Build
  $ ./Build test
  $ ./Build install

That should be it.  For a little example PDF viewer, use:

  $ perl examples/viewer.pl t/test.pdf

Unfortunately, you'll have to always be in PDF-Poppler-0.01/ for
anything to work, because otherwise the needed data/poppler.raw will not
be found.  If anyone has some insights into how to install data files,
I'd appreciate any advise.

If anything doesn't work for you, I'd like to know about it too.

-- 
Have fun,
-Torsten

Attachment: libffi-configure.patch
Description: Text Data

Attachment: libffi.pc
Description: Text document

Attachment: gobject-introspection.patch
Description: Text Data

Attachment: Glib-Object-Introspection-0.01.tar.gz
Description: application/compressed-tar

Attachment: PDF-Poppler-0.01.tar.gz
Description: application/compressed-tar



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