Compiling Mogan under Android

With certain amounts of trial-and-errors, I succeeded to compile and run Mogan 1.1.1 on termux under Android. I will write up details when I have spare time. Here are some key points:

  1. First of all, one has to disable the phantom processes killing for Android 12+, otherwise many processes are killed tacitly, making compilation and something else failed. A guide can be found here. One can also look at this post.

  2. We install termux, then X11 and vnc. One should also install some libGL (I installed mesa) to run tigervnc, which is not mentioned in the previous wiki page. (Edit: thanks to this patch, mesa is already included into the dependency thus the extra step is no longer necessary.)

  3. Then we install termux-packages and setup. We enter the main directory of this package.

  4. Create a folder mogan under x11-packages, a build script (expand below), and compile via ./ -I mogan as described in this page.
    # http(s) link to package home page.
    # One-line, short package description.
    TERMUX_PKG_DESCRIPTION="A structured editor for science and technology"
    # License.
    # Who cares about package.
    # Specify yourself (Github nick, or name + email) if you wish to maintain the
    # package, fix its bugs, etc. Otherwise specify "@termux".
    # Please note that unofficial repositories are not allowed to reference @termux
    # as their maintainer.
    # Version.
    # URL to archive with source code.
    # SHA-256 checksum of the source code archive.
    TERMUX_PKG_DEPENDS="libc++, qt5-qtbase, qt5-qtsvg"
    	LDFLAGS+=" -lexecinfo"
  5. The package is installed automatically after compilation (this seems dirty, but since termux is not a system, it seems acceptable), and we get a deb package in output directory. We can dpkg -i to “install” it so that later it is easier to use pkg remove to uninstall.

@darcy I am not sure whether there is an issue in cmake. I suspect that the current file cannot be compiled with clang/llvm (there seems no problem for gcc). I have to add -lexecinfo into LDFLAGS (as shown in the script below), otherwise there are errors during linking about the references backtrace() and backtrace_symbols() in /src/System/Misc/stack_trace.cpp. There is an if branch in the CMakeList.txt, and maybe we should add add_includes_ldflags there.

Update: This might be related to which seems to indicate that backtrace etc. are not included in Android’s libc.


Furthermore, there is an extra problem, but I guess that it is not Mogan specific: I cannot use Morgan to open a file in my storage, which is shared through termux-setup-storage, with error:

TeXmacs] std-warning, Load error for XXX, Function not implemented

There is no problem using command-line tools such as neovim and touch under termux to open and modify these files.

Update: It turns out to be a problem on file locking: File locks in TeXmacs

It is also possible to compile Mogan under AnLinux. However, it seems to me that the performance is worse than that in termux directly. After all, AnLinux has an extra layer over termux.

We are working on the WASM port, once the WASM port is production ready, GNU TeXmacs or Mogan Editor will be accessible where there is a browser!

Click Try online on .


Good news: incorporated into Termux.

It then suffices to install in Termux via pkg install mogan.


Can somebody take a screenshot? I would like to put the info on twitter.

Mogan under Termux, along with Qt Terminal and i3 window manager.


Thanks, added:

1 Like