hledger icon indicating copy to clipboard operation
hledger copied to clipboard

hledger in termux

Open linuxcaffe opened this issue 8 years ago • 22 comments

Termux is a terminal emulator and Linux environment bringing powerful terminal access to Android. Having hledger available in the termux repositories would be a big step towards tracking your expenses when and where they happen, and having your accounts in your pocket.

.. however haskell support in termux has been started but isn't working, and till that gets fixed, hledger (and hledger-web, ui, iadd etc) can't be compiled for the platform.

If you're a haskeller with an android phone, please have a look at http://termux.com and http://github.com/termux/termux-packages/tree/master/disabled-packages/ghc and see if you can help make this happen.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

linuxcaffe avatar Sep 07 '16 23:09 linuxcaffe

see also https://github.com/termux/termux-packages/issues/80 for earlier discussion of same.

linuxcaffe avatar Sep 07 '16 23:09 linuxcaffe

I've just opened up an issue specific to hledger - https://github.com/termux/termux-packages/issues/3803

For reference, Termux Packages repo: https://github.com/termux/termux-packages

Historical reference: #139

alensiljak avatar May 13 '19 10:05 alensiljak

Thanks!

simonmichael avatar May 13 '19 13:05 simonmichael

Actually, this is worth a separate post.

Hledger is available on Nix, https://hledger.org/download.html Nix is a package manager for Haskell apps (I believe), https://nixos.org/nix/about.html Using this script, Nix can be installed in Termux on Android: https://github.com/t184256/nix-in-termux The author of the script is working on Nix-on-Droid, project, which is a self-contained app (uses a Termux fork), according to the description. Available at https://nix-on-droid.unboiled.info/ Bootstrap script provides more info.

I have not tried these (yet) but, if that works, then hledger is already available on Android (though not in Termux, as per the original request title :P).

Edit: I think that having a binary package would be a much cleaner option. I have Termux installed for Ledger and Python anyway.

alensiljak avatar May 13 '19 13:05 alensiljak

Do you store expenses on smartphone?

crocket avatar May 13 '19 13:05 crocket

@crocket, absolutely! I'm using ~~Android MMEx~~ Cashier for entering transactions on the phone and then export them to a ledger file, on a quiet day, approx. once a month.

But I think it would be convenient if I could just run those same reports on the phone directly.

alensiljak avatar May 13 '19 14:05 alensiljak

Apparently, there is also another option available: http://donyaquick.com/running-haskell-on-linux-on-android/. Haven't tried yet. Userland

alensiljak avatar Jun 21 '19 10:06 alensiljak

Consider running a VPN or a (Raspberry Pi) wake-up server that wakes up your desktop. With a wake-up server, you can wake up your desktop remotely over the internet and connect to it via SSH. Or, you can run hledger on Raspberry Pi. Because microSD card is susceptible to writes, I put any variable files on tmpfs.

I use Raspberry Pi as a morning alarm and a home automation system, too.

crocket avatar Jun 22 '19 00:06 crocket

Interesting idea but implies much more infrastructure than I'd like to have. I enjoy places without electricity and GSM signal. There I get the best ideas and can focus without distractions. Hence it's a different use case.

alensiljak avatar Jun 22 '19 08:06 alensiljak

I enjoy places without electricity and GSM signal.

Where do you find such places?

crocket avatar Jun 22 '19 11:06 crocket

Austrian Alps, Croatian islands, Bosnian mountains and outback... Not too many left, though.

alensiljak avatar Jun 22 '19 11:06 alensiljak

I also use termux on android and spend lots of time im places without cell signal. Would be nice to see this work! Following along in the hopes that this will work at some point.

AndrewMcSwain avatar Dec 15 '22 14:12 AndrewMcSwain

This is actually (more than) half-way there. Hledger is available as a regular package, for example, in Debian, which can be installed as a proot-distro. I may have also tried it in Alpine, if memory serves me well.

So, in terms of functionality - yes, hledger can be run on a phone!

alensiljak avatar Dec 15 '22 14:12 alensiljak

see also termux/termux-packages#80 for earlier discussion of same.

Also, this issue is implemented by now.

