diff --git a/README-zh.md b/README-zh.md index 699b8a75..6648d44a 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,7 +1,7 @@ # `skr canvas` ![CI](https://github.com/Brooooooklyn/canvas/workflows/CI/badge.svg) -![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm93-hotpink) +![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm94-hotpink) [![install size](https://packagephobia.com/badge?p=@napi-rs/canvas)](https://packagephobia.com/result?p=@napi-rs/canvas) [![Downloads](https://img.shields.io/npm/dm/@napi-rs/canvas.svg?sanitize=true)](https://npmcharts.com/compare/@napi-rs/canvas?minimal=true) diff --git a/README.md b/README.md index 0167de23..8b5e3cb8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # `skr canvas` ![CI](https://github.com/Brooooooklyn/canvas/workflows/CI/badge.svg) -![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm93-hotpink) +![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm94-hotpink) [![install size](https://packagephobia.com/badge?p=@napi-rs/canvas)](https://packagephobia.com/result?p=@napi-rs/canvas) [![Downloads](https://img.shields.io/npm/dm/@napi-rs/canvas.svg?sanitize=true)](https://npmcharts.com/compare/@napi-rs/canvas?minimal=true) diff --git a/build.rs b/build.rs index 9578fa35..02be8ce8 100644 --- a/build.rs +++ b/build.rs @@ -191,6 +191,7 @@ fn main() { println!("cargo:rustc-link-lib=static=skiac"); println!("cargo:rustc-link-lib=skparagraph"); println!("cargo:rustc-link-lib=skshaper"); + println!("cargo:rustc-link-lib=static=skunicode"); } #[cfg(not(target_os = "linux"))] @@ -200,6 +201,7 @@ fn main() { println!("cargo:rustc-link-lib=skiac"); println!("cargo:rustc-link-lib=skparagraph"); println!("cargo:rustc-link-lib=skshaper"); + println!("cargo:rustc-link-lib=skunicode"); } napi_build::setup(); } diff --git a/scripts/build-skia.js b/scripts/build-skia.js index 8f6eb593..021778b4 100644 --- a/scripts/build-skia.js +++ b/scripts/build-skia.js @@ -1,4 +1,5 @@ const { execSync } = require('child_process') +const { readFileSync, writeFileSync } = require('fs') const path = require('path') const { platform } = require('os') @@ -203,6 +204,19 @@ const OUTPUT_PATH = path.join('out', 'Static') GN_ARGS.push(`cc=${CC}`, `cxx=${CXX}`, `extra_cflags_cc=[${ExtraCflagsCC}]`, ExtraSkiaBuildFlag) +const SkLoadICUCppFilePath = path.join(__dirname, '..', 'skia', 'third_party', 'icu', 'SkLoadICU.cpp') +const CODE_TO_PATCH = 'good = load_from(executable_directory()) || load_from(library_directory());' +const CODE_I_WANT = 'good = load_from(library_directory()) || load_from(executable_directory());' + +if (PLATFORM_NAME === 'win32') { + const content = readFileSync(SkLoadICUCppFilePath, 'utf8') + const patch = content.replace(CODE_TO_PATCH, CODE_I_WANT) + writeFileSync(SkLoadICUCppFilePath, patch) + process.once('beforeExit', () => { + writeFileSync(SkLoadICUCppFilePath, content) + }) +} + exec( `${process.env.GN_EXE ? process.env.GN_EXE : path.join('bin', 'gn')} gen ${OUTPUT_PATH} --args='${GN_ARGS.join( ' ', diff --git a/scripts/release-skia-binary.js b/scripts/release-skia-binary.js index 9af74222..c3bd22ae 100644 --- a/scripts/release-skia-binary.js +++ b/scripts/release-skia-binary.js @@ -18,7 +18,7 @@ if (TARGET && TARGET.startsWith('--target=')) { TARGET_TRIPLE = TARGET.replace('--target=', '') } -const LIB = ['skia', 'skparagraph', 'skshaper', 'svg', 'sktext'] +const LIB = ['skia', 'skparagraph', 'skshaper', 'svg', 'sktext', 'skunicode'] const ICU_DAT = 'icudtl.dat' const CLIENT = new Octokit({ diff --git a/skia b/skia index a8d840a5..975fcdd7 160000 --- a/skia +++ b/skia @@ -1 +1 @@ -Subproject commit a8d840a58a09e1f41b31ad3013c7eefabca328d1 +Subproject commit 975fcdd755dfc5d57cddbb25857e0c4ac29abe98