Skip to content

Commit

Permalink
Extracted checkout.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
tonsky committed Oct 8, 2020
1 parent f47070d commit 67c0548
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 156 deletions.
61 changes: 30 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,43 @@ on:
- master
paths:
- .github/workflows/**
- build_*.sh
- version
- "*.sh"

env:
# version: m87
skia_branch: chrome/m87
skia_commit: a0c82f08df58dcd0e1d143db9ccab38f8d823b95
release_tag: m87-a0c82f0
version: m87
release: m87-a0c82f0

jobs:
# macos:
# runs-on: macos-10.15
# steps:
# - uses: actions/checkout@v2
# - run: ./build_macos.sh
# - uses: actions/upload-artifact@v2
# with:
# name: skia-macos
# path: "*.zip"
macos:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- run: ./build_macos.sh
- uses: actions/upload-artifact@v2
with:
name: skia-macos
path: "*.zip"

# linux:
# runs-on: ubuntu-16.04
# steps:
# - uses: actions/checkout@v2
# - name: Install GCC 9
# run: |
# sudo apt install -y ninja-build libglu1-mesa-dev
# sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
# sudo apt update -y
# sudo apt install -y gcc-9 g++-9
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
# sudo update-alternatives --config gcc
# gcc --version
# - run: ./build_linux.sh
# - uses: actions/upload-artifact@v2
# with:
# name: skia-linux
# path: "*.zip"
linux:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2
- name: Install GCC 9
run: |
sudo apt install -y ninja-build libglu1-mesa-dev
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update -y
sudo apt install -y gcc-9 g++-9
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
sudo update-alternatives --config gcc
gcc --version
- run: ./build_linux.sh
- uses: actions/upload-artifact@v2
with:
name: skia-linux
path: "*.zip"

windows:
runs-on: windows-2019
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```sh
version=m87 ./build_macos.sh
```
28 changes: 2 additions & 26 deletions build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,7 @@
set -o errexit -o nounset -o pipefail
cd "`dirname $0`"

if [ ! -d "depot_tools" ]; then
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
fi
export PATH="${PWD}/depot_tools:${PATH}"

version=`cat version`
branch="chrome/${version}"

if [ -d "skia" ]; then
pushd skia
if [ -n "$(git branch --list ${branch})" ]; then
echo "Advancing ${branch}"
git checkout -B ${branch}
git fetch
git reset --hard origin/${branch}
else
echo "Fetching ${branch}"
git fetch origin ${branch}:remotes/origin/${branch}
git checkout -b ${branch}
fi
else
echo "Cloning ${branch}"
git clone https://skia.googlesource.com/skia --quiet --depth 1 --branch ${branch}
pushd skia
fi
source ./checkout.sh

python2 tools/git-sync-deps
gn gen out/Release-x64 --args="is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_icu=false \
Expand All @@ -36,7 +12,7 @@ gn gen out/Release-x64 --args="is_debug=false is_official_build=true skia_use_sy
target_cpu=\"x64\" extra_cflags_cc=[\"-frtti\"] cxx=\"g++-9\""
ninja -C out/Release-x64 skia modules

zip --recurse-paths --quiet ../Skia-${version}-linux-Release-x64.zip \
zip --recurse-paths --quiet ../Skia-${release}-linux-Release-x64.zip \
out/Release-x64/*.a \
include \
modules/particles/include/*.h \
Expand Down
28 changes: 2 additions & 26 deletions build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,7 @@
set -o errexit -o nounset -o pipefail
cd "`dirname $0`"

if [ ! -d "depot_tools" ]; then
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
fi
export PATH="${PWD}/depot_tools:${PATH}"

version=`cat version`
branch="chrome/${version}"

if [ -d "skia" ]; then
pushd skia
if [ -n "$(git branch --list ${branch})" ]; then
echo "Advancing ${branch}"
git checkout -B ${branch}
git fetch
git reset --hard origin/${branch}
else
echo "Fetching ${branch}"
git fetch origin ${branch}:remotes/origin/${branch}
git checkout -b ${branch}
fi
else
echo "Cloning ${branch}"
git clone https://skia.googlesource.com/skia --quiet --depth 1 --branch ${branch}
pushd skia
fi
source ./checkout.sh

python2 tools/git-sync-deps
gn gen out/Release-x64 --args="is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_icu=false \
Expand All @@ -36,7 +12,7 @@ gn gen out/Release-x64 --args="is_debug=false is_official_build=true skia_use_sy
target_cpu=\"x64\" extra_cflags=[\"-stdlib=libc++\", \"-mmacosx-version-min=10.13\"] extra_cflags_cc=[\"-frtti\"]"
ninja -C out/Release-x64 skia modules

zip --recurse-paths --quiet ../Skia-${version}-macos-Release-x64.zip \
zip --recurse-paths --quiet ../Skia-${release}-macos-Release-x64.zip \
out/Release-x64/*.a \
include \
modules/particles/include/*.h \
Expand Down
116 changes: 44 additions & 72 deletions build_windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,77 +3,49 @@ set -o errexit -o nounset -o pipefail
set PYTHONHTTPSVERIFY=0
cd "`dirname $0`"

if [ ! -d "depot_tools" ]; then
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
fi
export PATH="${PWD}/depot_tools:${PATH}"
source ./checkout.sh

# version=`cat version`
# branch="chrome/${version}"
python tools/git-sync-deps
gn gen out/Release-x64 --args="is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_icu=false \
skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false \
skia_use_sfntly=false skia_use_freetype=true skia_use_harfbuzz=true skia_pdf_subset_harfbuzz=true \
skia_use_system_freetype2=false skia_use_system_harfbuzz=false \
extra_cflags=[\"-DSK_FONT_HOST_USE_SYSTEM_SETTINGS\"] \
target_cpu=\"x64\""
ninja -C out/Release-x64 skia modules

# if [ -d "skia" ]; then
# pushd skia
# if [ -n "$(git branch --list ${branch})" ]; then
# echo "Advancing ${branch}"
# git checkout -B ${branch}
# git fetch
# git reset --hard origin/${branch}
# else
# echo "Fetching ${branch}"
# git fetch origin ${branch}:remotes/origin/${branch}
# git checkout -b ${branch}
# fi
# else
# echo "Cloning ${branch}"
# git clone https://skia.googlesource.com/skia --quiet --depth 1 --branch ${branch}
# pushd skia
# fi

# python tools/git-sync-deps
# gn gen out/Release-x64 --args="is_debug=false is_official_build=true skia_use_system_expat=false skia_use_system_icu=false \
# skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false \
# skia_use_sfntly=false skia_use_freetype=true skia_use_harfbuzz=true skia_pdf_subset_harfbuzz=true \
# skia_use_system_freetype2=false skia_use_system_harfbuzz=false \
# extra_cflags=[\"-DSK_FONT_HOST_USE_SYSTEM_SETTINGS\"] \
# target_cpu=\"x64\""
# ninja -C out/Release-x64 skia modules

# zip --recurse-paths --quiet ../Skia-${version}-windows-Release-x64.zip \
# out/Release-x64/*.lib \
# out/Release-x64/icudtl.dat \
# include \
# modules/particles/include/*.h \
# modules/skottie/include/*.h \
# modules/skparagraph/include/*.h \
# modules/skplaintexteditor/include/*.h \
# modules/skresources/include/*.h \
# modules/sksg/include/*.h \
# modules/skshaper/include/*.h \
# src/core/*.h \
# src/gpu/gl/*.h \
# third_party/externals/angle2/LICENSE \
# third_party/externals/angle2/include \
# third_party/externals/freetype/docs/FTL.TXT \
# third_party/externals/freetype/docs/GPLv2.TXT \
# third_party/externals/freetype/docs/LICENSE.TXT \
# third_party/externals/freetype/include \
# third_party/externals/libpng/LICENSE \
# third_party/externals/libpng/*.h \
# third_party/externals/libwebp/COPYING \
# third_party/externals/libwebp/PATENTS \
# third_party/externals/libwebp/src/dec/*.h \
# third_party/externals/libwebp/src/dsp/*.h \
# third_party/externals/libwebp/src/enc/*.h \
# third_party/externals/libwebp/src/mux/*.h \
# third_party/externals/libwebp/src/utils/*.h \
# third_party/externals/libwebp/src/webp/*.h \
# third_party/externals/harfbuzz/COPYING \
# third_party/externals/harfbuzz/src/*.h \
# third_party/externals/swiftshader/LICENSE.txt \
# third_party/externals/swiftshader/include \
# third_party/externals/zlib/LICENSE \
# third_party/externals/zlib/*.h

7z a -tzip -r Skia-${version}-windows-Release-x64.zip \
depot_tools/tests/*.py \
depot_tools/recipes
7z a -tzip -r ../Skia-${release}-windows-Release-x64.zip \
out/Release-x64/*.lib \
out/Release-x64/icudtl.dat \
include \
modules/particles/include/*.h \
modules/skottie/include/*.h \
modules/skparagraph/include/*.h \
modules/skplaintexteditor/include/*.h \
modules/skresources/include/*.h \
modules/sksg/include/*.h \
modules/skshaper/include/*.h \
src/core/*.h \
src/gpu/gl/*.h \
third_party/externals/angle2/LICENSE \
third_party/externals/angle2/include \
third_party/externals/freetype/docs/FTL.TXT \
third_party/externals/freetype/docs/GPLv2.TXT \
third_party/externals/freetype/docs/LICENSE.TXT \
third_party/externals/freetype/include \
third_party/externals/libpng/LICENSE \
third_party/externals/libpng/*.h \
third_party/externals/libwebp/COPYING \
third_party/externals/libwebp/PATENTS \
third_party/externals/libwebp/src/dec/*.h \
third_party/externals/libwebp/src/dsp/*.h \
third_party/externals/libwebp/src/enc/*.h \
third_party/externals/libwebp/src/mux/*.h \
third_party/externals/libwebp/src/utils/*.h \
third_party/externals/libwebp/src/webp/*.h \
third_party/externals/harfbuzz/COPYING \
third_party/externals/harfbuzz/src/*.h \
third_party/externals/swiftshader/LICENSE.txt \
third_party/externals/swiftshader/include \
third_party/externals/zlib/LICENSE \
third_party/externals/zlib/*.h
40 changes: 40 additions & 0 deletions checkout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
set -o errexit -o nounset -o pipefail
cd "`dirname $0`"

if [ ! -d "depot_tools" ]; then
git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
fi
export PATH="${PWD}/depot_tools:${PATH}"

skia_branch=${skia_branch:-chrome/${version}}

if [ -d "skia" ]; then
pushd skia
if [ -n "$(git branch --list ${skia_branch})" ]; then
echo "> Advancing ${skia_branch}"
git checkout -B ${skia_branch}
git fetch
git reset --hard origin/${skia_branch}
else
echo "> Fetching ${skia_branch}"
git fetch origin ${skia_branch}:remotes/origin/${skia_branch}
git checkout -b ${skia_branch}
fi
else
echo "> Cloning ${skia_branch}"
time git clone https://skia.googlesource.com/skia --quiet --branch ${skia_branch}
pushd skia
fi

if [ -n "${skia_commit:-}" ]; then
echo "> Checking out ${skia_commit}"
git -c advice.detachedHead=false checkout ${skia_commit}
else
echo "> Using $(git rev-parse HEAD)"
fi

if [ -z "${release:-}" ]; then
release="${version}-$(git rev-parse --short HEAD)"
echo "> Release ${release}"
fi
1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit 67c0548

Please sign in to comment.