Skip to content

Commit

Permalink
update skia to 131
Browse files Browse the repository at this point in the history
close #5401
  • Loading branch information
std-microblock authored Dec 30, 2024
1 parent 64c15d3 commit 161a7ad
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions packages/s/skia/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ package("skia")

local commits = {["88"] = "158dc9d7d4cafb177b99b68c5dc502f8f4282092",
["89"] = "109bfc9052ce1bde7acf07321d605601d7b7ec24",
["90"] = "adbb69cd7fe4e1c321e1526420e30265655e809c"}
["90"] = "adbb69cd7fe4e1c321e1526420e30265655e809c",
["132"] = "07f41bcb8ee32fd84ae845095d49055d5122e606"}
add_urls("https://github.com/google/skia/archive/$(version).zip", {version = function (version) return commits[tostring(version)] end})
add_versions("88", "3334fd7d0705e803fe2dd606a2a7d67cc428422a3e2ba512deff84a4bc5c48fa")
add_versions("89", "b4c8260ad7d1a60e0382422d76ea6174fc35ce781b01030068fcad08364dd334")
add_versions("90", "5201386a026d1dd55e662408acf9df6ff9d8c1df24ef6a5b3d51b006b516ac90")

add_versions("132", "1246975f106a2fc98a167bf5d56053a6e8618e42db0394228c6f152daa298116")
add_deps("gn", "python", "ninja", {kind = "binary"})

add_includedirs("include")
Expand Down Expand Up @@ -87,8 +88,19 @@ package("skia")

-- patches
io.replace("bin/fetch-gn", "import os\n", "import os\nimport ssl\nssl._create_default_https_context = ssl._create_unverified_context\n", {plain = true})
os.vrunv("python", {"tools/git-sync-deps"}, {envs = {LD_LIBRARY_PATH = LD_LIBRARY_PATH}})
io.replace("gn/BUILD.gn", "libs += [ \"pthread\" ]", "libs += [ \"pthread\", \"m\", \"stdc++\" ]", {plain = true})
os.vrunv("python", {"tools/git-sync-deps"}, {
envs = {
LD_LIBRARY_PATH = LD_LIBRARY_PATH,
HTTP_PROXY = os.getenv("HTTP_PROXY"),
HTTPS_PROXY = os.getenv("HTTPS_PROXY"),
}})
local skia_gn = "gn/skia/BUILD.gn"

if not io.exists(skia_gn) then
skia_gn = "gn/BUILD.gn"
end

io.replace(skia_gn, "libs += [ \"pthread\" ]", "libs += [ \"pthread\", \"m\", \"stdc++\" ]", {plain = true})
io.replace("gn/toolchain/BUILD.gn", "$shell $win_sdk/bin/SetEnv.cmd /x86 && ", "", {plain = true})
io.replace("third_party/externals/dng_sdk/source/dng_pthread.cpp", "auto_ptr", "unique_ptr", {plain = true})
io.replace("BUILD.gn", 'executable%("skia_c_api_example"%) {.-}', "")
Expand All @@ -113,10 +125,10 @@ package("skia")
end
end
if #cflags > 0 then
io.replace("gn/BUILD.gn", "cflags = []", 'cflags = ["' .. table.concat(cflags, '", "') .. '"]', {plain = true})
io.replace(skia_gn, "cflags = []", 'cflags = ["' .. table.concat(cflags, '", "') .. '"]', {plain = true})
end
if #ldflags > 0 then
io.replace("gn/BUILD.gn", "ldflags = []", 'ldflags = ["' .. table.concat(ldflags, '", "') .. '"]', {plain = true})
io.replace(skia_gn, "ldflags = []", 'ldflags = ["' .. table.concat(ldflags, '", "') .. '"]', {plain = true})
end

-- installation
Expand Down Expand Up @@ -145,5 +157,5 @@ package("skia")
SkPaint paint;
paint.setStyle(SkPaint::kFill_Style);
}
]]}, {configs = {languages = "c++14"}, includes = "core/SkPaint.h"}))
]]}, {configs = {languages = "c++17"}, includes = "core/SkPaint.h"}))
end)

0 comments on commit 161a7ad

Please sign in to comment.