Skip to content

Commit 968e7b0

Browse files
committed
Switch to docker for 14.1 builds
Manjaro seems to be too advanced at this point to properly compile java...
1 parent 64b72ec commit 968e7b0

4 files changed

Lines changed: 120 additions & 1 deletion

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*

Dockerfile_14.1

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Use Ubuntu 20.04 as the base image
2+
FROM ubuntu:20.04
3+
4+
# Define build-time arguments for hostname and username
5+
ARG HOSTNAME
6+
ARG USERNAME
7+
8+
# Set the hostname dynamically based on the build argument
9+
RUN echo "$HOSTNAME" > /etc/hostname
10+
11+
# Set non-interactive mode for apt
12+
ENV DEBIAN_FRONTEND=noninteractive
13+
14+
# Update and install required dependencies
15+
RUN apt-get update \
16+
&& apt-get install -y --no-install-recommends \
17+
bc \
18+
bison \
19+
build-essential \
20+
curl \
21+
flex \
22+
g++-multilib \
23+
gcc-multilib \
24+
git \
25+
git-lfs \
26+
gnupg \
27+
gperf \
28+
imagemagick \
29+
lib32readline-dev \
30+
lib32z1-dev \
31+
libelf-dev \
32+
liblz4-tool \
33+
lz4 \
34+
libsdl1.2-dev \
35+
libssl-dev \
36+
libxml2 \
37+
libxml2-utils \
38+
lzop \
39+
pngcrush \
40+
rsync \
41+
schedtool \
42+
squashfs-tools \
43+
unzip \
44+
xsltproc \
45+
zip \
46+
zlib1g-dev \
47+
lib32ncurses5-dev \
48+
libncurses5 \
49+
libncurses5-dev \
50+
openjdk-8-jdk \
51+
python-is-python2 \
52+
&& apt-get clean \
53+
&& rm -rfv /var/lib/apt/lists/*
54+
55+
# Set up Python symlink for compatibility
56+
RUN ln -sf /usr/bin/python2 /usr/bin/python
57+
58+
# Modify java.security to remove TLSv1 and TLSv1.1
59+
RUN sed -i 's/\(jdk\.tls\.disabledAlgorithms=.*\)\bTLSv1,\s*TLSv1\.1,\s*/\1/' /etc/java-8-openjdk/security/java.security
60+
61+
# Add a user to avoid running as root
62+
RUN useradd -ms /bin/bash "$USERNAME"
63+
64+
# Set the USER environment variable
65+
ENV USER="$USERNAME"
66+
67+
# Set up a working directory
68+
WORKDIR "/home/$USERNAME"
69+
RUN mkdir -p "/home/$USERNAME/android"
70+
71+
# Change ownership of the working directory to the new user
72+
RUN chown -R $USERNAME:$USERNAME /home/$USERNAME
73+
74+
# Set Java environment variables
75+
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
76+
ENV PATH=$JAVA_HOME/bin:$PATH
77+
78+
# Switch to the non-root user
79+
USER "$USERNAME"
80+
81+
# Command to keep the container running
82+
CMD ["bash"]

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ Then to sync up:
4848
repo sync -j $(nproc --all) -c --no-tags --no-clone-bundle --force-sync --fail-fast
4949
```
5050

51+
Building the docker container
52+
-----------------------------
53+
54+
```bash
55+
docker build --build-arg HOSTNAME=$(hostname) --build-arg USERNAME=${USER} -f Dockerfile_14.1 -t gothicvi/laos:14.1 .
56+
docker push gothicvi/laos:14.1
57+
```
58+
5159
Solving issues
5260
--------------
5361

laos_build.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,35 @@ echo
667667
echo "Start the actual build..."
668668
echo "#########################"
669669
echo
670-
build || exit 1
670+
if [ "${rev}" == "14.1" ]; then
671+
docker run --rm -it \
672+
--pull=never \
673+
-v "${HOME}/android/laos_14.1":"/home/${USER}/android/laos_14.1" \
674+
-v /tmp:/tmp \
675+
--hostname "$(hostname)" \
676+
-e rev="${rev}" \
677+
-e dev="${dev}" \
678+
-e USER="${USER}" \
679+
gothicvi/laos:14.1 \
680+
bash -c " \
681+
cd android/laos_14.1 || exit 1; \
682+
export LC_ALL=C; \
683+
source build/envsetup.sh || exit 1; \
684+
breakfast \"${dev}\" || exit 1; \
685+
croot; \
686+
brunch \"${dev}\" || exit 1; \
687+
echo \"\${OUT}\" > \"/tmp/out_${rev}_${dev}\" || exit 1; \
688+
exit 0"
689+
# shellcheck disable=SC2181
690+
if [ "$?" == 0 ]; then
691+
OUT=$(cat "/tmp/out_${rev}_${dev}")
692+
cd "${OUT}" || exit 1
693+
else
694+
exit 1
695+
fi
696+
else
697+
build || exit 1
698+
fi
671699
echo
672700
echo "Press ENTER to continue..."
673701
echo

0 commit comments

Comments
 (0)