[GNC] Pack with Python bindings on macOS?

john jralls at ceridwen.us
Fri Apr 21 12:20:10 EDT 2023



> On Apr 21, 2023, at 3:17 AM, monson <holymonson at gmail.com> wrote:
> 
> Hi there,
> 
> The pure python client `piecash` seems obsoleted and no longer worked with latest sqlalchemy and gnucash, so I'm trying to switch to original python bindings. Since they aren't shipped in the pre-built bundle, I tried to build those bindings but it seems have to build the whole gnucash and doesn't work well.
> On Linux (e.g. archlinux) those python bindings are shipped with the gnucash package. May I ask if we can do the same on macOS? Thanks.

Unfortunately there's no good way to do that. The Python bindings need to be linked with libpython3 and Apple only provides one in recent versions of Xcode--Xcode itself, mind, not the SDK--with a decidedly quirky framework layout. Supporting that across 5 versions of macOS isn't practical. Worse, since it's not in the SDK it can't be linked from another bundle: Apple's notarization doesn't allow linking anything outside the bundle that's not in either /usr/lib or /System/Library/Frameworks. With that latter rule the only way to include the python bindings in GnuCash app is to include a full build of Python in the bundle and you'd have to use the Python executable in the bundle with the scripts. That's a lot of extra baggage for the few users who want it.

If building GnuCash with gtk-osx is too hard consider MacPorts instead. Homebrew just "bottles" GnuCash.app so it's not an alternative.

Regards,
John Ralls




More information about the gnucash-user mailing list