alensiljak avatar Dec 15 '22 14:12 alensiljak

I am so close...

pkg install unstable-repo
pkg install ghc cabal-install
cabal install alex happy
cabal install hledger hledger-ui

On the last step, however, the build fails:

Wrote tarball sdist to
/data/data/com.termux/files/home/downloads/hledger/dist-newstyle/sdist/hledger-lib-1.30.99.tar.gz
Wrote tarball sdist to
/data/data/com.termux/files/home/downloads/hledger/dist-newstyle/sdist/hledger-1.30.99.tar.gz
Wrote tarball sdist to
/data/data/com.termux/files/home/downloads/hledger/dist-newstyle/sdist/hledger-ui-1.30.99.tar.gz
Wrote tarball sdist to
/data/data/com.termux/files/home/downloads/hledger/dist-newstyle/sdist/hledger-web-1.30.99.tar.gz
Resolving dependencies...
Build profile: -w ghc-9.2.5 -O1
In order, the following will be built (use -v for more details):
 - fsnotify-0.4.1.0 (lib) (requires build)
 - hledger-lib-1.30.99 (lib) (requires build)
 - shakespeare-2.1.0 (lib) (requires build)
 - vty-5.38 (lib) (requires build)
 - hledger-1.30.99 (lib) (requires build)
 - brick-1.9 (lib) (requires build)
 - hledger-1.30.99 (exe:hledger) (requires build)
 - hledger-ui-1.30.99 (exe:hledger-ui) (requires build)
Starting     fsnotify-0.4.1.0 (lib)
Starting     shakespeare-2.1.0 (lib)
Starting     vty-5.38 (lib)
Starting     hledger-lib-1.30.99 (lib)
Building     fsnotify-0.4.1.0 (lib)
Building     shakespeare-2.1.0 (lib)
Building     vty-5.38 (lib)
Building     hledger-lib-1.30.99 (lib)

Failed to build fsnotify-0.4.1.0.
Build log (
/data/data/com.termux/files/home/.cabal/logs/ghc-9.2.5/fsnotify-0.4.1.0-4aa93aa529c569a6c66b41318f92ecfcedd1257e5ff1dc9f3791d3a17fc68ade.log
):
Configuring library for fsnotify-0.4.1.0..
Preprocessing library for fsnotify-0.4.1.0..
Building library for fsnotify-0.4.1.0..
[1 of 7] Compiling System.FSNotify.Find ( src/System/FSNotify/Find.hs, dist/build/System/FSNotify/Find.o, dist/build/System/FSNotify/Find.dyn_o )
[2 of 7] Compiling System.FSNotify.Path ( src/System/FSNotify/Path.hs, dist/build/System/FSNotify/Path.o, dist/build/System/FSNotify/Path.dyn_o )
[3 of 7] Compiling System.FSNotify.Types ( src/System/FSNotify/Types.hs, dist/build/System/FSNotify/Types.o, dist/build/System/FSNotify/Types.dyn_o )
[4 of 7] Compiling System.FSNotify.Listener ( src/System/FSNotify/Listener.hs, dist/build/System/FSNotify/Listener.o, dist/build/System/FSNotify/Listener.dyn_o )
[5 of 7] Compiling System.FSNotify.Polling ( src/System/FSNotify/Polling.hs, dist/build/System/FSNotify/Polling.o, dist/build/System/FSNotify/Polling.dyn_o )
[6 of 7] Compiling System.FSNotify  ( src/System/FSNotify.hs, dist/build/System/FSNotify.o, dist/build/System/FSNotify.dyn_o )

src/System/FSNotify.hs:175:34: error:
    Not in scope: type constructor or class ‘NativeManager’
    |
175 |     createManager :: Either Text NativeManager -> IO WatchManager
    |                                  ^^^^^^^^^^^^^

