[GNC-dev] History of gnu_quote_source_s old_internal_name?

2023-05-25 Thread Vincent Lucarelli
Hi,

I’ve been slowly working on PR #1626 to use the to-be-released Finance::Quote 
get_features() to communicate to gnucash at runtime the available quote sources 
and required parameters like API keys. The PR describes what is implemented and 
a sketch of what remains to be implemented.

I’m at the point that I want to remove the hard coded sources in 
gnucash/libgnucash/engine/gnc-commodity.c and dynamically populate the lists.

However, I was surprised to find “old_internal_name” in the gnc_quote_source_s 
struct with a deprecated comment. I see at least two options
  - remove it and added a tool to help users efficiently update their quote 
sources
  - keep a hard coded mapping in the source file and continue to carry 
old_internal_name

I don’t know the history or potential side effects of messing with 
old_internal_name, but for maintainability, removing old_internal_names is 
appealing.

Any advice or guidance?

Thanks,

Vince


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Finance::Quote get_features() and GnuCash

2023-01-21 Thread Vincent Lucarelli
Hi,

We have an experimental function in Finance::Quote called get_features() that 
returns a perl hash that provides information on 
quote_modules - list of sources for stock quotes + a list of any required 
parameters (such as an API key) the module requires
quote_methods - a single module or list of modules to try in a specific order
currency_modules - list of sources for currency information if FQ is required 
to convert quotes from one currency to another

The current version of FQ just uses AlphaVantage for currency conversion and 
users must specify an AlphaVantage API through either an environment variable 
or through GnuCash Settings.

With this experimental FQ function, GnuCash could 
Solicit API keys in Settings to centralize where users setup FQ
Expose currecy_modules to users so they could use alternatives to AlphaVantage
Reduce issues on platforms like macOS where setting GnuCash environment 
variables is not straight-forward nor survivors GnuCash upgrades

It looks like there are three touch points for FQ in GnuCash
GUI: Tools > Security Editor > Add
I’m not clear on what the “Unknown” list is, but the Single is for “modules” 
and Multiple is for “methods”
One approach to simplify this is to just have a list of “methods” and in the 
list indicate which modules the method uses
GUI: gnucash > Settings… > Online Quotes
This currently only asks for an AlphaVantage API Key
The additional information from get_features() would allow expanding these 
preferences to include any API key + control over currency conversion
finance-quote-wrapper
The API key info + currency preferences from the GUI will need to be routed 
through here (I think?)
Is this also used to populate the lists in Security Editor

Potential Changes to GunCash (listed in the order I think I would try to 
implement)
Expand Settings… > Online Quotes to solicit all FQ parameters & route info to 
finance-quote-wrapper
Use information from get_features to better populate Security Editor > Add and 
potential simplify GUI
Expand Settings… > Online Quotes to expose currency features to users

Looking for missing touch points, feedback on potential changes, and pointers 
to GnuCash-FQ interactions that are more complicated than I presented here.

Best,

Vince
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Missing FreeType2 for Mac OS Development

2023-01-21 Thread Vincent Lucarelli
I now have a function development environment with gnucash from git and FQ from 
git installed, so I can develop in both.

Documented everything at the bottom of 
https://wiki.gnucash.org/wiki/MacOS/Quartz

I’m going to start on new thread on this mailing list to discuss how to use the 
new FQ features in GnuCash.

Thanks,

Vince

