1
0
Fork 0
mayvaneday/blog/2024/09/calibre.html

59 lines
5.5 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Kovid Goyal doesn't want you to know this, but you <em>can</em> run Calibre directly on Android - Archive - MayVaneDay Studios</title>
<link href="../../../style.css" rel="stylesheet" type="text/css" media="all">
<meta name="author" content="Vane Vander">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body class="mayvaneday">
<article>
<div class="box">
<h1>Kovid Goyal doesn't want you to know this, but you <em>can</em> run Calibre directly on Android</h1>
<p>published: 2024-09-04</p>
</div>
<hr>
<div class="box">
<p>Well, maybe not <em>directly</em> directly, but the code itself is running on <em>your device</em>, not on a remote server.</p>
<p>I make the statement in the title based off three observations:</p>
<ol>
<li><a href="https://web.archive.org/web/20240829223803/https://calibre-ebook.com/download_android">The official Calibre website</a> states that "calibre itself does not run on phones/tablets".</li>
<li>The developer doesn't want you using any versions of Calibre specifically modified to work on your device:</li>
</ol>
<blockquote>Please do not use your distribution provided calibre package, as those are often buggy/outdated. Instead use the Binary install described below.</blockquote>
<ol>
<li>Attempting to perform an isolated install in Termux using the <a href="https://web.archive.org/web/20240829225637/https://calibre-ebook.com/download_linux">official instructions for installing on Linux</a> immediately throws an error:</li>
</ol>
<pre>
Using python executable: /data/data/com.termux/files/usr/bin/python3
Your system is not based on GNU libc. The calibre binaries require GNU libc
</pre>
<p>So in my pursuit of minimizing the amount of activities that require me to pull out my aging Thinkpad T510, and because I don't particularly care how software maintainers think I should have my computing environment setup, I went ahead and installed Calibre in a Debian proot inside Termux.</p>
<p>If you've ever gone looking in F-Droid for solutions to run Linux software on Android that hasn't been compiled for Termux yet, you may have come across <a href="https://web.archive.org/web/20240829230858/https://f-droid.org/en/packages/exa.lnx.a/">AnLinux</a>, which provides many "proot"s for popular Linux distros to run inside Termux. But installing it and opening up reveals that it's just a bunch of scripts to copy-paste. Installing AnLinux thus isn't needed, as you can find all the <a href="https://web.archive.org/web/20240829231142/https://github.com/EXALAB/Anlinux-Resources/tree/master/Scripts/Installer">installer scripts on GitHub</a>.</p>
<p>To install Calibre directly on Android:</p>
<ol>
<li><a href="https://web.archive.org/save/https://f-droid.org/en/packages/com.termux/">Download and install Termux</a>, obviously.</li>
<li>Inside Termux, run <code>termux-setup-storage</code> to <a href="https://archive.ph/https://wiki.termux.com/wiki/Termux-setup-storage">give it access</a> to the rest of the files on your device.</li>
<li>Run the <a href="https://web.archive.org/web/20230330011819/https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Debian/debian.sh">AnLinux Debian installer script</a> to get a Debian proot working.</li>
<li>Edit <code>start-debian.sh</code> and uncomment the two lines after "uncomment the following line" to give the proot access to the files on your device.</li>
<li>Run <code>bash start-debian.sh</code> to start the proot.</li>
<li>Now inside the proot, run <a href="https://web.archive.org/web/20240829232010/https://raw.githubusercontent.com/EXALAB/Anlinux-Resources/master/Scripts/DesktopEnvironment/Apt/Xfce4/de-apt-xfce4.sh">the AnLinux XFCE4 installer script</a> to get a graphical environment installed and working.</li>
<li>Install a VNC client of your choice. I personally use <a href="https://web.archive.org/web/20240829232045/https://f-droid.org/en/packages/com.gaurav.avnc/">AVNC, also available on F-Droid</a>. Use the VNC app to connect to the VNC server now running inside the proot inside Termux. The address to connect to is usually <code>127.0.0.1:5901</code>. If you get a "connection refused" error, go back to Termux and, in the proot, run <code>vncserver-start</code>.</li>
<li>In the VNC app, open a terminal and run <code>apt install calibre</code>. Wait as it downloads and installs everything you need.</li>
<li>Now run Calibre!</li>
</ol>
<p>Caveats:</p>
<ol>
<li>The built-in book editor will crash if you don't run Calibre in a terminal with the command <code>QTWEBENGINE_CHROMIUM_FLAGS=&quot;--no-sandbox&quot; calibre</code>. This is because, in the proot, there is only one user and so you are technically running as root, which the Chromium engine doesn't like. Even with that special flag set, the book editor frequently refuses to save as it claims the cache has suddenly gone missing. Sigil, a standalone book editor, also requires <code>--no-sandbox</code> set via an environment variable like shown above, but in my personal experience it seems much more stable for anything longer than fixing a typo.</li>
<li>Unless your device is rooted and you've given Termux superuser permissions, Calibre won't be able to manage libraries stored on external storages, like microSD cards.</li>
</ol>
</div>
<hr>
<div class="box">
<p align=right>CC BY-NC-SA 4.0 &copy; Vane Vander</p>
</div>
</article>
</body>
</html>