Failed to build hledger-lib-1.30.99.
Build log (
/data/data/com.termux/files/home/.cabal/logs/ghc-9.2.5/hledger-lib-1.30.99-674fbfe8839bcc0fe7f2e173a11ffed799693b14e0cbe0a732958d7d7d8e5486.log
):
Configuring library for hledger-lib-1.30.99..
Preprocessing library for hledger-lib-1.30.99..
Building library for hledger-lib-1.30.99..
[ 1 of 55] Compiling Hledger.Utils.Regex ( Hledger/Utils/Regex.hs, dist/build/Hledger/Utils/Regex.o, dist/build/Hledger/Utils/Regex.dyn_o )
[ 2 of 55] Compiling Hledger.Data.Types ( Hledger/Data/Types.hs, dist/build/Hledger/Data/Types.o, dist/build/Hledger/Data/Types.dyn_o )
[ 3 of 55] Compiling Hledger.Data.Period ( Hledger/Data/Period.hs, dist/build/Hledger/Data/Period.o, dist/build/Hledger/Data/Period.dyn_o )
[ 4 of 55] Compiling Paths_hledger_lib ( dist/build/autogen/Paths_hledger_lib.hs, dist/build/Paths_hledger_lib.o, dist/build/Paths_hledger_lib.dyn_o )
[ 5 of 55] Compiling Text.Megaparsec.Custom ( Text/Megaparsec/Custom.hs, dist/build/Text/Megaparsec/Custom.o, dist/build/Text/Megaparsec/Custom.dyn_o )
[ 6 of 55] Compiling Text.WideString  ( Text/WideString.hs, dist/build/Text/WideString.o, dist/build/Text/WideString.dyn_o )
[ 7 of 55] Compiling Text.Tabular.AsciiWide ( Text/Tabular/AsciiWide.hs, dist/build/Text/Tabular/AsciiWide.o, dist/build/Text/Tabular/AsciiWide.dyn_o )
[ 8 of 55] Compiling Hledger.Utils.Text ( Hledger/Utils/Text.hs, dist/build/Hledger/Utils/Text.o, dist/build/Hledger/Utils/Text.dyn_o )
[ 9 of 55] Compiling Hledger.Utils.IO ( Hledger/Utils/IO.hs, dist/build/Hledger/Utils/IO.o, dist/build/Hledger/Utils/IO.dyn_o )
[10 of 55] Compiling Hledger.Utils.Test ( Hledger/Utils/Test.hs, dist/build/Hledger/Utils/Test.o, dist/build/Hledger/Utils/Test.dyn_o )
[11 of 55] Compiling Hledger.Utils.Debug ( Hledger/Utils/Debug.hs, dist/build/Hledger/Utils/Debug.o, dist/build/Hledger/Utils/Debug.dyn_o )
[12 of 55] Compiling Hledger.Utils.Parse ( Hledger/Utils/Parse.hs, dist/build/Hledger/Utils/Parse.o, dist/build/Hledger/Utils/Parse.dyn_o )
[13 of 55] Compiling Hledger.Utils.String ( Hledger/Utils/String.hs, dist/build/Hledger/Utils/String.o, dist/build/Hledger/Utils/String.dyn_o )
[14 of 55] Compiling Hledger.Utils    ( Hledger/Utils.hs, dist/build/Hledger/Utils.o, dist/build/Hledger/Utils.dyn_o )
[15 of 55] Compiling Hledger.Read.CsvUtils ( Hledger/Read/CsvUtils.hs, dist/build/Hledger/Read/CsvUtils.o, dist/build/Hledger/Read/CsvUtils.dyn_o )
[16 of 55] Compiling Hledger.Data.RawOptions ( Hledger/Data/RawOptions.hs, dist/build/Hledger/Data/RawOptions.o, dist/build/Hledger/Data/RawOptions.dyn_o )
[17 of 55] Compiling Hledger.Data.Dates ( Hledger/Data/Dates.hs, dist/build/Hledger/Data/Dates.o, dist/build/Hledger/Data/Dates.dyn_o )
[18 of 55] Compiling Hledger.Data.AccountName ( Hledger/Data/AccountName.hs, dist/build/Hledger/Data/AccountName.o, dist/build/Hledger/Data/AccountName.dyn_o )
[19 of 55] Compiling Hledger.Data.StringFormat ( Hledger/Data/StringFormat.hs, dist/build/Hledger/Data/StringFormat.o, dist/build/Hledger/Data/StringFormat.dyn_o )
[20 of 55] Compiling Hledger.Data.Amount ( Hledger/Data/Amount.hs, dist/build/Hledger/Data/Amount.o, dist/build/Hledger/Data/Amount.dyn_o )
[21 of 55] Compiling Hledger.Data.Valuation ( Hledger/Data/Valuation.hs, dist/build/Hledger/Data/Valuation.o, dist/build/Hledger/Data/Valuation.dyn_o )
[22 of 55] Compiling Hledger.Data.Posting ( Hledger/Data/Posting.hs, dist/build/Hledger/Data/Posting.o, dist/build/Hledger/Data/Posting.dyn_o )
[23 of 55] Compiling Hledger.Data.Transaction ( Hledger/Data/Transaction.hs, dist/build/Hledger/Data/Transaction.o, dist/build/Hledger/Data/Transaction.dyn_o )
[24 of 55] Compiling Hledger.Query    ( Hledger/Query.hs, dist/build/Hledger/Query.o, dist/build/Hledger/Query.dyn_o )
[25 of 55] Compiling Hledger.Data.TransactionModifier ( Hledger/Data/TransactionModifier.hs, dist/build/Hledger/Data/TransactionModifier.o, dist/build/Hledger/Data/TransactionModifier.dyn_o )
[26 of 55] Compiling Hledger.Data.Timeclock ( Hledger/Data/Timeclock.hs, dist/build/Hledger/Data/Timeclock.o, dist/build/Hledger/Data/Timeclock.dyn_o )
[27 of 55] Compiling Hledger.Data.Errors ( Hledger/Data/Errors.hs, dist/build/Hledger/Data/Errors.o, dist/build/Hledger/Data/Errors.dyn_o )
[28 of 55] Compiling Hledger.Data.JournalChecks.Ordereddates ( Hledger/Data/JournalChecks/Ordereddates.hs, dist/build/Hledger/Data/JournalChecks/Ordereddates.o, dist/build/Hledger/Data/JournalChecks/Ordereddates.dyn_o )
[29 of 55] Compiling Hledger.Data.PeriodicTransaction ( Hledger/Data/PeriodicTransaction.hs, dist/build/Hledger/Data/PeriodicTransaction.o, dist/build/Hledger/Data/PeriodicTransaction.dyn_o )
[30 of 55] Compiling Hledger.Data.Json ( Hledger/Data/Json.hs, dist/build/Hledger/Data/Json.o, dist/build/Hledger/Data/Json.dyn_o )
[31 of 55] Compiling Hledger.Data.Journal ( Hledger/Data/Journal.hs, dist/build/Hledger/Data/Journal.o, dist/build/Hledger/Data/Journal.dyn_o )
[32 of 55] Compiling Hledger.Data.JournalChecks.Uniqueleafnames ( Hledger/Data/JournalChecks/Uniqueleafnames.hs, dist/build/Hledger/Data/JournalChecks/Uniqueleafnames.o, dist/build/Hledger/Data/JournalChecks/Uniqueleafnames.dyn_o )
[33 of 55] Compiling Hledger.Data.JournalChecks ( Hledger/Data/JournalChecks.hs, dist/build/Hledger/Data/JournalChecks.o, dist/build/Hledger/Data/JournalChecks.dyn_o )
[34 of 55] Compiling Hledger.Data.Balancing ( Hledger/Data/Balancing.hs, dist/build/Hledger/Data/Balancing.o, dist/build/Hledger/Data/Balancing.dyn_o )
<command line>: dlopen failed: cannot locate symbol "stg_SRT_1_info" referenced by "/data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/utf8-string-1.0.2-7fc89245a138ffaa17972bd07b0d4c1d5158af5fe1613f6082a28b8d6003eb39/lib/libHSutf8-string-1.0.2-7fc89245a138ffaa17972bd07b0d4c1d5158af5fe1613f6082a28b8d6003eb39-ghc9.2.5.so"...

