Skip to content

Instantly share code, notes, and snippets.

@yuripourre
Last active July 13, 2024 20:58
Show Gist options
  • Save yuripourre/23ee55a1bc0047509e43dd61ded8eeac to your computer and use it in GitHub Desktop.
Save yuripourre/23ee55a1bc0047509e43dd61ded8eeac to your computer and use it in GitHub Desktop.
Wolvic Chromium - Fedora
# Instructions:
# https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#install
# https://github.com/Igalia/wolvic/blob/main/CHROMIUM.md
# Install build tools
# ninja-build is not necessary (it's included in the depot_tools)
sudo dnf install -y gperf
# Setup depot_tools
cd ~/git
# We need to clone Wolvic repo
git clone git@github.com:Igalia/wolvic.git
cd wolvic
export WOLVIC_REPOSITORY=$(pwd)
git submodule update --init --recursive
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="${HOME}/git/depot_tools:$PATH"
# Preparing Chromium
mkdir ~/chromium && cd ~/chromium
# Fetch Chromium without history
fetch --nohooks --no-history chromium
# Prepare build to android (as target)
sed -i 's|\(\s*"custom_vars": {\)\s*|\1\n "checkout_pgo_profiles": True,\n |; $a target_os = ["android"]' ./.gclient
cd src
gclient runhooks
gclient sync
# Point to Wolvic
git remote add wolvic-chromium https://github.com/Igalia/wolvic-chromium
git fetch --depth=1 wolvic-chromium
git switch wolvic
# This is not in the documentation but I had to run it again
# The expected Rust version is 7168c13579a550f2c47f7eea22f5e226a436cd00-1-llvmorg-19-init-2941-ga0b3dbaf but the actual version is None
gclient sync
gclient runhooks
# Prepare build
gn gen out/Default
echo 'target_os = "android"' >> ./out/Default/args.gn
echo 'target_cpu = "arm64"' >> ./out/Default/args.gn
echo 'is_official_build = true' >> ./out/Default/args.gn
echo 'ffmpeg_branding="Chrome"' >> ./out/Default/args.gn
echo 'proprietary_codecs=true' >> ./out/Default/args.gn
echo '# exclude_unwind_tables = false # Optional, allows to get stack traces on release builds.' >> ./out/Default/args.gn
autoninja -C out/Default content_aar ui_aar
autoninja -C out/Default content/shell:content_shell_resources_grit
autoninja -C out/Default content_aar ui_aar
./fix_aar.sh out/Default/Content.aar && ./fix_aar.sh out/Default/ChromiumUi.aar
mkdir -p ${WOLVIC_REPOSITORY}/app/src/chromium/assets/
cp out/Default/snapshot_blob.bin ${WOLVIC_REPOSITORY}/app/src/chromium/assets/snapshot_blob_64.bin
cp out/Default/icudtl.dat ${WOLVIC_REPOSITORY}/app/src/chromium/assets/
cp out/Default/wolvic.pak ${WOLVIC_REPOSITORY}/app/src/chromium/assets/
echo "" >> $WOLVIC_REPOSITORY/local.properties
echo "\nchromium_aar=$(pwd)" >> $WOLVIC_REPOSITORY/local.properties
# Then we need to install Android Studio and open Wolvic as a Project
# For Oculus we need to download the SDK for mobile:
# https://developer.oculus.com/downloads/native-android/
# We need to download the OpenXR SDK and extract at the third_party folder
# Remember: Oculus OpenXR Mobile SDK should match the OpenXR-SDK
# Info about mobile SDK and versions
# https://developer.oculus.com/documentation/native/android/mobile-openxr/
# Combination: 66.0 + 1.0.34
# Results in: XR_ERROR_API_VERSION_UNSUPPORTED
# xrCreateInstance called with invalid API version 1.1. Max supported version is 1.0
# https://developer.oculus.com/downloads/package/oculus-openxr-mobile-sdk/66.0
# https://github.com/KhronosGroup/OpenXR-SDK/releases/tag/release-1.0.34
# Combination: 60.0 + 1.0.30
# Results in: XR_ERROR_RUNTIME_UNAVAILABLE
# Abort message: 'terminating with uncaught exception of type std::logic_error: XrResult failure [XR_ERROR_RUNTIME_UNAVAILABLE]
# Origin: xrEnumerateInstanceExtensionProperties(nullptr, 0, &extensionCount, nullptr)
# Source: /home/yuri/git/wolvic/app/src/openxr/cpp/OpenXRExtensions.cpp:33'
# Added implementation to build.gradle:
#// Oculus Quest
#implementation 'org.khronos.openxr:openxr_loader_for_android:1.0.34'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment