any progress on this ?
Needed
3 years hanging request)
After installing depot-tools as a tool, copy the manually downloaded gn.exe and put it in _${SOURCE_PATH}/bin_, run ${DEPOT-TOOLS} bin/gn gen out/sln --ide=vs, error occurred:
gn.py: Could not find checkout in any parent of the current path.
This must be run inside a checkout.
Blocked.
Hi, recently I'm making the prebuilt binaries of Skia (after m70) for the development of SVG Native Viewer, at skia-binaries. May I help you? I'm really unfamiliar with vcpkg system, but I would be able to provide some documents or prebuilt binaries.
@mediabuff thanks!
But we are more inclined to use source code to compile binary files.
I already have PR #8850 to add the port of chromium class, and I have encountered some problems. Can you help me?
Yes, I understand what vcpkg needs is not prebuilt binary, but the source and the instruction how to build the binaries from the source.
In future, Skia would not be provided as separated port in vcpkg, but would be provided as a part of Chromium Class? If it's only the way, I should try to build Chromium on Windows, although I've never tried before.
In my case, I execute gn on WSL (but target is Windows), and generate Ninja input files (instead of VS project file), and tweak some parts manually, and build the library. Such building process is acceptable for vcpkg? Using project file is essential?
@mpsuzuki We should build the corresponding binary on different triplets. Since skia is a chomium class, I tend to use a unified build method (vcpkg _*_ gn) to reduce the code in portfile.cmake and exist as a separate port, and now the parameter passed to gn has escaping problem in cmake, can you help me?
Thanks.
Checking a few ports, I understand that vcpkg want to build the packages for Windows, macOS and Linux by unified cmake file. Could I check any work-in-progress cmake file for Chromium? (maybe I should move to the discussion in #8850)
In my personal impression, the string manipulation in cmake is badly problematic.
@mpsuzuki Yes please, we really need your help to solve these problems.
Thanks.
@JackBoosY
Since 3 days ago, I'm trying to build Chromium for Windows by myself to understand the process. Also I need to learn how to make vcpkg by myself. Please let me spend some time...
BTW, looking at the process to build Chromium (not finished yet, sorry - still running), I think, it includes the source tree of Skia, but its building process does not create skia.dll or skia.lib. To make a vcpkg of Skia, should I execute another building process to make skia.dll or skia.lib?
SKIA is seriously terrible thing to build. Include paths are hardcoded, some use internal headers and even headers from "src" folder, which should be in "include".
The code does not compile as is, depends on options. Some options will not compile, some will fail on linkage.
It works nice when is as a part of the project.
If someone interested in it, here is a hint. It compiles on ArchLinux but I did not checked it if everything works.
Also check here: https://github.com/TheAifam5/patch-files/tree/master/skia
# Maintainer: TheAifam5 <[email protected]>
pkgname=skia
_pkgver=m80
pkgver=m80.793beff5ac6
pkgrel=1
epoch=0
pkgdesc="Skia is an open source 2D graphics library which provides common APIs that work across a variety of hardware and software platforms. It serves as the graphics engine for Google Chrome and Chrome OS, Android, Mozilla Firefox and Firefox OS, and many other products."
arch=(x86_64)
url="https://skia.org/"
license=('BSD')
provides=(skia)
conflicts=(skia)
replaces=(skia)
depends=(zlib bzip2 glib2 glibc libgl libgles libegl harfbuzz libjpeg-turbo expat freetype2 fontconfig libpng libwebp gcc-libs graphite)
makedepends=(zlib clang ninja depot-tools-git gn)
source=("git+https://skia.googlesource.com/skia.git#branch=chrome/$_pkgver")
md5sums=('SKIP')
# EDIT SECTION START
_enable_rtti=false
_enable_lua=true
# EDIT SECTION END
function join_by { local IFS="$1"; shift; echo "$*"; }
function use_system { echo "skia_use_$1=true skia_use_system_$1=true"; }
function check_option_str { check_option "$1" $2 && echo "true" || echo "false"; }
# DAWN does not work lol:
# $(use_system dawn) \
# 'dawn_enable_null=true' \
# 'dawn_enable_opengl=true' \
# 'dawn_enable_vulkan=true' \
#
# Intel VTune needed:
# 'skia_enable_skvm_jit=true' \
#
# Some other things
# 'skia_enable_tools=true' \ # needs GR_TEST_UTILS to be defined, but somehow is not WTF
# "is_official_build=$(check_option_str 'debug' n)" \
args=$(join_by " " \
'is_official_build=false' \
"is_debug=$(check_option_str 'debug' y)" \
'skia_use_gl=true' \
'skia_use_egl=true' \
'skia_use_vulkan=true' \
'skia_use_xps=true' \
'skia_use_libheif=true' \
'skia_use_angle=true' \
$(use_system zlib) \
$(use_system icu) \
$(use_system harfbuzz) \
$(use_system expat) \
'skia_use_opencl=true' \
'skia_use_ffmpeg=true' \
'skia_use_wuffs=true' \
$(use_system libwebp) \
'skia_use_dng_sdk=true' \
$(use_system libpng) \
$(use_system libjpeg_turbo) \
'skia_use_piex=true' \
'skia_use_sfntly=true' \
'skia_use_fontconfig=true' \
'skia_use_freetype=true' \
'skia_use_system_freetype2=true' \
"$($_enable_lua && use_system lua)" \
'skia_enable_pdf=true' \
'skia_enable_gpu=true' \
'skia_enable_tools=true' \
'skia_enable_nvpr=true' \
'skia_enable_atlas_text=true' \
'skia_enable_sksl_interpreter=true' \
'skia_enable_spirv_validation=true' \
'skia_enable_discrete_gpu=true' \
'skia_enable_fontmgr_empty=false' \
'skia_enable_fontmgr_custom=false' \
'skia_enable_fontmgr_custom_empty=false' \
'skia_compile_processors=true' \
'skia_pdf_subset_harfbuzz=true' \
'skia_generate_workarounds=true' \
'skia_include_multiframe_procs=true' \
'skia_qt_path="/usr"' \
'cc="clang"' \
'cxx="clang++"' \
"$($_enable_rtti && echo 'extra_cflags_cc=["-frtti"]')" \
"is_component_build=$(check_option_str 'staticlibs' n)" \
'extra_ldflags=["-fuse-ld=lld"]')
pkgver() {
cd "$pkgname"
printf "$_pkgver.%s" "$(git rev-parse --short HEAD)"
}
prepare() {
# to make sure depot tools are in path
if [[ ! ":$PATH:" == *":/opt/depot_tools:"* ]]; then
export PATH=$PATH:/opt/depot_tools
fi
# make python2 default python
mkdir -p .pkgbuild-bin
ln -sf /usr/bin/python2-config .pkgbuild-bin/python-config
ln -sf /usr/bin/python2 .pkgbuild-bin/python
export PATH="$srcdir/.pkgbuild-bin":$PATH
cd "$pkgname"
rm -rf out
python2 tools/git-sync-deps
mkdir -p bin
ln -sf /usr/bin/clang-format bin/clang-format
# Just Google like always....
mv tools/mdbviz/mainwindow.h tools/mdbviz/MainWindow.h
mv tools/mdbviz/mainwindow.cpp tools/mdbviz/MainWindow.cpp
echo "========== Compiling with args =========="
echo "$args"
echo "========================================="
gn gen out --args="$args"
}
build() {
cd "$pkgname"
ninja -C out -j $(nproc)
# Copy all headers, to include, because Google....
pushd src
find ./ -name '*.h' -exec cp --parents \{\} ../include \;
popd
# Copy headers from modules
pushd modules
for i in ()
do
pushd $i/include
mkdir -p ../../include/$i
find ./ -name '*.h' -exec cp --parents \{\} ../../include/$i \;
popd
done
popd
# Fix all includes, because Google....
pushd include
find ./ -type f -exec sed -i 's/include\//skia\//g' {} \;
popd
}
package() {
cd "$pkgname"
mkdir -p $pkgdir/usr/{include/skia,lib}
cp -dpr --no-preserve=ownership ./include/* "$pkgdir/usr/include/skia"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
if check_option "staticlibs" y; then
install -Dm644 out/*.a "$pkgdir/usr/lib/"
else
install -Dm755 out/*.so "$pkgdir/usr/lib/"
fi
}
The Skia port is now (https://github.com/microsoft/vcpkg/commit/e368f0f4ce1cc23513d5aaf44bb7f294c1cd355e) available for macOS and Windows (x64). Linux and the other targets supported by Skia might work with the port as it now, but they haven't been tested.
Close this issue via #10083 merged.