This commit is contained in:
James Walmsley 2022-04-21 20:08:00 +01:00
Родитель 2a6cd6670c
Коммит f646bbe94d
5 изменённых файлов: 104 добавлений и 32 удалений

68
.github/workflows/skiabuild.yml поставляемый
Просмотреть файл

@ -1,10 +1,33 @@
name: Build Skia x-plat
on: [push]
jobs:
env:
runs-on: [self-hosted, linux, x64]
# env:
# runs-on: [self-hosted, linux, x64]
# steps:
# - run: printenv
build_windows:
runs-on: windows-latest
steps:
- run: printenv
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- run: dir
- run: python3 -m pip install ninja
- run: ninja --version
- run: make skia_defconfig
- run: make source-checkout
- run: make CONFIG_VARIANT=win_x64
- run: Compress-Archive -Path out/skia/win_x64/sysroot/ skia-win64.zip
- run: echo "🍏 This job's status is ${{ job.status }}."
- uses: actions/upload-artifact@v3
with:
name: libskia-win_x64
path: skia-win64.zip
build_skia_64:
runs-on: [self-hosted, linux, x64]
container: jameswalmsley/skiabuild:latest
@ -19,17 +42,12 @@ jobs:
make skia_defconfig
make source-checkout -j$(nproc)
DISTCC_HOSTS="${{ secrets.DISTCC_HOSTS }}" make
- run: echo "🍏 This job's status is ${{ job.status }}."
- uses: actions/upload-artifact@v3
with:
name: libskia-x86_64-linux-gnu
path: out/skia/x86_64-linux-gnu/sysroot.tar.gz
# - uses: actions/upload-artifact@v3
# with:
# name: libskia-x86-linux-gnu
# path: out/skia/sysroot.tar.gz
test_skia_archlinux:
runs-on: ubuntu-latest
@ -46,18 +64,18 @@ jobs:
LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ldd ./usr/local/bin/avalonia.skia.testprog
md5sum *.png
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v2
# - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
# - name: Check out repository code
# uses: actions/checkout@v2
- name: Test build skialib against pre-built package
run: |
mkdir build && cd build
cmake -GNinja ../libavalonia.skia
ninja
lddtree ./avalonia.skia.testprog
./avalonia.skia.testprog
md5sum *.png
# - name: Test build skialib against pre-built package
# run: |
# mkdir build && cd build
# cmake -GNinja ../libavalonia.skia
# ninja
# lddtree ./avalonia.skia.testprog
# ./avalonia.skia.testprog
# md5sum *.png
test_skia_debian:
@ -108,7 +126,7 @@ jobs:
release_libskia:
needs: [build_skia_64]
needs: [build_skia_64, build_windows, test_skia_archlinux, test_skia_debian]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
@ -121,15 +139,17 @@ jobs:
- run: ls -R
if: startsWith(github.ref, 'refs/tags/v')
- run: tar cvzf avalonia.skia-${{ steps.get_version.outputs.VERSION }}-sysroots.tar.gz *
- run: mv libskia-x86_64-linux-gnu/sysroot.tar.gz avalonia.skia-${{ steps.get_version.outputs.VERSION }}-linux-x86_64-linux-gnu-sysroot.tar.gz
if: startsWith(github.ref, 'refs/tags/v')
- run: mv libskia-win_x64/skia-win64.zip avalonia.skia-${{ steps.get_version.outputs.VERSION }}-win_x64-sysroot.zip
if: startsWith(github.ref, 'refs/tags/v')
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
files: |
avalonia.skia-${{ steps.get_version.outputs.VERSION }}-sysroots.tar.gz
avalonia.skia-*.zip
avalonia.skia-*.tar.gz

Просмотреть файл