> On Jan 16, 2023, at 9:10 PM, John Ralls  wrote:
> 
> xmlsec is how AQBanking and friends hook gcrypt.
> 
> Yes, the New Account Hierarchy Assistant's Apply button tries to open a 
> GncFileChooser that's derived from GtkFileChooser. That crashes if you try to 
> run it from the build directory.
> 
> No, you don't need to make a bundle, just run `ninja install` to install 
> everything in $PREFIX. When that's done you can run $PREFIX/bin/gnucash if 
> you're in a jhbuild shell or otherwise have $PREFIX set. If not you'll have 
> to spell out the path to the installed gnucash.
> 
> Regards,
> John Ralls
> 
> 
>> On Jan 16, 2023, at 5:56 PM, Vincent Lucarelli  
>> wrote:
>> 
>> Sorry - I didn’t explain that I used ACLs (chmod -a)  to completely block 
>> access for my build user “gnucash” from accessing /opt/homebrew and then 
>> started from the beginning of setting up a build environment as the gnucash 
>> user. During this rebuild, I ran into an error while building libxmlsec1, 
>> which depends on gnutls.  I traced that failure to -lgcrypt missing from the 
>> link line.
>> 
>> I was planning to document the full procedure on the wiki in case it helps 
>> someone else trying to start from scratch on Mac OS.
>> 
>> When creating a new file, is the last step to pick a file location with 
>> GtkFileChooser?  That would explain why I’m crashing on trying to create a 
>> new GnuCash file because I am running from the build directory.
>> 
>> Do I need to create a bundle for GtkFileChooser to not crash?
>> 
>> Thanks for your help,
>> 
>> Vince
>> 
>> 
>>> On Jan 16, 2023, at 7:13 PM, John Ralls  wrote:
>>> 
>>> I thought that you said the freetype2 problem was from Cmake finding 
>>> libbrotlidec in /opt/homebrew. I don't think that freetype2 has a 
>>> dependency on gnutls. Webkit (via libsoup<-glib-networking) and AQBanking 
>>> depend on it; IIRC the missing -lgcrypt is in the glib-networking build.
>>> 
>>> The problem with libdbdmysql.so is that 
>>> $PREFIX/lib/mariadb/libmariaconnector.3.dylib gets built with a bare 
>>> install name, so at runtime the loader doesn't know how to find it. The 
>>> post-build fix is to use install_name_tool to change its id to one with a 
>>> full path and then to change libdbdmysql.so's listing to use the path. To 
>>> get it to build correctly it needs CMAKE_MACOSX_RPATH=ON and 
>>> CMAKE_INSTALL_NAME_DIR=$PREFIX/lib. The first could be set in the module's 
>>> cmakeargs attribute but the second would have to be conjured in 
>>> jhbuildrc-custom using module_cmakeargs.
>>> 
>>> That shouldn't have caused the crash; it's probably to do with gsettings 
>>> schemas. GnuCash will crash when run from the build directory if you try to 
>>> do anything involving the GtkFileChooser because that won't be able to find 
>>> its Gsettings schemas.
>>> 
>>> Regards,
>>> John Ralls
>>> 
>>> 
>>> 
>>> 
>>>> On Jan 16, 2023, at 8:39 AM, Vincent Lucarelli 
>>>>  wrote:
>>>> 
>>>> Got much farther with the build, but now stuck with a build/run time error.
>>>> 
>>>> The freetype2 error was rooted in gnutls.pc missing -lgcrypt.  I’m not 
>>>> sure if this is an issue for gnutls or a patch for arm64/MacOSx build.  
>>>> Manually added the dependency and finished the build.
>>>> 
>>>> Tried to run gnucash build from git/master, but it crashed when I tried to 
>>>> create a new file, after I walked through the setup, and right when I 
>>>> clicked “Apply”.
>>>> 
>>>> Decided to rebuild with debugging and during the build of gnucash, I 
>>>> noticed 
>>>> 
>>>>> libdbi: Failed to load driver: 
>>>>> /Users/gnucash/opt/gnucash/inst/lib/dbd/libdbdmysql.so
>>>> 
>>>> Trying to determine if libdbi or a dependency had an issue during build or 
>>>> if there is something else going on.
>>>> 
>>>> If any of this looks familiar, suggestions are appreciated.  Otherwise, 
>>>> I’ll keep digging.
>>>> 
>>>> Thanks,
>&

Re: [GNC-dev] Missing FreeType2 for Mac OS Development

2023-01-16 Thread Vincent Lucarelli
Sorry - I didn’t explain that I used ACLs (chmod -a)  to completely block 
access for my build user “gnucash” from accessing /opt/homebrew and then 
started from the beginning of setting up a build environment as the gnucash 
user. During this rebuild, I ran into an error while building libxmlsec1, which 
depends on gnutls.  I traced that failure to -lgcrypt missing from the link 
line.

I was planning to document the full procedure on the wiki in case it helps 
someone else trying to start from scratch on Mac OS.

When creating a new file, is the last step to pick a file location with 
GtkFileChooser?  That would explain why I’m crashing on trying to create a new 
GnuCash file because I am running from the build directory.

Do I need to create a bundle for GtkFileChooser to not crash?

Thanks for your help,

Vince


