Building CalyxOS's Chromium fork
Chromium is the primary browser, and also responsible for providing WebView, a component used by many, many apps (more than you think!)
It has it’s own build system and is built separately.
CalyxOS usually tracks the Chrome Android stable release, you can see the latest version at https://chromiumdash.appspot.com/releases?platform=Android. Look for the first version under ‘Stable’
Stable version at time of writing this: 120.0.6099.144
export V=120.0.6099.144 # Replace this with the correct version
Short version
- This assumes you have a Chromium build environment already setup and have built it before
Steps:
- Fetch the tag and create a new branch from it.
cd ~/chromium/srcgit fetch origin refs/tags/$V:refs/tags/$V && git checkout -b calyxos-$V $Vgclient sync -D; gclient runhooks
- Fetch our patches and build configuration
cd ~/chromiumgit clone https://gitlab.com/CalyxOS/platform_external_calyx_chromium -b main
- Apply patches (you version has to match the version in args.gn)
cd ~/chromium/srcfor i in $(cat ../platform_external_calyx_chromium/build/*_patches_list.txt); do git am ../platform_external_calyx_chromium/build/patches/$i; done
- Setup build config
gn args out/Default- You want to fill out the args from
~/chromium/src/args.gnnow. - You can also modify
target_cpuif needed.
- Build
autoninja -C out/Default trichrome_chrome_64_32_bundle trichrome_library_64_32_apk trichrome_webview_64_32_apk system_webview_shell_apk
- Process output
cd ~/chromium/src/out/Default/apksjava -jar ../../../third_party/android_build_tools/bundletool/cipd/bundletool.jar build-apks --mode universal --bundle TrichromeChrome6432.aab --output . --output-format DIRECTORY
- Done
- You can now copy the APKs to
prebuilts/calyx/chromium/arm64/for usage in the OS build.
- You can now copy the APKs to