Skip to content

Commit

Permalink
Merge cd3fed4 into 83e74ca
Browse files Browse the repository at this point in the history
  • Loading branch information
misl6 committed Nov 19, 2023
2 parents 83e74ca + cd3fed4 commit 249823e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 40 deletions.
62 changes: 28 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# If platform is not specified, by default the target platform of the build request is used.
# This is not what we want, as Google doesn't provide a linux/arm64 compatible NDK.
# See: https://docs.docker.com/engine/reference/builder/#from
FROM --platform=linux/amd64 ubuntu:20.04
FROM --platform=linux/amd64 ubuntu:22.04

# configure locale
RUN apt -y update -qq > /dev/null \
Expand Down Expand Up @@ -48,43 +48,37 @@ ENV HOME_DIR="/home/${USER}"
ENV WORK_DIR="${HOME_DIR}/app" \
PATH="${HOME_DIR}/.local/bin:${PATH}" \
ANDROID_HOME="${HOME_DIR}/.android" \
JAVA_HOME="/usr/lib/jvm/java-13-openjdk-amd64"
JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"


# install system dependencies
RUN dpkg --add-architecture i386 \
&& ${RETRY} apt -y update -qq > /dev/null \
RUN ${RETRY} apt -y update -qq > /dev/null \
&& ${RETRY} DEBIAN_FRONTEND=noninteractive apt install -qq --yes --no-install-recommends \
autoconf \
automake \
autopoint \
build-essential \
ccache \
cmake \
gettext \
git \
lbzip2 \
libffi-dev \
libgtk2.0-0:i386 \
libidn11:i386 \
libltdl-dev \
libncurses5:i386 \
libssl-dev \
libstdc++6:i386 \
libtool \
openjdk-13-jdk \
patch \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-venv \
sudo \
unzip \
wget \
zip \
zlib1g-dev \
zlib1g:i386 \
ant \
autoconf \
automake \
ccache \
cmake \
g++ \
gcc \
git \
lbzip2 \
libffi-dev \
libltdl-dev \
libtool \
libssl-dev \
openjdk-17-jdk \
patch \
unzip \
zip \
pkg-config \
python3 \
python3-dev \
python3-pip \
python3-venv \
make \
sudo \
wget \
&& apt -y autoremove \
&& apt -y clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down
12 changes: 6 additions & 6 deletions pythonforandroid/prerequisites.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class JDKPrerequisite(Prerequisite):
name = "JDK"
mandatory = dict(linux=False, darwin=True)
installer_is_supported = dict(linux=False, darwin=True)
min_supported_version = 11
min_supported_version = 17

def darwin_checker(self):
if "JAVA_HOME" in os.environ:
Expand Down Expand Up @@ -206,12 +206,12 @@ def _darwin_jdk_is_supported(self, jdk_path):

def darwin_helper(self):
info(
"python-for-android requires a JDK 11 or higher to be installed on macOS,"
"python-for-android requires a JDK 17 or higher to be installed on macOS,"
"but seems like you don't have one installed."
)
info(
"If you think that a valid JDK is already installed, please verify that "
"you have a JDK 11 or higher installed and that `/usr/libexec/java_home` "
"you have a JDK 17 or higher installed and that `/usr/libexec/java_home` "
"shows the correct path."
)
info(
Expand All @@ -221,12 +221,12 @@ def darwin_helper(self):

def darwin_installer(self):
info(
"Looking for a JDK 11 or higher installation which is not the default one ..."
"Looking for a JDK 17 or higher installation which is not the default one ..."
)
jdk_path = self._darwin_get_libexec_jdk_path(version="11+")
jdk_path = self._darwin_get_libexec_jdk_path(version="17+")

if not self._darwin_jdk_is_supported(jdk_path):
info("We're unlucky, there's no JDK 11 or higher installation available")
info("We're unlucky, there's no JDK 17 or higher installation available")

base_url = "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/"
if platform.machine() == "arm64":
Expand Down

0 comments on commit 249823e

Please sign in to comment.