Failed to build shakespeare-2.1.0.
Build log (
/data/data/com.termux/files/home/.cabal/logs/ghc-9.2.5/shakespeare-2.1.0-4f62ff0fa3f4b164822fa213028d61a6c51c5655fde5e5e94e51ff718ba9e6e8.log
):
Configuring library for shakespeare-2.1.0..
Preprocessing library for shakespeare-2.1.0..
Building library for shakespeare-2.1.0..
[ 1 of 22] Compiling Text.IndentToBrace ( Text/IndentToBrace.hs, dist/build/Text/IndentToBrace.o, dist/build/Text/IndentToBrace.dyn_o )

Text/IndentToBrace.hs:32:25: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding: Patterns of type ‘[T.Text]’ not matched: []
   |
32 |                     let (x:xs) = go True $ after : ls
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 2 of 22] Compiling Text.Internal.Cassius ( Text/Internal/Cassius.hs, dist/build/Text/Internal/Cassius.o, dist/build/Text/Internal/Cassius.dyn_o )
[ 3 of 22] Compiling Text.MkSizeType  ( Text/MkSizeType.hs, dist/build/Text/MkSizeType.o, dist/build/Text/MkSizeType.dyn_o )
[ 4 of 22] Compiling Text.Shakespeare.Base ( Text/Shakespeare/Base.hs, dist/build/Text/Shakespeare/Base.o, dist/build/Text/Shakespeare/Base.dyn_o )

