guile-gtk-general
[Top][All Lists]
Advanced

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

Re: success! Re: g-wrap? libffi?


From: Andreas Rottmann
Subject: Re: success! Re: g-wrap? libffi?
Date: Wed, 04 Aug 2004 14:57:52 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Steve Tell <address@hidden> writes:

> It took some doing, but I got g-wrap installed and successfully wrapped
> the trivial example in the "2.1 Overview" section of the g-wrap.texi
> manual.
>
> G-wrap was easy to build, but its dependencies proved um, interesting.
>
> So I hope the travellogue below might save someone some trouble.
>
> While getting the example running, I think I learned enough to fix
> the example in section 2 of g-wrap.texi to work with g-wrap 1.9.1.  
> My working example is below; is there interest in a patch to the .texi?
>
Thanks for pointing the mismatch with the docs out; I'll go over it
myself.

> Steve
>
>
> tonight's adventure: trying out g-wrap in N steps:
>
Thanks a lot for detailing the problems here!

> download g-wrap-1.9.1.tar.gz from 
> http://savannah.nongnu.org/download/g-wrap/
>
> g-wrap requires libffi.
>
> download libffi-src-20030921.tar.gz from 
> http://sourceforge.net/project/showfiles.php?group_id=14534
> (this is from the PyObjC project)
>
> Inspired by the notes in http://sablevm.org/wiki/LibFFI on how to build
> libffi apart from the gcc source, we 
> hack libffi just slightly 
>
[snip]

> then "configure;make;make install" as usual to install libffi.
>
> We can now configure and build g-wrap itself.
> I recall it being relatively uneventful.
>
Maybe I should ship libffi with G-Wrap, falling back to the included
copy when no external libffi could be found. I don't know wether
that's worth the hassle, since there are RPMs and DEBs for libffi.

> In order to run, g-wrap requires srfi-34, and possibly other stuff
> from guile-lib.
>
> download guile-lib from 
> http://download.gna.org/guile-lib/guile-lib-0.1.1.tar.gz
> This doesn't contain srfi-34, which was added after that release.
>
Well, guile-lib is not strictly necessary, since SRFI 34 and SRFI 35
are bundled with G-Wrap for greater building convinience. Guile-Lib
may become a real dependency in the near future, however.

> download the guile-lib snapshot from 
> http://download.gna.org/guile-lib/daily/guile-lib-20040625.tar.gz
>
> The build process looks like it should be:
>
[snip]
>
> But it doesn't work because a file called '=RELEASE-ID' is missing
> from the top directory of the 20040625 snapshot.  So copy it from the
> guile-lib-0.1.1 release.
>
This snapshot indeed is bogus in not having that file. I've just
uploaded a new snapshot and will make a new official release soon.

> G-wrap has a test suite of some kind, part of which is built during
> its build process.  But I couldn't figure out how to run it.
>
For automake-based packages (like G-Wrap), this is always 'make
check'. For package-framework-based packages (like guile-lib) it's
'make test'.

>
> But we can forge ahead and to wrap a little testcase with g-wrap.
> Aside from some typos, the simple example in section 2 of the
> documentation isn't too far from working.  
>
> But the example gets simpler if the wrapset classes aren't put into
> seperate modules.  Here's what I wound up with:
>
Yeah, I will probably change this in the docs, too.

>
> ; begin my-frob-spec.scm
> (use-modules 
>  (oop goops)
>  (g-wrap) 
>  (g-wrap guile) 
>  (g-wrap guile ws standard))
>
> (define-class <my-wrapset> (<gw-wrapset>)
>   #:id 'my-wrapset
>   #:dependencies '(standard))
>
> (define-method (initialize (ws <my-wrapset>) initargs)
>   (next-method)
>
>   (wrap-function! ws 
>                 #:name 'frob
>                 #:returns 'int
>                 #:arguments '((int x) (double y))
>                 #:c-name "frob"
>                 #:description "Return the result of frobbing x and y."))
>
>
> (define-class <my-guile-wrapset> (<my-wrapset> <gw-guile-wrapset>)
>   #:id 'my-guile-wrapset)
>
> (define-method (global-declarations-cg (ws <my-guile-wrapset>))
>   (list
>    (next-method)
>    "#include \"myfrob.h\"\n"))
>
That method should be moved into the non-Guile-specific wrapset.

Andy
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://yi.org/rotty      | GnuPG Key: http://yi.org/rotty/gpg.asc
Fingerprint              | DFB4 4EB4 78A4 5EEE 6219  F228 F92F CFC5 01FD 5B62

Make free software, not war!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]