forked from chromium/chromium
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Building
krackers edited this page Jul 4, 2023
·
17 revisions
Build steps are mostly the same as the original Chromium's one except for compatibility patches.
- macOS 13.3 SDK
- need a patch for SDK:
-
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDevice.h
--- GCDevice.h 2022-02-24 00:00:00.000000000 +0900 +++ GCDevice.h 2022-02-24 00:00:00.000000000 +0900 @@ -27,7 +27,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,
-
- to build for 10.7, also need patches for SDK:
-
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Foundation.framework/Headers
-
- need a patch for SDK:
- Xcode 13+
- to build for 10.7, need patched clang
- powerful CPUs
- about 40mins to distributed build from scratch with
Ryzen 9 5950X
+ 2 xRyzen 9 3950X
- about 3-4hrs+ to build from scratch with
Core i9-9980HK
- about 40mins to distributed build from scratch with
Note: Setting min build target to 10.9
instead of 10.7
may be necessary if you run into issues with visibility of certain math.h
functions like sincospif
. (This can also be worked around by modifying SDK to force inline and change visibility).
curl https://gist.githubusercontent.com/blueboxd/c1f355fb6fe829e98ff5453880683993/raw/744c2352501afb7b0ca184a788580de2149e0872/build.sh | bash
first setup & build:
# setup working dir
mkdir -pv chromium-project && cd chromium-project
# prepare patched clang
mkdir -pv clang-master && pushd clang-master
curl -LOJ https://github.com/blueboxd/llvm-project/releases/download/main/main.tar.xz
tar xvf main.tar.xz
popd
# 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 --no-history
# 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 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
# use patched clang
pushd ../clang-master
echo "clang_base_path=\"`pwd`\"" >> ../chromium-legacy/out/release/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
# 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
to build:
cd chromium-project
export PATH=`pwd`/depot_tools:"$PATH"
cd chromium-legacy/src
ninja -C ../out/release chrome