-
-
Save cwillsey06/ff41d7c49f901036f19f4b965d1617b8 to your computer and use it in GitHub Desktop.
Compile ALVR client using Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # syntax=docker/dockerfile:1.3 | |
| FROM archlinux AS build | |
| ARG VERSION="latest" | |
| RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ | |
| pacman -Syu --noconfirm | |
| RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ | |
| pacman -Sy --needed --noconfirm base-devel cmake git unzip rustup cargo jre11-openjdk-headless jdk8-openjdk clang python | |
| RUN useradd -m -G wheel -s /bin/bash aurbuild | |
| RUN echo '%wheel ALL=(ALL:ALL) NOPASSWD: ALL' > /etc/sudoers.d/wheel | |
| USER aurbuild | |
| RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ | |
| sudo git clone https://aur.archlinux.org/yay-git.git /opt/yay-git | |
| WORKDIR /opt/yay-git | |
| RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ | |
| sudo chown -R aurbuild:aurbuild . | |
| RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ | |
| makepkg -si --noconfirm | |
| RUN --mount=type=cache,sharing=locked,target=/var/cache/pacman \ | |
| yay -S --noconfirm android-sdk | |
| WORKDIR /tmp | |
| RUN rustup default stable && rustup target add aarch64-linux-android | |
| RUN git clone https://github.com/alvr-org/ALVR.git | |
| RUN --mount=type=cache,sharing=locked,target=/tmp/ALVR/target \ | |
| sudo chown aurbuild -R /tmp/ALVR | |
| WORKDIR /tmp/ALVR | |
| RUN if [ "$VERSION" != "latest" ]; then git checkout "${VERSION}"; fi | |
| RUN --mount=type=cache,sharing=locked,target=/tmp/ALVR/target \ | |
| cargo xtask prepare-deps --platform android | |
| ENV ANDROID_HOME=/opt/android-sdk | |
| RUN sudo archlinux-java set java-8-openjdk | |
| RUN yes | sudo ${ANDROID_HOME}/tools/bin/sdkmanager "patcher;v4" "cmake;3.18.1" "ndk;25.1.8937393" "platforms;android-33" "build-tools;33.0.0" | |
| RUN sudo archlinux-java set java-11-openjdk | |
| RUN --mount=type=cache,sharing=locked,target=/tmp/ALVR/target \ | |
| cargo xtask build-client --platform oculus_quest --release | |
| FROM scratch AS export | |
| COPY --from=build /tmp/ALVR/build/alvr_client_oculus_quest/alvr_client_oculus_quest.apk / |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Quick 'install'
Just in case the command above doesn't work for you, try this one
And if you're really out of luck, just use this template and paste the link to the raw of this gist into the section marked as such
(and remove the markers, obviously)