-
Notifications
You must be signed in to change notification settings - Fork 0
Android build environment
You could build Android or Sailfish HADK bits on your Linux PC directly. Alternative is to use an environment that has all packages installed for a build. This document describes such alternative procedure.
Below, few environment variables that are defined for simplicity:
export DEVICE=xqct54
export HABUILD_DEVICE=pdx223
export VENDOR=sony
export FAMILY=nagara
export ANDROID_VERSION_MAJOR=14
export HAVERSION=lineage-21.0
export ANDROID_ROOT="$HOME/nagara/hadk"
To build the environment, you can use Podman and docker configuration in https://github.com/sailfishos-sony-nagara/main repository.
To use Podman with the included Dockerfile, proceed as follows:
- change to
android-buildsubfolder ofmainrepository - rename
.gitconfig.templateto.gitconfigand fill-in information - build the image:
podman build --no-cache -t android-env .
After that, you can enter the environment with
podman run --rm -it -v `pwd`:/android android-env:latestinside your $ANDROID_ROOT folder. If using this environment, $ANDROID_ROOT will be set to /android. To pass
HADK related environment variables to podman, write a script or run something like
podman run --rm -it \
-v $ANDROID_ROOT:/android \
-v $ANDROID_ROOT-userconfig:/root \
-v $ANDROID_ROOT_REPO/.repo:/android/.repo \
-e DEVICE=$DEVICE -e HABUILD_DEVICE=$HABUILD_DEVICE \
-e VENDOR=$VENDOR \
-e FAMILY=$FAMILY \
-e ANDROID_VERSION_MAJOR=$ANDROID_VERSION_MAJOR \
-e HAVERSION=$HAVERSION \
-e PORT_ARCH=$PORT_ARCH \
-e SAILFISH_BUILD=1 \
android-env:latestAbove, folder $ANDROID_ROOT-userconfig should be available and it would keep your last command history. Its also a folder
that would have to have then your .gitconfig.