Finance Quote Install difficulties

Lincoln A Baxter lab at lincolnbaxter.com
Sat Nov 17 11:21:45 EST 2012


On Sat, 2012-11-17 at 17:08 +0900, John Ralls wrote:
> On Nov 16, 2012, at 11:45 PM, Erik Colson <eco at ecocode.net> wrote:
> 
> > John Ralls <jralls at ceridwen.us> writes:
> > 
> >> On Nov 16, 2012, at 6:23 PM, Erik Colson <eco at ecocode.net> wrote:
> >> 
> >>> Gill <gill at madyak.net> writes:
> >>> 
> >>>> Erik and John -- The work arounds seemed to do it once I understood the need
> >>>> for using sudo!  Thanks.
> >>> 
> >>> great !
> >>> We'll probably need to document this ...
> >> 
> >> http://wiki.gnucash.org/wiki/FAQ#Q:_How_do_I_install_Finance::Quote_on_a_Mac.3F
> >> 
> >> But it would be better to figure out what's broken in CPAN and fix
> >> it. Even better, I guess, would be to figure out how to get it
> >> installed into the bundle so that users needn't mess with CPAN and
> >> Xcode at all.
> > 
> > yep...
> > That is doable. We can do this in at least two ways:
> > - put all pure-perl modules in a directory of gnucash, and tell so to
> > perl on the command line. This will also be most 'os-independent'
> > - make a packaged file which includes perl and the modules. this can
> > only be done os-dependently
> > 
> > other ideas ?
> 
> Well, not all of the packages are pure perl, which is a big part of the problem. But IIRC perl dlopens modules binaries, so if 
> I package them in Resources/lib, set LD_LIBRARY_PATH to point there, put the modules somewhere, and add somewhere to @INC, it should be good, right?
> 
> Regards,
> John Ralls

This would work, probably work, but would have OS specific issues.  I
would try for a solution that is contained within the perl script, or at
least within perl because, perl will take care of the OS specific
difference.

        1) One can define 
                PERL5LIB="/the/path/to/the/root/of/the/guncash/perl/lib/tree"
        before executing perl.
        
        2) execute perl with the -I switch as in: 
                perl -I /the/path/to/the/root/of/the/gnucash/perl/lib script.pl
        
        3) Or, one can diddle @INC within a BEGIN block of the script
        (which will execute before any mainline use statements are
        executed, thus enabling the libraries to be found)

                BEGIN {
                	@INC = ( "/the/path/to/the/root/of/the/gnucash/perl/lib", @INC );
                }

No doubt, there are other ways to do it... I linr #3 above best because
it is entirely self contained within the script. 

The above should work on any perl 5, on any OS on which Gnucash is
supported.

BTW, perl puts dynamically loaded libraries into the INC path in
the ./auto/ directory of any library path root, so for instance (on my
system):

        $ cd /usr/lib/perl5 
        $ find . -name \*.so\* -print
        ./auto/Unicode/String/String.so
        ./auto/BerkeleyDB/BerkeleyDB.so
        ./auto/Crypt/SSLeay/SSLeay.so
        ./auto/UUID/UUID.so
        ./auto/Text/Iconv/Iconv.so
        ./auto/Text/CharWidth/CharWidth.so
        ./auto/Sub/Name/Name.so
        ./auto/Audio/FLAC/Header/Header.so
        ./auto/Audio/Scan/Scan.so
        ./auto/Glib/Glib.so
        ./auto/Gtk2/Gtk2.so
        ./auto/Term/ReadLine/Gnu/Gnu.so
        ./auto/Ogg/Vorbis/Header/Header.so
        ./auto/Cairo/Cairo.so
        ./auto/NetAddr/IP/Util/Util.so
        ./auto/Pango/Pango.so
        ./auto/Socket6/Socket6.so
        ./auto/Net/SSLeay/SSLeay.so
        ./auto/Net/DNS/DNS.so
        ./auto/YAML/Syck/Syck.so
        ./auto/Locale/gettext/gettext.so
        ./auto/Algorithm/Diff/XS/XS.so
        ./auto/HTML/Parser/Parser.so
        

The following module may help one to write a script that will quickly
identify exactly which modules are used:

        http://search.cpan.org/dist/Module-Extract-Use/


More OS specific solutions will be a bit more painful to setup, and a
little harder to support.

Setting LD_LIBRARY_PATH, will only work on Posix OSes, should also work
within the cygwin environment.  One probably wants to remember to do it
in a way the respects existing setting, as in:

	export LD_LIBRARY_PATH="/local/resouces':$LD_LIBRARY_PATH"

This would not be necessary if the process executing perl does not
depend on using perl for anything else.

I don't pay the M$ tax... and I don't have a windows box with which to
test this in windows land any more (my work windows box is too locked
down now), but if I remember rightly, adding the path to the DLLs
required to the windows PATH environment variable (again putting these
at the front of the PATH variable), should get the process to to find
any DLLs that are required.

As I said above, I would try to go with a solution that is entirely
contained within the perl world.  I might be convinced to help with this
if someone provides me some pointers to how Finance::Quote gets executed
by GnuCash.  

I'm a perl module author: http://search.cpan.org/~lbaxter/Sys-SigAction/

Lincoln

> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
> 





More information about the gnucash-user mailing list