Text/Shakespeare/Base.hs:30:1: warning: [-Wdodgy-imports]
    Module
    ‘Language.Haskell.TH.Syntax’
    does not export
    ‘makeRelativeToProject’
   |
30 | import Language.Haskell.TH.Syntax hiding (makeRelativeToProject)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Text/Shakespeare/Base.hs:31:1: warning: [-Wunused-imports]
    The import of ‘Language.Haskell.TH’ is redundant
      except perhaps to import instances from ‘Language.Haskell.TH’
    To import instances alone, use: import Language.Haskell.TH()
   |
31 | import Language.Haskell.TH (appE)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Text/Shakespeare/Base.hs:37:1: warning: [-Wunused-imports]
    The import of ‘Data.Ratio’ is redundant
      except perhaps to import instances from ‘Data.Ratio’
    To import instances alone, use: import Data.Ratio()
   |
37 | import Data.Ratio (Ratio, numerator, denominator, (%))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 5 of 22] Compiling Text.Shakespeare ( Text/Shakespeare.hs, dist/build/Text/Shakespeare.o, dist/build/Text/Shakespeare.dyn_o )
[ 6 of 22] Compiling Text.Julius      ( Text/Julius.hs, dist/build/Text/Julius.o, dist/build/Text/Julius.dyn_o )

Text/Julius.hs:51:1: warning: [-Wunused-imports]
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
   |
51 | import Data.Monoid (Monoid(..))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Text/Julius.hs:52:1: warning: [-Wunused-imports]
    The import of ‘Data.Semigroup’ is redundant
      except perhaps to import instances from ‘Data.Semigroup’
    To import instances alone, use: import Data.Semigroup()
   |
52 | import Data.Semigroup (Semigroup(..))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 7 of 22] Compiling Text.Roy         ( Text/Roy.hs, dist/build/Text/Roy.o, dist/build/Text/Roy.dyn_o )
[ 8 of 22] Compiling Text.Coffee      ( Text/Coffee.hs, dist/build/Text/Coffee.o, dist/build/Text/Coffee.dyn_o )
[ 9 of 22] Compiling Text.Internal.Css ( Text/Internal/Css.hs, dist/build/Text/Internal/Css.o, dist/build/Text/Internal/Css.dyn_o )

Text/Internal/Css.hs:22:1: warning: [-Wunused-imports]
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
   |
22 | import Data.Monoid (Monoid, mconcat, mappend, mempty)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Text/Internal/Css.hs:23:1: warning: [-Wunused-imports]
    The import of ‘Data.Semigroup’ is redundant
      except perhaps to import instances from ‘Data.Semigroup’
    To import instances alone, use: import Data.Semigroup()
   |
23 | import Data.Semigroup (Semigroup(..))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Text/Internal/Css.hs:31:1: warning: [-Wunused-imports]
    The import of ‘Control.Applicative’ is redundant
      except perhaps to import instances from ‘Control.Applicative’
    To import instances alone, use: import Control.Applicative()
   |
