Preview of some introspection stuff

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Preview of some introspection stuff

Torsten Schoenfeld
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:[hidden email]:/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:[hidden email]:/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

libffi-configure.patch (611 bytes) Download Attachment
libffi.pc (241 bytes) Download Attachment
gobject-introspection.patch (2K) Download Attachment
Glib-Object-Introspection-0.01.tar.gz (32K) Download Attachment
PDF-Poppler-0.01.tar.gz (22K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Preview of some introspection stuff

Jan Hudec
On Sun, Aug 21, 2005 at 17:10:58 +0200, Torsten Schoenfeld wrote:
> 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.

I have installed glade files among perl modules some time ago. Take advantage
of the fact, that _everything_ in lib is considered a module, no matter what
extension it has (by EU::MM, that is, IIRC). So just put it in as
lib/PDF/Poppler/poppler.raw. Then open 'perldoc -f require' and copy the code
you find there, replace the "do $realfilename" with whatever loading is
appropriate and ask it to load "PDF/Poppler/poppler.raw".

-------------------------------------------------------------------------------
                                                 Jan 'Bulb' Hudec <[hidden email]>

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Preview of some introspection stuff

Torsten Schoenfeld
On Sun, 2005-08-21 at 22:53 +0200, Jan Hudec wrote:

> On Sun, Aug 21, 2005 at 17:10:58 +0200, Torsten Schoenfeld wrote:
> > 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.
>
> I have installed glade files among perl modules some time ago. Take advantage
> of the fact, that _everything_ in lib is considered a module, no matter what
> extension it has (by EU::MM, that is, IIRC). So just put it in as
> lib/PDF/Poppler/poppler.raw. Then open 'perldoc -f require' and copy the code
> you find there, replace the "do $realfilename" with whatever loading is
> appropriate and ask it to load "PDF/Poppler/poppler.raw".

I had to coerce Module::Build into installing poppler.raw like so:

  pm_files          => {
      'lib/PDF/Poppler.pm'          => 'lib/PDF/Poppler.pm',
      'lib/PDF/Poppler/poppler.raw' => 'lib/PDF/Poppler/poppler.raw',
  },

But otherwise it worked great.  Thanks!

--
Bye,
-Torsten

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list
Reply | Threaded
Open this post in threaded view
|

Re: Preview of some introspection stuff

Jan Hudec
On Mon, Aug 22, 2005 at 18:58:56 +0200, Torsten Schoenfeld wrote:

> On Sun, 2005-08-21 at 22:53 +0200, Jan Hudec wrote:
> > I have installed glade files among perl modules some time ago. Take advantage
> > of the fact, that _everything_ in lib is considered a module, no matter what
> > extension it has (by EU::MM, that is, IIRC). So just put it in as
> > lib/PDF/Poppler/poppler.raw. Then open 'perldoc -f require' and copy the code
> > you find there, replace the "do $realfilename" with whatever loading is
> > appropriate and ask it to load "PDF/Poppler/poppler.raw".
>
> I had to coerce Module::Build into installing poppler.raw like so:
>
>   pm_files          => {
>       'lib/PDF/Poppler.pm'          => 'lib/PDF/Poppler.pm',
>       'lib/PDF/Poppler/poppler.raw' => 'lib/PDF/Poppler/poppler.raw',
>   },
>
> But otherwise it worked great.  Thanks!
Yes, M::B has different logic than EU::MM. But when I used it, I had
5 compilers (m4, PDL::PP, xsubpp, cc and ld) to process each source, plus
another 2 for documentation and beating EU::MM to do what I want was easier
than beating M::B.

--
                                                 Jan 'Bulb' Hudec <[hidden email]>

_______________________________________________
gtk-perl-list mailing list
[hidden email]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

signature.asc (196 bytes) Download Attachment