* bug#65207: 30.0; More instructions for how to build Android emacs, are needed
@ 2023-08-10 9:23 Johan Widén
2023-08-10 14:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 1 reply; 3+ messages in thread
From: Johan Widén @ 2023-08-10 9:23 UTC (permalink / raw)
To: 65207
[-- Attachment #1.1: Type: text/plain, Size: 3929 bytes --]
Note: This is a request for an enhancement of the emacs version 30
documentation. I am writing this submission in emacs 29.1, so the
current environment details are irrelevant.
I needed to build and run the Android emacs APK, to try and track down a
bug. As I am a novice regarding building Android apps, finding out how
to do this required considerable effort. I therefore suggest that
information similar to what I include below, is added as an appendix to
java/INSTALL.
First I suggest that the emacs repo top level README or INSTALL should
include a reference to java/INSTALL. Perhaps something like this:
• For instructions on how to build Android emacs, see ./java/INSTALL.
Here is now my build and run instructions:
I am using Ubuntu, so these instructions are Ubuntu specific, but should
be easily adaptable to other linux based distributions. Note that
Android Studio, Android SDK, Android NDK can be downloaded from the
software provider, if they are not available in your linux distributions package manager.
I first installed Android Studio. It is available in the Ubuntu snap store:
• sudo snap install android-studio
I then ran Android Studio to set it up, and also tried to build a sample
project. I believe that at this point $HOME/Android with important
subdirectory $HOME/Android/Sdk/build-tools/33.0.1 was added to my $HOME
directory. See below why this was important.
I then installed a number of apt packages:
• sudo apt install android-sdk
• sudo apt install sdkmanager
• sudo apt-get install crossbuild-essential-arm64
• sudo apt install google-android-ndk-r25c-installer
Not sure if package crossbuild-essential-arm64 is needed.
The SDK was installed under /usr/lib/android-sdk.
The NDK was installed under /usr/lib/android-ndk.
The sdk supports creating Java based apps.
The ndk supports creating apps using C or C++ source.
Now something important: The sdk installation created, among other
things, a directory /usr/lib/android-sdk/build-tools/debian. I tried
building with that, but this did not work, as the contents of the
directory is very incomplete. That was when I discovered $HOME/Android, and
the important directory $HOME/Android/Sdk/build-tools/33.0.1. Using that
directory instead of the debian directory, I was able to make a
successful build.
I added a number of directories to my PATH, but I do not know if that is
necessary:
if [ -d “/usr/lib/android-sdk/tools/bin” ] ; then
PATH=“/usr/lib/android-sdk/tools/bin:$PATH”
fi
if [ -d “/usr/lib/android-sdk/platform-tools” ] ; then
PATH=“/usr/lib/android-sdk/platform-tools:$PATH”
fi
if [ -d “$HOME/Android/Sdk/build-tools/33.0.1” ] ; then
PATH=“$HOME/Android/Sdk/build-tools/33.0.1:$PATH”
fi
if [ -d “/usr/lib/android-ndk” ] ; then
PATH=“/usr/lib/android-ndk:$PATH”
fi
To install cross compilers for android I now did:
• sudo sdkmanager –list
• sudo sdkmanager “platforms;android-33”
Installed under “/opt/android-sdk//platforms/android-33”.
ANDROID_CC are under
/usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin
I then ran the following in the top directory of the emacs repo:
./configure –with-android=/opt/android-sdk/platforms/android-33/android.jar \
ANDROID_CC=/usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android33-clang \
SDK_BUILD_TOOLS=$HOME/Android/Sdk/build-tools/33.0.1
make all
To run the emulator I started Android Studio, and in the menu in the
upper right corner selected “Virtual Device Manager”. I could then
select and run the default emulator device
“Pixel_3A_API_34_extension_level_7_x86_64”. To load the APK into the
emulator I started a file manager and dragged and dropped the APK file
onto the emulator display. The computer keyboard can be used for typing into Android emacs.
[-- Attachment #1.2: Type: text/html, Size: 7672 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#65207: 30.0; More instructions for how to build Android emacs, are needed
2023-08-10 9:23 bug#65207: 30.0; More instructions for how to build Android emacs, are needed Johan Widén
@ 2023-08-10 14:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-10 17:25 ` Eli Zaretskii
0 siblings, 1 reply; 3+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-08-10 14:59 UTC (permalink / raw)
To: Johan Widén; +Cc: 65207
Johan Widén <j.e.widen@gmail.com> writes:
> Note: This is a request for an enhancement of the emacs version 30
> documentation. I am writing this submission in emacs 29.1, so the
> current environment details are irrelevant.
>
> I needed to build and run the Android emacs APK, to try and track
> down a bug. As I am a novice regarding building Android apps,
> finding out how to do this required considerable effort. I therefore
> suggest that information similar to what I include below, is added as
> an appendix to java/INSTALL.
>
> First I suggest that the emacs repo top level README or INSTALL
> should include a reference to java/INSTALL. Perhaps something like
> this:
>
> * For instructions on how to build Android emacs, see .
> /java/INSTALL.
Eli already did this, I think.
> Here is now my build and run instructions:
>
> I am using Ubuntu, so these instructions are Ubuntu specific, but
> should be easily adaptable to other linux based distributions. Note
> that Android Studio, Android SDK, Android NDK can be downloaded
> from the software provider, if they are not available in your linux
> distributions package manager.
>
> I first installed Android Studio. It is available in the Ubuntu snap
> store:
>
> * sudo snap install android-studio
>
> I then ran Android Studio to set it up, and also tried to build a sample
> project. I believe that at this point $HOME/Android with important
> subdirectory $HOME/Android/Sdk/build-tools/33.0.1 was added to
> my $HOME directory. See below why this was important.
> [Further instructions elided.]
While I don't oppose explaining the process in more detail, we should
not recommend using Android Studio, as it is proprietary software.
Google's binaries for the Android SDK and NDK are themselves free
software built directly from public source code. We should instead
describe how they can be obtained or built individually, without using
Android Studio or the Sdkmanager. (The Sdkmanager demands users sign a
scareware EULA before downloading anything, even free software that is
available separately.)
My understanding is that for Debian and Trisquel users, it is merely a
matter of installing a few packages from their default package
repositories, whereas the process for other GNU/Linux distribution is
more involved.
TIA.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#65207: 30.0; More instructions for how to build Android emacs, are needed
2023-08-10 14:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-10 17:25 ` Eli Zaretskii
0 siblings, 0 replies; 3+ messages in thread
From: Eli Zaretskii @ 2023-08-10 17:25 UTC (permalink / raw)
To: Po Lu; +Cc: j.e.widen, 65207
> Cc: 65207@debbugs.gnu.org
> Date: Thu, 10 Aug 2023 22:59:17 +0800
> From: Po Lu via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Johan Widén <j.e.widen@gmail.com> writes:
>
> > First I suggest that the emacs repo top level README or INSTALL
> > should include a reference to java/INSTALL. Perhaps something like
> > this:
> >
> > * For instructions on how to build Android emacs, see .
> > /java/INSTALL.
>
> Eli already did this, I think.
Yes, INSTALL now says near its beginning:
This file contains general information on building GNU Emacs. If you
are building an Emacs release tarball on a Unix or a GNU system, the
instructions in this file should be sufficient. For other
configurations, we have additional specialized files:
. INSTALL.REPO if you build from a Git checkout
. nt/INSTALL if you build for MS-Windows
. nextstep/INSTALL if you build for GNUstep/macOS
. java/INSTALL if you build for Android
. msdos/INSTALL if you build for MS-DOS
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-08-10 17:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-10 9:23 bug#65207: 30.0; More instructions for how to build Android emacs, are needed Johan Widén
2023-08-10 14:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-10 17:25 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).