> On Jan 16, 2023, at 7:13 PM, John Ralls  wrote:
> 
> I thought that you said the freetype2 problem was from Cmake finding 
> libbrotlidec in /opt/homebrew. I don't think that freetype2 has a dependency 
> on gnutls. Webkit (via libsoup<-glib-networking) and AQBanking depend on it; 
> IIRC the missing -lgcrypt is in the glib-networking build.
> 
> The problem with libdbdmysql.so is that 
> $PREFIX/lib/mariadb/libmariaconnector.3.dylib gets built with a bare install 
> name, so at runtime the loader doesn't know how to find it. The post-build 
> fix is to use install_name_tool to change its id to one with a full path and 
> then to change libdbdmysql.so's listing to use the path. To get it to build 
> correctly it needs CMAKE_MACOSX_RPATH=ON and 
> CMAKE_INSTALL_NAME_DIR=$PREFIX/lib. The first could be set in the module's 
> cmakeargs attribute but the second would have to be conjured in 
> jhbuildrc-custom using module_cmakeargs.
> 
> That shouldn't have caused the crash; it's probably to do with gsettings 
> schemas. GnuCash will crash when run from the build directory if you try to 
> do anything involving the GtkFileChooser because that won't be able to find 
> its Gsettings schemas.
> 
> Regards,
> John Ralls
> 
> 
> 
> 
>> On Jan 16, 2023, at 8:39 AM, Vincent Lucarelli  
>> wrote:
>> 
>> Got much farther with the build, but now stuck with a build/run time error.
>> 
>> The freetype2 error was rooted in gnutls.pc missing -lgcrypt.  I’m not sure 
>> if this is an issue for gnutls or a patch for arm64/MacOSx build.  Manually 
>> added the dependency and finished the build.
>> 
>> Tried to run gnucash build from git/master, but it crashed when I tried to 
>> create a new file, after I walked through the setup, and right when I 
>> clicked “Apply”.
>> 
>> Decided to rebuild with debugging and during the build of gnucash, I noticed 
>> 
>>> libdbi: Failed to load driver: 
>>> /Users/gnucash/opt/gnucash/inst/lib/dbd/libdbdmysql.so
>> 
>> Trying to determine if libdbi or a dependency had an issue during build or 
>> if there is something else going on.
>> 
>> If any of this looks familiar, suggestions are appreciated.  Otherwise, I’ll 
>> keep digging.
>> 
>> Thanks,
>> 
>> Vince
>> 
>> PS - When I try to open Gnucash Preferences, it crashes too.  Will try to 
>> get more info on that later.
>> 
>> 
>> 
>>> On Jan 14, 2023, at 10:43 PM, john  wrote:
>>> 
>>> While you're getting familiar enough with GnuCash ask questions here. Once 
>>> you've got a PR written we can move the discussion to that PR.
>>> 
>>> Regards,
>>> John Ralls
>>> 
>>> 
>>>> On Jan 14, 2023, at 4:21 PM, Vincent Lucarelli 
>>>>  wrote:
>>>> 
>>>> It looks like freetype2 picked up a dependency on 
>>>> /opt/homebrew/lib/libbrotlidec.dylib even though I started with a new user 
>>>> account and insulated the build with 
>>>>> cmakeargs = 
>>>>> '-DCMAKE_SYSTEM_IGNORE_PATH="/opt/homebrew:/opt/macports:/sw:/usr/local"'
>>>> as suggested at 
>>>> https://wiki.gnome.org/action/show/Projects/GTK/OSX/Building#Prerequisites
>>>> 
>>>> 
>>>> So when harfbuzz-no-cairo tried to configure against freetype2, it was 
>>>> looking for libbrotlidec.pc, but that wasn’t built by jhbuild.
>>>> 
>>>> I’ll try again tomorrow to see if I can track down exactly how homebrew is 
>>>> poisoning the build environment.
>>>> 
>>>> Provided I can actual build gnucash, should development questions about 
>>>> integrating FQ get_features() take place on this mailing list in a new 
>>>> thread or on GitHub under and issue?

Re: [GNC-dev] Missing FreeType2 for Mac OS Development

2023-01-16 Thread Vincent Lucarelli
Got much farther with the build, but now stuck with a build/run time error.

The freetype2 error was rooted in gnutls.pc missing -lgcrypt.  I’m not sure if 
this is an issue for gnutls or a patch for arm64/MacOSx build.  Manually added 
the dependency and finished the build.

Tried to run gnucash build from git/master, but it crashed when I tried to 
create a new file, after I walked through the setup, and right when I clicked 
“Apply”.

Decided to rebuild with debugging and during the build of gnucash, I noticed 

> libdbi: Failed to load driver: 
> /Users/gnucash/opt/gnucash/inst/lib/dbd/libdbdmysql.so

Trying to determine if libdbi or a dependency had an issue during build or if 
there is something else going on.

If any of this looks familiar, suggestions are appreciated.  Otherwise, I’ll 
keep digging.

Thanks,

Vince

PS - When I try to open Gnucash Preferences, it crashes too.  Will try to get 
more info on that later.



> On Jan 14, 2023, at 10:43 PM, john  wrote:
> 
> While you're getting familiar enough with GnuCash ask questions here. Once 
> you've got a PR written we can move the discussion to that PR.
> 
> Regards,
> John Ralls
> 
> 
>> On Jan 14, 2023, at 4:21 PM, Vincent Lucarelli  
>> wrote:
>> 
>> It looks like freetype2 picked up a dependency on 
>> /opt/homebrew/lib/libbrotlidec.dylib even though I started with a new user 
>> account and insulated the build with 
>>> 
>>> cmakeargs = 
>>> '-DCMAKE_SYSTEM_IGNORE_PATH="/opt/homebrew:/opt/macports:/sw:/usr/local"'
>> as suggested at 
>> https://wiki.gnome.org/action/show/Projects/GTK/OSX/Building#Prerequisites
>> 
>> 
>> So when harfbuzz-no-cairo tried to configure against freetype2, it was 
>> looking for libbrotlidec.pc, but that wasn’t built by jhbuild.
>> 
>> I’ll try again tomorrow to see if I can track down exactly how homebrew is 
>> poisoning the build environment.
>> 
>> Provided I can actual build gnucash, should development questions about 
>> integrating FQ get_features() take place on this mailing list in a new 
>> thread or on GitHub under and issue?
>> 
>> Best,
>> 
>> Vince
>> 
>> 
>>> On Jan 14, 2023, at 4:44 PM, John Ralls  wrote:
>>> 
>>> 
>>> 
>>>> On Jan 14, 2023, at 10:22 AM, Vincent Lucarelli 
>>>>  wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I am attempting to setup a new Mac OS X user account on Ventura 13.0.1 to 
>>>> build gnucash so I can attempt to help integrate a new Finance::Quote 
>>>> feature into GnuCash. Ran into 2 problems following the instructions at 
>>>> https://wiki.gnucash.org/wiki/MacOS/Quartz 
>>>> 
>>>> First issue - was able to solve - copying /bin/bash to 
>>>> $HOME/.new_local/bin doesn’t seem to work on Ventura.  The process is 
>>>> immediately killed when the alternate copy of bash is run.  Some googling 
>>>> suggests it might have something to do with quarantine or code signing, 
>>>> but a few of the suggested solutions didn’t work. I have homebrew 
>>>> installed (but not in the path for the account I’m using to try and build 
>>>> gnucash), so I just installed bash with brew and then copied that 
>>>> executable into .new_local/bin.
>>>> 
>>>> Second issue - not sure how to proceed.  The bootstrap run successfully, 
>>>> but the jhbuild step failed to find freetype2
>>>> 
>>>>> PREFIX=$HOME/opt/gnucash jhbuild build
>>>> 
>>>>> ../../src/harfbuzz-4.1.0/meson.build:87:0: ERROR: Dependency 'freetype2' 
>>>>> is required but not found.
>>>>> 
>>>>> A full log can be found at 
>>>>> /Users/gnucash/opt/gnucash/build/harfbuzz-4.1.0/meson-logs/meson-log.txt
>>>>> WARNING: Running the setup command as `meson [options]` instead of `meson 
>>>>> setup [options]` is ambiguous and deprecated.
>>>>> *** Error during phase configure of harfbuzz-no-cairo: ## Error 
>>>>> running meson --prefix /Users/gnucash/opt/gnucash/inst --libdir lib 
>>>>> -Dcoretext=enabled -Dfreetype=enabled -Ddocs=disabled 
>>>>> -Dbenchmark=disabled -Dintrospection=disabled --wrap-mode=nofallback 
>>>>> /Users/gnucash/opt/gnucash/src/harfbuzz-4.1.0 *** [20/76]
>>>>> 
>>>>> [1] Rerun phase configure
>>>>> [2] Ignore error and continue to build
>>>>> [3] Give up on module
>>>>> [4] Start shell
>>>>> [5] Reload configuration
>>>>> [6] Go to phase "wipe directory and start over"
>>>>> choice:
>>>> 
>>>> Any advice how how to proceed is appreciated.
>>> 
>>> harfbuzz-no-cairo depends on freetype-no-harfbuzz. If 
>>> $PREFIX/lib/pkgconfig/freetype2.pc isn't installed then something went 
>>> wrong with the latter. Scroll back in your terminal session to see what.
>>> 
>>> Regards,
>>> John Ralls
>> 
> 

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Missing FreeType2 for Mac OS Development

