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 91ee3a5..8b96247 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 @@ -511,6 +531,7 @@ os_argument() { void) os_void "$@";; opensuse) os_opensuse "$@";; alpine) os_alpine "$@";; + android) os_android "$@";; *) echo "Invalid --os argument: $OS" exit 1 esac || { @@ -541,6 +562,7 @@ os_nixos "$@" || \ os_void "$@" || \ os_opensuse "$@" || \ os_alpine "$@" || \ +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..deae13e --- /dev/null +++ b/server/autobuild.android @@ -0,0 +1,2 @@ +#!/bin/sh +sh autobuild $@