31 | import Control.Applicative ((<$>), (<*>))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Text/Internal/Css.hs:34:1: warning: [-Wunused-imports]
    The import of ‘Data.Functor.Identity’ is redundant
      except perhaps to import instances from ‘Data.Functor.Identity’
    To import instances alone, use: import Data.Functor.Identity()
   |
34 | import Data.Functor.Identity (runIdentity)
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[10 of 22] Compiling Text.Internal.Lucius ( Text/Internal/Lucius.hs, dist/build/Text/Internal/Lucius.o, dist/build/Text/Internal/Lucius.dyn_o )
[11 of 22] Compiling Text.Internal.CssCommon ( Text/Internal/CssCommon.hs, dist/build/Text/Internal/CssCommon.o, dist/build/Text/Internal/CssCommon.dyn_o )
<command line>: dlopen failed: cannot locate symbol "stg_upd_frame_info" referenced by "/data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/th-abstraction-0.5.0.0-6b8ea885864944bcdb0b9f20822dc8933077d86054019fcd5a22c9c955beab55/lib/libHSth-abstraction-0.5.0.0-6b8ea885864944bcdb0b9f20822dc8933077d86054019fcd5a22c9c955beab55-ghc9.2.5.so"...

Failed to build vty-5.38.
Build log (
/data/data/com.termux/files/home/.cabal/logs/ghc-9.2.5/vty-5.38-65b2ea2bb615ac2c4de864cd7b2770992fdaea7b2519f181902ff6baa598a3ce.log
):
Configuring library for vty-5.38..
Preprocessing library for vty-5.38..
Building library for vty-5.38..
[ 1 of 38] Compiling Data.Terminfo.Parse ( src/Data/Terminfo/Parse.hs, dist/build/Data/Terminfo/Parse.o, dist/build/Data/Terminfo/Parse.dyn_o )
[ 2 of 38] Compiling Data.Terminfo.Eval ( src/Data/Terminfo/Eval.hs, dist/build/Data/Terminfo/Eval.o, dist/build/Data/Terminfo/Eval.dyn_o )

src/Data/Terminfo/Eval.hs:18:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad.Identity’ is redundant
      except perhaps to import instances from ‘Control.Monad.Identity’
    To import instances alone, use: import Control.Monad.Identity()
   |
18 | import Control.Monad.Identity
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Terminfo/Eval.hs:39:9: warning: [-Wincomplete-uni-patterns]
    Pattern match(es) are non-exhaustive
    In a pattern binding: Patterns of type ‘[CapParam]’ not matched: []
   |
39 |     let v : stack' = evalStack s
   |         ^^^^^^^^^^^^^^^^^^^^^^^^