2023-01-14 Thread Vincent Lucarelli
It looks like freetype2 picked up a dependency on 
/opt/homebrew/lib/libbrotlidec.dylib even though I started with a new user 
account and insulated the build with 
> 
> cmakeargs = 
> '-DCMAKE_SYSTEM_IGNORE_PATH="/opt/homebrew:/opt/macports:/sw:/usr/local"'
as suggested at 
https://wiki.gnome.org/action/show/Projects/GTK/OSX/Building#Prerequisites


So when harfbuzz-no-cairo tried to configure against freetype2, it was looking 
for libbrotlidec.pc, but that wasn’t built by jhbuild.

I’ll try again tomorrow to see if I can track down exactly how homebrew is 
poisoning the build environment.

Provided I can actual build gnucash, should development questions about 
integrating FQ get_features() take place on this mailing list in a new thread 
or on GitHub under and issue?

Best,

Vince


> On Jan 14, 2023, at 4:44 PM, John Ralls  wrote:
> 
> 
> 
>> On Jan 14, 2023, at 10:22 AM, Vincent Lucarelli 
>>  wrote:
>> 
>> Hi,
>> 
>> I am attempting to setup a new Mac OS X user account on Ventura 13.0.1 to 
>> build gnucash so I can attempt to help integrate a new Finance::Quote 
>> feature into GnuCash. Ran into 2 problems following the instructions at 
>> https://wiki.gnucash.org/wiki/MacOS/Quartz 
>> 
>> First issue - was able to solve - copying /bin/bash to $HOME/.new_local/bin 
>> doesn’t seem to work on Ventura.  The process is immediately killed when the 
>> alternate copy of bash is run.  Some googling suggests it might have 
>> something to do with quarantine or code signing, but a few of the suggested 
>> solutions didn’t work. I have homebrew installed (but not in the path for 
>> the account I’m using to try and build gnucash), so I just installed bash 
>> with brew and then copied that executable into .new_local/bin.
>> 
>> Second issue - not sure how to proceed.  The bootstrap run successfully, but 
>> the jhbuild step failed to find freetype2
>> 
>>> PREFIX=$HOME/opt/gnucash jhbuild build
>> 
>>> ../../src/harfbuzz-4.1.0/meson.build:87:0: ERROR: Dependency 'freetype2' is 
>>> required but not found.
>>> 
>>> A full log can be found at 
>>> /Users/gnucash/opt/gnucash/build/harfbuzz-4.1.0/meson-logs/meson-log.txt
>>> WARNING: Running the setup command as `meson [options]` instead of `meson 
>>> setup [options]` is ambiguous and deprecated.
>>> *** Error during phase configure of harfbuzz-no-cairo: ## Error 
>>> running meson --prefix /Users/gnucash/opt/gnucash/inst --libdir lib 
>>> -Dcoretext=enabled -Dfreetype=enabled -Ddocs=disabled -Dbenchmark=disabled 
>>> -Dintrospection=disabled --wrap-mode=nofallback 
>>> /Users/gnucash/opt/gnucash/src/harfbuzz-4.1.0 *** [20/76]
>>> 
>>> [1] Rerun phase configure
>>> [2] Ignore error and continue to build
>>> [3] Give up on module
>>> [4] Start shell
>>> [5] Reload configuration
>>> [6] Go to phase "wipe directory and start over"
>>> choice:
>> 
>> Any advice how how to proceed is appreciated.
> 
> harfbuzz-no-cairo depends on freetype-no-harfbuzz. If 
> $PREFIX/lib/pkgconfig/freetype2.pc isn't installed then something went wrong 
> with the latter. Scroll back in your terminal session to see what.
> 
> Regards,
> John Ralls

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Missing FreeType2 for Mac OS Development

2023-01-14 Thread Vincent Lucarelli
Hi,

I am attempting to setup a new Mac OS X user account on Ventura 13.0.1 to build 
gnucash so I can attempt to help integrate a new Finance::Quote feature into 
GnuCash. Ran into 2 problems following the instructions at 
https://wiki.gnucash.org/wiki/MacOS/Quartz 

