Skip to content

Instantly share code, notes, and snippets.

@nitincodery
Created January 30, 2023 06:17
Show Gist options
  • Save nitincodery/6b0427708ef9269492a605697ebb3292 to your computer and use it in GitHub Desktop.
Save nitincodery/6b0427708ef9269492a605697ebb3292 to your computer and use it in GitHub Desktop.
Android Emacs Build Simple Steps

Android Emacs Build Steps

  1. install java (if not) get path of it via `ls -l /etc/alternatives/java` for JAVA_HOME
  2. mkdir android, cd android
  3. git clone git://git.sv.gnu.org/emacs.git git checkout feature/android
  4. ./autogen.sh
  5. download command line tools from https://developer.android.com/studio unzip, move all the contents of cmdline-tools to a sub-folder “latest”; move cmdline-tools folder under android folder;

    folder structure: . └── android/ └── cmdline-tools/ ├── latest/ │ ├── bin │ ├── lib │ ├── Notice.txt │ └── source.properties └── emacs

  6. put these lines in .bashrc
    export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
    export ANDROID_HOME=$HOME/android
    export PATH=$JAVA_HOME/bin:$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/cmdline-tools/latest:$PATH
        
  7. cd android, run:
    sdkmanager "build-tools;33.0.1" "platform-tools" "platforms;android-33" --install "ndk;25.1.8937393"
        
  8. note your android/arm inside ndk/v/toolchains/./././bin/ and use its path in ANDROID_CC

    cd android/emacs, run:

    ./configure --with-android=$ANDROID_HOME/platforms/android-33/android.jar ANDROID_CC=$ANDROID_HOME/ndk/25.1.8937393/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi29-clang SDK_BUILD_TOOLS=$ANDROID_HOME/build-tools/33.0.1 --with-gnutls=ifavailable --with-mailutils
        
  9. run: make all

After above process, you will find your emacs android apk inside android/emacs/java folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment