[AVALONIA] Added symbol versions and build variants.

- Separation between out/buildroot (the sysroot we build Skia against).
    .. and out/sysroot which is what gets packaged.
This commit is contained in:
James Walmsley 2022-04-04 21:44:04 +00:00
Родитель 26cce2013e
Коммит f630e677ef
10 изменённых файлов: 52 добавлений и 17 удалений

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

@ -24,7 +24,7 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: libskia-x86_64-linux-gnu
path: out/skia/sysroot.tar.gz
path: out/skia/x86_64-linux-gnu/sysroot.tar.gz
# - uses: actions/upload-artifact@v3
# with:
# name: libskia-x86-linux-gnu
@ -43,6 +43,7 @@ jobs:
mkdir out
cd out && tar xf ../libskia-x86_64-linux-gnu/sysroot.tar.gz
LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ./usr/local/bin/avalonia.skia.testprog
LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ldd ./usr/local/bin/avalonia.skia.testprog
md5sum *.png
test_skia_debian:
@ -57,6 +58,7 @@ jobs:
mkdir out
cd out && tar xf ../libskia-x86_64-linux-gnu/sysroot.tar.gz
LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ./usr/local/bin/avalonia.skia.testprog
LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ldd ./usr/local/bin/avalonia.skia.testprog
md5sum *.png
# test_skia_fedora:

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

@ -1,4 +1,10 @@
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
DOCKER_IMAGE:=skiabuild

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

@ -33,17 +33,6 @@ total 38724
drwxr-xr-x 1 james james 424 Apr 4 19:20 ./
drwxr-xr-x 1 james james 46 Apr 4 17:57 ../
-rwxr-xr-x 1 james james 10858032 Apr 4 19:20 libavalonia.skia.so*
lrwxrwxrwx 1 james james 18 Apr 4 17:57 libfontconfig.so -> libfontconfig.so.1*
lrwxrwxrwx 1 james james 23 Apr 4 17:57 libfontconfig.so.1 -> libfontconfig.so.1.13.0*
-rwxr-xr-x 1 james james 396800 Apr 4 17:57 libfontconfig.so.1.13.0*
-rw-r--r-- 1 james james 1098948 Apr 4 17:33 libfreetype.a
lrwxrwxrwx 1 james james 16 Apr 4 17:33 libfreetype.so -> libfreetype.so.6*
lrwxrwxrwx 1 james james 21 Apr 4 17:33 libfreetype.so.6 -> libfreetype.so.6.18.2*
-rwxr-xr-x 1 james james 896136 Apr 4 17:33 libfreetype.so.6.18.2*
-rw-r--r-- 1 james james 393354 Apr 4 17:33 libpng16.a
lrwxrwxrwx 1 james james 14 Apr 4 17:33 libpng16.so -> libpng16.so.16*
lrwxrwxrwx 1 james james 19 Apr 4 17:33 libpng16.so.16 -> libpng16.so.16.37.0*
-rwxr-xr-x 1 james james 306520 Apr 4 17:33 libpng16.so.16.37.0*
-rw-r--r-- 1 james james 25665680 Apr 4 19:18 libskia.a
drwxr-xr-x 1 james james 104 Apr 4 19:18 pkgconfig/
```

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

@ -4,4 +4,5 @@ RUN pacman --noconfirm -Syu \
sudo \
libgl \
make \
which
which \
fontconfig

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

@ -3,4 +3,5 @@ RUN apt-get -y update && \
apt-get -y install \
sudo \
libgl1-mesa-glx \
libfontconfig1 \
make

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

@ -0,0 +1,6 @@
FOO {
global:
do_draw;
local: *; # hide everything else
};

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

@ -6,11 +6,14 @@ project(
sk_dep = dependency('skia', static: true)
cpp = meson.get_compiler('cpp')
version_script = 'libavalonia.skia.version'
vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), version_script)
avalonia_skia_lib = shared_library(
'avalonia.skia',
['avalonia.skia.cpp'],
dependencies: [sk_dep],
link_args: vflag,
install: true,
)

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

@ -1,14 +1,27 @@
LAYER:=avalonia_skia
include $(DEFINE_LAYER)
avalonia_symbols:=$(PKGROOT)/libavalonia.skia.symbols
avalonia_install:=$(LSTAMP)/avalonia_install
$(call meson_srcdir, avalonia_skia, $(BASE)/libavalonia.skia)
$(L) += $(avalonia_symbols)
$(L) += $(avalonia_install)
DEPENDS += skia
include $(BUILD_LAYER)
$(L): $(BASE)/libavalonia.skia/meson.build
$(avalonia_symbols): $(LSTAMP)/avalonia_skia
nm $(SYSROOT)/$(PREFIX)/$(LIBDIR)/libavalonia.skia.so | grep '.*\sT\s.*$$' > $@
$(avalonia_install): $(LSTAMP)/avalonia_skia $(avalonia_symbols)
cd $(builddir)/avalonia_skia && DESTDIR=$(PKGROOT) ninja install
$(stamp)
$(L).clean:
rm -rf $(builddir)

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

@ -57,9 +57,13 @@ $(skia): $(skia_config)
$(stamp)
$(skia_install): $(skia)
mkdir -p $(SYSROOT)/usr/local/include/skia
cp -rv $(srcdir)/skia/include $(SYSROOT)/usr/local/include/skia
cp $(builddir)/skia/libskia.a $(SYSROOT)/usr/local/lib64/
mkdir -p $(SYSROOT)/$(PREFIX)/include/skia
mkdir -p $(PKGROOT)/$(PREFIX)/include/skia
mkdir -p $(PKGROOT)/$(PREFIX)/$(LIBDIR)
cp -rv $(srcdir)/skia/include $(SYSROOT)/$(PREFIX)/include/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)/
$(stamp)
$(skia_pkgconfig): $(skia_install)

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

@ -1,5 +1,14 @@
include $(DEFINE_RECIPE)
SYSROOT?=$(OUT)/sysroot
#
# SYSROOT is the staging sysroot which we use to build our static libskia against.
#
SYSROOT?=$(OUT)/buildroot
#
# PKGROOT is where the distributable package / sysroot will be installed to.
#
PKGROOT?=$(OUT)/sysroot
ifeq ($(CC),cc)
ifneq ($(shell which gcc-10 2> /dev/null),)
@ -45,3 +54,4 @@ LAYERS += sysroot/package
include $(BUILD_RECIPE)
$(sysroot-package): SYSROOT:=$(PKGROOT)