Skip to content

Commit 4afb2b5

Browse files
stensmoimciner2giordanofingolfin
authored
Added skia library (#11324)
* Add files via upload * Delete L/libwirePi directory * WiringPi WiringPi v 3.14. * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Delete W/wiringPi directory * Added WiringPi New library WiringPi * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update W/WiringPi/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Add files via upload * Updated Skia Removed the aarch build, since there is some weird interaction. * Update build_tarballs.jl Fixed build script with only one call to build_tarballs * Update build_tarballs.jl with more platforms * Update S/Skia/build_tarballs.jl Co-authored-by: Ian McInerney <[email protected]> * Update build_tarballs.jl * Update S/Skia/build_tarballs.jl Co-authored-by: Mosè Giordano <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Mosè Giordano <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Mosè Giordano <[email protected]> * First version of Skia * Updated Skia * Update build_tarballs.jl * Updated Skia * Use mutiline config Co-authored-by: Max Horn <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Mosè Giordano <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Mosè Giordano <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Some changes to Skia * Using platforms and filtering out * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Update S/Skia/build_tarballs.jl Co-authored-by: Max Horn <[email protected]> * Reverted to old line for --args * Removed expand abis * Reverted to Old skia conf * Bumped version * multiline * double quoting * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update S/Skia/build_tarballs.jl Co-authored-by: Mosè Giordano <[email protected]> * Update build_tarballs.jl * Added mac version * Update build_tarballs.jl * Added final CPU:s * Update build_tarballs.jl * New handling of dependencies * Update build_tarballs.jl * Added expand_cxxxstring_abis * Added expand_cxxxstring_abis * Update skiapatches.patch * Update skiapatches.patch * Removed dependencies * Removed unicodetools * Removed Piex, and dng_sdk * Added newer mac SDK * Added Mac os SDK 10.15 * No metal for x86 apple * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update build_tarballs.jl * Update skiapatches.patch * Update skiapatches.patch * Update skiapatches.patch * Update skiapatches.patch * Update skiapatches.patch * Update skiapatches.patch * Update skiapatches.patch * Update build_tarballs.jl --------- Co-authored-by: Ian McInerney <[email protected]> Co-authored-by: Mosè Giordano <[email protected]> Co-authored-by: Max Horn <[email protected]>
1 parent 6087e9a commit 4afb2b5

File tree

2 files changed

+237
-0
lines changed

2 files changed

+237
-0
lines changed

S/Skia/build_tarballs.jl

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Note that this script can accept some limited command-line arguments, run
2+
# `julia build_tarballs.jl --help` to see a usage message.
3+
using BinaryBuilder, Pkg
4+
5+
name = "Skia"
6+
version = v"0.40.0"
7+
8+
# Collection of sources required to complete build
9+
sources = [
10+
GitSource("https://github.com/google/skia.git", "482de011c920d85fdbe21a81c45852655df6a809"),
11+
GitSource("https://github.com/stensmo/cskia.git", "3438e6efd3a4f27f43457db675ceb33da30c60cf"),
12+
DirectorySource("./bundled"),
13+
# Missing header ft2build.h for freetype2
14+
GitSource("https://chromium.googlesource.com/chromium/src/third_party/freetype2.git","5d4e649f740c675426fbe4cdaffc53ee2a4cb954"),
15+
GitSource("https://chromium.googlesource.com/libyuv/libyuv.git","d248929c059ff7629a85333699717d7a677d8d96"),
16+
# These two have some kind of source dependency.
17+
GitSource("https://skia.googlesource.com/external/github.com/google/wuffs-mirror-release-c.git","e3f919ccfe3ef542cfc983a82146070258fb57f8"),
18+
GitSource("https://chromium.googlesource.com/chromium/src/third_party/zlib","646b7f569718921d7d4b5b8e22572ff6c76f2596"),
19+
# Need 10.15 SDK for Mac
20+
FileSource("https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.xz","2408d07df7f324d3beea818585a6d990ba99587c218a3969f924dfcc4de93b62"),
21+
]
22+
23+
24+
25+
# These are the platforms we will build for by default, unless further
26+
# platforms are passed in on the command line
27+
platforms = supported_platforms()
28+
filter!(p -> !Sys.iswindows(p), platforms)
29+
platforms = expand_cxxstring_abis(platforms)
30+
31+
# Remove musl && cxx03, since there is a bug preventing Skia to build
32+
filter!(p -> !(cxxstring_abi(p) == "cxx03" && libc(p) == "musl"), platforms)
33+
34+
35+
36+
# The products that we will ensure are always built
37+
products = [
38+
LibraryProduct("libskia", :libskia)
39+
]
40+
41+
# Dependencies that must be installed before this package can be built
42+
dependencies = [
43+
Dependency("Fontconfig_jll"; compat="2.16.0")
44+
Dependency("JpegTurbo_jll"; compat="3.1.1")
45+
Dependency("libpng_jll"; compat="1.6.49")
46+
Dependency("libwebp_jll"; compat="1.5.0")
47+
Dependency("ICU_jll"; compat="76.1")
48+
Dependency("Expat_jll"; compat="2.6.5")
49+
Dependency(PackageSpec(name="Xorg_libX11_jll", uuid="4f6342f7-b3d2-589e-9d20-edeb45f2b2bc");)
50+
Dependency(PackageSpec(name="xkbcommon_jll", uuid="d8fb68d0-12a3-5cfd-a85a-d49703b185fd"); )
51+
Dependency(PackageSpec(name="Libglvnd_jll", uuid="7e76a0d4-f3c7-5321-8279-8d96eeed0f29"); )
52+
BuildDependency(PackageSpec(name="Xorg_xorgproto_jll", uuid="c4d99508-4286-5418-9131-c86396af500b");)
53+
]
54+
55+
56+
57+
# Bash recipe for building across all platforms
58+
script = raw"""
59+
60+
cd $WORKSPACE/srcdir/
61+
for f in ${WORKSPACE}/srcdir/patches/*.patch; do
62+
atomic_patch -p1 ${f}
63+
done
64+
65+
mkdir skia/third_party/externals/
66+
shopt -s extglob
67+
68+
# Rename libraries to the names used in Skia
69+
mv wuffs-mirror-release-c wuffs
70+
mv freetype2 freetype
71+
72+
# Move dependencies to the correct location
73+
mv !(cskia|skia|patches|MacOSX10.15.sdk.tar.xz) skia/third_party/externals/
74+
75+
76+
cd skia
77+
78+
install_license LICENSE
79+
80+
bin/fetch-gn
81+
82+
83+
cp ../cskia/capi/sk_capi.cpp src/base/
84+
cp ../cskia/capi/sk_capi.h src/base/
85+
86+
87+
if [[ "${target}" == x86_64-* ]]; then
88+
target_cpu=x64
89+
elif [[ "${target}" == aarch64-* ]]; then
90+
target_cpu=arm64
91+
elif [[ "${target}" == riscv64-* ]]; then
92+
target_cpu=riscv
93+
elif [[ "${target}" == powerpc64le-* ]]; then
94+
target_cpu=powerpc64le
95+
elif [[ "${target}" == i686-* ]]; then
96+
target_cpu=x86
97+
elif [[ "${target}" == armv7l-* ]]; then
98+
target_cpu=armv7-a
99+
elif [[ "${target}" == armv6l-* ]]; then
100+
target_cpu=arm
101+
fi
102+
103+
104+
if [[ "${target}" == x86_64-apple-darwin* ]]; then
105+
# Work around the issue
106+
export MACOSX_DEPLOYMENT_TARGET=10.15
107+
# ...and install a newer SDK
108+
rm -rf /opt/${target}/${target}/sys-root/System
109+
tar --extract --file=${WORKSPACE}/srcdir/MacOSX10.15.sdk.tar.xz --directory="/opt/${target}/${target}/sys-root/." --strip-components=1 MacOSX10.15.sdk/System MacOSX10.15.sdk/usr
110+
111+
PLATFORM_ARGS="
112+
skia_use_x11=false \
113+
target_os=\\"mac\\"
114+
skia_use_metal=false
115+
skia_use_fonthost_mac=true
116+
skia_use_dng_sdk=false
117+
skia_use_fontconfig=false
118+
skia_use_freetype=false
119+
"
120+
elif [[ "${target}" == *-apple-* ]]; then
121+
PLATFORM_ARGS="
122+
skia_use_x11=false \
123+
target_os=\\"mac\\"
124+
skia_use_metal=true
125+
skia_enable_fontmgr_fontconfig=false
126+
skia_use_fonthost_mac=true
127+
"
128+
elif [[ "${target}" == *-unknown-* ]]; then
129+
PLATFORM_ARGS="
130+
target_os=\\"FreeBSD\\" \
131+
skia_use_dng_sdk=false
132+
"
133+
else
134+
PLATFORM_ARGS="
135+
skia_use_fontconfig=true \
136+
"
137+
fi
138+
139+
ARGS="
140+
is_component_build=true \
141+
target_cpu=\\"$target_cpu\\"
142+
cc=\\"clang\\"
143+
cxx=\\"clang++\\"
144+
is_official_build=true
145+
skia_enable_pdf=true
146+
skia_use_gl=true
147+
skia_use_harfbuzz=false
148+
skia_use_system_expat=true
149+
skia_use_system_freetype2=false
150+
skia_use_system_icu=true
151+
skia_use_system_libjpeg_turbo=true
152+
skia_use_system_libpng=true
153+
skia_use_system_libwebp=true
154+
skia_use_system_zlib=true
155+
skia_use_lua=false
156+
skia_use_piex=false
157+
skia_use_dng_sdk=false
158+
extra_cflags=[\\"-fpic\\", \\"-fvisibility=default\\"]
159+
$PLATFORM_ARGS
160+
"
161+
bin/gn gen out/Dynamic --args="$ARGS"
162+
163+
ninja -j${nproc} -C out/Dynamic
164+
165+
cd out/Dynamic/
166+
167+
168+
install -Dvm 755 "libskia.${dlext}" "${libdir}/libskia.${dlext}"
169+
"""
170+
171+
172+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version= v"11.1.0", preferred_llvm_version = v"15.0.7", julia_compat="1.10")
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
diff --git before/skia/BUILD.gn after/skia/BUILD.gn
2+
index 33f3208..b7efcf6 100644
3+
--- before/skia/BUILD.gn
4+
+++ after/skia/BUILD.gn
5+
@@ -173,7 +173,7 @@ opts("hsw") {
6+
if (is_win) {
7+
cflags = [ "/arch:AVX2" ]
8+
} else {
9+
- cflags = [ "-march=haswell" ]
10+
+ cflags = [ "" ]
11+
}
12+
}
13+
14+
@@ -183,7 +183,7 @@ opts("skx") {
15+
if (is_win) {
16+
cflags = [ "/arch:AVX512" ]
17+
} else {
18+
- cflags = [ "-march=skylake-avx512" ]
19+
+ cflags = [ "" ]
20+
}
21+
}
22+
23+
diff --git before/skia/gn/core.gni after/skia/gn/core.gni
24+
index 06a7bb1..0323fe9 100644
25+
--- before/skia/gn/core.gni
26+
+++ after/skia/gn/core.gni
27+
@@ -187,6 +187,8 @@ skia_core_sources = [
28+
"$_include/private/chromium/SkDiscardableMemory.h",
29+
"$_include/private/chromium/SkPMColor.h",
30+
"$_include/private/chromium/Slug.h",
31+
+ "$_src/base/sk_capi.cpp",
32+
+ "$_src/base/sk_capi.h",
33+
"$_src/base/SkArenaAlloc.cpp",
34+
"$_src/base/SkArenaAlloc.h",
35+
"$_src/base/SkArenaAllocList.h",
36+
@@ -847,3 +849,4 @@ skia_no_slug_srcs = []
37+
skia_core_sources += skia_pathops_sources
38+
39+
skia_core_public += skia_pathops_public
40+
+
41+
42+
diff --git before/skia/src/ports/SkTypeface_mac_ct.cpp after/skia/src/ports/SkTypeface_mac_ct.cpp
43+
index 81e11e4..d4b69ad 100644
44+
--- before/skia/src/ports/SkTypeface_mac_ct.cpp
45+
+++ after/skia/src/ports/SkTypeface_mac_ct.cpp
46+
@@ -727,18 +727,9 @@ bool SkTypeface_Mac::onGlyphMaskNeedsCurrentColor() const {
47+
return this->fHasColorGlyphs;
48+
}
49+
50+
+
51+
CFArrayRef SkTypeface_Mac::getVariationAxes() const {
52+
fInitVariationAxes([this]{
53+
- // Prefer kCTFontVariationAxesAttribute, faster since it doesn't localize axis names.
54+
- SkUniqueCFRef<CTFontDescriptorRef> desc(CTFontCopyFontDescriptor(fFontRef.get()));
55+
- SkUniqueCFRef<CFTypeRef> cf(
56+
- CTFontDescriptorCopyAttribute(desc.get(), kCTFontVariationAxesAttribute));
57+
- CFArrayRef array;
58+
- if (cf && SkCFDynamicCast(cf.get(), &array, "Axes")) {
59+
- fVariationAxes.reset(array);
60+
- cf.release();
61+
- return;
62+
- }
63+
fVariationAxes.reset(CTFontCopyVariationAxes(fFontRef.get()));
64+
});
65+
return fVariationAxes.get();

0 commit comments

Comments
 (0)