4

I run an open source project called "Senora" which is written in perl and does oracle database stuff. Until recently it ran out of the box with the perl distribution which comes with oracle.

But recently I tried to add more features and I needed LibXML. Personally I am running Strawberry perl at work and there is no problem adding LibXML. However, my users do not have their personal perls and they must live with whatever they find on the machine (oracle perl is always there).

I already added a lib directory to my Senora tree and put some plain perl modules in there, which oracle perl does not provide. This works.

But what do I do with compiled code? I felt tempted to just copy dlls from my Strawberry tree, but this feels to hackerish. After all this code was not compiled against oracle perl.

I also felt tempted to give my users my full Strawberry tree. This is ugly.

So what other option do I have to add "just what's missing" to my Senora distribution, so it runs with oracle perl?

4
  • If it is of any help, strawberry portable doesn't need installation nor special system privileges, it can install DBD::Oracle, and portability is plain zip/unzip of files
    – mpapec
    Oct 17, 2013 at 13:02
  • I just don't want to tell my users that in order to run Senora, they also need to install another perl. Oct 17, 2013 at 14:44
  • You can bundle everything together and give them zip file. :) At the end if java programs can complain about JRE, why perl programs can't do the same?
    – mpapec
    Oct 17, 2013 at 14:51
  • 1
    That's what I am doing to provide my pet project for Windows systems: using InnoSetup to create an installer program which contains a stripped+extended portable Strawberry Perl and my application. The user is getting a familiar installer which is even not that big (~10MB). Oct 17, 2013 at 21:20

2 Answers 2

2

TL;DR: Distributing Perl modules via CPAN is fun and easy when everyone has a full perl installation. For any other use case, this sucks.

  • Perl programs are usually distributed via CPAN, which offers automatic dependency installation. However, some modules require a working C toolchain for installation. Many users run crippled perls without this ability. The only solution here is to package precompiled files, however this must be done separately for each OS, and each perl configuration. This is what some OS vendors (like Debian or RedHat), and some Perl vendors (like ActiveState) do.

    Each of these vendors provide instructions to build your own packages from Perl modules, which can then be installed with their respective package manager.

  • If the target systems do have a C toolchain, then using cpan for installations is no problem – although local::lib should be investigated if you aren't uploading the module in question to CPAN.

    Note that the GNOME libxml2 is not distributed via CPAN, and has to be obtained by other means. Building the XML::LibXML module also requires the corresponding header files.

  • You can also use a packaging tool like PAR. This creates an executable archive with your perl interpreter, your source files, and any dependencies. These archives are large, because they contain a whole perl. As you now specify the perl version, the only remaining variable is the host operating system. Note that this won't reuse any perl installation from the host, and has to bring everything itself.

1
  • I do have a C toolchain - this is what Strawberry perl is all about. There is no problem extending Strawberry perl.The operating system is also not the issue - it will always be a 64bit Windows. My problem is that my users will have Oracle perl, which I don't know how to extend, and I also don't want force Strawberry perl on them. Oct 19, 2013 at 9:58
0

But what do I do with compiled code?

Code installed in $arch-specific directories will only work with the same version or later maintenance release in the same version (e.g. arch-specific module installed installed with 5.14.1 will work with 5.14.2 but not 5.14.0 or 5.16.). They will only work with a Perl with the same configuration. Unless you control the Perl on their machine, this is not likely to work.

they must live with whatever they find on the machine

Yet you're asking how to add to their machine. Which one is it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.