[ 3 of 38] Compiling Graphics.Text.Width ( src/Graphics/Text/Width.hs, dist/build/Graphics/Text/Width.o, dist/build/Graphics/Text/Width.dyn_o )
[ 4 of 38] Compiling Graphics.Vty.Attributes.Color240 ( src/Graphics/Vty/Attributes/Color240.hs, dist/build/Graphics/Vty/Attributes/Color240.o, dist/build/Graphics/Vty/Attributes/Color240.dyn_o )
[ 5 of 38] Compiling Graphics.Vty.Attributes.Color ( src/Graphics/Vty/Attributes/Color.hs, dist/build/Graphics/Vty/Attributes/Color.o, dist/build/Graphics/Vty/Attributes/Color.dyn_o )
[ 6 of 38] Compiling Graphics.Vty.Attributes ( src/Graphics/Vty/Attributes.hs, dist/build/Graphics/Vty/Attributes.o, dist/build/Graphics/Vty/Attributes.dyn_o )
[ 7 of 38] Compiling Graphics.Vty.DisplayAttributes ( src/Graphics/Vty/DisplayAttributes.hs, dist/build/Graphics/Vty/DisplayAttributes.o, dist/build/Graphics/Vty/DisplayAttributes.dyn_o )
[ 8 of 38] Compiling Graphics.Vty.Error ( src/Graphics/Vty/Error.hs, dist/build/Graphics/Vty/Error.o, dist/build/Graphics/Vty/Error.dyn_o )
[ 9 of 38] Compiling Graphics.Vty.Image.Internal ( src/Graphics/Vty/Image/Internal.hs, dist/build/Graphics/Vty/Image/Internal.o, dist/build/Graphics/Vty/Image/Internal.dyn_o )
[10 of 38] Compiling Graphics.Vty.Image ( src/Graphics/Vty/Image.hs, dist/build/Graphics/Vty/Image.o, dist/build/Graphics/Vty/Image.dyn_o )
[11 of 38] Compiling Graphics.Vty.Input.Events ( src/Graphics/Vty/Input/Events.hs, dist/build/Graphics/Vty/Input/Events.o, dist/build/Graphics/Vty/Input/Events.dyn_o )
[12 of 38] Compiling Graphics.Vty.Input.Classify.Types ( src/Graphics/Vty/Input/Classify/Types.hs, dist/build/Graphics/Vty/Input/Classify/Types.o, dist/build/Graphics/Vty/Input/Classify/Types.dyn_o )
[13 of 38] Compiling Graphics.Vty.Input.Classify.Parse ( src/Graphics/Vty/Input/Classify/Parse.hs, dist/build/Graphics/Vty/Input/Classify/Parse.o, dist/build/Graphics/Vty/Input/Classify/Parse.dyn_o )
[14 of 38] Compiling Graphics.Vty.Config ( src/Graphics/Vty/Config.hs, dist/build/Graphics/Vty/Config.o, dist/build/Graphics/Vty/Config.dyn_o )
[15 of 38] Compiling Graphics.Vty.Input.Focus ( src/Graphics/Vty/Input/Focus.hs, dist/build/Graphics/Vty/Input/Focus.o, dist/build/Graphics/Vty/Input/Focus.dyn_o )

src/Graphics/Vty/Input/Focus.hs:14:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad.State’ is redundant
      except perhaps to import instances from ‘Control.Monad.State’
    To import instances alone, use: import Control.Monad.State()
   |
14 | import Control.Monad.State
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[16 of 38] Compiling Graphics.Vty.Input.Mouse ( src/Graphics/Vty/Input/Mouse.hs, dist/build/Graphics/Vty/Input/Mouse.o, dist/build/Graphics/Vty/Input/Mouse.dyn_o )

src/Graphics/Vty/Input/Mouse.hs:18:1: warning: [-Wunused-imports]
    The import of ‘Control.Monad.State’ is redundant
      except perhaps to import instances from ‘Control.Monad.State’
    To import instances alone, use: import Control.Monad.State()
   |
18 | import Control.Monad.State
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
[17 of 38] Compiling Graphics.Vty.Input.Paste ( src/Graphics/Vty/Input/Paste.hs, dist/build/Graphics/Vty/Input/Paste.o, dist/build/Graphics/Vty/Input/Paste.dyn_o )
[18 of 38] Compiling Graphics.Vty.Input.Classify ( src/Graphics/Vty/Input/Classify.hs, dist/build/Graphics/Vty/Input/Classify.o, dist/build/Graphics/Vty/Input/Classify.dyn_o )
[19 of 38] Compiling Graphics.Vty.Input.Loop ( src/Graphics/Vty/Input/Loop.hs, dist/build/Graphics/Vty/Input/Loop.o, dist/build/Graphics/Vty/Input/Loop.dyn_o )
<command line>: dlopen failed: cannot locate symbol "stg_upd_frame_info" referenced by "/data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/data-array-byte-0.1.0.1-0774fdd67b40d018b0317444677d41304de45b8aef5580471e569cbfdc57188d/lib/libHSdata-array-byte-0.1.0.1-0774fdd67b40d018b0317444677d41304de45b8aef5580471e569cbfdc57188d-ghc9.2.5.so"...

gloriouslyawkwardlife avatar Aug 05 '23 03:08 gloriouslyawkwardlife

Building library for fsnotify-0.4.1.0.. ... [6 of 7] Compiling System.FSNotify ( src/System/FSNotify.hs, dist/build/System/FSNotify.o, dist/build/System/FSNotify.dyn_o )

