Skip to content
blueboxd edited this page Sep 10, 2023 · 17 revisions

Build steps are mostly the same as the original Chromium's one except for compatibility patches.

prerequisites

  • macOS 14+ SDK
    • need patches for SDK:
      • MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDevice.h
        --- GCDevice.h 	2023-09-10 00:00:00.000000000 +0900
        +++ GCDevice.h	2023-09-10 00:00:00.000000000 +0900
        @@ -26,7 +26,7 @@
          @see GCControllerDirectionPad.valueChangedHandler
          @see GCMotion.valueChangedHandler
          */
        -@property (nonatomic, strong) dispatch_queue_t handlerQueue API_AVAILABLE(macos(10.9), ios(7.0), tvos(7.0));
        +@property (nonatomic, assign) dispatch_queue_t handlerQueue API_AVAILABLE(macos(10.9), ios(7.0), tvos(7.0));
         
         /**
          A vendor supplied name. May be nil, and is not guaranteed to be unique. This should not be used as a key in a dictionary,
      • MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDevicePhysicalInput.h
        --- GCDevicePhysicalInput.h	2023-09-10 00:00:00.000000000 +0900
        +++ GCDevicePhysicalInput.h	2023-09-10 00:00:00.000000000 +0900
        @@ -36,7 +36,7 @@
          different queue.  You should set this property before configuring other
          callbacks.
          */
        -@property (atomic, strong, nullable) dispatch_queue_t queue API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0));
        +@property (atomic, assign, nullable) dispatch_queue_t queue API_AVAILABLE(macos(14.0), ios(17.0), tvos(17.0));
         
         #pragma mark Immediate Input
  • clang 18+
  • powerful CPUs
    • about 40mins to distributed build from scratch with Ryzen 9 5950X + 2 x Ryzen 9 3950X
    • about 3-4hrs+ to build from scratch with Core i9-9980HK

TL;DR

curl https://gist.githubusercontent.com/blueboxd/c1f355fb6fe829e98ff5453880683993/raw/744c2352501afb7b0ca184a788580de2149e0872/build.sh | bash

steps

first setup & build:

# setup working dir
mkdir -pv chromium-project && cd chromium-project

# setup depot_tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git && export PATH=`pwd`/depot_tools:"$PATH"

# setup project dir
mkdir -pv chromium-legacy && cd chromium-legacy
# place this repo as src
curl -OJL https://gist.githubusercontent.com/blueboxd/c1f355fb6fe829e98ff5453880683993/raw/9d97a2c622c206fd7bc03ec891ad89dd58be4004/.gclient

# checkout sources & dependencies
gclient sync -v

# setup patched skia
pushd src/third_party/skia
git remote add github https://github.com/blueboxd/skia.git
git fetch github && git checkout for-lion && git checkout for-lion -- .
popd

# setup patched angle
pushd src/third_party/angle/
git remote add github https://github.com/blueboxd/angle.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup patched dawn
pushd src/third_party/dawn/
git remote add github https://github.com/blueboxd/dawn.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup patched swiftshader
pushd src/third_party/swiftshader/
git remote add github https://github.com/blueboxd/swiftshader.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup patched vulkan_memory_allocator
pushd src/third_party/vulkan_memory_allocator/
git remote add github https://github.com/blueboxd/vulkan_memory_allocator.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup patched webrtc
pushd src/third_party/webrtc/
git remote add github https://github.com/blueboxd/webrtc.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup patched libc++
pushd src/third_party/libc++/src
git remote add github https://github.com/blueboxd/libcxx.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup patched boringssl
pushd src/third_party/boringssl/src
git remote add github https://github.com/blueboxd/boringssl.git
git fetch github && git checkout master.lion && git checkout master.lion -- .
popd

# setup out dir
mkdir -pv out/release
pushd out/release
# setup args.gn with basic parameters
curl -OJL https://gist.githubusercontent.com/blueboxd/c1f355fb6fe829e98ff5453880683993/raw/9d97a2c622c206fd7bc03ec891ad89dd58be4004/args.gn
popd

# generate build files
cd src
gn gen ../out/release

# build
time ninja -C ../out/release chrome

# now your build is ready
open -R ../out/release/Chromium.app

to update src:

cd chromium-project
export PATH=`pwd`/depot_tools:"$PATH"

# pull origin/master.lion
cd chromium-legacy/src
git fetch origin && git merge --no-edit origin/master.lion

# fetch & reset skia
pushd third_party/skia
git fetch --all
REV=`grep "\'skia_revision\':" ../../DEPS |awk -F "\'" '{print $4}'`
git checkout $REV
popd

# fetch & reset angle
pushd third_party/angle
git fetch --all
REV=`grep "\'angle_revision\':" ../../DEPS |awk -F "\'" '{print $4}'`
git checkout $REV
popd 

# fetch & reset dawn
pushd third_party/dawn
git fetch --all
REV=`grep "\'dawn_revision\':" ../../DEPS |awk -F "\'" '{print $4}'`
git checkout $REV
popd

# fetch & reset swiftshader
pushd third_party/swiftshader
git fetch --all
REV=`grep "\'swiftshader_revision\':" ../../DEPS |awk -F "\'" '{print $4}'`
git checkout $REV
popd

# fetch & reset vulkan_memory_allocator
pushd third_party/vulkan_memory_allocator
git fetch --all
REV=`grep "VulkanMemory" ../../DEPS |awk -F "\'" '{print $8}'`
git checkout $REV
popd

# fetch & reset webrtc
pushd  third_party/webrtc
git fetch --all
REV=`grep "Var.*webrtc_git" ../../DEPS |awk -F "\'" '{print $8}'`
git checkout $REV
popd

# fetch & reset libc++
pushd third_party/libc++/src
git fetch --all
REV=`grep "\'libcxx_revision\':" ../../../DEPS |awk -F "\'" '{print $4}'`
git checkout $REV
popd

# fetch & reset boringssl
pushd third_party/boringssl/src
git fetch --all
REV=`grep "\'boringssl_revision\':" ../../../DEPS |awk -F "'" '{print $4}'`
git checkout $REV
popd

# update dependencies
gclient sync -D

# restore skia
pushd third_party/skia
git checkout for-lion
popd

# restore angle
pushd third_party/angle
git checkout master.lion
popd

# restore dawn
pushd third_party/dawn
git checkout master.lion
popd

# restore swiftshader
pushd third_party/swiftshader
git checkout master.lion
popd

# restore vulkan_memory_allocator
pushd third_party/vulkan_memory_allocator
git checkout master.lion
popd

# restore webrtc
pushd third_party/webrtc
git checkout master.lion
popd

# restore libc++
pushd third_party/libc++/src
git checkout master.lion
popd

# restore boringssl
pushd third_party/boringssl/src
git checkout master.lion
popd

to build:

cd chromium-project
export PATH=`pwd`/depot_tools:"$PATH"

cd chromium-legacy/src
ninja -C ../out/release chrome
Clone this wiki locally