----- Original Message ----- 
From: "Alexandru Palade" <[EMAIL PROTECTED]>
To: <inline@perl.org>
Sent: Saturday, March 26, 2005 7:55 AM
Subject: Re: making an Inline::CPP based distribution


> > Is it a bug or a requirement?  In either case, it probably needs fixing
> > rather than FAQ'ing.
> >
>
> I guess it's a bug, and you're right it should be fixed. But until
> that can be done it should at least be documented. It's a pain to have
> your progress halted by something so trivial.
>

Trouble is that neither the bug can be fixed, nor the documentation amended,
until the next version of inline is released - and the timing of that
release is beyond the control of all us "users".

Note that you don't *have* to put your '.pm' file into a 'lib' folder for it
to be a proper CPAN source bundle. Leaving the '.pm' file in the top-level
source directory is quite acceptable, and still works fine. It's just that
*h2xs* now puts the '.pm' file in a 'lib' folder - which is *not* the way it
worked when Inline-0.44 was released (iirc).

>
> >IIRC, Inline::CPP creates the package one level below the current
> >package.  Not sure if this is a bug or by-design.
>
> >I think if you dig (in the build directory), you'll find that your
> >package comes out as ChmFile::ChmFile.  I haven't been working with it
> >for a while, but I think Inline::CPP may need some kind of option to
> >control this behavior.
>
> That's right, that's exactly what happens. But how am I supposed to
> build it then? If I don't put a package statement it comes out as
> main::ChFile and I can't use the VERSION and NAME configurations. It's
> weird though, it works quite fine if I use it without those (as in,
> just copy the ChmFile.pm to one of the lib directories), but it's
> obviously a bad solution since every time you run a script that uses
> the module it has to be compiled and creates the _Inline cache. Has
> anyone ever build something like this for the CPAN? And if so, how?
>

With Inline::C, I just use it to create the xs file, then use that xs file
to create a truly normal cpan-source bundle - ie there's no dependency on
Inline at all. Looks like you have to do a fair bit of stuffing around - so
maybe it would be just as simple for you to do likewise.

Just create a set-up that's going to work with Inline::C. Make sure that
ChFile.pm contains:

use Inline C => Config =>
      CLEAN_AFTER_BUILD => 0;

Then run:
perl Makefile.PL
make test

Then go into the Inline build directory and grab the XS file that was
generated (and INLINE.h if you've used the Inline Stack variables). You've
now got all you need to create a cpan-source distro that doesn't need Inline
at all. You'll need to edit ChFile.pm, removing all of the Inline stuff, and
sticking in the package name, version, etc.

This works fine for me with Inline::C - I don't see why it couldn't work
with Inline::CPP. You could even write a little script to do the entire job.

I'm not saying this is the only solution. I think it should work - there
would be no problems with Inline::C - but I haven't tested with Inline::CPP.

Cheers,
Rob

Reply via email to