Skip to content

Commit

Permalink
5.4 prep: add experimental ushell support under Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrehn committed Feb 16, 2024
1 parent 6a84001 commit 63c84bb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ue4docker/dockerfiles/ue4-build-prerequisites/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
git-lfs \
gpg-agent \
python3 \
python3-dev \
python3-pip \
Expand Down Expand Up @@ -93,5 +94,18 @@ RUN useradd --create-home --home /home/ue4 --shell /bin/bash --uid 1000 ue4 && \
usermod -a -G audio,video,sudo ue4
USER ue4

{% if enable_ushell %}
# Install Python 3.12, which is required by ushell
USER root
RUN add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends python3.12 python3.12-venv && \
rm -rf /var/lib/apt/lists/*
USER ue4

# Install a copy of pip for Python 3.12
RUN curl -fsSL 'https://bootstrap.pypa.io/get-pip.py' | python3.12
{% endif %}

# Enable Git Large File Storage (LFS) support
RUN git lfs install
19 changes: 19 additions & 0 deletions src/ue4docker/dockerfiles/ue4-minimal/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ RUN ./Engine/Build/BatchFiles/RunUAT.sh BuildGraph \
COPY split-components.py /tmp/split-components.py
RUN python3 /tmp/split-components.py /home/ue4/UnrealEngine/LocalBuilds/Engine/Linux /home/ue4/UnrealEngine/Components

# Ensure UnrealVersionSelector is built, since the prebuilt binaries may not be up-to-date
RUN ./Engine/Build/BatchFiles/Linux/Build.sh UnrealVersionSelector Linux Shipping

# Copy InstalledBuild.txt from the Installed Build and run UnrealVersionSelector to populate Install.ini with any custom Build ID specified in the BuildGraph flags
# (Note that the `-unattended` flag used below requires Unreal Engine 4.22 or newer, so this will break under older versions)
# (Note also that custom Build IDs are supported by Unreal Engine 5.3.1 and newer, and older versions will just use a GUID as the Build ID)
Expand All @@ -72,6 +75,13 @@ COPY --chown=ue4:ue4 copy-toolchain.py /tmp/copy-toolchain.py
RUN python3 /tmp/copy-toolchain.py /home/ue4/UnrealEngine
{% endif %}

{% if enable_ushell %}
# Ensure ushell is copied to the Installed Build
RUN rm -rf ./LocalBuilds/Engine/Linux/Engine/Extras/ushell && \
cp -r ./Engine/Extras/ushell ./LocalBuilds/Engine/Linux/Engine/Extras/ushell && \
bash -c 'set -e; shopt -s globstar; cd /home/ue4/UnrealEngine/LocalBuilds/Engine/Linux/Engine/Extras/ushell && chmod +x ./**/*.sh'
{% endif %}

# Copy the Installed Build into a clean image, discarding the source build
{% if combine %}
FROM prerequisites as minimal
Expand Down Expand Up @@ -103,6 +113,15 @@ LABEL com.adamrehn.ue4-docker.excluded.debug={% if excluded_components.debug ==
LABEL com.adamrehn.ue4-docker.excluded.templates={% if excluded_components.templates == true %}1{% else %}0{% endif %}
{% endif %}

{% if enable_ushell %}
# Add ushell to the system PATH and alias `ushell` to `ushell.sh`
ENV PATH="$PATH:/home/ue4/UnrealEngine/Engine/Extras/ushell"
RUN echo 'alias ushell="ushell.sh"' >> /home/ue4/.bashrc

# Perform first-run setup for ushell
RUN bash -c 'set -e; source /home/ue4/UnrealEngine/Engine/Extras/ushell/ushell.sh && exit 0'
{% endif %}

# Perform first-run setup for Mono, UnrealBuildTool and AutomationTool, which makes it possible to build Unreal projects and plugins as users other than `ue4`
# (Note that this will only work with 4.26.0 and newer, older Engine versions will always require write access to `/home/ue4/UnrealEngine`)
# See the comments on this issue for details, including the need to ensure $HOME is set correctly: <https://github.com/adamrehn/ue4-docker/issues/141>
Expand Down

0 comments on commit 63c84bb

Please sign in to comment.