src/System/FSNotify.hs:175:34: error: Not in scope: type constructor or class ‘NativeManager’ | 175 | createManager :: Either Text NativeManager -> IO WatchManager | ^^^^^^^^^^^^^

This seems like something to report to fsnotify maintainer. A similar issue: https://github.com/haskell-fswatch/hfsnotify/issues/109. Related code: https://hackage.haskell.org/package/fsnotify-0.1.0.2/docs/src/System-FSNotify.html

Building library for hledger-lib-1.30.99.. ... [34 of 55] Compiling Hledger.Data.Balancing ( Hledger/Data/Balancing.hs, dist/build/Hledger/Data/Balancing.o, dist/build/Hledger/Data/Balancing.dyn_o ) : dlopen failed: cannot locate symbol "stg_SRT_1_info" referenced by "/data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/utf8-string-1.0.2-7fc89245a138ffaa17972bd07b0d4c1d5158af5fe1613f6082a28b8d6003eb39/lib/libHSutf8-string-1.0.2-7fc89245a138ffaa17972bd07b0d4c1d5158af5fe1613f6082a28b8d6003eb39-ghc9.2.5.so"...

Building library for shakespeare-2.1.0.. ... [11 of 22] Compiling Text.Internal.CssCommon ( Text/Internal/CssCommon.hs, dist/build/Text/Internal/CssCommon.o, dist/build/Text/Internal/CssCommon.dyn_o ) : dlopen failed: cannot locate symbol "stg_upd_frame_info" referenced by "/data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/th-abstraction-0.5.0.0-6b8ea885864944bcdb0b9f20822dc8933077d86054019fcd5a22c9c955beab55/lib/libHSth-abstraction-0.5.0.0-6b8ea885864944bcdb0b9f20822dc8933077d86054019fcd5a22c9c955beab55-ghc9.2.5.so"...

Building library for vty-5.38.. ... [19 of 38] Compiling Graphics.Vty.Input.Loop ( src/Graphics/Vty/Input/Loop.hs, dist/build/Graphics/Vty/Input/Loop.o, dist/build/Graphics/Vty/Input/Loop.dyn_o ) : dlopen failed: cannot locate symbol "stg_upd_frame_info" referenced by "/data/data/com.termux/files/home/.cabal/store/ghc-9.2.5/data-array-byte-0.1.0.1-0774fdd67b40d018b0317444677d41304de45b8aef5580471e569cbfdc57188d/lib/libHSdata-array-byte-0.1.0.1-0774fdd67b40d018b0317444677d41304de45b8aef5580471e569cbfdc57188d-ghc9.2.5.so"...

I see signs online that these might be a problem in GHC 9.2's runtime system. I would try GHC 9.4.

simonmichael avatar Aug 05 '23 10:08 simonmichael

PS building hledger should work if you omit hledger-ui for now.

simonmichael avatar Aug 05 '23 10:08 simonmichael

I compiled it. It's not clean, it's hacky, but it works.

erplsf avatar Sep 04 '23 13:09 erplsf

Quick instructions until I get back to my laptop next week:

  1. Follow this guide to setup chroot env: https://blog.devgenius.io/how-to-compile-haskell-on-termux-for-aarch64-architecture-cc15375d3595
  2. Also install libgmp-dev g++
  3. Run ghcup install ghc 9.4
  4. Run ghcup install cabal
  5. Run cabal install alex happy hledger
  6. Run su in proot env
  7. Now you can run hledger

Current problem is that I can't move this binary out of proot env because I can't find corresponding libs in base termux.

erplsf avatar Sep 04 '23 13:09 erplsf

necroposting a bit to post a screenshot and remind myself to properly package it: Screenshot_20240427_171032_Termux

erplsf avatar Apr 27 '24 15:04 erplsf

Yes please @erplsf.

Is a narrow/"responsive" mode for the commands list needed ? You seem to have 60 columns there.

simonmichael avatar Apr 27 '24 17:04 simonmichael

Though, less's -S would probably help. LESS=S hledger

simonmichael avatar Apr 27 '24 17:04 simonmichael