First issue - was able to solve - copying /bin/bash to $HOME/.new_local/bin 
doesn’t seem to work on Ventura.  The process is immediately killed when the 
alternate copy of bash is run.  Some googling suggests it might have something 
to do with quarantine or code signing, but a few of the suggested solutions 
didn’t work. I have homebrew installed (but not in the path for the account I’m 
using to try and build gnucash), so I just installed bash with brew and then 
copied that executable into .new_local/bin.

Second issue - not sure how to proceed.  The bootstrap run successfully, but 
the jhbuild step failed to find freetype2

> PREFIX=$HOME/opt/gnucash jhbuild build

> ../../src/harfbuzz-4.1.0/meson.build:87:0: ERROR: Dependency 'freetype2' is 
> required but not found.
> 
> A full log can be found at 
> /Users/gnucash/opt/gnucash/build/harfbuzz-4.1.0/meson-logs/meson-log.txt
> WARNING: Running the setup command as `meson [options]` instead of `meson 
> setup [options]` is ambiguous and deprecated.
> *** Error during phase configure of harfbuzz-no-cairo: ## Error 
> running meson --prefix /Users/gnucash/opt/gnucash/inst --libdir lib 
> -Dcoretext=enabled -Dfreetype=enabled -Ddocs=disabled -Dbenchmark=disabled 
> -Dintrospection=disabled --wrap-mode=nofallback 
> /Users/gnucash/opt/gnucash/src/harfbuzz-4.1.0 *** [20/76]
> 
>   [1] Rerun phase configure
>   [2] Ignore error and continue to build
>   [3] Give up on module
>   [4] Start shell
>   [5] Reload configuration
>   [6] Go to phase "wipe directory and start over"
> choice:

Any advice how how to proceed is appreciated.

Thanks,

Vince
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Flatpak GnuCash and Finance::Quote

2022-10-06 Thread Vincent Lucarelli
Hi,

F::Q uses Dist::Zilla to create the distribution and Dist::Zilla provides a 
mechanism to list all dependencies.

Is it possible in the build commands for a flatpack to bootstrap - install 
perl, install Dist::Zilla, use Dist::Zilla to install all F::Q perl 
dependencies, then install F::Q?

Vince

> On Oct 5, 2022, at 4:27 PM, Bruce Schuck  wrote:
> 
> Thank you for the response.
> 
> I really wasn't expecting a fix, just clarification as I never worked with 
> flatpak before. Makes sense that one would not want to be able to modify any 
> of the related tools and supported applications (like perl and the F::Q 
> modules for GnuCash). Making changes would violate the concept of why it's a 
> flatpak.
> 
> At first my mindset is too used to the chroot, Solaris Zones, VMs, LXC/LXD 
> way of thinking.
> 
> Thanks again also to John R for his responses.
> 
> Official F::Q v1.53 should be pushed to CPAN this Saturday, 10/08/2022.
> 
> - Bruce S.
> 
> On 10/5/22 1:08 PM, Geert Janssens wrote:
>> Op maandag 3 oktober 2022 00:38:23 CEST schreef Bruce Schuck:
>> > Hello all,
>> >
>> > Noticing that the most recent Flatpak version of GnuCash (4.12+ (Flathub
>> > 4.12)) has v1.49 of Finance::Quote, I wanted to update to the recent
>> > release candidate I pushed to CPAN. I believe there are issues running
>> > gnc-fq-update or cpan within the flatpak container because some of the
>> > modules required by F::Q v1.52 and later require the gcc compiler to
>> > make and install. As far as I can see, gcc is not in the flatpak GnuCash
>> > distribution.
>> >
>> > While copying the ./lib/Finance tree from GitHub or a downloaded tarball
>> > may seem to work, some of the lesser used methods for data retrieval may
>> > not work.
>> >
>> > - Bruce S.
>> Flatpak follows a completely different distribution model than typical 
>> distributions do. It starts from the concept of an immutable base system. 
>> You are not supposed to manipulate this directly. So running gnc-fq-update 
>> is unfortunately not supposed to work within flatpak and the whole concept 
>> is designed to make that difficult to do.
>> The runtime that's normally used to run flatpak applications doesn't have 
>> any developer tools. You can switch to using sdk packages instead as Frank 
>> linked to, but it remains limited.
>> Having said that, there are several options to get newer versions of 
>> Finance::Quote in the hands of gnucash flatpak users. Though all involve 
>> rebuilding the gnucash flatpak in some way.
>> 1. We have our own flatpak repository in which we publish nightly builds. 
>> The source for these nightly builds is the Gnucash/gnucash-on-flatpak repo 
>> on github. The build system is fairly automated (more on that later).
>> 2. You can also use the same repo to set up your own build environment for 
>> gnucash flatpaks, if your main goal is to test for yourself or before you 
>> submit a PR to gnucash-on-flatpak. I don't know how easy or hard this is 
>> perceived by outsiders (I created that repo and the scripts in there, so to 
>> me it's obviously not too hard).
>> 3. The flatpaks as distributed on flathub are also under the gnucash 
>> project's control. We typically first test our changes in gnucash-on-flatpak 
>> and if proven ok, we copy the same patches to flathub. Flathub offers both a 
>> stable and a beta branch. On stable we should only push stable software, so 
>> release  candidates for Finance::Quote don't belong there. However we could 
>> experiment on the beta branch if that helps.
>> The idea is the same in all cases: flatpak builds follow a recipe as 
>> describe in a manifest file. Our manifest file is split up in smaller parts 
>> for readability but in general this contains a list of source packages, 
>> where to find them and how to build them. The sources for Finance::Quote are 
>> in
>> https://github.com/Gnucash/gnucash-on-flatpak/blob/master/modules/finance-quote-sources.json
>>  
>> 
>> The way to update is to change version numbers of tar balls and the sha256 
>> sums for these tarballs. Pushing these changes to the correct upstream repos 
>> will trigger new builds of the respective flatpaks.
>> Regards,
>> Geert
> 
> ___
> gnucash-devel mailing list
> gnucash-devel@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Finance Quote 1.50 release candidate 1 is available

2021-01-30 Thread Vincent Lucarelli
Finance Quote 1.50-rc.1 is available at 
https://github.com/finance-quote/finance-quote/releases/tag/v1.50-rc.1 


If anyone is available to test out their favorite quote modules, please do so.  
If you find any problems or have suggestions, please open an issue on GitHub so 
we can try address them before the final release.

Vince


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Finance::Quote approaching 1.50 release - some API changes for GnuCash to consider

2020-11-02 Thread Vincent Lucarelli
Dear GnuCash Developers,

It has been a slow effort, but we are finally approaching a 1.50 Finance::Quote 
release.

First, the intent is to maintain backwards compatibility, so if nothing changes 
in GnuCash, users should still be able to fetch quotes.

There are two new features that GnuCash could expose to users:

1. Module specific options 
2. Multiple sources for currency conversion rates

Both features are documented in the README at 
https://github.com/finance-quote/finance-quote 


Instead of adding a new environment variable for each module that requires an 
API key, Finance::Quote->new now takes a configuration hash:

$q = Finance::Quote->new('IEXCloud’, iexcloud => {API_KEY => ‘pk_0...'});
%quotes = $q->iexcloud(@symbols);

AlphaVantage will still use an environment variable, but the intent going 
forward is to limit environment variables.


