summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Widén <j.e.widen@gmail.com>2023-07-29 11:08:33 +0200
committerVedang Manerikar <ved.manerikar@gmail.com>2025-12-29 09:45:02 +0530
commitd89686e4e0b35d8a0deff5d8709b81edd5cd5630 (patch)
tree64a97b5f19208287eb3a4c45b8e7ce35f196ff72
parent07d4e5a07baa4ea7c2b8a03d25a0d7fb4cf88e81 (diff)
Add support for Android Emacs using Termux
Notes from the original PR: The dependencies for android in autobuild can not be installed in pdf-tools-install, they have to be installed manually in Termux. But the dependencies are checked when running autobuild. pdf-tools-install successfully installs epdfinfo in Android Emacs. One can then view pdf files. The shebang in autobuild does not work in Termux, I therefore had to create a separate script "autobuild.android" that in turn executes autobuild. The problem with the shebang is that "env" in Termux is not located at "/usr/bin/env". pdf-tools/Makefile does currently not work in Android Emacs, but it is not needed for running pdf-tools-install. Fixing this will have to be done in a separate pull request, if deemed necessary. Reason: There is yet no consensus for how to implement a command line emacs, to be run in batch mode, in Android Emacs. I have successfully run "make test" in Ubuntu, in the repo feature branch. Running "make server-test" in the master branch fails, so I have not tested this in the feature branch. Closes: #230 Author: @johanwiden
-rw-r--r--lisp/pdf-tools.el2
-rwxr-xr-xserver/autobuild22
-rwxr-xr-xserver/autobuild.android2
3 files changed, 25 insertions, 1 deletions
diff --git a/lisp/pdf-tools.el b/lisp/pdf-tools.el
index 670792c..e36f966 100644
--- a/lisp/pdf-tools.el
+++ b/lisp/pdf-tools.el
@@ -323,7 +323,7 @@ Returns the buffer of the compilation process."
(process-environment process-environment)
(default-directory build-directory)
(autobuild (shell-quote-argument
- (expand-file-name "autobuild" build-directory)))
+ (expand-file-name (if (eq system-type 'android) "autobuild.android" "autobuild") build-directory)))
(msys2-p (equal "bash.exe" (file-name-nondirectory shell-file-name))))
(unless shell-file-name
(error "No suitable shell found"))
diff --git a/server/autobuild b/server/autobuild
index 1d76820..3201a00 100755
--- a/server/autobuild
+++ b/server/autobuild
@@ -306,6 +306,26 @@ os_debian() {
return 0
}
+# Android using Termux
+os_android() {
+ if ! [ -d "/data/data/com.termux/files/home" ]; then
+ return 1
+ fi
+ PACKAGES="autoconf
+ automake
+ binutils
+ clang
+ libpng
+ poppler
+ zlib
+ make
+ xorgproto
+ pkg-config"
+ PKGCMD=pkg
+ PKGARGS="install"
+ return 0
+}
+
# Msys2
os_msys2() {
if [ -z "$MSYSTEM" ] || ! [ -r "/etc/profile" ]; then
@@ -546,6 +566,7 @@ os_argument() {
opensuse) os_opensuse "$@";;
alpine) os_alpine "$@";;
nobara) os_nobara "$@";;
+ android) os_android "$@";;
*) echo "Invalid --os argument: $OS"
exit 1
esac || {
@@ -577,6 +598,7 @@ os_void "$@" || \
os_opensuse "$@" || \
os_alpine "$@" || \
os_nobara "$@" || \
+os_android "$@" || \
{
OS_IS_HANDLED=
if [ -z "$DRY_RUN" ]; then
diff --git a/server/autobuild.android b/server/autobuild.android
new file mode 100755
index 0000000..4fc076f
--- /dev/null
+++ b/server/autobuild.android
@@ -0,0 +1,2 @@
+#!/bin/sh
+sh autobuild "$@"