You are not logged in.

#1 2024-05-20 10:41:46

Randoragon
Member
Registered: 2021-02-28
Posts: 3

Enable GPGME feature in the ledger package

Ledger for a few years now has had a very useful, but not well-known feature. That feature is to decrypt journal files on-the-fly using GPGME (a random blogpost about this: https://passingcuriosity.com/2024/ledger-with-gnupg/).

I might be speaking for a niche minority, but this feature is immensely useful to me, because I keep all my journals encrypted, as I think everyone should.
Enabling it requires a tiny modification to CMakeLists.txt before building (https://github.com/ledger/ledger/blob/f … ts.txt#L38) that for some reason is not enabled by default. Given that ledger is pretty annoying to build by hand (takes a long time and has quite a few dependencies), I would love to see this being a part of the extra/ledger official package.

The necessary modification can be easily accomplished e.g. with sed:

git clone git@github.com:ledger/ledger.git

cd ledger
sed -i '/^option(USE_GPGME/s/OFF)$/ON)/' CMakeLists.txt   # <-- The only extra step needed
./acprep dependencies
./acprep update
sudo make install

By the looks of it, this would need to be inserted before this cmake command: https://gitlab.archlinux.org/archlinux/ … GBUILD#L29

Would this be possible?

Side-note: Ledger reports whether this feature is enabled upon invocation, e.g. the current build from the extra repos has "without support for gpg encrypted journals" in its output:

$ /usr/bin/ledger
Ledger 3.3.2-20230330, the command-line accounting tool
without support for gpg encrypted journals and with Python support

Copyright (c) 2003-2023, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.
]

Offline

Board footer

Powered by FluxBB