From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Johan =?UTF-8?Q?Wid=C3=A9n?= Newsgroups: gmane.emacs.bugs Subject: bug#65207: 30.0; More instructions for how to build Android emacs, are needed Date: Thu, 10 Aug 2023 11:23:41 +0200 Message-ID: <87sf8rw8ka.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25304"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.10.5; emacs 29.1 To: 65207@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 10 15:22:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qU5cI-0006SA-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Aug 2023 15:22:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qU5c4-0005FR-Ow; Thu, 10 Aug 2023 09:22:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qU5c3-0005Ez-1I for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 09:22:03 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qU5c2-0000d0-P5 for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 09:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qU5c2-0001Iz-Jb for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 09:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Johan =?UTF-8?Q?Wid=C3=A9n?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Aug 2023 13:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65207 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16916737074982 (code B ref -1); Thu, 10 Aug 2023 13:22:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Aug 2023 13:21:47 +0000 Original-Received: from localhost ([127.0.0.1]:41692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU5bm-0001IB-EK for submit@debbugs.gnu.org; Thu, 10 Aug 2023 09:21:47 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:37216) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qU22T-0000oF-ME for submit@debbugs.gnu.org; Thu, 10 Aug 2023 05:33:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qU22N-0002Ts-Sl for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 05:33:00 -0400 Original-Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qU22L-0003Qa-GN for bug-gnu-emacs@gnu.org; Thu, 10 Aug 2023 05:32:59 -0400 Original-Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b9338e4695so10478061fa.2 for ; Thu, 10 Aug 2023 02:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691659974; x=1692264774; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=/PRh3XwOYHxZFPENkqT3HLVNLSqi6VYoP92Uze+BquM=; b=FWuf9d64rXt/YfF0kVc0WJXLqHN4eVo1yI/2KPmOa4qIjuYnye4ULUc2cY1f36LF3e E+fMj0V/2ZI7XAo2fo2V24unqBg7V+Lm3O6pQmVlbmBxiYRy6XVyHFq06Z8Pf4tTyYVr t81ENQQQ43Can0iWSb2tkHlYebQNXkqubHnQ5nz9RPDvKckeMdzEIwy++dTkoBDTk3rb Co8Lc2ExGY4vfGYBLrhejxRn8H5aRRCoSV52Gt0xj0lrpuK9i8x//KWkeXRw2l+oGdMA mzirx6MfuLVO4kshmbAhfYJE+2JzVtJEoLk0dBxrYA/R5Atkq44fzbbkLktZDNi8NkBr 8/2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691659974; x=1692264774; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/PRh3XwOYHxZFPENkqT3HLVNLSqi6VYoP92Uze+BquM=; b=dcbxDDeaAjQiaQ8ziRsM6i1n5nMRhzCgm18W0D0SAhbJtJGXwQsm+MR6HOowA0CpmT jEJT+z4T0JVItBQaQ9VVu3TQ/Rh7fWBgjLDRe9mnSD92/7P/xEeuitFHlDxU5iveR/lV 71XrMRZPV2LVt5t9yRnPkaBgrviwJ+OQb95Vz5iShOw3+JjgRgjha4Se/4hagFPW2MPH HwOfBUc4eBbQLQ4bDqb4Sfyh2WjQZrLVhgurtrNmDVjJq846XUfqS75oxcZ/wS7dHGv+ GxXgdvZRSjOfxzVpla7dZmDdPny5ml9KBb0XK0kmJbv8EOCii+gUkYegXpfbYtsJ9sd6 UJtA== X-Gm-Message-State: AOJu0YxTWg2V/E695MInWLEETpdOsNdY7ab5lZ4U5x+P+rarN/gaebxp wyYctnY5sjjXQ1qsXBcNE5OOPlu7IKI= X-Google-Smtp-Source: AGHT+IHM3Rk90wSp0g6jXt/jDq5JgriET6AERzLI+iFC5SCslvP940A4dp0vqWmR5aJuBl92YMID2Q== X-Received: by 2002:a2e:9806:0:b0:2b6:e2c1:6cda with SMTP id a6-20020a2e9806000000b002b6e2c16cdamr1427862ljj.46.1691659973963; Thu, 10 Aug 2023 02:32:53 -0700 (PDT) Original-Received: from localhost (h-82-196-111-90.NA.cust.bahnhof.se. [82.196.111.90]) by smtp.gmail.com with ESMTPSA id e16-20020a2e9e10000000b002b9baa7ce37sm273927ljk.22.2023.08.10.02.32.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Aug 2023 02:32:53 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=j.e.widen@gmail.com; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 10 Aug 2023 09:21:43 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267130 Archived-At: --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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: =E2=80=A2 For instructions on how to build Android emacs, see ./java/INSTAL= L. 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 pa= ckage manager. I first installed Android Studio. It is available in the Ubuntu snap store: =E2=80=A2 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: =E2=80=A2 sudo apt install android-sdk =E2=80=A2 sudo apt install sdkmanager =E2=80=A2 sudo apt-get install crossbuild-essential-arm64 =E2=80=A2 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 =E2=80=9C/usr/lib/android-sdk/tools/bin=E2=80=9D ] ; then PATH=3D=E2=80=9C/usr/lib/android-sdk/tools/bin:$PATH=E2=80=9D fi if [ -d =E2=80=9C/usr/lib/android-sdk/platform-tools=E2=80=9D ] ; then PATH=3D=E2=80=9C/usr/lib/android-sdk/platform-tools:$PATH=E2=80=9D fi if [ -d =E2=80=9C$HOME/Android/Sdk/build-tools/33.0.1=E2=80=9D ] ; then PATH=3D=E2=80=9C$HOME/Android/Sdk/build-tools/33.0.1:$PATH=E2=80=9D fi if [ -d =E2=80=9C/usr/lib/android-ndk=E2=80=9D ] ; then PATH=3D=E2=80=9C/usr/lib/android-ndk:$PATH=E2=80=9D fi To install cross compilers for android I now did: =E2=80=A2 sudo sdkmanager =E2=80=93list =E2=80=A2 sudo sdkmanager =E2=80=9Cplatforms;android-33=E2=80=9D Installed under =E2=80=9C/opt/android-sdk//platforms/android-33=E2=80=9D. 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 =E2=80=93with-android=3D/opt/android-sdk/platforms/android-33/a= ndroid.jar \ ANDROID_CC=3D/usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin= /aarch64-linux-android33-clang \ SDK_BUILD_TOOLS=3D$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 =E2=80=9CVirtual Device Manager=E2=80=9D. I cou= ld then select and run the default emulator device =E2=80=9CPixel_3A_API_34_extension_level_7_x86_64=E2=80=9D. 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 int= o Android emacs. --==-=-= Content-Type: text/html; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable

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 An= droid 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 pa= ckage 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 =E2=80=9C/usr/lib/android-sdk/tools/bin=E2=80=9D ] ; then PATH=3D=E2=80=9C/usr/lib/android-sdk/tools/bin:$PATH=E2=80=9D fi if [ -d =E2=80=9C/usr/lib/android-sdk/platform-tools=E2=80=9D ] ; then PATH=3D=E2=80=9C/usr/lib/android-sdk/platform-tools:$PATH=E2=80=9D fi if [ -d =E2=80=9C$HOME/Android/Sdk/build-tools/33.0.1=E2=80=9D ] ; then PATH=3D=E2=80=9C$HOME/Android/Sdk/build-tools/33.0.1:$PATH=E2=80=9D fi if [ -d =E2=80=9C/usr/lib/android-ndk=E2=80=9D ] ; then PATH=3D=E2=80=9C/usr/lib/android-ndk:$PATH=E2=80=9D fi

To install cross compilers for android I now did:

  • sudo sdkmanager =E2=80=93list
  • sudo sdkmanager =E2=80=9Cplatforms;android-33=E2=80=9D

Installed under =E2=80=9C/opt/android-sdk//platforms/android-33=E2=80=9D. 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 =E2=80=93with-android=3D/opt/android-sdk/platforms/android-33/a= ndroid.jar \ ANDROID_CC=3D/usr/lib/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin= /aarch64-linux-android33-clang \ SDK_BUILD_TOOLS=3D$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 =E2=80=9CVirtual Device Manager=E2=80=9D. I cou= ld then select and run the default emulator device =E2=80=9CPixel_3A_API_34_extension_level_7_x86_64=E2=80=9D. 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 int= o Android emacs.

--==-=-=-- --=-=-=--