Previously, currency conversion was handled only by AlphaVantage and required 
an API key.  We have added the European Central Bank as one key-free source 
(but it is limited) and several other sources with API keys that avoid the 
AlphaVantage throttling.

 $q = Finance::Quote->new('currency_rates' => {order => ['ECB', 'Fixer'],
 fixer => {API_KEY => ‘0…'}});


I thought a bit about how GnuCash might expose this to users, but we haven’t 
finalized 1.50 yet so there is still time for change.


Best,

Vince

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: [GNC-dev] Thoughts on new Finance::Quote modules that require an API Key

2019-06-16 Thread Vincent Lucarelli
Hi,

I think for the next release of Finance::Quote, Alphavantage.pm and IEXCloud 
will only support environment variables (named ALPHVANTAGE_API_KEY and 
IEXCLOUD_API_KEY).

We are going to work on extending the new operator to allow setting instance 
variables, including module specific data.  Something like:

my $q = Finance::Quote->new(
 TIMEOUT => 60,
 FAILOVER => 1,
 alphavantage => { API_KEY => 'thealphavkey', othervariable => 'value' },
 iexcloud => { API_KEY => 'theiexkey'},
  );

There will also be setter methods as you suggested.

We can keep you informed so that the September GnuCash release can take 
advantage.

Best,

Vince

> On Jun 15, 2019, at 10:59 PM, John Ralls  wrote:
> 
> David,
> 
> AQBanking maintains its own set of settings files in ~/.aqbanking. 
> Finance::Quote at present doesn't keep any user state.
> 
> Regards,
> John Ralls
> 
> 
>> On Jun 15, 2019, at 5:52 PM, David Carlson  
>> wrote:
>> 
>> I believe the AQ Banking feature has already solved the issue of saving 
>> usernames and passwords for multiple financial institutions in a manner that 
>> is easily migrated to new GnuCash releases.  Is it possible to do the API 
>> Key thing in a manner that would seem very little different to the user?
>> 
>> 
>> 
>> On Sat, Jun 15, 2019 at 12:53 PM John Ralls  wrote:
>> 
>> 
>>> On Jun 15, 2019, at 9:17 AM, Vincent Lucarelli 
>>>  wrote:
>>> 
>>> Hi,
>>> 
>>> We are working on the next release of Finance::Quote and will try to add 
>>> https://iexcloud.io/ <https://iexcloud.io/> as a new module.
>>> 
>>> Like Alphavantage, users will need to register and get an API key.
>>> 
>>> Since GnuCash is a major user of Finance::Quote, I wanted to get opinions 
>>> on how to handle API keys.  I have two initial ideas:
>>> 
>>> 
>>> 1. Each Finance::Quote module expects a module specific environment 
>>> variable and GnuCash would need to update the Preferences > Online Quotes 
>>> pane for each API key.
>>> 
>>> 2. We invent a more global environment variable that can hold multiple API 
>>> keys. For example, something like
>>> 
>>> FQ_API_KEYS=ALPHAVANTAGE_API_KEY:;IEXCLOUD_API_KEY:sk_
>>> 
>>> 
>>> The problem with the first approach is that GnuCash preferences need to 
>>> change with each addition.
>>> 
>>> The problems wit the second approach are usability and parsing (do we 
>>> assume no service would ever include : or ; in the API key?).  The later 
>>> could be solved with json formatting, but that is even worse for users.
>>> 
>>> 
>>> 
>>> Appreciate any suggestions.
>> 
>> Vince,
>> 
>> Excellent news, thanks for stepping up to help Erik out.
>> 
>> ';' in your FQ_API_KEYS will have to be quoted to keep the shell from 
>> interpreting it, and any quotes in the key would have to be escaped even 
>> with separate environment variables per service. Telling users to escape the 
>> delimiter character and quotes is easier than teaching them to format a JSON 
>> string. e.g FQ_API_KEYS="AlphaVantage:x\"\:xx...". The real 
>> problem with that is that it breaks backward compatibility with GnuCash, 
>> which sets ALPHAVANTAGE_API_KEY when the preference is set. That could be 
>> worked around by continuing to look for the older environment variable, or 
>> telling users to set the new environment variable themselves, which they'd 
>> need to do anyway to use a new service until we rewrote the preference item. 
>> Note that we're two weeks away from our next release, so that change would 
>> be in the September release at the earliest.
>> 
>> Environment variables are clumsy. Might you consider an alternative, perhaps 
>> a "set_key(service, key)" function on the Finance::Quote object? 
>> 
>> Regards,
>> John Ralls
>> 
>> 
>> ___
>> gnucash-devel mailing list
>> gnucash-devel@gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>> 
>> 
>> -- 
>> David Carlson
> 

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


[GNC-dev] Thoughts on new Finance::Quote modules that require an API Key

2019-06-15 Thread Vincent Lucarelli
Hi,

We are working on the next release of Finance::Quote and will try to add 
https://iexcloud.io/  as a new module.

Like Alphavantage, users will need to register and get an API key.

Since GnuCash is a major user of Finance::Quote, I wanted to get opinions on 
how to handle API keys.  I have two initial ideas:


1. Each Finance::Quote module expects a module specific environment variable 
and GnuCash would need to update the Preferences > Online Quotes pane for each 
API key.

2. We invent a more global environment variable that can hold multiple API 
keys. For example, something like

FQ_API_KEYS=ALPHAVANTAGE_API_KEY:;IEXCLOUD_API_KEY:sk_


The problem with the first approach is that GnuCash preferences need to change 
with each addition.

The problems wit the second approach are usability and parsing (do we assume no 
service would ever include : or ; in the API key?).  The later could be solved 
with json formatting, but that is even worse for users.



Appreciate any suggestions.


Best,

Vince
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel