-
-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(readme): fix build instructions (#15)
- Loading branch information
Showing
16 changed files
with
237 additions
and
57 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ node_modules/ | |
/build | ||
/chromium/* | ||
!/chromium/.gclient | ||
!/chromium/depot_tools | ||
/Cargo.lock |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "libsixel"] | ||
path = libsixel | ||
url = https://github.com/saitoha/libsixel | ||
[submodule "chromium/depot_tools"] | ||
path = chromium/depot_tools | ||
url = https://chromium.googlesource.com/chromium/tools/depot_tools.git |
This file contains 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
Submodule depot_tools
added at
b7d8ef
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd)) | ||
|
||
target="$1" | ||
source "$CARBONYL_ROOT/scripts/env.sh" | ||
|
||
shift | ||
platform="linux" | ||
cpu=$(uname -m) | ||
|
||
scripts/ninja.sh "$target" | ||
electron/src/electron/script/strip-binaries.py -d "electron/src/out/$target" "$@" | ||
ninja -C "electron/src/out/$target" electron:electron_dist_zip | ||
if [[ "$cpu" == "arm64" ]]; then | ||
cpu="aarch64" | ||
fi | ||
|
||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
platform="unknown-linux-gnu" | ||
elif [[ "$OSTYPE" == "darwin"* ]]; then | ||
platform="apple-darwin" | ||
else | ||
echo "Unsupported platform: $OSTYPE" | ||
|
||
exit 2 | ||
fi | ||
|
||
target="$cpu-$platform" | ||
|
||
if grep -q "is_debug\s*=\s*false" "$CHROMIUM_SRC/out/$1/args.gn"; then | ||
cargo build --target "$target" --release | ||
else | ||
cargo build --target "$target" | ||
fi | ||
|
||
cd "$CHROMIUM_SRC/out/$1" | ||
|
||
ninja headless:headless_shell |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd)) | ||
|
||
source "$CARBONYL_ROOT/scripts/env.sh" | ||
|
||
cpu="$1" | ||
target="$2" | ||
|
||
build_dir="$CARBONYL_ROOT/build/browser/$cpu" | ||
|
||
rm -rf "$build_dir" | ||
mkdir -p "$build_dir" | ||
cd "$build_dir" | ||
|
||
cp "$CARBONYL_ROOT/Dockerfile" . | ||
cp "$CHROMIUM_SRC/out/$target/headless_shell" carbonyl | ||
cp "$CHROMIUM_SRC/out/$target/icudtl.dat" . | ||
cp "$CHROMIUM_SRC/out/$target/libEGL.so" . | ||
cp "$CHROMIUM_SRC/out/$target/libGLESv2.so" . | ||
cp "$CHROMIUM_SRC/out/$target/v8_context_snapshot.bin" . | ||
|
||
if [[ "$cpu" == "arm64" ]]; then | ||
aarch64-linux-gnu-strip carbonyl *.so | ||
else | ||
strip carbonyl *.so | ||
fi | ||
|
||
tag="fathyb/carbonyl:$cpu" | ||
|
||
docker buildx build . --load --platform "linux/$cpu" --tag "$tag" | ||
|
||
echo "Image tag: $tag" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
export CHROMIUM_ROOT="$CARBONYL_ROOT/chromium" | ||
export CHROMIUM_SRC="$CHROMIUM_ROOT/src" | ||
export DEPOT_TOOLS_ROOT="$CHROMIUM_ROOT/depot_tools" | ||
export PATH="$PATH:$DEPOT_TOOLS_ROOT" | ||
|
||
if [ ! -d "$DEPOT_TOOLS_ROOT" ]; then | ||
echo "depot_tools not found, fetching submodule.." | ||
|
||
git -C "$CARBONYL_ROOT" submodule update --init --recursive | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -exo pipefail | ||
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd)) | ||
|
||
cd electron | ||
source "$CARBONYL_ROOT/scripts/env.sh" | ||
|
||
gclient sync --with_tags "$@" | ||
( | ||
cd "$CHROMIUM_ROOT" && | ||
gclient "$@" | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd)) | ||
|
||
mode="$1" | ||
shift | ||
source "$CARBONYL_ROOT/scripts/env.sh" | ||
|
||
cd electron/src | ||
CHROMIUM_BUILDTOOLS_PATH=`pwd`/buildtools \ | ||
gn gen "out/${mode}" --args="import(\"//electron/build/args/$mode.gn\") ${GN_ARGS}" "$@" | ||
( | ||
cd "$CHROMIUM_SRC" && | ||
gn "$@" | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd)) | ||
|
||
source "$CARBONYL_ROOT/scripts/env.sh" | ||
|
||
cd "$CHROMIUM_SRC" | ||
|
||
chromium_upstream="111.0.5511.1" | ||
skia_upstream="486deb23bc2a4d3d09c66fef52c2ad64d8b4f761" | ||
|
||
if [[ "$1" == "apply" ]]; then | ||
echo "Stashing Chromium changes.." | ||
git add -A carbonyl | ||
git stash | ||
git checkout "$chromium_upstream" | ||
echo "Applying Chromium patches.." | ||
git apply < ../../src/chromium.patch | ||
|
||
cd third_party/skia | ||
echo "Stashing Chromium changes.." | ||
git stash | ||
git checkout "$skia_upstream" | ||
echo "Applying Skia patches.." | ||
git apply < ../../../../src/skia.patch | ||
|
||
echo "Patches successfully applied" | ||
elif [[ "$1" == "save" ]]; then | ||
echo "Updating Chromium patch.." | ||
git add -A carbonyl | ||
git diff "$chromium_upstream" > ../../src/chromium.patch | ||
|
||
echo "Updating Skia patch.." | ||
cd third_party/skia | ||
git diff "$skia_upstream" > ../../../../src/skia.patch | ||
|
||
echo "Patches successfully updated" | ||
else | ||
echo "Unknown argument: $1" | ||
|
||
exit 2 | ||
fi |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
export CARBONYL_ROOT=$(cd $(dirname -- "$0") && dirname -- $(pwd)) | ||
|
||
source "$CARBONYL_ROOT/scripts/env.sh" | ||
|
||
target="$1" | ||
shift | ||
|
||
"$CHROMIUM_SRC/out/$target/headless_shell" "$@" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
enable_nacl=false | ||
headless_enable_commands=false | ||
headless_use_embedded_resources=true | ||
enable_pdf=false | ||
enable_printing=false | ||
enable_ppapi=false | ||
enable_plugins=false | ||
enable_browser_speech_service=false | ||
enable_component_updater=false | ||
enable_media_remoting=false | ||
enable_print_preview=false | ||
enable_rust_json=false | ||
enable_screen_ai_service=false | ||
enable_speech_service=false | ||
enable_system_notifications=false | ||
enable_tagged_pdf=false | ||
enable_webui_certificate_viewer=false |