@ -1,8 +1,5 @@
BASE:=$(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
#
# Specifies the default variant to be built.
#
CONFIG_VARIANT?=x86_64-linux-gnu
include $(BASE)/ve-root/Makefile

Просмотреть файл

@ -7,7 +7,10 @@ skia:=$(LSTAMP)/skia
skia_sync_deps:=$(LSTAMP)/skia_sync_deps
skia_config:=$(LSTAMP)/skia_config
skia_install:=$(LSTAMP)/skia_install
ifndef WINDOWS
skia_pkgconfig:=$(SYSROOT)/$(PREFIX)/$(LIBDIR)/pkgconfig/skia.pc $(PKGROOT)/$(PREFIX)/$(LIBDIR)/pkgconfig/skia.pc
endif
$(call git_clone, skia, https://github.com/google/skia.git, $(SKIA_GIT_REF))
@ -23,43 +26,71 @@ DEPENDS += fontconfig
include $(BUILD_LAYER)
SKIA_ARCH=x86_64
ifdef WINDOWS
SKIA_ARCH:=x64
else
SKIA_ARCH:=x86_64
endif
$(skia_sync_deps):
cd $(srcdir)/skia && ./tools/git-sync-deps
cd $(srcdir)/skia && python3 ./tools/git-sync-deps
$(stamp)
SKIA_ARGS:=
SKIA_ARGS += is_official_build=true
SKIA_ARGS += skia_enable_tools=false
SKIA_ARGS += target_cpu=\"$(SKIA_ARCH)\"
ifndef WINDOWS
SKIA_ARGS += target_os=\"linux\"
SKIA_ARGS += extra_cflags=[\"-I$(SYSROOT)/$(PREFIX)/include\"]
SKIA_ARGS += extra_ldflags=[\"-L$(SYSROOT)/$(PREFIX)/$(LIBDIR)\", \"-static-libstdc++\", \"-static-libgcc\" ]
SKIA_ARGS += target_os=\"linux\" target_cpu=\"$(SKIA_ARCH)\"
else
SKIA_ARGS += target_os=\"win\"
SKIA_ARGS += skia_use_dng_sdk=true
SKIA_ARGS += skia_enable_fontmgr_win_gdi=false
SKIA_ARGS += extra_cflags=[ \"-D_HAS_AUTO_PTR_ETC=1\" ]
endif
SKIA_ARGS += skia_use_icu=false
SKIA_ARGS += skia_use_sfntly=false
SKIA_ARGS += skia_use_piex=true
SKIA_ARGS += skia_use_system_expat=false
ifndef WINDOWS
SKIA_ARGS += skia_use_system_freetype2=false
endif
SKIA_ARGS += skia_use_system_libjpeg_turbo=false
SKIA_ARGS += skia_use_system_libpng=false
SKIA_ARGS += skia_use_system_libwebp=false
SKIA_ARGS += skia_use_system_zlib=false
SKIA_ARGS += skia_use_x11=false
SKIA_ARGS += skia_enable_gpu=true
ifndef WINDOWS
SKIA_ARGS += skia_use_vulkan=true
SKIA_ARGS += cc=\"$(CLANG)\"
SKIA_ARGS += cxx=\"$(CLANGXX)\"
SKIA_ARGS += ar=\"$(AR)\"
endif
ifdef WINDOWS
SKIA_ARGS += clang_win=\"c:\Program Files\LLVM\"
endif
GN:=gn
ifdef WINDOWS
GN:=./bin/gn
endif
$(skia_config): $(skia_sync_deps)
cd $(srcdir)/skia && gn gen $(builddir)/skia --args="$(SKIA_ARGS)"
cd $(srcdir)/skia && $(GN) gen $(builddir)/skia --args="$(SKIA_ARGS)"
$(stamp)
$(skia): $(skia_config)
cd $(builddir)/skia && ninja $(BUILD_JOBS)
$(stamp)
$(skia_install): $(skia)
ifndef WINDOWS
mkdir -p $(SYSROOT)/$(PREFIX)/include/skia
mkdir -p $(PKGROOT)/$(PREFIX)/include/skia
mkdir -p $(PKGROOT)/$(PREFIX)/$(LIBDIR)
@ -68,10 +99,17 @@ $(skia_install): $(skia)
cp -rv $(srcdir)/skia/include $(PKGROOT)/$(PREFIX)/include/skia
cp $(builddir)/skia/libskia.a $(SYSROOT)/$(PREFIX)/$(LIBDIR)/
cp $(builddir)/skia/libskia.a $(PKGROOT)/$(PREFIX)/$(LIBDIR)/
else
mkdir -p $(PKGROOT)/include/skia
cp -rv $(srcdir)/skia/include $(PKGROOT)/include/skia
cp $(builddir)/skia/skia.lib $(PKGROOT)
endif
$(stamp)
ifndef WINDOWS
$(skia_pkgconfig): $(skia_install)
cp $(BASE_skia)/skia.pc.in $@
endif
$(L).clean:
rm -rf $(builddir)

Просмотреть файл

@ -20,6 +20,13 @@ endif
CLANG?=clang-13
CLANGXX?=clang++-13
ifdef WINDOWS
CLANG?=clang
CLANGXX?=clang++
CC=clang
endif
HOST:=$(shell $(CC) -dumpmachine)
PREFIX:=usr/local
@ -31,7 +38,9 @@ endif
export LIBRARY_PATH="$(SYSROOT)/$(PREFIX)/$(LIBDIR):$(SYSROOT)/usr/lib64"
ifndef WINDOWS
BUILD_JOBS:=-j$(shell nproc)
endif
ifneq ($(shell which distcc 2> /dev/null),)
ifdef DISTCC_HOSTS
@ -45,12 +54,20 @@ endif
MESON_OPTIONS:=
ifndef WINDOWS
LAYERS += meson
LAYERS += freetype
LAYERS += fontconfig
endif
LAYERS += skia
ifndef WINDOWS
LAYERS += avalonia_skia
LAYERS += sysroot/package
endif
include $(BUILD_RECIPE)

@ -1 +1 @@
Subproject commit ce09b81e58ef1575d9e5d0997ef4282d641b0426
Subproject commit 41d91fbcec82f0940be949e96a651bc9cb65c452